Drupal-check errors / coding standards

Created on 18 July 2023, over 1 year ago
Updated 27 August 2024, 4 months ago

Problem/Motivation

Errors found when running drupal-check. I found the errors on my custom folder cause I extended the IconsetBase class. So, I decided to run a report on the contrib module

Steps to reproduce

1. Install drupal-check as per https://github.com/mglaman/drupal-check
2. Run drupal-check: php vendor/bin/drupal-check web/modules/contrib/social_media_links

Result

------ ----------------------------------------------------------------------------------------------------- 
  Line   modules/social_media_links_field/src/Plugin/Field/FieldType/SocialMediaLinksFieldItem.php            
 ------ ----------------------------------------------------------------------------------------------------- 
  161    Access to an undefined property                                                                      
         Drupal\social_media_links_field\Plugin\Field\FieldType\SocialMediaLinksFieldItem::$platform.         
         πŸ’‘ Learn more:                                                                                       
            https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                             
  162    Access to an undefined property                                                                      
         Drupal\social_media_links_field\Plugin\Field\FieldType\SocialMediaLinksFieldItem::$value.            
         πŸ’‘ Learn more:                                                                                       
            https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                             
  163    Access to an undefined property                                                                      
         Drupal\social_media_links_field\Plugin\Field\FieldType\SocialMediaLinksFieldItem::$platform_values.  
         πŸ’‘ Learn more:                                                                                       
            https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                             
 ------ ----------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------ 
  Line   modules/social_media_links_field/src/Plugin/Field/FieldWidget/SocialMediaLinksFieldDefaultWidget.php  
 ------ ------------------------------------------------------------------------------------------------------ 
  26     Call to an undefined method                                                                           
         Drupal\Core\TypedData\TypedDataInterface::toArray().                                                  
 ------ ------------------------------------------------------------------------------------------------------ 

 ------ ----------------------------------------------------------------------------------------------------- 
  Line   modules/social_media_links_field/src/Plugin/Field/FieldWidget/SocialMediaLinksFieldSelectWidget.php  
 ------ ----------------------------------------------------------------------------------------------------- 
  27     Call to an undefined method                                                                          
         Drupal\Core\TypedData\TypedDataInterface::getEntity().                                               
  27     Call to an undefined method                                                                          
         Drupal\Core\TypedData\TypedDataInterface::toArray().                                                 
  58     Access to an undefined property                                                                      
         Symfony\Component\Validator\ConstraintViolationInterface::$arrayPropertyPath.                        
         πŸ’‘ Learn more:                                                                                       
            https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                             
  58     Call to static method getValue() on an unknown class                                                 
         Drupal\social_media_links_field\Plugin\Field\FieldWidget\NestedArray.                                
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols                                  
 ------ ----------------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------- 
  Line   src/IconsetBase.php                          
 ------ --------------------------------------------- 
  118    Cannot call method getIconName() on string.  
 ------ --------------------------------------------- 

 ------ ----------------------------------------------------- 
  Line   src/Plugin/SocialMediaLinks/Iconset/FontAwesome.php  
 ------ ----------------------------------------------------- 
  47     Cannot call method getIconName() on string.          
 ------ ----------------------------------------------------- 

 [ERROR] Found 10 errors    
πŸ› Bug report
Status

Closed: won't fix

Version

2.9

Component

Code

Created by

πŸ‡§πŸ‡·Brazil carolpettirossi Campinas - SP

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024