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

[Dep] Update to php 8.1 requirement #1364

Merged
merged 14 commits into from
Dec 4, 2021
Merged

[Dep] Update to php 8.1 requirement #1364

merged 14 commits into from
Dec 4, 2021

Conversation

samsonasik
Copy link
Member

No description provided.

@samsonasik
Copy link
Member Author

it seems #[\ReturnTypeWillChange] attributerequired at :

PHP Deprecated:  Return type of Stringy\Stringy::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/runner/work/rector-src/rector-src/vendor/danielstjules/stringy/src/Stringy.php on line 270
Deprecated: Return type of Stringy\Stringy::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/runner/work/rector-src/rector-src/vendor/danielstjules/stringy/src/Stringy.php on line 270
PHP Deprecated:  Return type of Stringy\Stringy::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/runner/work/rector-src/rector-src/vendor/danielstjules/stringy/src/Stringy.php on line 453
Deprecated: Return type of Stringy\Stringy::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/runner/work/rector-src/rector-src/vendor/danielstjules/stringy/src/Stringy.php on line 453
PHP Deprecated:  Return type of Stringy\Stringy::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 /home/runner/work/rector-src/rector-src/vendor/danielstjules/stringy/src/Stringy.php on line 850
Deprecated: Return type of Stringy\Stringy::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 /home/runner/work/rector-src/rector-src/vendor/danielstjules/stringy/src/Stringy.php on line 850
PHP Deprecated:  Return type of Stringy\Stringy::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 /home/runner/work/rector-src/rector-src/vendor/danielstjules/stringy/src/Stringy.php on line 873
Deprecated: Return type of Stringy\Stringy::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 /home/runner/work/rector-src/rector-src/vendor/danielstjules/stringy/src/Stringy.php on line 873
PHP Deprecated:  Return type of Stringy\Stringy::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 /home/runner/work/rector-src/rector-src/vendor/danielstjules/stringy/src/Stringy.php on line 893
Deprecated: Return type of Stringy\Stringy::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 /home/runner/work/rector-src/rector-src/vendor/danielstjules/stringy/src/Stringy.php on line 893
PHP Deprecated:  Return type of Stringy\Stringy::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 /home/runner/work/rector-src/rector-src/vendor/danielstjules/stringy/src/Stringy.php on line 906
Deprecated: Return type of Stringy\Stringy::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 /home/runner/work/rector-src/rector-src/vendor/danielstjules/stringy/src/Stringy.php on line 906

@samsonasik
Copy link
Member Author

Also there are errors:

ERROR] Could not process                                                      
         "packages/PHPStanStaticTypeMapper/TypeMapper/CallableTypeMapper.php"   
         file, due to:                                                          
         "Rector\Core\PhpParser\ClassLikeAstResolver::resolveClassFromClassRefle
         ction(): Return value must be of type                                  
         PhpParser\Node\Stmt\Trait_|PhpParser\Node\Stmt\Class_|PhpParser\Node\St
         mt\Interface_|null, PhpParser\Node\Stmt\Enum_ returned". On line: 70   
                                                                                

                                                                                
 [ERROR] Could not process                                                      
         "packages/PHPStanStaticTypeMapper/TypeMapper/ClosureTypeMapper.php"    
         file, due to:                                                          
         "Rector\Core\PhpParser\ClassLikeAstResolver::resolveClassFromClassRefle
         ction(): Return value must be of type                                  
         PhpParser\Node\Stmt\Trait_|PhpParser\Node\Stmt\Class_|PhpParser\Node\St
         mt\Interface_|null, PhpParser\Node\Stmt\Enum_ returned". On line: 41   
                                                                                

                                                                                
 [ERROR] Could not process                                                      
         "packages/PHPStanStaticTypeMapper/TypeMapper/NeverTypeMapper.php" file,
         due to:                                                                
         "Rector\Core\PhpParser\ClassLikeAstResolver::resolveClassFromClassRefle
         ction(): Return value must be of type                                  
         PhpParser\Node\Stmt\Trait_|PhpParser\Node\Stmt\Class_|PhpParser\Node\St
         mt\Interface_|null, PhpParser\Node\Stmt\Enum_ returned". On line: 41   
                                                                                

                                                                                
 [ERROR] Could not process                                                      
         "packages/PHPStanStaticTypeMapper/TypeMapper/NullTypeMapper.php" file, 
         due to:                                                                
         "Rector\Core\PhpParser\ClassLikeAstResolver::resolveClassFromClassRefle
         ction(): Return value must be of type                                  
         PhpParser\Node\Stmt\Trait_|PhpParser\Node\Stmt\Class_|PhpParser\Node\St
         mt\Interface_|null, PhpParser\Node\Stmt\Enum_ returned". On line: 41   
                                                                                

@samsonasik
Copy link
Member Author

I added Enum_ return to ClassLikeAstResolver::resolveClassFromClassReflection()

@samsonasik
Copy link
Member Author

samsonasik commented Dec 2, 2021

rectify seems cause error in phpunit https://github.com/rectorphp/rector-src/pull/1364/files#diff-4dc6b2e58922af67eeb5d15d229c3b540f5ba436383dc4ff2b506c3bfd1ffaf8 :

1s
Run vendor/bin/phpunit
PHPUnit 9.5.10 by Sebastian Bergmann and contributors.

PHP Fatal error:  Case REFACTORING of non-backed enum Rector\Core\Enum\ApplicationPhase must not have a value, try adding ": string" to the enum declaration in /home/runner/work/rector-src/rector-src/vendor/rector/rector-src/src/Enum/ApplicationPhase.php on line 12
Error: Process completed with exit code 255.

@samsonasik
Copy link
Member Author

There is also error on readonly param with no type:

.EFE....PHP Fatal error:  Readonly property Rector\Caching\ValueObject\CacheItem::$data must have type in /Users/samsonasik/www/rector-src/packages/Caching/ValueObject/CacheItem.php on line 16

Fatal error: Readonly property Rector\Caching\ValueObject\CacheItem::$data must have type in /Users/samsonasik/www/rector-src/packages/Caching/ValueObject/CacheItem.php on line 16

@samsonasik
Copy link
Member Author

rebased.

@samsonasik
Copy link
Member Author

@TomasVotruba I think Enum syntax upgrade needs to be skipped as it change PhpVersion class that extends :

use MyCLabs\Enum\Enum;

- final class PhpVersion extends Enum
+ enum PhpVersion : int

which will need update currently manually of its usage:

-PhpVersion::PHP_52;
+PhpVersion::PHP_52->value;

and it seems cause change

also other Enums, eg ObjectReference and ApplicationPhase manually:

-        if ($node->toString() === ObjectReference::PARENT()->getValue()) {
+        if ($node->toString() === ObjectReference::PARENT()->value) {
-        }, ApplicationPhase::PARSING());
+        }, ApplicationPhase::PARSING->value);

and we need to create a downgrade rule for it to keep working on scoping.

I commented the rules at 6ea553c

@samsonasik
Copy link
Member Author

It seems readonly rule make error:

1) Rector\Tests\BetterPhpDocParser\PhpDocInlineHtml\TestInlineHtmlTest::test with data set #0 (Symplify\SmartFileSystem\SmartFileInfo Object (...))
Error: Cannot modify readonly property Rector\Core\PhpParser\Node\CustomNode\FileWithoutNamespace::$stmts

/home/runner/work/rector-src/rector-src/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:111
/home/runner/work/rector-src/rector-src/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:223
/home/runner/work/rector-src/rector-src/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:91
/home/runner/work/rector-src/rector-src/src/PhpParser/NodeTraverser/RectorNodeTraverser.php:41
/home/runner/work/rector-src/rector-src/src/Application/FileProcessor.php:43
/home/runner/work/rector-src/rector-src/src/Application/FileProcessor/PhpFileProcessor.php:107
/home/runner/work/rector-src/rector-src/src/Application/FileProcessor/PhpFileProcessor.php:122
/home/runner/work/rector-src/rector-src/src/Application/FileProcessor/PhpFileProcessor.php:108
/home/runner/work/rector-src/rector-src/src/Application/FileProcessor/PhpFileProcessor.php:61
/home/runner/work/rector-src/rector-src/src/Application/ApplicationFileProcessor.php:59
/home/runner/work/rector-src/rector-src/src/Application/ApplicationFileProcessor.php:36
/home/runner/work/rector-src/rector-src/packages/Testing/PHPUnit/AbstractRectorTestCase.php:177
/home/runner/work/rector-src/rector-src/packages/Testing/PHPUnit/AbstractRectorTestCase.php:131
/home/runner/work/rector-src/rector-src/packages/Testing/PHPUnit/AbstractRectorTestCase.php:115
/home/runner/work/rector-src/rector-src/packages-tests/BetterPhpDocParser/PhpDocInlineHtml/TestInlineHtmlTest.php:18

Also it seems there is diff change on PhpDocInfoPrinter:

There were 55 failures:

1) Rector\Tests\BetterPhpDocParser\PhpDocInfo\PhpDocInfoPrinter\DoctrineTest::testClass with data set #0 ('/home/runner/work/rector-src/...le.txt', PhpParser\Node\Stmt\Class_ Object (...))
packages-tests/BetterPhpDocParser/PhpDocInfo/PhpDocInfoPrinter/Source/Doctrine/index_in_table.txt
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 '/**
- * @ORM\Table(
- *     name="building",
- *     indexes={
- *          @ORM\Index(name="isDemoBuilding", columns={"is_demo_building"})

/home/runner/work/rector-src/rector-src/packages-tests/BetterPhpDocParser/PhpDocParser/TagValueNodeReprint/TagValueNodeReprintTest.php:99
/home/runner/work/rector-src/rector-src/packages-tests/BetterPhpDocParser/PhpDocParser/TagValueNodeReprint/TagValueNodeReprintTest.php:57

53) Rector\Tests\BetterPhpDocParser\PhpDocParser\TagValueNodeReprint\TagValueNodeReprintTest::test with data set #50 (Symplify\SmartFileSystem\SmartFileInfo Object (...))
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 '/**
-     * @ORM\JoinTable(name="PushCampaignCluster", joinColumns={
-     *      @ORM\JoinColumn(name="pushCampaignId", referencedColumnName="id")
-     * })
+ * @ORM\JoinTable(name="PushCampaignCluster", joinColumns={(name="pushCampaignId", referencedColumnName="id")})
      */'

/home/runner/work/rector-src/rector-src/packages-tests/BetterPhpDocParser/PhpDocParser/TagValueNodeReprint/TagValueNodeReprintTest.php:99
/home/runner/work/rector-src/rector-src/packages-tests/BetterPhpDocParser/PhpDocParser/TagValueNodeReprint/TagValueNodeReprintTest.php:57

54) Rector\Tests\BetterPhpDocParser\PhpDocParser\TagValueNodeReprint\TagValueNodeReprintTest::test with data set #51 (Symplify\SmartFileSystem\SmartFileInfo Object (...))
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 '/**
-     * @ORM\JoinTable(name="page_template_area",
-     *      joinColumns={@ORM\JoinColumn(name="template_id", referencedColumnName="id", onDelete="CASCADE")},
-     *      inverseJoinColumns={@ORM\JoinColumn(name="area_id", referencedColumnName="id")}
-     * )
+ * @ORM\JoinTable(name="page_template_area", joinColumns={(name="template_id", referencedColumnName="id", onDelete="CASCADE")}, inverseJoinColumns={(name="area_id", referencedColumnName="id")})
      */'

/home/runner/work/rector-src/rector-src/packages-tests/BetterPhpDocParser/PhpDocParser/TagValueNodeReprint/TagValueNodeReprintTest.php:99
/home/runner/work/rector-src/rector-src/packages-tests/BetterPhpDocParser/PhpDocParser/TagValueNodeReprint/TagValueNodeReprintTest.php:57

55) Rector\Tests\BetterPhpDocParser\PhpDocParser\TagValueNodeReprint\TestModifyReprintTest::test
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 '/**
  * @Route("/hello/", methods={"GET", "HEAD"})
-     * @Template("some_path")
+ * @Template("some_path")
      */'

@samsonasik
Copy link
Member Author

rebased.

@samsonasik
Copy link
Member Author

I updated danielstjules/stringy to use fork while wait for PR danielstjules/Stringy#208 to be merged.

@samsonasik
Copy link
Member Author

1 more error:

Run bin/rector process rules --ansi --no-progress-bar
  bin/rector process rules --ansi --no-progress-bar
  shell: /usr/bin/bash -e {0}
  env:
    COMPOSER_ROOT_VERSION: dev-main

In UnionTypeMapper.php line 137:
                                                                               
  Look at "Rector\PHPStanStaticTypeMapper\TypeMapper\UnionTypeMapper::mapToPh  
  pParserNode()" on line 137                  

@samsonasik
Copy link
Member Author

debug output:

    [applying] Rector\CodeQuality\Rector\PropertyFetch\ExplicitMethodCallOverMagicGetSetRector

In UnionTypeMapper.php line 137:
                                                                                                         
  [Rector\Core\Exception\ShouldNotHappenException]                                                       
  Look at "Rector\PHPStanStaticTypeMapper\TypeMapper\UnionTypeMapper::mapToPhpParserNode()" on line 137  
                                                                                                         

Exception trace:
  at /Users/samsonasik/www/rector-src/packages/PHPStanStaticTypeMapper/TypeMapper/UnionTypeMapper.php:137
 Rector\PHPStanStaticTypeMapper\TypeMapper\UnionTypeMapper->mapToPhpParserNode() at /Users/samsonasik/www/rector-src/packages/PHPStanStaticTypeMapper/PHPStanStaticTypeMapper.php:56
 Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper->mapToPhpParserNode() at /Users/samsonasik/www/rector-src/packages/StaticTypeMapper/StaticTypeMapper.php:53
 Rector\StaticTypeMapper\StaticTypeMapper->mapPHPStanTypeToPhpParserNode() at /Users/samsonasik/www/rector-src/rules/TypeDeclaration/TypeAlreadyAddedChecker/ReturnTypeAlreadyAddedChecker.php:56
 Rector\TypeDeclaration\TypeAlreadyAddedChecker\ReturnTypeAlreadyAddedChecker->isSameOrBetterReturnTypeAlreadyAdded() at /Users/samsonasik/www/rector-src/rules/TypeDeclaration/Rector/FunctionLike/ReturnTypeDeclarationRector.php:113
 Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector->refactor() at /Users/samsonasik/www/rector-src/src/Rector/AbstractRector.php:232
 Rector\Core\Rector\AbstractRector->enterNode() at /Users/samsonasik/www/rector-src/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:200
 PhpParser\NodeTraverser->traverseArray() at /Users/samsonasik/www/rector-src/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:114
 PhpParser\NodeTraverser->traverseNode() at /Users/samsonasik/www/rector-src/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:223
 PhpParser\NodeTraverser->traverseArray() at /Users/samsonasik/www/rector-src/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:114
 PhpParser\NodeTraverser->traverseNode() at /Users/samsonasik/www/rector-src/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:223
 PhpParser\NodeTraverser->traverseArray() at /Users/samsonasik/www/rector-src/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:91
 PhpParser\NodeTraverser->traverse() at /Users/samsonasik/www/rector-src/src/PhpParser/NodeTraverser/RectorNodeTraverser.php:44
 Rector\Core\PhpParser\NodeTraverser\RectorNodeTraverser->traverse() at /Users/samsonasik/www/rector-src/src/Application/FileProcessor.php:43
 Rector\Core\Application\FileProcessor->refactor() at /Users/samsonasik/www/rector-src/src/Application/FileProcessor/PhpFileProcessor.php:107
 Rector\Core\Application\FileProcessor\PhpFileProcessor->Rector\Core\Application\FileProcessor\{closure}() at /Users/samsonasik/www/rector-src/src/Application/FileProcessor/PhpFileProcessor.php:122
 Rector\Core\Application\FileProcessor\PhpFileProcessor->tryCatchWrapper() at /Users/samsonasik/www/rector-src/src/Application/FileProcessor/PhpFileProcessor.php:108
 Rector\Core\Application\FileProcessor\PhpFileProcessor->refactorNodesWithRectors() at /Users/samsonasik/www/rector-src/src/Application/FileProcessor/PhpFileProcessor.php:61
 Rector\Core\Application\FileProcessor\PhpFileProcessor->process() at /Users/samsonasik/www/rector-src/src/Application/ApplicationFileProcessor.php:59
 Rector\Core\Application\ApplicationFileProcessor->processFiles() at /Users/samsonasik/www/rector-src/src/Application/ApplicationFileProcessor.php:36
 Rector\Core\Application\ApplicationFileProcessor->run() at /Users/samsonasik/www/rector-src/src/Console/Command/ProcessCommand.php:115
 Rector\Core\Console\Command\ProcessCommand->execute() at /Users/samsonasik/www/rector-src/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at /Users/samsonasik/www/rector-src/vendor/symfony/console/Application.php:1005
 Symfony\Component\Console\Application->doRunCommand() at /Users/samsonasik/www/rector-src/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at /Users/samsonasik/www/rector-src/src/Console/ConsoleApplication.php:79
 Rector\Core\Console\ConsoleApplication->doRun() at /Users/samsonasik/www/rector-src/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /Users/samsonasik/www/rector-src/bin/rector.php:71
 require_once() at /Users/samsonasik/www/rector-src/bin/rector:4

process [-o|--output-format [OUTPUT-FORMAT]] [-n|--dry-run] [-a|--autoload-file AUTOLOAD-FILE] [--no-progress-bar] [--no-diffs] [--clear-cache] [--port PORT] [--identifier IDENTIFIER] [--] [<source>...]

@samsonasik
Copy link
Member Author

handled with ComplexType handling cf0c256

@samsonasik
Copy link
Member Author

Using Stringy fork sometime seems cause composer install error:

                                                                                                              
  [RuntimeException]                                                                                          
  Failed to clone 
https://github.com/samsonasik/Stringy
 via https, ssh protocols, aborting.                   
                                                                                                              
  - 
https://github.com/samsonasik/Stringy
                                                                     
    Cloning into bare repository '/home/runner/.cache/composer/vcs/https---github.com-samsonasik-Stringy'...  
    BUG: refs/files-backend.c:2992: initial ref transaction called with existing refs                         
    Aborted (core dumped)                      

@samsonasik
Copy link
Member Author

I updated stringy with vendor-patches

@samsonasik
Copy link
Member Author

@TomasVotruba All green 🎉 , there are pending status workflow that I can't found in the workflows list, are they cache?

PHP 8.0 tests for packages-tests Expected — Waiting for status to be reported
Required
PHP 8.0 tests for rules-tests Expected — Waiting for status to be reported
Required
PHP 8.0 tests for tests Expected — Waiting for status to be reported 

Screen Shot 2021-12-02 at 19 33 08

@samsonasik
Copy link
Member Author

samsonasik commented Dec 2, 2021

I tried downgrade script locally from php 8.1 and it seems got error on scoping:

[NOTE] Running scoper to rector-prefixed-downgraded

SSL_INIT
SSL_INIT
PHP Deprecated:  Return type of HumbugBox383\KevinGH\RequirementChecker\RequirementCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///Users/samsonasik/www/rector-src/php-scoper.phar/.box/src/RequirementCollection.php on line 15

Deprecated: Return type of HumbugBox383\KevinGH\RequirementChecker\RequirementCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///Users/samsonasik/www/rector-src/php-scoper.phar/.box/src/RequirementCollection.php on line 15
PHP Deprecated:  Return type of HumbugBox383\KevinGH\RequirementChecker\RequirementCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///Users/samsonasik/www/rector-src/php-scoper.phar/.box/src/RequirementCollection.php on line 19

Deprecated: Return type of HumbugBox383\KevinGH\RequirementChecker\RequirementCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///Users/samsonasik/www/rector-src/php-scoper.phar/.box/src/RequirementCollection.php on line 19
PHP Fatal error:  During inheritance of IteratorAggregate: Uncaught ErrorException: Return type of _HumbugBox016dd6921859\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:///Users/samsonasik/www/rector-src/php-scoper.phar/vendor/symfony/finder/Finder.php:219
Stack trace:
#0 phar:///Users/samsonasik/www/rector-src/php-scoper.phar/vendor/symfony/finder/Finder.php(16): _HumbugBox016dd6921859\Humbug\PhpScoper\{closure}(8192, 'Return type of ...', 'phar:///Users/s...', 219)
#1 phar:///Users/samsonasik/www/rector-src/php-scoper.phar/.box/vendor/composer/ClassLoader.php(444): include('phar:///Users/s...')
#2 phar:///Users/samsonasik/www/rector-src/php-scoper.phar/.box/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('phar:///Users/s...')
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass('_HumbugBox016dd...')
#4 phar:///Users/samsonasik/www/rector-src/php-scoper.phar/bin/php-scoper(42): class_alias('_HumbugBox016dd...', 'Isolated\\Symfon...')
#5 /Users/samsonasik/www/rector-src/php-scoper.phar(19): require('phar:///Users/s...')
#6 {main} in phar:///Users/samsonasik/www/rector-src/php-scoper.phar/vendor/symfony/finder/Finder.php on line 16

Fatal error: During inheritance of IteratorAggregate: Uncaught ErrorException: Return type of _HumbugBox016dd6921859\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:///Users/samsonasik/www/rector-src/php-scoper.phar/vendor/symfony/finder/Finder.php:219
Stack trace:
#0 phar:///Users/samsonasik/www/rector-src/php-scoper.phar/vendor/symfony/finder/Finder.php(16): _HumbugBox016dd6921859\Humbug\PhpScoper\{closure}(8192, 'Return type of ...', 'phar:///Users/s...', 219)
#1 phar:///Users/samsonasik/www/rector-src/php-scoper.phar/.box/vendor/composer/ClassLoader.php(444): include('phar:///Users/s...')
#2 phar:///Users/samsonasik/www/rector-src/php-scoper.phar/.box/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('phar:///Users/s...')
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass('_HumbugBox016dd...')
#4 phar:///Users/samsonasik/www/rector-src/php-scoper.phar/bin/php-scoper(42): class_alias('_HumbugBox016dd...', 'Isolated\\Symfon...')
#5 /Users/samsonasik/www/rector-src/php-scoper.phar(19): require('phar:///Users/s...')
#6 {main} in phar:///Users/samsonasik/www/rector-src/php-scoper.phar/vendor/symfony/finder/Finder.php on line 16

@TomasVotruba do you think we need to use php 8.0 on build scoped as the scoper is inside php-scoper.phar phar file.

@samsonasik
Copy link
Member Author

samsonasik commented Dec 2, 2021

@TomasVotruba I set php to 8.0 on build scoped due #[\ReturnTypeWillChange] required inside php-scoper.phar when running on php 8.1, ref #1364 (comment)

@samsonasik
Copy link
Member Author

@TomasVotruba rebased, I think it is ready for merge.

@samsonasik
Copy link
Member Author

rebased.

@samsonasik
Copy link
Member Author

rebased.

@TomasVotruba
Copy link
Member

It's still too huge.
Could you decouple the non-Rectify code to standalone PR?

And another PR can be just about readonly properties. It's better to send PR-per single rule, in case it's huge.

@samsonasik
Copy link
Member Author

It mostly a rectify PR, the manual part mostly phpstan on string array key unpack.

I will try to do enable php-81 config per-service on different PR (comment one by one).

@samsonasik
Copy link
Member Author

rebased.

@samsonasik
Copy link
Member Author

rebased.

@samsonasik
Copy link
Member Author

samsonasik commented Dec 4, 2021

@TomasVotruba I think the rest of change mostly on finalize public constant, I think this PR can be merged instead of other per-service rule PRs.

@samsonasik
Copy link
Member Author

Enabling the rest (except the Enum rectors), seems this is ready.

@samsonasik samsonasik enabled auto-merge (squash) December 4, 2021 15:48
@samsonasik samsonasik merged commit 5d1f96f into main Dec 4, 2021
@samsonasik samsonasik deleted the tv-php81-2 branch December 4, 2021 15:50
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.

3 participants