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

Command icon 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

elc created an issue. See original summary.

elc’s picture

Issue summary: View changes

Added more deprecations.

  • elc committed 8ed07eb7 on 2.1.x
    task: #3621896 Fixes for deprecation notices.
    
    By: elc
    

  • elc committed daad9c8b on 3.0.x
    task: #3621896 Fixes for deprecation notices.
    
    By: elc
    
elc’s picture

Assigned: elc » Unassigned
Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.