Closed Smoren closed 1 year ago
Hi @Smoren,
Wow, thank you for the PR and adding meta data annotations for types and such. This was a long term goal of mine to get the static analysis suggestions implemented from PHPStan.
This is a large PR with a lot of changes, so give me some time to review it. Glancing at it it looks like good stuff.
Just curious, what version of PHP and version of PHPStan did you use for testing?
Thanks again! Mark
Hi @markrogoyski,
PHP 7.4.33 (cli) (built: Jan 13 2023 10:42:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
with Xdebug v3.1.6, Copyright (c) 2002-2022, by Derick Rethans
BTW, also pay attention to the places where I had to use @phpstan-ignore-next-line
. Maybe you can figure out how to avoid using it in some places. I used this operator only in the most extreme cases.
Hi @markrogoyski,
This branch is rebased from develop
and added tasks for static analisys to workflows. Fixed several PHPstan errors for PHP 8+.
Now PHPstan succeed for PHP versions from 7.2 to 8.2.
@Smoren,
Thank you for your hard work adding all the type annotations and comments to provide better static analysis during development!
Thank you @markrogoyski for merging this PR!
Hi @markrogoyski,
I wrote PHPdoc annotations for library components.
Now PHPstan works without errors.
In some places, I needed to slightly modify the code (mainly typecasting).
Places that I considered controversial, I marked FIXME in the comments. Look, please, these places especially attentively.
I hope this work will be useful for the library and its users.