Skip to content

wp cli cache clear - PHP Deprecated: Return type of Symfony\Component\Finder #134

Open

Description

@qcybb

Bug Report

Describe the current, buggy behavior

Running wp cli cache clear produces this error:

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 phar:///usr/local/bin/wp/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 phar:///usr/local/bin/wp/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 phar:///usr/local/bin/wp/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 phar:///usr/local/bin/wp/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php on line 42
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::getChildren() should either be compatible with RecursiveDirectoryIterator::getChildren(): RecursiveDirectoryIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php on line 89
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::rewind() should either be compatible with FilesystemIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php on line 117
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::current() should either be compatible with FilesystemIterator::current(): SplFileInfo|FilesystemIterator|string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php on line 65
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php on line 55
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php on line 71
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::getChildren() should either be compatible with RecursiveIterator::getChildren(): ?RecursiveIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php on line 76
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\FilterIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/symfony/finder/Iterator/FilterIterator.php on line 32
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\PathFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/symfony/finder/Iterator/PathFilterIterator.php on line 27
Success: Cache cleared.

Describe how other contributors can replicate this bug

  • by running wp cli cache clear

Describe what you would expect as the correct outcome

I expect it not to produce so many depreciated warnings.

Let us know what environment you are running this on

$ wp --info
OS:     FreeBSD 15.1-RELEASE-p4 FreeBSD 15.1-RELEASE-p4 releng/15.1-n283627-e38a7085f3a8 GENERIC amd64
Shell:  /usr/local/bin/bash
PHP binary:     /usr/local/bin/php
PHP version:    8.4.26
php.ini used:   /usr/local/etc/php.ini
MySQL binary:   /usr/local/bin/mysql
MySQL version:  mysql  Ver 8.4.11 for FreeBSD15.1 on amd64 (Source distribution)
SQL modes:      NO_ENGINE_SUBSTITUTION
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       phar:///usr/local/bin/wp
WP-CLI packages dir:
WP-CLI cache dir:       /home/ken/.wp-cli/cache
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.12.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions