tomzx / php-semver-checker

Compares two source sets and determines the appropriate semantic versioning to apply.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for PHP 7.4 Typed Properties

mallardduck opened this issue · comments

commented

Per subject, it seems that using PHP 7.4's typed properties causes the Scanner class to blow up.

So if you do something like:

    /**
     * @var EventContractLoader
     */
    private EventContractLoader $loader;

Then you'll see an error like, this:

  [RuntimeException]
  Parse Error: Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST on line 14 in /src/
  Loader/EventContractLoader.php

Note: I use the git version of the project, not sure if that matters.

You probably have an old version of PHP Parser installed, or are running the tool on PP 7.3 or lower? Could you run composer show?

commented

@GrahamCampbell - it actually does seem the *-git variant may be the root issue. I'm still digging into it but it seems that version uses:

"tomzx/php-semver-checker": "^0.12",

Which is a few versions behind.

commented

Yeah, I can close out this one and make an Issue under https://github.com/tomzx/php-semver-checker-git instead if that makes more sense. Testing with two different folders of my project with this repo, I'm not seeing the same error.

So it must be with something in the git specific code and potentially the version being behind. I'll work on a PR for that too.

"tomzx/php-semver-checker": "^0.12",

This will not give you the latest version. You must use:

"tomzx/php-semver-checker": "^0.15",

commented

@GrahamCampbell yep, I follow. To clarify I was citing the version I found in https://github.com/tomzx/php-semver-checker-git currently.

I'm trying to get that working but as it turns out there are some dependencies that haven't been updated and aren't compatible. I'm a few levels deep right now but making some progress. The https://github.com/tomzx/gitter library is the current one I'm working to get updated for newer PHP/symfony.

commented

@GrahamCampbell - I know it appears that you're not on the repos I'm working in, but if you can put any steam behind them that would be appreciated. I sent PRs to both the relevant repos to update the git version to working order.

tomzx/gitter#4 - Fix the Gitter package to work with PHP 7 (previously had an Object class)
tomzx/php-semver-checker-git#30 - Update the *-git flavor package for the Gitter fixes.