-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use stubfile extension for PasswordUpgraderInterface #335
Use stubfile extension for PasswordUpgraderInterface #335
Conversation
@VincentLanglet Thank you! Works for SF 4.4. But with SF 6.2 I have other issues now. Below output is from the SF 4.4 project, Symfony 6.2 follows later: Below: $ vendor/bin/phpstan analyse src -c phpstan.neon --level=5
951/951 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Line Security/DoctrineUserProvider.php
------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
80 Parameter $user of method App\Security\DoctrineUserProvider::upgradePassword() has invalid type Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface.
------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Line Security/KimaiUserProvider.php
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
87 Parameter $user of method App\Security\KimaiUserProvider::upgradePassword() has invalid type Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface.
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
[ERROR] Found 2 errors
Script vendor/bin/phpstan analyse src -c phpstan.neon --level=5 handling the phpstan event returned with error code 1 Composer update: $ composer update
Loading composer repositories with package information Restricting packages listed in "symfony/symfony" to "4.4.*"
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
- Upgrading phpstan/phpstan-symfony (1.2.23 => dev-PasswordAuthenticatedUserStubFilesExtension d879c1a)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
- Downloading phpstan/phpstan-symfony (dev-PasswordAuthenticatedUserStubFilesExtension d879c1a)
- Upgrading phpstan/phpstan-symfony (1.2.23 => dev-PasswordAuthenticatedUserStubFilesExtension d879c1a): Extracting archive
Package sensio/framework-extra-bundle is abandoned, you should avoid using it. Use Symfony instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Package symfony/inflector is abandoned, you should avoid using it. Use EnglishInflector from the String component instead.
Package php-cs-fixer/diff is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
139 packages you are using are looking for funding.
Use the `composer fund` command to find out more! Afterwards: $ vendor/bin/phpstan analyse src -c phpstan.neon --level=5
951/951 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[OK] No errors
|
20a2e46
to
4243db4
Compare
Great
Certainly because I used |
Yep 👍 The lastest commit fixed the SF 6.2 issues. And SF 4.4 still works. I assume your branch is behind 1.2.23, right? Because I get |
4243db4
to
f961a75
Compare
Great !
Certainly. I rebased my branch ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, now SF 6.2 is green as well. Fixed 👍
Thank you for your quick support, very much appreciated!
|
||
public function getFiles(): array | ||
{ | ||
if (!interface_exists('Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runtime concerns are irrelevant for PHPStan, you need to ask ReflectionProvider. If ReflectionProvider cannot be injected, then ask Reflector, as phpstan-doctrine does: https://github.com/phpstan/phpstan-doctrine/blob/1.3.x/src/Stubs/Doctrine/StubFilesExtensionLoader.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that I understand anything about PHPStan internals, but isn't that the "same" as in : https://github.com/phpstan/phpstan-symfony/blob/1.2.x/src/Symfony/InputBagStubFilesExtension.php#L13 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is reaaaaaally old and should be fixed too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done for both StubFilesExtension.
bda236b
to
c12047b
Compare
Friendly ping @ondrejmirtes, is this PR ok to you ? |
Thank you. |
I'm trying to solve #333
@kevinpapst can you try this branch ?
Closes #333