Skip to content

Replace "integer" types with "int", to suppress warnings in PHP 7.4 and PHP 8.0#5

Merged
jb-lopez merged 2 commits intoLupeCode:masterfrom
jackwh:master
Apr 11, 2021
Merged

Replace "integer" types with "int", to suppress warnings in PHP 7.4 and PHP 8.0#5
jb-lopez merged 2 commits intoLupeCode:masterfrom
jackwh:master

Conversation

@jackwh
Copy link
Copy Markdown
Contributor

@jackwh jackwh commented Apr 10, 2021

Since PHP 7.4, the alias integer can no longer be used as a scalar type. Instead, int must be used. See here for some more info. When loading this package under PHP 8.0, this warning gets thrown in 12 separate places:

PHP Warning:  "integer" will be interpreted as a class name. Did you mean "int"? Write "\LupeCode\phpTraderInterface\integer" or import the class with "use" to suppress this warning in /home/vagrant/my-site/vendor/lupecode/php-trader-interface/source/Trader.php on line 1507

This PR simply replaces the few instances of integer with int... and makes the errors go away.

Thanks for a useful package!

@jb-lopez jb-lopez merged commit 83ed959 into LupeCode:master Apr 11, 2021
@jb-lopez
Copy link
Copy Markdown
Contributor

Thanks @jackwh !

@jackwh
Copy link
Copy Markdown
Contributor Author

jackwh commented Apr 11, 2021

No problem 😊 On a side note, would you consider tagging a new release? The last one seems to be from 2016!

This caught me out at first, I installed with composer require without specifying a version, so it defaulted to the last tag. It took a while before I realised and changed to dev-master. Just in case this catches anyone else out!

@jb-lopez
Copy link
Copy Markdown
Contributor

I had to manually update Packagist, but it looks okay now. Let me know if you cannot get 1.0.5 from composer.

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.

2 participants