Skip to content

Fatal error: Uncaught Error: Typed property Rector\Parallel\ValueObject\ParallelProcess::$encoder must not be accessed before initialization #9885

Description

@raphaelincert

Bug Report

Subject Details
Rector version 2.6.6

Fatal error: Uncaught Error: Typed property Rector\Parallel\ValueObject\ParallelProcess::$encoder must not be accessed before initialization

Minimal PHP Code Causing Issue

Rector config:

<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\PropertyProperty\RemoveNullPropertyInitializationRector;
use Rector\Php70\Rector\Variable\WrapVariableVariableNameInCurlyBracesRector;
use Rector\Set\ValueObject\LevelSetList;

return RectorConfig::configure()
    ->withSets([
        LevelSetList::UP_TO_PHP_80
    ])
    ->withSkip([
        WrapVariableVariableNameInCurlyBracesRector::class,
        RemoveNullPropertyInitializationRector::class
    ])
    ->withImportNames()
    ->withParallel(360)
    ->withDeadCodeLevel(74)
    ->withTypeCoverageLevel(0)
    ->withCodeQualityLevel(0);

Full stack trace:

devilbox@php-8.0.27 in /shared/httpd/my-gms/htdocs $ ./vendor/bin/rector --clear-cache
 6992/7408  94%Fatal error: Uncaught Error: Typed property Rector\Parallel\ValueObject\ParallelProcess::$encoder must not be accessed before initialization in /shared/httpd/my-gms/htdocs/vendor/rector/rector/src/Parallel/ValueObject/ParallelProcess.php:107
Stack trace:
#0 /shared/httpd/my-gms/htdocs/vendor/rector/rector/src/Parallel/ValueObject/ProcessPool.php(46): Rector\Parallel\ValueObject\ParallelProcess->quit()
#1 /shared/httpd/my-gms/htdocs/vendor/rector/rector/src/Parallel/ValueObject/ProcessPool.php(56): Rector\Parallel\ValueObject\ProcessPool->quitProcess('01lbsfggwl')
#2 /shared/httpd/my-gms/htdocs/vendor/rector/rector/src/Parallel/Application/ParallelFileProcessor.php(108): Rector\Parallel\ValueObject\ProcessPool->quitAll()
#3 /shared/httpd/my-gms/htdocs/vendor/rector/rector/src/Parallel/ValueObject/ParallelProcess.php(95): Rector\Parallel\Application\ParallelFileProcessor->Rector\Parallel\Application\{closure}(Object(Exception))
#4 /shared/httpd/my-gms/htdocs/vendor/rector/rector/vendor/react/event-loop/src/Timer/Timers.php(86): Rector\Parallel\ValueObject\ParallelProcess->Rector\Parallel\ValueObject\{closure}(Object(RectorPrefix202609\React\EventLoop\Timer\Timer))
#5 /shared/httpd/my-gms/htdocs/vendor/rector/rector/vendor/react/event-loop/src/StreamSelectLoop.php(150): RectorPrefix202609\React\EventLoop\Timer\Timers->tick()
#6 /shared/httpd/my-gms/htdocs/vendor/rector/rector/src/Parallel/Application/ParallelFileProcessor.php(193): RectorPrefix202609\React\EventLoop\StreamSelectLoop->run()
#7 /shared/httpd/my-gms/htdocs/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(248): Rector\Parallel\Application\ParallelFileProcessor->process(Object(Rector\Parallel\ValueObject\Schedule), './vendor/bin/re...', Object(Closure), Object(RectorPrefix202609\Symfony\Component\Console\Input\ArgvInput))
#8 /shared/httpd/my-gms/htdocs/vendor/rector/rector/src/Application/ApplicationFileProcessor.php(134): Rector\Application\ApplicationFileProcessor->runParallel(Array, Object(RectorPrefix202609\Symfony\Component\Console\Input\ArgvInput), Object(Closure))
#9 /shared/httpd/my-gms/htdocs/vendor/rector/rector/src/Console/Command/ProcessCommand.php(178): Rector\Application\ApplicationFileProcessor->run(Object(Rector\ValueObject\Configuration), Object(RectorPrefix202609\Symfony\Component\Console\Input\ArgvInput))
#10 /shared/httpd/my-gms/htdocs/vendor/rector/rector/vendor/symfony/console/Command/Command.php(289): Rector\Console\Command\ProcessCommand->execute(Object(RectorPrefix202609\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix202609\Symfony\Component\Console\Output\ConsoleOutput))
#11 /shared/httpd/my-gms/htdocs/vendor/rector/rector/vendor/symfony/console/Application.php(911): RectorPrefix202609\Symfony\Component\Console\Command\Command->run(Object(RectorPrefix202609\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix202609\Symfony\Component\Console\Output\ConsoleOutput))
#12 /shared/httpd/my-gms/htdocs/vendor/rector/rector/vendor/symfony/console/Application.php(279): RectorPrefix202609\Symfony\Component\Console\Application->doRunCommand(Object(Rector\Console\Command\ProcessCommand), Object(RectorPrefix202609\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix202609\Symfony\Component\Console\Output\ConsoleOutput))
#13 /shared/httpd/my-gms/htdocs/vendor/rector/rector/src/Console/ConsoleApplication.php(61): RectorPrefix202609\Symfony\Component\Console\Application->doRun(Object(RectorPrefix202609\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix202609\Symfony\Component\Console\Output\ConsoleOutput))
#14 /shared/httpd/my-gms/htdocs/vendor/rector/rector/vendor/symfony/console/Application.php(162): Rector\Console\ConsoleApplication->doRun(Object(RectorPrefix202609\Symfony\Component\Console\Input\ArgvInput), Object(RectorPrefix202609\Symfony\Component\Console\Output\ConsoleOutput))
#15 /shared/httpd/my-gms/htdocs/vendor/rector/rector/bin/rector.php(138): RectorPrefix202609\Symfony\Component\Console\Application->run()
#16 /shared/httpd/my-gms/htdocs/vendor/rector/rector/bin/rector(5): require_once('/shared/httpd/m...')
#17 /shared/httpd/my-gms/htdocs/vendor/bin/rector(120): include('/shared/httpd/m...')
#18 {main}
  thrown in /shared/httpd/my-gms/htdocs/vendor/rector/rector/src/Parallel/ValueObject/ParallelProcess.php on line 107

environment:

devilbox@php-8.0.27 in /shared/httpd/my-gms/htdocs $ php --version
PHP 8.0.27 (cli) (built: Jan  8 2023 01:18:48) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.27, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.27, Copyright (c), by Zend Technologies
    with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethans

Expected Behaviour

No fatal error

Activity

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