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

Correct return value for init command #41

Merged
merged 4 commits into from
Dec 9, 2020

Conversation

AJenbo
Copy link
Contributor

@AJenbo AJenbo commented Dec 8, 2020

Questions Answers
Description? This correct a type error when running the phpstan init command
Type? bug fix
BC breaks? no
Deprecations? no
How to test? Please indicate how to best verify that this PR is correct.
PHP Fatal error:  Uncaught TypeError: Return value of "PrestaShop\CodingStandards\Command\PhpStanInitCommand::execute()" must be of the type int, "null" returned. in vendor/symfony/console/Command/Command.php:258
Stack trace:
#0 vendor/symfony/console/Application.php(971): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 vendor/symfony/console/Application.php(290): Symfony\Component\Console\Application->doRunCommand(Object(PrestaShop\CodingStandards\Command\PhpStanInitCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 vendor/symfony/console/Application.php(166): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component in vendor/symfony/console/Command/Command.php on line 258

@@ -36,5 +36,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$destination . '/.' . $template
);
}

return self::SUCCESS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you have a problem with your phpstan container, because this const is not available before Symfony 5, it failed on Symfony 3 & 4. The composer.lock is targeting the v3.4.42

Copy link
Contributor Author

@AJenbo AJenbo Dec 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

composer.lock does not propagate, it's basically meaningless to have it for a library

https://getcomposer.org/doc/02-libraries.md#lock-file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated it to use an int so that it should be compatible with Symfony 3-5

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any reason to keep the composer.lock file in this repository 🤔

@PierreRambaud PierreRambaud merged commit b9cd87a into PrestaShop:master Dec 9, 2020
@PierreRambaud
Copy link
Contributor

Thank @AJenbo

@AJenbo AJenbo deleted the patch-1 branch December 9, 2020 14:49
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