Skip to content

Bump phpstan to major version 2 #304

Open
@phil-davis

Description

@phil-davis

It reports:

$ composer phpstan
> phpstan analyse
Note: Using configuration file /home/phil/git/sabre-io/xml/phpstan.neon.
 39/39 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ----------------------------------------------------------------------------- 
  Line   lib/Serializer/functions.php                                                 
 ------ ----------------------------------------------------------------------------- 
  184    Call to function is_string() with string will always evaluate to true.       
         🪪  function.alreadyNarrowedType                                              
  202    Call to function is_object() with object will always evaluate to true.       
         🪪  function.alreadyNarrowedType                                              
         💡 Remove remaining cases below this one and this error will disappear too.   
  204    Call to function is_null() with *NEVER* will always evaluate to true.        
         🪪  function.alreadyNarrowedType                                              
 ------ ----------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------------------------------------------- 
  Line   tests/Sabre/Xml/ReaderTest.php                                                                                         
 ------ ----------------------------------------------------------------------------------------------------------------------- 
  342    Call to static method PHPUnit\Framework\Assert::assertIsArray() with array<LibXMLError> will always evaluate to true.  
         🪪  staticMethod.alreadyNarrowedType                                                                                    
 ------ ----------------------------------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------------------------------------------------- 
  Line   tests/Sabre/Xml/ServiceTest.php                                                                                                  
 ------ --------------------------------------------------------------------------------------------------------------------------------- 
  189    Call to static method PHPUnit\Framework\Assert::assertIsObject() with Sabre\Xml\PropFindTestAsset will always evaluate to true.  
         🪪  staticMethod.alreadyNarrowedType                                                                                              
         💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your      
            phpstan.neon.                                                                                                                 
 ------ --------------------------------------------------------------------------------------------------------------------------------- 

                                                                                                                        
 [ERROR] Found 5 errors                                                                                                 
                                                                                                                        

Script phpstan analyse handling the phpstan event returned with error code 1

ToDo: sort out the above so it passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions