Skip to content

Conversation

williamdes
Copy link
Contributor

Ref: #133

Left over:

./vendor/bin/phpstan analyse --level=3 src/
 29/29 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ------------------------------------------------------------------------------------------- 
  Line   Svg/Style.php                                                                              
 ------ ------------------------------------------------------------------------------------------- 
  100    Argument of an invalid type Svg\Style supplied for foreach, only iterables are supported.  
         🪪  foreach.nonIterable                                                                    
 ------ ------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------------------- 
  Line   Svg/Surface/CPdf.php                                                                               
 ------ --------------------------------------------------------------------------------------------------- 
  609    Property Svg\Surface\CPdf::$catalogId (int) does not accept string.                                
         🪪  assign.propertyType                                                                            
  874    PHPDoc tag @throws with type FontLib\Exception\FontNotFoundException is not subtype of Throwable   
         🪪  throws.notThrowable                                                                            
  1056   PHPDoc tag @throws with type FontLib\Exception\FontNotFoundException is not subtype of Throwable   
         🪪  throws.notThrowable                                                                            
  1116   Variable $object in isset() is never defined.                                                      
         🪪  isset.variable                                                                                 
  1117   Undefined variable: $object                                                                        
         🪪  variable.undefined                                                                             
  1119   Undefined variable: $object                                                                        
         🪪  variable.undefined                                                                             
  1662   Property Svg\Surface\CPdf::$procsetObjectId (int) does not accept string.                          
         🪪  assign.propertyType                                                                            
  1702   Property Svg\Surface\CPdf::$infoObject (int) does not accept string.                               
         🪪  assign.propertyType                                                                            
  1923   Property Svg\Surface\CPdf::$currentPage (int) does not accept string.                              
         🪪  assign.propertyType                                                                            
  2082   Binary operation "+" between string and 1 results in an error.                                     
         🪪  binaryOp.invalid                                                                               
  2713   Property Svg\Surface\CPdf::$arc4_objnum (int) does not accept string.                              
         🪪  assign.propertyType                                                                            
  3429   Binary operation ">>" between non-empty-list<string>|non-falsy-string and 8 results in an error.   
         🪪  binaryOp.invalid                                                                               
  3430   Binary operation "&" between non-empty-list<string>|non-falsy-string and 255 results in an error.  
         🪪  binaryOp.invalid                                                                               
  3493   PHPDoc tag @throws with type FontLib\Exception\FontNotFoundException is not subtype of Throwable   
         🪪  throws.notThrowable                                                                            
  3651   Call to vsprintf contains 3 placeholders, 4 values given.                                          
         🪪  argument.vsprintf                                                                              
  3690   Call to vsprintf contains 3 placeholders, 4 values given.                                          
         🪪  argument.vsprintf                                                                              
  6091   Variable $errormsg might not be defined.                                                           
         🪪  variable.undefined                                                                             
  6106   Variable $idata might not be defined.                                                              
         🪪  variable.undefined                                                                             
  6108   Variable $pdata might not be defined.                                                              
         🪪  variable.undefined                                                                             
  6112   Variable $color might not be defined.                                                              
         🪪  variable.undefined                                                                             
  6113   Variable $ncolor might not be defined.                                                             
         🪪  variable.undefined                                                                             
 ------ --------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------- 
  Line   Svg/Surface/SurfaceCpdf.php                            
 ------ ------------------------------------------------------- 
  133    Call to an undefined method Svg\Surface\CPdf::clip().  
         🪪  method.notFound                                    
 ------ ------------------------------------------------------- 

 ------ ------------------------------------------------------------ 
  Line   Svg/Tag/AbstractTag.php                                     
 ------ ------------------------------------------------------------ 
  232    Variable $meetOrSlice on left side of ?? is never defined.  
         🪪  nullCoalesce.variable                                   
 ------ ------------------------------------------------------------ 

                                                                                                                        
 [ERROR] Found 24 errors                                                                                                

```
 ------ -----------------------------------------------------------------------------------
  Line   Svg/Document.php
 ------ -----------------------------------------------------------------------------------
  407    PHPDoc tag @var with type Svg\Tag\AbstractTag is not subtype of native type null.
         🪪  varTag.nativeType
 ------ -----------------------------------------------------------------------------------
```
For `$o` they always exist but phpstan can not detect it
@bsweeney bsweeney added this to the 1.0.1 milestone Sep 18, 2025
@bsweeney bsweeney linked an issue Sep 23, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Address issues reported by phpstan
2 participants