Problem/Motivation
Method "Symfony\Component\Validator\ConstraintValidatorInterface::validate()" might add "void" as a native return type declaration in the future. Do the same in implementation "Drupal\cas_server\Plugin\Validation\Constraint\CasServicePatternConstraintValidator" now to avoid errors or add an explicit @return annotation to suppress this message.
Line tests/src/Functional/UserLoginFormTest.php
------ ---------------------------------------------------------------------
103 Storing entity storage as a class property is not recommended. Call
Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() at the
call-site instead.
🪪 drupal.entityStoragePropertyAssignment
💡 See
https://mglaman.dev/blog/dependency-injection-anti-patterns-drupal 1) Metadata found in doc-comment for class Drupal\Tests\cas_server\Functional\BakingTest. Metadata in doc-comments is deprecated and will no longer be supported in PHPUnit 12. Update your test code to use attributes instead.
Steps to reproduce
Run full tests on a Drupal 11 test in ddev which will result in deprecation notices.
Proposed resolution
- Add add "void" as a native return type declaration to 2.1.x and 3.0.x branches.
- In tests, use \Drupal::entityTypeManager->getStorage() where used instead of storing as property
- For 2.1.x, add PHPUnit Attributes in addition to docblock. For 3.0.x, remove the docblock ones
Remaining tasks
- ✅ File an issue
- ➖ Addition/Change/Update/Fix
- ➖ Testing to ensure no regression
- ❌ Release
User interface changes
- N/A
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- N/A
Issue fork cas_server-3621896
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
elc commentedAdded more deprecations.
Comment #7
elc commented