{"record":{"id":"222efa82f041303d","repo":"passbolt/passbolt_api","slug":"info-php-composer-phar-require-psy-psysh-info","errorCode":null,"errorMessage":"<info>$ php composer.phar require psy/psysh</info>","messagePattern":"<info>\\$ php composer\\.phar require psy/psysh</info>","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/Command/ConsoleCommand.php","lineNumber":49,"sourceCode":"{\n    /**\n     * Start the Command and interactive console.\n     *\n     * @param \\Cake\\Console\\Arguments $args The command arguments.\n     * @param \\Cake\\Console\\ConsoleIo $io The console io\n     * @return int|null|void The exit code or null for success\n     */\n    public function execute(Arguments $args, ConsoleIo $io) // phpcs:ignore\n    {\n        if (!class_exists('Psy\\Shell')) {\n            $io->err('<error>Unable to load Psy\\Shell.</error>');\n            $io->err('');\n            $io->err('Make sure you have installed psysh as a dependency,');\n            $io->err('and that Psy\\Shell is registered in your autoloader.');\n            $io->err('');\n            $io->err('If you are using composer run');\n            $io->err('');\n            $io->err('<info>$ php composer.phar require psy/psysh</info>');\n            $io->err('');\n\n            return static::CODE_ERROR;\n        }\n\n        $io->out('You can exit with <info>`CTRL-C`</info> or <info>`exit`</info>');\n        $io->out();\n\n        Log::drop('debug');\n        Log::drop('error');\n        $io->setLoggers(false);\n        restore_error_handler();\n        restore_exception_handler();\n\n        $psy = new PsyShell(new PsyConfiguration([\n            'updateCheck' => 'never',\n        ]));\n        $psy->run();","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/src/Command/ConsoleCommand.php#L31-L67","documentation":"This is the suggested remediation command line printed by ConsoleCommand::execute() as part of the Psy\\Shell-not-found guidance: '<info>$ php composer.phar require psy/psysh</info>'. It is informational CLI output (wrapped in CakePHP <info> tags) showing the exact composer command the developer should run, not an error thrown by the library.","triggerScenarios":"Emitted whenever the console command runs and class_exists('Psy\\Shell') is false — i.e. psy/psysh is missing from the autoloader.","commonSituations":"Developers see this hint in the terminal after bin/cake console fails on a fresh clone, in CI containers without dev dependencies, or on hosts where only composer.phar (not a global composer) is available.","solutions":["Execute the suggested command: php composer.phar require psy/psysh (or composer require psy/psysh if composer is installed globally).","If psysh should be a dev-only tool, add it with --dev so production installs without --no-dev still lack it and this hint remains correct.","Re-run bin/cake console after installation to confirm the shell starts."],"exampleFix":"// before\n$ bin/cake console\nIf you are using composer run\n$ php composer.phar require psy/psysh\n\n// after\n$ php composer.phar require psy/psysh\n$ bin/cake console\nYou can exit with `CTRL-C` or `exit`","handlingStrategy":"validation","validationCode":"if php -r \"exit(class_exists('Psy\\\\Shell') ? 0 : 1);\"; then bin/cake console; else php composer.phar require psy/psysh; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the hinted command proactively on fresh clones: composer require --dev psy/psysh.","Pin psy/psysh in composer.json so dependency resolution stays reproducible.","Verify composer/psysh availability in CI images used for interactive debugging."],"tags":["cli","composer","console","missing-dependency"],"backgroundTag":"missing-dependency","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}