None
Problem/Motivation
As you can see the pipelines report issues with PHPStan => https://git.drupalcode.org/project/navigation_extra/-/jobs/6567156
------ -----------------------------------------------------------------------
Line navigation_extra.module
------ -----------------------------------------------------------------------
87 Class Drupal\navigation\Hook\NavigationHooks constructor invoked with
0 parameters, 5 required.
🪪 arguments.count
------ -----------------------------------------------------------------------
------ -----------------------------------------------------------------------
Line src/Plugin/Block/NavigationExtraVersionBlock.php
------ -----------------------------------------------------------------------
62 Access to an undefined property
Drupal\navigation_extra\Plugin\Block\NavigationExtraVersionBlock::$na
vigationExtra.
🪪 property.notFound
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-und
efined-property
------ -----------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line src/Plugin/Menu/TranslatedMenuLink.php
------ ----------------------------------------------------------------------
54 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
------ ----------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line src/Plugin/Navigation/Extra/UsersPlugin.php
------ ----------------------------------------------------------------------
212 Call to static method logException() on an unknown class
Drupal\police_core\Police.
🪪 class.notFound
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ ----------------------------------------------------------------------
[ERROR] Found 4 errors
Steps to reproduce
https://git.drupalcode.org/project/navigation_extra/-/jobs/6567156
Proposed resolution
Fix the issues.
Remaining tasks
Create MR with fixes.
User interface changes
None
API changes
None
Data model changes
None
Issue fork navigation_extra-3573066
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 #4
nickolajPatch fixes all four PHPStan errors: uses `\Drupal::classResolver()` for NavigationHooks instantiation, adds `$navigationExtra` property via DI and fixes `blockdAccess` typo in NavigationExtraVersionBlock, replaces `\Drupal::logger()` with injected LoggerChannelInterface in TranslatedMenuLink, and replaces unknown `Police::logException()` with `LoggerChannelTrait` in UsersPlugin.
Comment #5
paraderojether commentedHi
I reviewed MR!23, and PHPStan is still failing on GitLab CI.
Kindly check and advise, please.
Thank you.
Comment #6
tim-dielsFixed "Call to deprecated method get() of class Symfony\Component\HttpFoundation\Request since Symfony 7.4"
Comment #8
tim-diels