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

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

tim-diels created an issue. See original summary.

nickolaj made their first commit to this issue’s fork.

nickolaj’s picture

Status: Active » Needs review

Patch 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.

paraderojether’s picture

Status: Needs review » Needs work

Hi

I reviewed MR!23, and PHPStan is still failing on GitLab CI.

Line   src/AlternativeContentView.php                                
 ------ -------------------------------------------------------------- 
  41     Call to deprecated method get() of class                      
         Symfony\Component\HttpFoundation\Request:                     
         since Symfony 7.4, use properties `->attributes`, `query` or  
         `request` directly instead                                    
         🪪  method.deprecated  

Kindly check and advise, please.
Thank you.

tim-diels’s picture

Status: Needs work » Needs review

Fixed "Call to deprecated method get() of class Symfony\Component\HttpFoundation\Request since Symfony 7.4"

tim-diels’s picture

Status: Needs review » 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.