Skip to content

PasswordEncoderInterface has wrong type hinting #31812

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

Closed
garak opened this issue Jun 3, 2019 · 1 comment
Closed

PasswordEncoderInterface has wrong type hinting #31812

garak opened this issue Jun 3, 2019 · 1 comment
Labels

Comments

@garak
Copy link
Contributor

garak commented Jun 3, 2019

Symfony version(s) affected: >=3.4

PasswordEncoderInterface has, in both methods, string for the type-hinting (in phpDoc) of $salt parameter.
This is wrong and should be string|null: as a matter of fact, newer encoders don't require a salt.

I found this with phpstan:

Parameter 2 $salt of method Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface::encodePassword() expects string, null given.

@xabbuh xabbuh added the Security label Jun 3, 2019
@chalasr
Copy link
Member

chalasr commented Jun 3, 2019

👍 PR welcome

garak added a commit to garak/symfony that referenced this issue Jun 3, 2019
nicolas-grekas added a commit that referenced this issue Jun 3, 2019
This PR was squashed before being merged into the 3.4 branch (closes #31813).

Discussion
----------

fix type hint for salt in PasswordEncoderInterface

See issue #31812

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31812
| License       | MIT
| Doc PR        | none

Pretty self-explanatory

Commits
-------

0e741f9 fix type hint for salt in PasswordEncoderInterface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants