Project

General

Profile

Actions

Task #102140

closed

Unneeded pseudo-uncertain instanceof usage

Added by Benjamin Franzke about 1 year ago. Updated 10 months ago.

Status:
Closed
Priority:
Should have
Category:
Code Cleanup
Start date:
2023-10-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

bin/phpstan analyse -c Build/phpstan/phpstan.local.neon --no-interaction --memory-limit 4G
 4786/4786 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ---------------------------------------------------------------------------------------------------------- 
  Line   adminpanel/Classes/Modules/Debug/QueryInformation.php                                                     
 ------ ---------------------------------------------------------------------------------------------------------- 
  69     Unneeded instanceof on TYPO3\CMS\Adminpanel\Log\DoctrineSqlLoggingMiddleware|null. Use !== null instead.  
 ------ ---------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------ 
  Line   backend/Classes/Controller/AjaxLoginController.php                                                          
 ------ ------------------------------------------------------------------------------------------------------------ 
  139    Unneeded instanceof on TYPO3\CMS\Core\Authentication\BackendUserAuthentication|null. Use !== null instead.  
 ------ ------------------------------------------------------------------------------------------------------------ 

 ------ ------------------------------------------------------------------------------------------- 
  Line   backend/Classes/Controller/PageTsConfig/PageTsConfigActiveController.php                   
 ------ ------------------------------------------------------------------------------------------- 
  136    Unneeded instanceof on TYPO3\CMS\Core\TypoScript\UserTsConfig|null. Use !== null instead.  
 ------ ------------------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------------------------------------------- 
  Line   backend/Classes/Controller/PageTsConfig/PageTsConfigIncludesController.php                                             
 ------ ----------------------------------------------------------------------------------------------------------------------- 
  121    Unneeded instanceof on TYPO3\CMS\Core\TypoScript\UserTsConfig|null. Use !== null instead.                              
  205    Unneeded instanceof on TYPO3\CMS\Core\TypoScript\UserTsConfig|null. Use !== null instead.                              
  232    Unneeded instanceof on TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface|null. Use !== null instead.  
  236    Unneeded instanceof on TYPO3\CMS\Core\TypoScript\Tokenizer\Line\LineStream|null. Use !== null instead.                 
  281    Unneeded instanceof on TYPO3\CMS\Core\TypoScript\UserTsConfig|null. Use !== null instead.                              
 ------ ----------------------------------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------- 
  Line   backend/Classes/Http/RouteDispatcher.php                                               
 ------ --------------------------------------------------------------------------------------- 
  66     Unneeded instanceof on Psr\Http\Message\ResponseInterface|null. Use !== null instead.  
 ------ --------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------- 
  Line   backend/Classes/Security/ContentSecurityPolicy/CspAjaxController.php             
 ------ --------------------------------------------------------------------------------- 
  95     Unneeded instanceof on Symfony\Component\Uid\UuidV4|null. Use !== null instead.  
 ------ --------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------- 
  Line   backend/Classes/Template/Components/Buttons/DropDown/AbstractDropDownItem.php   
 ------ -------------------------------------------------------------------------------- 
  49     Unneeded instanceof on TYPO3\CMS\Core\Imaging\Icon|null. Use !== null instead.  
 ------ -------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------- 
  Line   backend/Classes/Template/Components/Buttons/DropDownButton.php                  
 ------ -------------------------------------------------------------------------------- 
  62     Unneeded instanceof on TYPO3\CMS\Core\Imaging\Icon|null. Use !== null instead.  
 ------ -------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------- 
  Line   backend/Classes/Template/Components/Buttons/GenericButton.php                   
 ------ -------------------------------------------------------------------------------- 
  62     Unneeded instanceof on TYPO3\CMS\Core\Imaging\Icon|null. Use !== null instead.  
 ------ -------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------- 
  Line   backend/Classes/View/BackendLayoutView.php                                                             
 ------ ------------------------------------------------------------------------------------------------------- 
  305    Unneeded instanceof on TYPO3\CMS\Backend\View\BackendLayout\BackendLayout|null. Use !== null instead.  
 ------ ------------------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------------------------------------------------- 
  Line   core/Classes/Domain/Repository/PageRepository.php                                                                                
 ------ --------------------------------------------------------------------------------------------------------------------------------- 
  1310   Unneeded instanceof on TYPO3\CMS\Core\Database\Query\Restriction\QueryRestrictionContainerInterface|null. Use !== null instead.  
 ------ --------------------------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------ 
  Line   core/Classes/Error/AbstractExceptionHandler.php                                                             
 ------ ------------------------------------------------------------------------------------------------------------ 
  152    Unneeded instanceof on TYPO3\CMS\Core\Authentication\BackendUserAuthentication|null. Use !== null instead.  
 ------ ------------------------------------------------------------------------------------------------------------ 

 ------ ------------------------------------------------------------------------------------------------------------ 
  Line   core/Classes/Error/ProductionExceptionHandler.php                                                           
 ------ ------------------------------------------------------------------------------------------------------------ 
  109    Unneeded instanceof on TYPO3\CMS\Core\Authentication\BackendUserAuthentication|null. Use !== null instead.  
 ------ ------------------------------------------------------------------------------------------------------------ 

 ------ --------------------------------------------------------------------------------------- 
  Line   core/Classes/Imaging/IconFactory.php                                                   
 ------ --------------------------------------------------------------------------------------- 
  92     Unneeded instanceof on TYPO3\CMS\Core\Type\Icon\IconState|null. Use !== null instead.  
 ------ --------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------- 
  Line   core/Classes/Messaging/FlashMessageQueue.php                                                                 
 ------ ------------------------------------------------------------------------------------------------------------- 
  159    Unneeded instanceof on TYPO3\CMS\Core\Authentication\AbstractUserAuthentication|null. Use !== null instead.  
  197    Unneeded instanceof on TYPO3\CMS\Core\Authentication\AbstractUserAuthentication|null. Use !== null instead.  
 ------ ------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------ 
  Line   core/Classes/Routing/PageRouter.php                                                             
 ------ ------------------------------------------------------------------------------------------------ 
  100    Unneeded instanceof on TYPO3\CMS\Core\Routing\RouteResultInterface|null. Use !== null instead.  
 ------ ------------------------------------------------------------------------------------------------ 

 ------ ------------------------------------------------------------------------------------------- 
  Line   core/Classes/TypoScript/PageTsConfigFactory.php                                            
 ------ ------------------------------------------------------------------------------------------- 
  61     Unneeded instanceof on TYPO3\CMS\Core\TypoScript\UserTsConfig|null. Use !== null instead.  
 ------ ------------------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------- 
  Line   dashboard/Classes/Controller/DashboardController.php                              
 ------ ---------------------------------------------------------------------------------- 
  121    Unneeded instanceof on TYPO3\CMS\Dashboard\Dashboard|null. Use !== null instead.  
 ------ ---------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------- 
  Line   dashboard/Classes/DashboardInitializationService.php                              
 ------ ---------------------------------------------------------------------------------- 
  70     Unneeded instanceof on TYPO3\CMS\Dashboard\Dashboard|null. Use !== null instead.  
  97     Unneeded instanceof on TYPO3\CMS\Dashboard\Dashboard|null. Use !== null instead.  
 ------ ---------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------------- 
  Line   extbase/Classes/Persistence/Generic/Mapper/DataMapper.php                               
 ------ ---------------------------------------------------------------------------------------- 
  677    Unneeded instanceof on Symfony\Component\PropertyInfo\Type|null. Use !== null instead.  
  725    Unneeded instanceof on Symfony\Component\PropertyInfo\Type|null. Use !== null instead.  
  834    Unneeded instanceof on Symfony\Component\PropertyInfo\Type|null. Use !== null instead.  
 ------ ---------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------ 
  Line   extensionmanager/Classes/Utility/DependencyUtility.php                                                
 ------ ------------------------------------------------------------------------------------------------------ 
  343    Unneeded instanceof on TYPO3\CMS\Extensionmanager\Domain\Model\Extension|null. Use !== null instead.  
 ------ ------------------------------------------------------------------------------------------------------ 

 ------ ---------------------------------------------------------------------------- 
  Line   extensionmanager/Classes/Utility/InstallUtility.php                         
 ------ ---------------------------------------------------------------------------- 
  393    Unneeded instanceof on TYPO3\CMS\Impexp\Import|null. Use !== null instead.  
 ------ ---------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------ 
  Line   extensionmanager/Classes/Utility/ListUtility.php                                                      
 ------ ------------------------------------------------------------------------------------------------------ 
  212    Unneeded instanceof on TYPO3\CMS\Extensionmanager\Domain\Model\Extension|null. Use !== null instead.  
  218    Unneeded instanceof on TYPO3\CMS\Extensionmanager\Domain\Model\Extension|null. Use !== null instead.  
 ------ ------------------------------------------------------------------------------------------------------ 

 ------ ----------------------------------------------------------------------------------- 
  Line   felogin/Tests/Unit/Configuration/RecoveryConfigurationTest.php                     
 ------ ----------------------------------------------------------------------------------- 
  64     Unneeded instanceof on TYPO3\CMS\Core\Context\Context|null. Use !== null instead.  
 ------ ----------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------------- 
  Line   form/Classes/Mvc/Persistence/FormPersistenceManager.php                                     
 ------ -------------------------------------------------------------------------------------------- 
  732    Unneeded instanceof on TYPO3\CMS\Core\Resource\ResourceStorage|null. Use !== null instead.  
 ------ -------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------------------------------- 
  Line   frontend/Classes/ContentObject/FilesContentObject.php                                                          
 ------ --------------------------------------------------------------------------------------------------------------- 
  60     Unneeded instanceof on TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController|null. Use !== null instead.  
  71     Unneeded instanceof on TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController|null. Use !== null instead.  
 ------ --------------------------------------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------------------------------------- 
  Line   frontend/Classes/Controller/ErrorController.php                                                                     
 ------ -------------------------------------------------------------------------------------------------------------------- 
  51     Unneeded instanceof on TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerInterface|null. Use !== null instead.  
  69     Unneeded instanceof on TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerInterface|null. Use !== null instead.  
  84     Unneeded instanceof on TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerInterface|null. Use !== null instead.  
  103    Unneeded instanceof on TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerInterface|null. Use !== null instead.  
 ------ -------------------------------------------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------------------------- 
  Line   frontend/Classes/Middleware/BackendUserAuthenticator.php                                                
 ------ -------------------------------------------------------------------------------------------------------- 
  65     Unneeded instanceof on TYPO3\CMS\Backend\FrontendBackendUserAuthentication|null. Use !== null instead.  
 ------ -------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------ 
  Line   frontend/Classes/Middleware/SiteBaseRedirectResolver.php                                                    
 ------ ------------------------------------------------------------------------------------------------------------ 
  99     Unneeded instanceof on TYPO3\CMS\Core\Authentication\BackendUserAuthentication|null. Use !== null instead.  
 ------ ------------------------------------------------------------------------------------------------------------ 

 ------ ----------------------------------------------------------------------------------- 
  Line   impexp/Classes/Controller/ExportController.php                                     
 ------ ----------------------------------------------------------------------------------- 
  128    Unneeded instanceof on TYPO3\CMS\Core\Resource\Folder|null. Use !== null instead.  
  147    Unneeded instanceof on TYPO3\CMS\Core\Resource\Folder|null. Use !== null instead.  
 ------ ----------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------- 
  Line   impexp/Classes/Controller/ImportController.php                                     
 ------ ----------------------------------------------------------------------------------- 
  105    Unneeded instanceof on TYPO3\CMS\Core\Resource\File|null. Use !== null instead.    
  116    Unneeded instanceof on TYPO3\CMS\Core\Resource\Folder|null. Use !== null instead.  
 ------ ----------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------- 
  Line   impexp/Classes/Export.php                                                          
 ------ ----------------------------------------------------------------------------------- 
  1321   Unneeded instanceof on TYPO3\CMS\Core\Resource\Folder|null. Use !== null instead.  
 ------ ----------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------- 
  Line   install/Classes/Middleware/Maintenance.php                                             
 ------ --------------------------------------------------------------------------------------- 
  203    Unneeded instanceof on Psr\Http\Message\ResponseInterface|null. Use !== null instead.  
 ------ --------------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------------------------------- 
  Line   redirects/Classes/Hooks/DataHandlerSlugUpdateHook.php                                                         
 ------ -------------------------------------------------------------------------------------------------------------- 
  63     Unneeded instanceof on TYPO3\CMS\Redirects\RedirectUpdate\SlugRedirectChangeItem|null. Use !== null instead.  
 ------ -------------------------------------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------- 
  Line   redirects/Classes/Http/Middleware/RedirectHandler.php                             
 ------ ---------------------------------------------------------------------------------- 
  69     Unneeded instanceof on Psr\Http\Message\UriInterface|null. Use !== null instead.  
 ------ ---------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------- 
  Line   scheduler/Classes/Scheduler.php                               
 ------ -------------------------------------------------------------- 
  197    Unneeded instanceof on Throwable|null. Use !== null instead.  
 ------ -------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------------------------- 
  Line   tstemplate/Classes/Controller/TemplateAnalyzerController.php                                            
 ------ -------------------------------------------------------------------------------------------------------- 
  205    Unneeded instanceof on TYPO3\CMS\Core\TypoScript\Tokenizer\Line\LineStream|null. Use !== null instead.  
 ------ -------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------------ 
  Line   workspaces/Classes/Middleware/WorkspacePreview.php                                                                
 ------ ------------------------------------------------------------------------------------------------------------------ 
  102    Unneeded instanceof on TYPO3\CMS\Workspaces\Authentication\PreviewUserAuthentication|null. Use !== null instead.  
  130    Unneeded instanceof on TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController|null. Use !== null instead.     
  135    Unneeded instanceof on TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController|null. Use !== null instead.     
 ------ ------------------------------------------------------------------------------------------------------------------ 

 [ERROR] Found 55 errors                                                                                                


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #102374: Missing null check in redirect slug update hookClosedMathias Brodala2023-11-15

Actions
Actions

Also available in: Atom PDF