Rector: Class 'Symplify\ParameterNameGuard\ParameterNameGuardBundle' not found

Created on 9 Jun 2020  Â·  3Comments  Â·  Source: rectorphp/rector

Hi! I'm unable to upgrade from 0.7.26 to 0.7.29:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.1.*"

Prefetching 8 packages 🎶 💨
  - Downloading (100%) 

Package operations: 0 installs, 8 updates, 0 removals
  - Updating symplify/smart-file-system (v7.3.18 => v8.0.0): Loading from cache
  - Updating symplify/set-config-resolver (v7.3.18 => v8.0.0): Loading from cache
  - Updating symplify/parameter-name-guard (v7.3.18 => v8.0.0): Loading from cache
  - Updating symplify/package-builder (v7.3.18 => v8.0.0): Loading from cache
  - Updating symplify/console-color-diff (v7.3.18 => v8.0.0): Loading from cache
  - Updating symplify/autowire-array-parameter (v7.3.18 => v8.0.0): Loading from cache
  - Updating symplify/auto-bind-parameter (v7.3.18 => v8.0.0): Loading from cache
  - Updating rector/rector (v0.7.26 => v0.7.29): Loading from cache
Writing lock file
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
110 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

What about running composer global require symfony/thanks && composer thanks now?
This will spread some 💖  by sending a ★  to the GitHub repositories of your fellow package maintainers.

phpstan/extension-installer: Extensions installed
Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 255
!!  Symfony\Component\ErrorHandler\Error\ClassNotFoundError {#83
!!    #message: """
!!      Attempted to load class "ParameterNameGuardBundle" from namespace "Symplify\ParameterNameGuard".\n
!!      Did you forget a "use" statement for "Symplify\ParameterNameGuard\Bundle\ParameterNameGuardBundle"?
!!      """
!!    #code: 0
!!    #file: "./vendor/symfony/framework-bundle/Kernel/MicroKernelTrait.php"
!!    #line: 74
!!    trace: {
!!      ./vendor/symfony/framework-bundle/Kernel/MicroKernelTrait.php:74 { …}
!!      ./vendor/symfony/http-kernel/Kernel.php:371 { …}
!!      ./vendor/symfony/http-kernel/Kernel.php:128 { …}
!!      ./vendor/symfony/framework-bundle/Console/Application.php:168 { …}
!!      ./vendor/symfony/framework-bundle/Console/Application.php:74 { …}
!!      ./vendor/symfony/console/Application.php:140 { …}
!!      ./bin/console:43 {
!!        › $application = new Application($kernel);
!!        › $application->run($input);
!!        › 
!!        arguments: {
!!          $input: Symfony\Component\Console\Input\ArgvInput {#7 …}
!!        }
!!      }
!!    }
!!  }
!!  2020-06-09T09:53:51+00:00 [critical] Uncaught Error: Class 'Symplify\ParameterNameGuard\ParameterNameGuardBundle' not found
!!  
Script @auto-scripts was called via post-update-cmd

Most helpful comment

Do you use Symfony project? My guess would be bundles.php, there is ParameterNameGuardBundle that doesn't belong there. Just remove it.

Unfortunatelly, symfonyflex is trying to install all bundles it founds, even though it's part of another packages and not desired. Than this happens.

All 3 comments

Do you use Symfony project? My guess would be bundles.php, there is ParameterNameGuardBundle that doesn't belong there. Just remove it.

Unfortunatelly, symfonyflex is trying to install all bundles it founds, even though it's part of another packages and not desired. Than this happens.

Yeah thats exactly it :) Had two references in my bundles.php.

    Symplify\ConsoleColorDiff\ConsoleColorDiffBundle::class => ['dev' => true, 'test' => true],
    Symplify\ParameterNameGuard\ParameterNameGuardBundle::class => ['dev' => true, 'test' => true],

Thank you for your quick response!

You're welcome :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jakzal picture jakzal  Â·  4Comments

pavarnos picture pavarnos  Â·  4Comments

Aerendir picture Aerendir  Â·  5Comments

peterrehm picture peterrehm  Â·  4Comments

orklah picture orklah  Â·  5Comments