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

Running plugin-ci under php 8.x shows multiple deprecation warnings #221

Closed
kiklop74 opened this issue Mar 22, 2023 · 2 comments
Closed

Comments

@kiklop74
Copy link
Contributor

When executing any moodle-plugin-ci command under PHP 8.x numerous deprecation warinings are being issued.

PHP Deprecated:  Return type of Symfony\Component\Finder\Finder::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /opt/moodle-plugin-ci/vendor/symfony/finder/Finder.php on line 566
PHP Deprecated:  Return type of Symfony\Component\Finder\Finder::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /opt/moodle-plugin-ci/vendor/symfony/finder/Finder.php on line 637
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\FilterIterator::rewind() should either be compatible with FilterIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /opt/moodle-plugin-ci/vendor/symfony/finder/Iterator/FilterIterator.php on line 32
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\FileTypeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /opt/moodle-plugin-ci/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php on line 42

This is because project uses older symfony/console version. It needs to be upgraded to at least v6.0.7 that fixes this issue.

These are the steps that need to be executed to update composer.json and lock the version on master branch

cd <ci dir>
composer config platform.php 8.0.2
composer require -W 'symfony/console:^v6.0.7' 'sebastian/phpcpd:^v6.0' 'stecman/symfony-console-completion:^0.12'
@stronk7
Copy link
Member

stronk7 commented Mar 22, 2023

Note that we are really, really near releasing version 4.0 (from master branch). It uses Symfony 5.x and will support all Moodle branches >= 38_STABLE and PHP >= 7.4.

You can sneak preview it by changing the ^3 version by dev-master (soon to become ^4).

The plan & progress is being tracked @ #151 .

Ciao :-)

@kiklop74
Copy link
Contributor Author

OK, that is great news. Closing this one.

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

No branches or pull requests

2 participants