Fix coding standards and phpstan errors

Created on 30 March 2023, almost 2 years ago

Problem/Motivation

phpcs
=====

FILE: ...k/.dropsolid_launchpad/projects/phpunit/docroot/modules/contrib/seo_urls/src/Controller/SeoUrlCreateController.php
------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------
  32 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 107 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------------


FILE: ...k/.dropsolid_launchpad/projects/phpunit/docroot/modules/contrib/seo_urls/src/PathProcessor/SeoUrlPathProcessor.php
------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 34 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------------

Time: 148ms; Memory: 12MB

phpstan
=======

------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   Controller/SeoUrlCreateController.php                                                                                                                                                            
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  78     Method Drupal\seo_urls\Controller\SeoUrlCreateController::vocabularyTitle() should return string but returns array<string, array|Drupal\Core\StringTranslation\TranslatableMarkup|string|null>.  
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------- 
  Line   EventSubscriber/SeoUrlSubscriber.php                                       
 ------ --------------------------------------------------------------------------- 
  25     Promoted properties are supported only on PHP 8.0 and later.               
  38     Call to an undefined method Drupal\seo_urls\SeoUrlManager::setCacheKey().  
  46     Call to an undefined method Drupal\seo_urls\SeoUrlManager::writeCache().   
 ------ --------------------------------------------------------------------------- 

 ------ --------------------------------- 
  Line   MenuLinkDestination.php          
 ------ --------------------------------- 
  35     Left side of && is always true.  
 ------ --------------------------------- 

 ------ ----------------------------------------------------------------------------------- 
  Line   Plugin/Validation/Constraint/UniqueLinkValueValidator.php                          
 ------ ----------------------------------------------------------------------------------- 
  44     Access to an undefined property Symfony\Component\Validator\Constraint::$message.  
 ------ ----------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   SeoUrlManager.php                                                                                                                                                                           
 ------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  75     Property Drupal\seo_urls\SeoUrlManager::$preloadedPathLookups (array) does not accept default value of type false.                                                                          
  98     Promoted properties are supported only on PHP 8.0 and later.                                                                                                                                
  226    Method Drupal\seo_urls\SeoUrlManager::getSeoUrlEntity() should return Drupal\taxonomy\TermInterface|null but returns Drupal\Core\Entity\ContentEntityInterface.                             
  305    Method Drupal\seo_urls\SeoUrlManager::getCanonicalEntities() should return array<Drupal\Core\Entity\ContentEntityInterface> but returns array<string, Drupal\Core\Entity\EntityInterface>.  
 ------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 

 [ERROR] Found 10 errors

Proposed resolution

Fix all issues or explain why we can't fix them.

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024