Skip to content

Commit

Permalink
bug #70 Fixed deprecated message for PHP8.4+ (pflueg)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.0-dev branch.

Discussion
----------

"Implicitly marking parameter $translator as nullable is deprecated" fixed

| Q             | A
| ------------- | ---
| Branch?       | main
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Fixed tickets | none
| License       | MIT

Found a strangler deprecation issue.

You might want to update the phpstan/phpunit packages to the latest version, [which will "unshut" phpstan again](https://github.com/rollerworks/PasswordStrengthValidator/blob/v2.0.2/tests/Validator/PasswordRequirementsValidatorTest.php#L73) 😄 You can fix this with "?->" on the `$constraintViolationAssertion` usages, but need to retest the whole thing throughout your BC list.

Thx alot for the package!!

Commits
-------

fc1661b Fixed deprecated message for PHP8.4+
  • Loading branch information
sstok authored Dec 17, 2024
2 parents b02141c + fc1661b commit 89f0c1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Validator/Constraints/PasswordStrengthValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class PasswordStrengthValidator extends ConstraintValidator
5 => 'very_strong',
];

public function __construct(TranslatorInterface $translator = null)
public function __construct(?TranslatorInterface $translator = null)
{
// If translator is missing create a new translator.
// With the 'en' locale and 'validators' domain.
Expand Down

0 comments on commit 89f0c1d

Please sign in to comment.