Skip to content

[Security] Added type-hints to password encoders #32352

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

Merged
merged 1 commit into from
Jul 4, 2019

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Jul 3, 2019

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #32179
License MIT
Doc PR N/A

This PR adds type declarations to all implementations of PasswordEncoderInterface and UserPasswordEncoderInterface.

@derrabus derrabus force-pushed the improvement/type-hints-on-encoders branch from b7f758d to d763e63 Compare July 3, 2019 22:57
@@ -299,3 +292,30 @@ protected function getProvider($user = null, $userChecker = null, $passwordEncod
return new DaoAuthenticationProvider($userProvider, $userChecker, 'key', $encoderFactory);
}
}

class TestUser implements UserInterface
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 UserInterface wasn't mocked properly in the tests: getPassword() returned null where it shouldn't. This caused problems with the new type-hints, so I switched to a dummy implementation instead of bloating the mocking code.

@derrabus derrabus mentioned this pull request Jul 3, 2019
57 tasks
@fabpot
Copy link
Member

fabpot commented Jul 4, 2019

Thank you @derrabus.

@fabpot fabpot merged commit d763e63 into symfony:master Jul 4, 2019
fabpot added a commit that referenced this pull request Jul 4, 2019
This PR was merged into the 5.0-dev branch.

Discussion
----------

[Security] Added type-hints to password encoders

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32179
| License       | MIT
| Doc PR        | N/A

This PR adds type declarations to all implementations of `PasswordEncoderInterface` and `UserPasswordEncoderInterface`.

Commits
-------

d763e63 [Security] Added type-hints to password encoders.
@derrabus derrabus deleted the improvement/type-hints-on-encoders branch July 4, 2019 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants