propelorm / Propel2

Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP
http://propelorm.org/
MIT License
1.26k stars 396 forks source link

PHP 8.1 issues #1811

Closed dereuromark closed 2 years ago

dereuromark commented 2 years ago
 ------ ---------------------------------------------------------------------- 
  Line   Propel/Generator/Builder/Util/PropelTemplate.php                      
 ------ ---------------------------------------------------------------------- 
  88     Parameter #1 $enable of function ob_implicit_flush expects bool, int  
         given.                                                                
 ------ ---------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   Propel/Generator/Builder/Util/SchemaReader.php                         
 ------ ----------------------------------------------------------------------- 
         Ignored error pattern #^Parameter \#2 \$shdl of function               
         xml_set_element_handler expects callable\(\)\: mixed, 'startElement'   
         given\.$# in path                                                      
         /var/work/git/Propel2/src/Propel/Generator/Builder/Util/SchemaReader.  
         php was not matched in reported errors.                                
         Ignored error pattern #^Parameter \#3 \$ehdl of function               
         xml_set_element_handler expects callable\(\)\: mixed, 'endElement'     
         given\.$# in path                                                      
         /var/work/git/Propel2/src/Propel/Generator/Builder/Util/SchemaReader.  
         php was not matched in reported errors.                                
  185    Property Propel\Generator\Builder\Util\SchemaReader::$parser           
         (resource) does not accept XMLParser.                                  
  188    Parameter #2 $start_handler of function xml_set_element_handler        
         expects callable(): mixed, 'startElement' given.                       
  188    Parameter #3 $end_handler of function xml_set_element_handler expects  
         callable(): mixed, 'endElement' given.                                 
  463    Parameter #1 $parser of function xml_get_current_line_number expects   
         XMLParser, resource given.                                             
  464    Parameter #1 $parser of function xml_get_current_column_number         
         expects XMLParser, resource given.                                     
 ------ ----------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   Propel/Generator/Platform/SqlitePlatform.php                           
 ------ ----------------------------------------------------------------------- 
         Ignored error pattern #^Parameter \#1 \$str of function trim expects   
         string, Propel\\Generator\\Model\\ColumnDefaultValue\|null given\.$#   
         in path                                                                
         /var/work/git/Propel2/src/Propel/Generator/Platform/SqlitePlatform.ph  
         p was not matched in reported errors.                                  
  176    Parameter #1 $string of function trim expects string,                  
         Propel\Generator\Model\ColumnDefaultValue|null given.                  
 ------ ----------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------- 
  Line   Propel/Runtime/ActiveQuery/BaseModelCriteria.php                     
 ------ --------------------------------------------------------------------- 
  301    Return type mixed of method                                          
         Propel\Runtime\ActiveQuery\BaseModelCriteria::getIterator() is not   
         covariant with tentative return type Traversable of method           
         IteratorAggregate::getIterator().                                    
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute  
         to temporarily suppress the error.                                   
 ------ --------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   Propel/Runtime/ActiveRecord/NestedSetRecursiveIterator.php             
 ------ ----------------------------------------------------------------------- 
  42     Return type mixed of method                                            
         Propel\Runtime\ActiveRecord\NestedSetRecursiveIterator::rewind() is    
         not covariant with tentative return type void of method                
         Iterator::rewind().                                                    
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  50     Return type mixed of method                                            
         Propel\Runtime\ActiveRecord\NestedSetRecursiveIterator::valid() is     
         not covariant with tentative return type bool of method                
         Iterator::valid().                                                     
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  80     Return type mixed of method                                            
         Propel\Runtime\ActiveRecord\NestedSetRecursiveIterator::next() is not  
         covariant with tentative return type void of method Iterator::next().  
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  103    Return type mixed of method                                            
         Propel\Runtime\ActiveRecord\NestedSetRecursiveIterator::hasChildren()  
         is not covariant with tentative return type bool of method             
         RecursiveIterator::hasChildren().                                      
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  111    Return type mixed of method                                            
         Propel\Runtime\ActiveRecord\NestedSetRecursiveIterator::getChildren()  
         is not covariant with tentative return type RecursiveIterator|null of  
         method RecursiveIterator::getChildren().                               
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
 ------ ----------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   Propel/Runtime/Collection/Collection.php                               
 ------ ----------------------------------------------------------------------- 
  92     Return type mixed of method                                            
         Propel\Runtime\Collection\Collection::offsetExists() is not covariant  
         with tentative return type bool of method                              
         ArrayAccess::offsetExists().                                           
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  115    Return type mixed of method                                            
         Propel\Runtime\Collection\Collection::offsetSet() is not covariant     
         with tentative return type void of method ArrayAccess::offsetSet().    
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  129    Return type mixed of method                                            
         Propel\Runtime\Collection\Collection::offsetUnset() is not covariant   
         with tentative return type void of method ArrayAccess::offsetUnset().  
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  177    Return type mixed of method                                            
         Propel\Runtime\Collection\Collection::getIterator() is not covariant   
         with tentative return type Traversable of method                       
         IteratorAggregate::getIterator().                                      
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  187    Return type mixed of method                                            
         Propel\Runtime\Collection\Collection::count() is not covariant with    
         tentative return type int of method Countable::count().                
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
 ------ ----------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------- 
  Line   Propel/Runtime/Collection/CollectionIterator.php                     
 ------ --------------------------------------------------------------------- 
  200    Return type mixed of method                                          
         Propel\Runtime\Collection\CollectionIterator::offsetSet() is not     
         covariant with tentative return type void of method                  
         ArrayAccess::offsetSet().                                            
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute  
         to temporarily suppress the error.                                   
  212    Return type mixed of method                                          
         Propel\Runtime\Collection\CollectionIterator::offsetUnset() is not   
         covariant with tentative return type void of method                  
         ArrayAccess::offsetUnset().                                          
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute  
         to temporarily suppress the error.                                   
  224    Return type mixed of method                                          
         Propel\Runtime\Collection\CollectionIterator::append() is not        
         covariant with tentative return type void of method                  
         ArrayIterator::append().                                             
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute  
         to temporarily suppress the error.                                   
  236    Return type mixed of method                                          
         Propel\Runtime\Collection\CollectionIterator::asort() is not         
         covariant with tentative return type bool of method                  
         ArrayIterator::asort().                                              
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute  
         to temporarily suppress the error.                                   
  247    Return type mixed of method                                          
         Propel\Runtime\Collection\CollectionIterator::ksort() is not         
         covariant with tentative return type bool of method                  
         ArrayIterator::ksort().                                              
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute  
         to temporarily suppress the error.                                   
  258    Return type mixed of method                                          
         Propel\Runtime\Collection\CollectionIterator::uasort() is not        
         covariant with tentative return type bool of method                  
         ArrayIterator::uasort().                                             
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute  
         to temporarily suppress the error.                                   
  269    Return type mixed of method                                          
         Propel\Runtime\Collection\CollectionIterator::uksort() is not        
         covariant with tentative return type bool of method                  
         ArrayIterator::uksort().                                             
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute  
         to temporarily suppress the error.                                   
  278    Return type mixed of method                                          
         Propel\Runtime\Collection\CollectionIterator::natsort() is not       
         covariant with tentative return type bool of method                  
         ArrayIterator::natsort().                                            
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute  
         to temporarily suppress the error.                                   
  287    Return type mixed of method                                          
         Propel\Runtime\Collection\CollectionIterator::natcasesort() is not   
         covariant with tentative return type bool of method                  
         ArrayIterator::natcasesort().                                        
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute  
         to temporarily suppress the error.                                   
 ------ --------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------- 
  Line   Propel/Runtime/Collection/ObjectCollection.php                       
 ------ --------------------------------------------------------------------- 
  440    Return type mixed of method                                          
         Propel\Runtime\Collection\ObjectCollection::offsetUnset() is not     
         covariant with tentative return type void of method                  
         ArrayAccess::offsetUnset().                                          
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute  
         to temporarily suppress the error.                                   
  491    Return type mixed of method                                          
         Propel\Runtime\Collection\ObjectCollection::offsetSet() is not       
         covariant with tentative return type void of method                  
         ArrayAccess::offsetSet().                                            
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute  
         to temporarily suppress the error.                                   
 ------ --------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   Propel/Runtime/Collection/OnDemandCollection.php                       
 ------ ----------------------------------------------------------------------- 
         Ignored error pattern #^Method                                         
         Propel\\Runtime\\Collection\\OnDemandCollection\:\:getIterator\(\)     
         should return Propel\\Runtime\\Collection\\OnDemandIterator but        
         returns Iterator\.$# in path                                           
         /var/work/git/Propel2/src/Propel/Runtime/Collection/OnDemandCollectio  
         n.php was not matched in reported errors.                              
         Ignored error pattern #^Return type                                    
         \(Propel\\Runtime\\Collection\\OnDemandIterator\) of method            
         Propel\\Runtime\\Collection\\OnDemandCollection\:\:getIterator\(\)     
         should be compatible with return type                                  
         \(Propel\\Runtime\\Collection\\CollectionIterator\) of method          
         Propel\\Runtime\\Collection\\Collection\:\:getIterator\(\)$# in path   
         /var/work/git/Propel2/src/Propel/Runtime/Collection/OnDemandCollectio  
         n.php was not matched in reported errors.                              
  115    Return type mixed of method                                            
         Propel\Runtime\Collection\OnDemandCollection::getIterator() is not     
         covariant with tentative return type Traversable of method             
         IteratorAggregate::getIterator().                                      
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  129    Return type mixed of method                                            
         Propel\Runtime\Collection\OnDemandCollection::offsetExists() is not    
         covariant with tentative return type bool of method                    
         ArrayAccess::offsetExists().                                           
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  154    Return type mixed of method                                            
         Propel\Runtime\Collection\OnDemandCollection::offsetSet() is not       
         covariant with tentative return type void of method                    
         ArrayAccess::offsetSet().                                              
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  166    Return type mixed of method                                            
         Propel\Runtime\Collection\OnDemandCollection::offsetUnset() is not     
         covariant with tentative return type void of method                    
         ArrayAccess::offsetUnset().                                            
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  202    Return type mixed of method                                            
         Propel\Runtime\Collection\OnDemandCollection::count() is not           
         covariant with tentative return type int of method                     
         Countable::count().                                                    
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
 ------ ----------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   Propel/Runtime/Collection/OnDemandIterator.php                         
 ------ ----------------------------------------------------------------------- 
  119    Return type mixed of method                                            
         Propel\Runtime\Collection\OnDemandIterator::next() is not covariant    
         with tentative return type void of method Iterator::next().            
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  137    Return type mixed of method                                            
         Propel\Runtime\Collection\OnDemandIterator::rewind() is not covariant  
         with tentative return type void of method Iterator::rewind().          
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  157    Return type mixed of method                                            
         Propel\Runtime\Collection\OnDemandIterator::valid() is not covariant   
         with tentative return type bool of method Iterator::valid().           
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
 ------ ----------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   Propel/Runtime/DataFetcher/DataFetcherInterface.php                    
 ------ ----------------------------------------------------------------------- 
  51     Return type mixed of method                                            
         Propel\Runtime\DataFetcher\DataFetcherInterface::next() is not         
         covariant with tentative return type void of method Iterator::next().  
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  70     Return type mixed of method                                            
         Propel\Runtime\DataFetcher\DataFetcherInterface::valid() is not        
         covariant with tentative return type bool of method                    
         Iterator::valid().                                                     
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  79     Return type mixed of method                                            
         Propel\Runtime\DataFetcher\DataFetcherInterface::rewind() is not       
         covariant with tentative return type void of method                    
         Iterator::rewind().                                                    
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  111    Return type mixed of method                                            
         Propel\Runtime\DataFetcher\DataFetcherInterface::count() is not        
         covariant with tentative return type int of method                     
         Countable::count().                                                    
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
 ------ ----------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------- 
  Line   Propel/Runtime/Util/PropelModelPager.php                              
 ------ ---------------------------------------------------------------------- 
  437    Return type mixed of method                                           
         Propel\Runtime\Util\PropelModelPager::getIterator() is not covariant  
         with tentative return type Traversable of method                      
         IteratorAggregate::getIterator().                                     
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute   
         to temporarily suppress the error.                                    
  449    Return type mixed of method                                           
         Propel\Runtime\Util\PropelModelPager::count() is not covariant with   
         tentative return type int of method Countable::count().               
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute   
         to temporarily suppress the error.                                    
 ------ ---------------------------------------------------------------------- 

 [ERROR] Found 48 errors                                                        

We might need to add some of those attributes now or fix up the API.

dereuromark commented 2 years ago

We should release a new beta then including these changes as well as the other tickets about

fbourigault commented 2 years ago

We should release a new beta then including these changes as well as the other tickets about

Is it the time to release a new beta and tackle those topics.

dereuromark commented 2 years ago

I opened a PR already with one of the open topics for the beta: Param/Return types. But I need some help to finish things up.

fbourigault commented 2 years ago

I will look at it.

dereuromark commented 2 years ago

It would be nice if we could plan for the next beta release for end of this month. We could hopefully fit:

dereuromark commented 2 years ago

@fbourigault Did you have a chance to check if there is anything missing?

I already did a 8.2 check and it seems fine so far

dereuromark commented 2 years ago

Looks to me all is done already via https://github.com/propelorm/Propel2/pull/1805 Closing then.