Problem/Motivation
Drupal CI is reporting various errors. This issue is to fix errors reported here: https://git.drupalcode.org/project/do_username/-/jobs/311830
------ -----------------------------------------------------------------------
Line src/Commands/DOCopyFieldValues.php
------ -----------------------------------------------------------------------
89 Relying on entity queries to check access by default is deprecated in
drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call
\Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or
FALSE to specify whether access should be checked.
💡 See https://www.drupal.org/node/3201242
------ -----------------------------------------------------------------------
------ ------------------------------------------------------------------------------
Line src/Plugin/Validation/Constraint/UsernameValidConstraintValidator.php
------ ------------------------------------------------------------------------------
38 Unsafe usage of new static().
💡 See:
https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static
------ ------------------------------------------------------------------------------
------ ---------------------------------------------------------------
Line tests/src/Kernel/ConfigTest.php
------ ---------------------------------------------------------------
19 Property Drupal\Tests\do_username\Kernel\ConfigTest::$modules
property must be protected.
💡 Change record: https://www.drupal.org/node/2909426
------ ---------------------------------------------------------------Proposed resolution
Fix the errors.
Comments
Comment #3
hussainwebFor the second error, it is a common Drupal practice and the advice is to ignore it as per https://www.drupal.org/docs/develop/development-tools/phpstan/handling-u.... The other two errors are fixed.