Fix the issues reported by drupal-check

Created on 1 May 2023, over 1 year ago

Getting following error/warnings

 ------ ----------------------------------------------------------------------- 
  Line   src/Commands/BackupMigrateCommands.php                                 
 ------ ----------------------------------------------------------------------- 
  106    Relying on entity queries to check access by default is deprecated in  
         drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call      
         \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or   
         FALSE to specify whether access should be checked.                     
         💡 See https://www.drupal.org/node/3201242                             
  130    Relying on entity queries to check access by default is deprecated in  
         drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call      
         \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or   
         FALSE to specify whether access should be checked.                     
         💡 See https://www.drupal.org/node/3201242                             
  154    Relying on entity queries to check access by default is deprecated in  
         drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call      
         \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or   
         FALSE to specify whether access should be checked.                     
         💡 See https://www.drupal.org/node/3201242                             
  178    Relying on entity queries to check access by default is deprecated in  
         drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call      
         \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or   
         FALSE to specify whether access should be checked.                     
         💡 See https://www.drupal.org/node/3201242                             
  180    Call to an undefined method                                            
         Drupal\Core\Entity\EntityInterface::getPlugin().                       
  186    Call to an undefined method                                            
         Drupal\Core\Entity\EntityInterface::get().                             
  209    Variable $schedules_id might not be defined.                           
  211    Variable $schedules_id might not be defined.                           
 ------ ----------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   src/Controller/BackupController.php                                    
 ------ ----------------------------------------------------------------------- 
  32     Relying on entity queries to check access by default is deprecated in  
         drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call      
         \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or   
         FALSE to specify whether access should be checked.                     
         💡 See https://www.drupal.org/node/3201242                             
  34     Call to an undefined method                                            
         Drupal\Core\Entity\EntityInterface::getObject().                       
  196    Call to method getFile() on an unknown class                           
         Drupal\backup_migrate\Entity\SourcePluginInterface.                    
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols    
  197    Call to method loadFileForReading() on an unknown class                
         Drupal\backup_migrate\Entity\SourcePluginInterface.                    
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols    
 ------ ----------------------------------------------------------------------- 

 ------ -------------------------------------------------- 
  Line   src/Controller/DestinationListBuilder.php         
 ------ -------------------------------------------------- 
  29     Call to an undefined method                       
         Drupal\Core\Entity\EntityInterface::get().        
  30     Call to an undefined method                       
         Drupal\Core\Entity\EntityInterface::getPlugin().  
 ------ -------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   src/Controller/ScheduleListBuilder.php                                 
 ------ ----------------------------------------------------------------------- 
  85     Parameter $form_state of method                                        
         Drupal\backup_migrate\Controller\ScheduleListBuilder::submitForm()     
         has invalid type Drupal\backup_migrate\Controller\FormStateInterface.  
  86     Call to an undefined static method                                     
         Drupal\Core\Config\Entity\ConfigEntityListBuilder::submitForm().       
 ------ ----------------------------------------------------------------------- 

 ------ ----------------------------------------------- 
  Line   src/Controller/SettingsProfileListBuilder.php  
 ------ ----------------------------------------------- 
  31     Access to an undefined property                
         Drupal\Core\Entity\EntityInterface::$config.   
  32     Access to an undefined property                
         Drupal\Core\Entity\EntityInterface::$config.   
  33     Access to an undefined property                
         Drupal\Core\Entity\EntityInterface::$config.   
 ------ ----------------------------------------------- 

 ------ ------------------------------------------------------------ 
  Line   src/Controller/SourceListBuilder.php                        
 ------ ------------------------------------------------------------ 
  29     Call to an undefined method                                 
         Drupal\Core\Entity\EntityInterface::get().                  
  30     Call to an undefined method                                 
         Drupal\Core\Entity\EntityInterface::getPluginDefinition().  
 ------ ------------------------------------------------------------ 

 ------ -------------------------------------------------------------------------- 
  Line   src/Core/Destination/DirectoryDestination.php                             
 ------ -------------------------------------------------------------------------- 
  153    Method                                                                    
         Drupal\backup_migrate\Core\Destination\DirectoryDestination::listFiles()  
         invoked with 1 parameter, 0 required.                                     
 ------ -------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------ 
  Line   src/Core/Filter/CompressionFilter.php                             
 ------ ------------------------------------------------------------------ 
  328    Method                                                            
         Drupal\backup_migrate\Core\Filter\CompressionFilter::zipDecode()  
         should return bool but return statement is missing.               
 ------ ------------------------------------------------------------------ 

 ------ -------------------------------------------------------- 
  Line   src/Core/Filter/FileExcludeFilter.php                   
 ------ -------------------------------------------------------- 
  29     PHPDoc tag @param references unknown parameter: $table  
 ------ -------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------- 
  Line   src/Core/Filter/Notify.php                                                      
 ------ -------------------------------------------------------------------------------- 
  150    Call to an undefined method                                                     
         Drupal\backup_migrate\Core\Plugin\PluginManagerInterface::services().           
  163    Call to an undefined method                                                     
         Drupal\backup_migrate\Core\Plugin\PluginManagerInterface::setServiceManager().  
 ------ -------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------- 
  Line   src/Core/Main/BackupMigrate.php                                                  
 ------ --------------------------------------------------------------------------------- 
  31     Property Drupal\backup_migrate\Core\Main\BackupMigrate::$services has            
         unknown class                                                                    
         Drupal\backup_migrate\Core\Service\ServiceManagerTheservicelocatorforthisobject  
         as its type.                                                                     
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols              
  75     Call to an undefined method                                                      
         Drupal\backup_migrate\Core\Plugin\PluginInterface::checkWritable().              
  88     Call to an undefined method                                                      
         Drupal\backup_migrate\Core\Plugin\PluginInterface::exportToFile().               
  96     Call to an undefined method                                                      
         Drupal\backup_migrate\Core\Plugin\PluginInterface::saveFile().                   
  139    Call to an undefined method                                                      
         Drupal\backup_migrate\Core\Plugin\PluginInterface::getFile().                    
  145    Call to an undefined method                                                      
         Drupal\backup_migrate\Core\Plugin\PluginInterface::loadFileForReading().         
  155    Call to an undefined method                                                      
         Drupal\backup_migrate\Core\Plugin\PluginInterface::importFromFile().             
 ------ --------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------- 
  Line   src/Core/Main/BackupMigrateInterface.php                            
 ------ -------------------------------------------------------------------- 
  29     PHPDoc tag @return has invalid value (): Unexpected token "\n   ",  
         expected type at offset 265                                         
 ------ -------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   src/Core/Plugin/PluginManagerInterface.php                             
 ------ ----------------------------------------------------------------------- 
  21     PHPDoc tag @param for parameter $item with type object is not subtype  
         of native type Drupal\backup_migrate\Core\Plugin\PluginInterface.      
  21     PHPDoc tag @return has invalid value (): Unexpected token "\n   ",     
         expected type at offset 177                                            
 ------ ----------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------- 
  Line   src/Core/Service/ArchiveWriterInterface.php                         
 ------ -------------------------------------------------------------------- 
  38     PHPDoc tag @return has invalid value (): Unexpected token "\n   ",  
         expected type at offset 238                                         
 ------ -------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------- 
  Line   src/Core/Service/ArchiverInterface.php                              
 ------ -------------------------------------------------------------------- 
  46     PHPDoc tag @return has invalid value (): Unexpected token "\n   ",  
         expected type at offset 211                                         
 ------ -------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------- 
  Line   src/Core/Service/TarArchiveWriter.php                                 
 ------ ---------------------------------------------------------------------- 
  121    Method                                                                
         Drupal\backup_migrate\Core\File\BackupFileWritableInterface::write()  
         invoked with 2 parameters, 1 required.                                
  126    Method                                                                
         Drupal\backup_migrate\Core\File\BackupFileWritableInterface::write()  
         invoked with 2 parameters, 1 required.                                
  129    Method                                                                
         Drupal\backup_migrate\Core\File\BackupFileWritableInterface::write()  
         invoked with 2 parameters, 1 required.                                
  171    Method                                                                
         Drupal\backup_migrate\Core\File\BackupFileWritableInterface::write()  
         invoked with 2 parameters, 1 required.                                
  176    Method                                                                
         Drupal\backup_migrate\Core\File\BackupFileWritableInterface::write()  
         invoked with 2 parameters, 1 required.                                
  179    Method                                                                
         Drupal\backup_migrate\Core\File\BackupFileWritableInterface::write()  
         invoked with 2 parameters, 1 required.                                
 ------ ---------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------------------- 
  Line   src/Drupal/Config/DrupalConfigHelper.php                                                                                 
 ------ ------------------------------------------------------------------------------------------------------------------------- 
  33     Call to an undefined method                                                                                              
         Drupal\backup_migrate\Core\Plugin\PluginInterface::configSchema().                                                       
  34     Call to an undefined method                                                                                              
         Drupal\backup_migrate\Core\Plugin\PluginInterface::config().                                                             
  53     Parameter $plugin of method                                                                                              
         Drupal\backup_migrate\Drupal\Config\DrupalConfigHelper::buildPluginForm()                                                
         has invalid type                                                                                                         
         Drupal\backup_migrate\Drupal\Config\FileDirectorySource.                                                                 
  53     Parameter $plugin of method                                                                                              
         Drupal\backup_migrate\Drupal\Config\DrupalConfigHelper::buildPluginForm()                                                
         has invalid type Drupal\backup_migrate\Drupal\Config\MySQLiSource.                                                       
  54     Call to method configSchema() on an unknown class                                                                        
         Drupal\backup_migrate\Drupal\Config\FileDirectorySource.                                                                 
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols                                                      
  54     Call to method configSchema() on an unknown class                                                                        
         Drupal\backup_migrate\Drupal\Config\MySQLiSource.                                                                        
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols                                                      
  55     Call to method config() on an unknown class                                                                              
         Drupal\backup_migrate\Drupal\Config\FileDirectorySource.                                                                 
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols                                                      
  55     Call to method config() on an unknown class                                                                              
         Drupal\backup_migrate\Drupal\Config\MySQLiSource.                                                                        
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols                                                      
  232    PHPDoc tag @param for parameter $plugins with type                                                                       
         array<Drupal\backup_migrate\Core\Config\ConfigurableInterface>|Drupal\backup_migrate\Core\Plugin\PluginManagerInterface  
         is not subtype of native type                                                                                            
         Drupal\backup_migrate\Core\Plugin\PluginManagerInterface.                                                                
  235    Call to an undefined method                                                                                              
         Drupal\backup_migrate\Core\Plugin\PluginInterface::confGet().                                                            
  284    Method                                                                                                                   
         Drupal\backup_migrate\Drupal\Config\DrupalConfigHelper::getSettingsProfileSelector()                                     
         should return array but return statement is missing.                                                                     
 ------ ------------------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------ 
  Line   src/Drupal/Destination/DrupalBrowserUploadDestination.php                           
 ------ ------------------------------------------------------------------------------------ 
  21     Method Symfony\Component\HttpFoundation\ParameterBag::get() invoked                 
         with 3 parameters, 1-2 required.                                                    
  23     Method                                                                              
         Drupal\backup_migrate\Drupal\Destination\DrupalBrowserUploadDestination::getFile()  
         should return Drupal\backup_migrate\Core\File\BackupFileInterface but               
         return statement is missing.                                                        
 ------ ------------------------------------------------------------------------------------ 

 ------ -------------------------------------------------------------------------- 
  Line   src/Drupal/Destination/DrupalDirectoryDestination.php                     
 ------ -------------------------------------------------------------------------- 
  97     Method                                                                    
         Drupal\backup_migrate\Core\Destination\DirectoryDestination::listFiles()  
         invoked with 1 parameter, 0 required.                                     
 ------ -------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------------------- 
  Line   src/Drupal/EntityPlugins/WrapperPluginBase.php                                                 
 ------ ----------------------------------------------------------------------------------------------- 
  29     Method                                                                                         
         Drupal\backup_migrate\Drupal\EntityPlugins\WrapperPluginBase::getObject()                      
         has invalid return type                                                                        
         Drupal\backup_migrate\Drupal\EntityPlugins\Drupal\backup_migrate\Core\Plugin\PluginInterface.  
  32     Method                                                                                         
         Drupal\backup_migrate\Drupal\EntityPlugins\WrapperPluginBase::getObject()                      
         should return                                                                                  
         Drupal\backup_migrate\Drupal\EntityPlugins\Drupal\backup_migrate\Core\Plugin\PluginInterface   
         but return statement is missing.                                                               
 ------ ----------------------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   src/Drupal/Filter/DrupalEncrypt.php                                    
 ------ ----------------------------------------------------------------------- 
  78     Call to static method encryptFileWithPassword() on an unknown class    
         Defuse\Crypto\File.                                                    
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols    
  83     Caught class Drupal\backup_migrate\Drupal\Filter\Exception not found.  
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols    
  96     Call to static method decryptFileWithPassword() on an unknown class    
         Defuse\Crypto\File.                                                    
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols    
  100    Caught class Drupal\backup_migrate\Drupal\Filter\Exception not found.  
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols    
 ------ ----------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------- 
  Line   src/Entity/Schedule.php                                               
 ------ ---------------------------------------------------------------------- 
  122    Call to an undefined method                                           
         Drupal\backup_migrate\Core\Main\BackupMigrateInterface::setConfig().  
 ------ ---------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------- 
  Line   src/Entity/WrapperEntityBase.php                                      
 ------ ---------------------------------------------------------------------- 
  46     Method Drupal\backup_migrate\Entity\WrapperEntityBase::getObject()    
         has invalid return type                                               
         Drupal\backup_migrate\Entity\SourcePluginInterface.                   
  47     Method Drupal\backup_migrate\Entity\WrapperEntityBase::getObject()    
         should return Drupal\backup_migrate\Entity\SourcePluginInterface but  
         return statement is missing.                                          
 ------ ---------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------- 
  Line   src/Form/BackupDeleteForm.php                                        
 ------ --------------------------------------------------------------------- 
  92     Call to method deleteFile() on an unknown class                      
         Drupal\backup_migrate\Entity\SourcePluginInterface.                  
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols  
 ------ --------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------- 
  Line   src/Form/BackupRestoreForm.php                                       
 ------ --------------------------------------------------------------------- 
  77     Call to an undefined method                                          
         Drupal\backup_migrate\Core\Plugin\PluginManagerInterface::config().  
 ------ --------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------- 
  Line   src/Form/ScheduleForm.php                                             
 ------ ---------------------------------------------------------------------- 
  44     Call to an undefined method                                           
         Drupal\Core\Entity\EntityInterface::get().                            
  51     Call to an undefined method                                           
         Drupal\Core\Entity\EntityInterface::get().                            
  56     Call to an undefined method                                           
         Drupal\Core\Entity\EntityInterface::get().                            
  61     Call to an undefined method                                           
         Drupal\Core\Entity\EntityInterface::get().                            
  64     Call to an undefined method                                           
         Drupal\Core\Entity\EntityInterface::get().                            
  101    Call to an undefined method                                           
         Drupal\Core\Entity\EntityInterface::get().                            
  144    Method Drupal\backup_migrate\Form\ScheduleForm::save() should return  
         int but return statement is missing.                                  
 ------ ---------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------- 
  Line   src/Form/SettingsProfileForm.php                                      
 ------ ---------------------------------------------------------------------- 
  42     Call to an undefined method                                           
         Drupal\Core\Entity\EntityInterface::get().                            
  73     Method Drupal\backup_migrate\Form\SettingsProfileForm::save() should  
         return int but return statement is missing.                           
 ------ ---------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------- 
  Line   src/Form/WrapperEntityForm.php                                      
 ------ -------------------------------------------------------------------- 
  38     Call to an undefined method                                         
         Drupal\Core\Entity\EntityInterface::get().                          
  43     Call to an undefined method                                         
         Drupal\Core\Entity\EntityInterface::getPluginManager().             
  51     Call to an undefined method                                         
         Drupal\Core\Entity\EntityInterface::getPlugin().                    
  58     Call to an undefined method                                         
         Drupal\Core\Entity\EntityInterface::getObject().                    
  86     Method Drupal\backup_migrate\Form\WrapperEntityForm::save() should  
         return int but return statement is missing.                         
  119    Call to an undefined method                                         
         Drupal\Core\Entity\EntityInterface::set().                          
 ------ -------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------------------------- 
  Line   src/Plugin/BackupMigrateSource/DefaultDBSourcePlugin.php                                             
 ------ ----------------------------------------------------------------------------------------------------- 
  29     Method                                                                                               
         Drupal\backup_migrate\Plugin\BackupMigrateSource\DefaultDBSourcePlugin::getObject()                  
         has invalid return type                                                                              
         Drupal\backup_migrate\Plugin\BackupMigrateSource\Drupal\backup_migrate\Core\Plugin\PluginInterface.  
  31     Static method Drupal\Core\Database\Database::getConnectionInfo()                                     
         invoked with 2 parameters, 0-1 required.                                                             
 ------ ----------------------------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------------------------- 
  Line   src/Plugin/BackupMigrateSource/EntireSiteSourcePlugin.php                                            
 ------ ----------------------------------------------------------------------------------------------------- 
  31     Method                                                                                               
         Drupal\backup_migrate\Plugin\BackupMigrateSource\EntireSiteSourcePlugin::getObject()                 
         has invalid return type                                                                              
         Drupal\backup_migrate\Plugin\BackupMigrateSource\Drupal\backup_migrate\Core\Plugin\PluginInterface.  
  33     Static method Drupal\Core\Database\Database::getConnectionInfo()                                     
         invoked with 2 parameters, 0-1 required.                                                             
 ------ ----------------------------------------------------------------------------------------------------- 

 [ERROR] Found 88 errors                                                        

Thanks for using drupal-check!

🐛 Bug report
Status

Needs work

Version

5.1

Component

Code

Created by

🇮🇳India Akshay kashyap

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024