Report from drupal-check -ad

 13/13 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ---------------------------------------------------------------------------------------- 
  Line   auto_entitylabel.install                                                                
 ------ ---------------------------------------------------------------------------------------- 
  29     Variable $config in PHPDoc tag @var does not match assigned variable $old_config.       
  66     Call to an undefined method Drupal\Core\Entity\EntityTypeInterface::getConfigPrefix().  
 ------ ---------------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------- 
  Line   auto_entitylabel.module                                                   
 ------ -------------------------------------------------------------------------- 
  54     Call to an undefined method Drupal\Core\Form\FormInterface::getEntity().  
 ------ -------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------ 
  Line   src/AutoEntityLabelManager.php                                                                        
 ------ ------------------------------------------------------------------------------------------------------ 
  114    Access to an undefined property Drupal\auto_entitylabel\AutoEntityLabelManager::$bundle_entity_type.  
  163    Comparison operation "==" between Drupal\Core\Config\ImmutableConfig and 1 results in an error.       
  170    Comparison operation "==" between Drupal\Core\Config\ImmutableConfig and 2 results in an error.       
  187    Method Drupal\auto_entitylabel\AutoEntityLabelManager::getStatus() should return bool but returns     
         Drupal\Core\Config\ImmutableConfig.                                                                   
  194    Ternary operator condition is always true.                                                            
 ------ ------------------------------------------------------------------------------------------------------ 

 ------ ------------------------------------------------------- 
  Line   src/AutoEntityLabelPermissionController.php            
 ------ ------------------------------------------------------- 
  38     Unsafe usage of new static().                          
         💡 Consider making the class or the constructor final.  
 ------ ------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------------ 
  Line   src/EntityDecorator.php                                                                                           
 ------ ------------------------------------------------------------------------------------------------------------------ 
  62     Property Drupal\auto_entitylabel\EntityDecorator::$entityTypeManager (Drupal\Core\Entity\EntityTypeManager) does  
         not accept Drupal\Core\Entity\EntityTypeManagerInterface.                                                         
  70     Property Drupal\auto_entitylabel\EntityDecorator::$entity (Drupal\Core\Entity\ContentEntityInterface) does not    
         accept Drupal\auto_entitylabel\AutoEntityLabelManager.                                                            
 ------ ------------------------------------------------------------------------------------------------------------------ 

 ------ ------------------------------------------------------------------------------------------------------------------ 
  Line   src/Form/AutoEntityLabelForm.php                                                                                  
 ------ ------------------------------------------------------------------------------------------------------------------ 
  26     PHPDoc tag @property has invalid value (String entityBundle): Unexpected token "entityBundle", expected variable  
         at offset 234                                                                                                     
  26     PHPDoc tag @property has invalid value (String entityType): Unexpected token "entityType", expected variable at   
         offset 203                                                                                                        
  26     PHPDoc tag @property has invalid value (\Drupal\Core\Config\ConfigFactoryInterface config_factory): Unexpected    
         token "config_factory", expected variable at offset 93                                                            
  26     PHPDoc tag @property has invalid value (\Drupal\Core\Entity\EntityTypeManagerInterface entity_manager):           
         Unexpected token "entity_manager", expected variable at offset 168                                                
  26     PHPDoc tag @property has invalid value (\Drupal\auto_entitylabel\AutoEntityLabelManager                           
         auto_entity_label_manager): Unexpected token "\n *", expected variable at offset 307                              
  135    Unsafe usage of new static().                                                                                     
         💡 Consider making the class or the constructor final.                                                             
 ------ ------------------------------------------------------------------------------------------------------------------ 

 ------ ------------------------------------------------------- 
  Line   src/Plugin/Derivative/AutoEntityLabelConfigTask.php    
 ------ ------------------------------------------------------- 
  38     Unsafe usage of new static().                          
         💡 Consider making the class or the constructor final.  
 ------ ------------------------------------------------------- 

 ------ ----------------------------------------------------------------- 
  Line   src/Plugin/Validation/EntityLabelNotNullConstraintValidator.php  
 ------ ----------------------------------------------------------------- 
  41     Unsafe usage of new static().                                    
         💡 Consider making the class or the constructor final.            
 ------ ----------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------------- 
  Line   src/Routing/RouteSubscriber.php                                                              
 ------ --------------------------------------------------------------------------------------------- 
  55     Method Drupal\auto_entitylabel\Routing\RouteSubscriber::getEntityLabelRoute() should return  
         Symfony\Component\Routing\Route|null but return statement is missing.                        
 ------ --------------------------------------------------------------------------------------------- 

                                                                                                                        
 [ERROR] Found 20 errors                                                                                                
                                                                                                                        

Report from phpcs

FILE: .../src/Form/AutoEntityLabelForm.php
----------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------
  40 | ERROR   | [ ] Missing member variable doc comment
 135 | ERROR   | [x] Space before opening parenthesis of function call prohibited
 220 | WARNING | [ ] Line exceeds 80 characters; contains 91 characters
----------------------------------------------------------------------------------------------------------------------------
CommentFileSizeAuthor
#6 3110765-6.patch20.02 KBnace_fr
#2 3110765-2.patch28.39 KBbcizej

Comments

benjamincizej created an issue. See original summary.

bcizej’s picture

StatusFileSize
new28.39 KB

I'm attaching a patch that fixes all the issues except Unsafe usage of new static().

bcizej’s picture

Status: Active » Needs review
kbrodej’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed the patch from #2, works as intended.

dqd’s picture

Status: Reviewed & tested by the community » Needs work
d8/web/modules/contrib/auto_entitylabel$ git apply -v 3110765-2.patch

Checking patch auto_entitylabel.api.php...
Checking patch auto_entitylabel.install...
Checking patch auto_entitylabel.module...
Checking patch auto_entitylabel.services.yml...
error: while searching for:
services:
  auto_entitylabel.route_subscriber:
    class: Drupal\auto_entitylabel\Routing\RouteSubscriber
    arguments: ['@entity.manager']
    tags:
      - { name: event_subscriber }
  auto_entitylabel.route_enhancer:
    class: Drupal\auto_entitylabel\Routing\RouteEnhancer
    arguments: ['@entity.manager']
    tags:
      - { name: route_enhancer }
  auto_entitylabel.manager:
    class: Drupal\auto_entitylabel\AutoEntityLabelManager
    arguments: ['@entity.manager', '@config.factory', '@entity_type.manager', '@token']
  auto_entitylabel.entity_decorator:
    class: Drupal\auto_entitylabel\EntityDecorator
    arguments: ['@config.factory', '@entity_type.manager', '@token']

error: patch failed: auto_entitylabel.services.yml:1
error: auto_entitylabel.services.yml: patch does not apply
Checking patch src/AutoEntityLabelManager.php...
Checking patch src/AutoEntityLabelPermissionController.php...
error: while searching for:
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityManager;

  /**
   * Constructs a new AutoEntityLabelPermissionController instance.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager
   *   The entity manager.
   */
  public function __construct(EntityTypeManagerInterface $entity_manager) {
    $this->entityManager = $entity_manager;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static($container->get('entity.manager'));
  }

  /**

error: patch failed: src/AutoEntityLabelPermissionController.php:19
error: src/AutoEntityLabelPermissionController.php: patch does not apply
Checking patch src/EntityDecorator.php...
Checking patch src/Form/AutoEntityLabelForm.php...
error: while searching for:
   */
  protected $configFactory;

  protected $entityManager;

  // @codingStandardsIgnoreLine
  protected $route_match;

  /**
   * Module handler.

error: patch failed: src/Form/AutoEntityLabelForm.php:37
error: src/Form/AutoEntityLabelForm.php: patch does not apply
Checking patch src/Plugin/Derivative/AutoEntityLabelConfigTask.php...
error: while searching for:
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityManager;

  /**
   * Creates an FieldUiLocalTask object.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager
   *   The entity manager.
   */
  public function __construct(EntityTypeManagerInterface $entity_manager) {
    $this->entityManager = $entity_manager;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, $base_plugin_id) {
    return new static(
      $container->get('entity.manager')
    );
  }

  /**

error: patch failed: src/Plugin/Derivative/AutoEntityLabelConfigTask.php:19
error: src/Plugin/Derivative/AutoEntityLabelConfigTask.php: patch does not apply
Checking patch src/Plugin/Validation/EntityLabelNotNullConstraintValidator.php...
Checking patch src/Routing/RouteEnhancer.php...
error: while searching for:
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityManager;

  /**
   * Constructs a RouteEnhancer object.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager
   *   The entity manager.
   */
  public function __construct(EntityTypeManagerInterface $entity_manager) {
    $this->entityManager = $entity_manager;
  }

  /**

error: patch failed: src/Routing/RouteEnhancer.php:21
error: src/Routing/RouteEnhancer.php: patch does not apply
Checking patch src/Routing/RouteSubscriber.php...
error: while searching for:
  /**
   * Constructs a new RouteSubscriber object.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager
   *   The entity type manager.
   */
  public function __construct(EntityTypeManagerInterface $entity_manager) {
    $this->entityTypeManager = $entity_manager;
  }

  /**

error: patch failed: src/Routing/RouteSubscriber.php:24
error: src/Routing/RouteSubscriber.php: patch does not apply

Thanks for working on this. Please reroll against latest 8.x-3.x-dev and please be aware of #2856225: Replace all usages of deprecated EntityManagerInterface being committed already.

nace_fr’s picture

Status: Needs work » Needs review
StatusFileSize
new20.02 KB

Hi. I have rerolled patch from #2 and it should apply without issues now. Also all the errors should be fixed.

kbrodej’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed and tested the patch that was rerolled. All ok. Marking it as RTBC.

  • benjamincizej authored 87de1f9 on 8.x-3.x
    Issue #3110765 by benjamincizej, nace_fric, kbrodej, diqidoq: Code...
colan’s picture

Category: Support request » Task
Status: Reviewed & tested by the community » Fixed

Thanks everyone!

Status: Fixed » Closed (fixed)

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