mschwemer / typo3scan

Scans TYPO3 extensions for usage of deprecated and or changed code
MIT License
94 stars 15 forks source link

PHP 8.2 Deprecations and Warnings #46

Closed theLine closed 1 year ago

theLine commented 1 year ago

Hi, I'm in the process to update my TYPO3 v11 Project to PHP 8.2 and I'm using your awesome tool.
with PR #45 you added support for PHP 8, but when running the extension scanner with PHP 8.2 I'm getting some deprecations and warnings:



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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Finder.php on line 566

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Finder.php on line 637

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/FilterIterator.php on line 32

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php on line 42

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php on line 89

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php on line 117

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php on line 65

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php on line 55

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php on line 71

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php on line 76

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/FilterIterator.php on line 32

Deprecated: Return type of Symfony\Component\Finder\Iterator\FilenameFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/FilenameFilterIterator.php on line 28

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/PathFilterIterator.php on line 27

Warning: Undefined property: PhpParser\Node\VariadicPlaceholder::$unpack in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Matcher/AbstractCoreMatcher.php on line 172

Warning: Undefined property: PhpParser\Node\VariadicPlaceholder::$unpack in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Matcher/AbstractCoreMatcher.php on line 172```

Are you aware of these deprecations and warnings or is that some configuration error on my end?
Tuurlijk commented 1 year ago

Please try https://github.com/Tuurlijk/typo3scan/releases/tag/1.7.5

Tuurlijk commented 1 year ago

Please try https://github.com/Tuurlijk/typo3scan/releases/tag/1.7.5

Met vriendelijke groet, Kind regards,

Michiel Roos

w: www.xposer.iow: www.michielroos.com e: @.*** t: +31 6 28035114

c: 71665943

[image]

Sent with Proton Mail secure email.

------- Original Message ------- On Friday, February 24th, 2023 at 09:54, theLine @.***> wrote:

Hi, I'm in the process to update my TYPO3 v11 Project to PHP 8.2 and I'm using your awesome tool. with PR #45 you added support for PHP 8, but when running the extension scanner with PHP 8.2 I'm getting some deprecations and warnings:

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Finder.php on line 566

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Finder.php on line 637

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/FilterIterator.php on line 32

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php on line 42

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php on line 89

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php on line 117

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php on line 65

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php on line 55

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php on line 71

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php on line 76

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/FilterIterator.php on line 32

Deprecated: Return type of Symfony\Component\Finder\Iterator\FilenameFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/FilenameFilterIterator.php on line 28

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:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/PathFilterIterator.php on line 27

Warning: Undefined property: PhpParser\Node\VariadicPlaceholder::$unpack in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Matcher/AbstractCoreMatcher.php on line 172

Warning: Undefined property: PhpParser\Node\VariadicPlaceholder::$unpack in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Matcher/AbstractCoreMatcher.php on line 172```

Are you aware of these deprecations and warnings or is that some configuration error on my end?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

theLine commented 1 year ago

First of all thanks for the quick response and possible fix!

But after updating to v1.7.5 I'm getting some weird issues:

$ ddev exec vendor/bin/typo3scan scan --target=11 packages
PHP Parse error:  syntax error, unexpected token "::", expecting "(" in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Scanner.php on line 25
$ ddev exec vendor/bin/typo3scan scan --target=12 packages
In MatcherBundle.php line 35:
Path "phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/src/TYPO3Scan/Service/../../../vendor/typo3/cms-scanner/config/Matcher/v12" does not exist
Tuurlijk commented 1 year ago

Weird. Can't reproduce the first error.

Fixed the second though. I've updated the scanner to include the actual v12 matchers.

Tuurlijk commented 1 year ago

Pleae try https://github.com/Tuurlijk/typo3scan/releases/tag/1.7.6

theLine commented 1 year ago

Hi, thankls for the quick fix! Now it's working again, but I still get a PHP Warning:

$ ddev exec vendor/bin/typo3scan scan --target=11 packages
PHP Warning:  Undefined property: PhpParser\Node\VariadicPlaceholder::$unpack in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Matcher/AbstractCoreMatcher.php on line 172

Warning: Undefined property: PhpParser\Node\VariadicPlaceholder::$unpack in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Matcher/AbstractCoreMatcher.php on line 172
PHP Warning:  Undefined property: PhpParser\Node\VariadicPlaceholder::$unpack in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Matcher/AbstractCoreMatcher.php on line 172

Warning: Undefined property: PhpParser\Node\VariadicPlaceholder::$unpack in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Matcher/AbstractCoreMatcher.php on line 172
/var/www/html/packages
$ ddev exec vendor/bin/typo3scan scan --target=12 packages
PHP Warning:  Undefined property: PhpParser\Node\VariadicPlaceholder::$unpack in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Matcher/AbstractCoreMatcher.php on line 172
PHP Warning:  Undefined property: PhpParser\Node\VariadicPlaceholder::$unpack in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Matcher/AbstractCoreMatcher.php on line 172
Tuurlijk commented 1 year ago

https://github.com/Tuurlijk/typo3scan/releases/tag/1.7.7 disables Warnings, Depreactions and Notices

Before I just blocked the Deprecations. My bad.

theLine commented 1 year ago

It works like a charm. Thank you for the quick fix!