Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run linter using PHP 8.1 as well (and fix any issues) #153

Merged
merged 3 commits into from
Sep 22, 2022
Merged

Conversation

macbre
Copy link
Member

@macbre macbre commented Sep 22, 2022

Production (when switched to PHP 8.1) reports:

$ cat phperror.log | grep 22-Sep | cut -d] -f2 | sort | uniq
 PHP Deprecated:  Implicit conversion from float 3.5 to int loses precision in /usr/home/macbre/elecena/git/app/controllers/search/SearchController.class.php on line 438
 PHP Deprecated:  Implicit conversion from float 7.5 to int loses precision in /usr/home/macbre/elecena/git/app/controllers/parameters/ParametersController.class.php on line 300
 PHP Deprecated:  Implicit conversion from float 7.5 to int loses precision in /usr/home/macbre/elecena/git/app/controllers/search/SearchController.class.php on line 438
 PHP Deprecated:  Return type of DatabaseResult::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange
 PHP Deprecated:  Return type of DatabaseResult::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange
 PHP Deprecated:  Return type of DatabaseResult::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange
 PHP Deprecated:  Return type of DatabaseResult::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange
 PHP Deprecated:  Return type of DatabaseResult::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange
 PHP Deprecated:  Return type of DatabaseResult::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange
 PHP Deprecated:  Return type of Predis\Client::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange
 PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/home/macbre/elecena/git/app/vendor/elecena/nano/classes/Router.class.php on line 286
 PHP Notice:  ob_end_clean(): Failed to discard buffer of zlib output compression (2) in /usr/home/macbre/elecena/git/app/vendor/elecena/nano/classes/Response.class.php on line 365

Production (when switched to PHP 8.1) reports:

[22-Sep-2022 15:33:25 Europe/Berlin] PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/home/macbre/elecena/git/app/vendor/elecena/nano/classes/Router.class.php on line 286
[22-Sep-2022 15:33:25 Europe/Berlin] PHP Deprecated:  Return type of DatabaseResult::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/macbre/elecena/git/app/vendor/elecena/nano/classes/DatabaseResult.class.php on line 101
@macbre macbre added the enhancement New feature or request label Sep 22, 2022
@macbre
Copy link
Member Author

macbre commented Sep 22, 2022

Yay!

 ------ ----------------------------------------------------------------------- 
  Line   classes/DatabaseResult.class.php                                       
 ------ ----------------------------------------------------------------------- 
  84     Return type mixed of method DatabaseResult::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.                                     
  92     Return type mixed of method DatabaseResult::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.                                     
  101    Return type mixed of method DatabaseResult::current() is not           
         covariant with tentative return type mixed of method                   
         Iterator::current().                                                   
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  110    Return type mixed of method DatabaseResult::key() is not covariant     
         with tentative return type mixed of method Iterator::key().            
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute    
         to temporarily suppress the error.                                     
  115    Return type mixed of method DatabaseResult::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.                                     
  122    Return type mixed of method DatabaseResult::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.                                     
 ------ ----------------------------------------------------------------------- 
Error:  [ERROR] Found 6 errors                                                         

macbre added a commit that referenced this pull request Sep 22, 2022
PHP Deprecated:  Return type of DatabaseResult::... should either be compatible with ...

Resolves #153
@macbre macbre changed the title Run linter using PHP 8.1 as well Run linter using PHP 8.1 as well (and fix any issues) Sep 22, 2022
macbre added a commit that referenced this pull request Sep 22, 2022
PHP Deprecated:  Return type of DatabaseResult::... should either be compatible with ...

Resolves #153
PHP Deprecated:  Return type of DatabaseResult::... should either be compatible with ...

Resolves #153
Fixes:

 PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/home/macbre/elecena/git/app/vendor/elecena/nano/classes/Router.class.php on line 286
@macbre macbre merged commit f6e8502 into master Sep 22, 2022
@macbre macbre deleted the php81/linter branch September 22, 2022 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PHP 8.x support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant