phpsa icon indicating copy to clipboard operation
phpsa copied to clipboard

Some issues were closed and merged to master but i still can encounter those issues

Open armoour opened this issue 7 years ago • 6 comments

Such as #286 , it was closed on 2016,but now i still can reproduce: Notice: Undefined property: PhpParser\Node\Expr\ArrayDimFetch::$name in C:\ProgramData\ComposerSetup\bin\vendor\ovr\phpsa\src\Analyzer\Pass\Statement\UnexpectedUseOfThis.php on line 186 Notice: It's not possible to fetch an array element on a non array in E:********* on 168 [language_error] unset($seatNewArr[$key]);**

armoour avatar Jul 09 '18 03:07 armoour

And something is strange that my phpsa is 0.6.2,but the requirement for php is >=5.5(in composer.lock) while The README.MD is PHP>=7.0,it's very strange;

armoour avatar Jul 09 '18 03:07 armoour

@armoour version 0.6.2 is from december 2016 since then there was no new release, you have to use the master branch to fix this bug.

ddmler avatar Jul 09 '18 08:07 ddmler

@ddmler According your advice i update my phpsa to dev-master, but i met a issue same as #353 , so is there any other solutions or workaround?

armoour avatar Jul 10 '18 01:07 armoour

The solution to that problem should be to copy the .phpsa.yml file from us into your projects root directory for now.

ddmler avatar Jul 10 '18 07:07 ddmler

@ddmler I copied file .phpsa.yml from phpsa directory to my test project root path and then i ran phpsa check E:\*** command, i got an error as below : Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 14 in C:\ProgramData\ComposerSetup\bin\vendor\ovr\phpsa\src\Command\CheckCommand.php on line 106 ..... Notice: Undefined index: pCardNo(this arg is from my php class) in C:\ProgramData\ComposerSetup\bin\vendor\ovr\phpsa\src\Compiler\Expression\ArrayDimFetch.php on line 55

armoour avatar Jul 11 '18 01:07 armoour

It seems that we have a bug in our file handling for windows. (your warning message) It uses any directory starting with p as the \p unicode category regex matcher. Try Linux or the unix subsystem for windows to fix this.

ddmler avatar Jul 13 '18 07:07 ddmler