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

Fix deprecation errors in modern PHP #75

Closed
wants to merge 3 commits into from
Closed

Fix deprecation errors in modern PHP #75

wants to merge 3 commits into from

Conversation

miken32
Copy link

@miken32 miken32 commented Apr 21, 2022

Project seems dead, but whatever. Gets rid of these notices:

PHP Deprecated:  Return type of PEAR2\Net\RouterOS\Message::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/Message.php on line 183
PHP Deprecated:  Return type of PEAR2\Net\RouterOS\Message::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/Message.php on line 193
PHP Deprecated:  Return type of PEAR2\Net\RouterOS\Util::count(?PEAR2\Net\RouterOS\Query $query = null, $from = null) should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/Util.php on line 955
PHP Deprecated:  Return type of PEAR2\Net\RouterOS\ResponseCollection::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/ResponseCollection.php on line 311
PHP Deprecated:  Return type of PEAR2\Net\RouterOS\ResponseCollection::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/ResponseCollection.php on line 326
PHP Deprecated:  Return type of PEAR2\Net\RouterOS\ResponseCollection::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/ResponseCollection.php on line 348
PHP Deprecated:  Return type of PEAR2\Net\RouterOS\ResponseCollection::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/ResponseCollection.php on line 364
PHP Deprecated:  Return type of PEAR2\Net\RouterOS\ResponseCollection::seek($position) should either be compatible with SeekableIterator::seek(int $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/ResponseCollection.php on line 389
PHP Deprecated:  Return type of PEAR2\Net\RouterOS\ResponseCollection::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/ResponseCollection.php on line 419
PHP Deprecated:  Return type of PEAR2\Net\RouterOS\ResponseCollection::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/ResponseCollection.php on line 407
PHP Deprecated:  Return type of PEAR2\Net\RouterOS\ResponseCollection::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/ResponseCollection.php on line 456
PHP Deprecated:  Return type of PEAR2\Net\RouterOS\ResponseCollection::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/ResponseCollection.php on line 466
PHP Deprecated:  Return type of PEAR2\Net\RouterOS\ResponseCollection::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/ResponseCollection.php on line 374
PHP Deprecated:  Return type of PEAR2\Net\RouterOS\ResponseCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in src/PEAR2/Net/RouterOS/ResponseCollection.php on line 297
PHP Deprecated:  stream_get_line(): Passing null to parameter #2 ($length) of type int is deprecated in src/PEAR2/Net/RouterOS/Response.php on line 228

Used the #[\ReturnTypeWillChange] attribute in a few places since mixed is not available as a return type in the (technically) still supported PHP 7.4.

@boenrobot
Copy link
Member

Please rebase this against the develop branch.

It's not that the project is dead, it's that I don't have time for it.

After this PR, I think I'll just make a composer only tag, as the biggest roadblock to a normal release is the phar production, which requires packages that are now dead.

@miken32 miken32 changed the base branch from master to develop April 21, 2022 17:57
@miken32
Copy link
Author

miken32 commented Apr 21, 2022

Thanks, just noticed there was a dev branch more recently updated. Will close and re-submit against dev

@miken32 miken32 closed this Apr 21, 2022
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.

None yet

2 participants