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

[BUG] Fatal error for tasks without description (PHP7.4, symfony/console ^5.0) #1969

Closed
sirian opened this issue Dec 14, 2019 · 16 comments
Closed

Comments

@sirian
Copy link

sirian commented Dec 14, 2019

image

<?php
namespace Deployer;

task('test', function(){});
{
    "require": {
        "symfony/console": "^5.0",
        "deployer/deployer": "^6.7"
    }
}
@sirian sirian changed the title TypeError for PHP7.4 TypeError for PHP7.4 when using symfony/console ^5.0 Dec 14, 2019
@sirian sirian changed the title TypeError for PHP7.4 when using symfony/console ^5.0 [BUG] Fatal error for tasks without description (PHP7.4, symfony/console ^5.0) Dec 14, 2019
@sirian
Copy link
Author

sirian commented Dec 14, 2019

@antonmedv

@antonmedv
Copy link
Member

What PHP version? Works for me.

@sirian
Copy link
Author

sirian commented Dec 14, 2019

@antonmedv php7.4 i mentioned it in subject :)

@sirian
Copy link
Author

sirian commented Dec 14, 2019

@antonmedv
Copy link
Member

I see. This is odd, as I just testes it in 7.4 and for me everything is working.

@sirian
Copy link
Author

sirian commented Dec 15, 2019

probably you tried at symfony/console 4. Bug happens with symfony/console 5.

Try this

rm -rf /tmp/test && mkdir /tmp/test && cd /tmp/test
echo "<?php namespace Deployer;task('test', function(){});" > deploy.php
composer require symfony/console:^5.0 deployer/deployer:^6.7
vendor/bin/dep

@antonmedv
Copy link
Member

Okay, will try this

@sirian
Copy link
Author

sirian commented Dec 15, 2019

@antonmedv And there are plenty more errors due to type hints in symfony/console 5 and some breacking changes. For example
image

image

@antonmedv
Copy link
Member

Yeah. Looks like PR for symphony 5 was incomplete.

@sirian
Copy link
Author

sirian commented Dec 15, 2019 via email

@antonmedv
Copy link
Member

Got only one error:

vendor/bin/phpstan analyse src
 79/79 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ -------------------------------------------------------
  Line   Initializer/Exception/TemplateNotFoundException.php
 ------ -------------------------------------------------------
  29     Unsafe usage of new static().
         💡 Consider making the class or the constructor final.
 ------ -------------------------------------------------------


 [ERROR] Found 1 error

@antonmedv
Copy link
Member

Done in 86c7b38

@sirian
Copy link
Author

sirian commented Dec 15, 2019

Got only one error:

vendor/bin/phpstan analyse src
 79/79 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ -------------------------------------------------------
  Line   Initializer/Exception/TemplateNotFoundException.php
 ------ -------------------------------------------------------
  29     Unsafe usage of new static().
         💡 Consider making the class or the constructor final.
 ------ -------------------------------------------------------


 [ERROR] Found 1 error

@antonmedv Consider to check with strict phpstan-strict-rules and witth vimeo/psalm. Currently on master psalm displays 95 errors, phpstan - 89

composer require --dev phpstan/phpstan phpstan/phpstan-strict-rules phpstan/extension-installer vimeo/psalm
vendor/bin/phpstan analyse src
vendor/bin/psalm --show-info=false src

For example psalm errors:
image

@sirian
Copy link
Author

sirian commented Dec 15, 2019

currently (6.7.1) ssh cleanup doesn't work :(

➤ Executing task cleanup

 [TypeError] Argument 1 passed to Symfony\Component\Process\Process::__construct() 
must be of the type array, string given
called in /tmp/test/vendor/deployer/deployer/src/Ssh/Client.php on line 149

and psalm detects 7 errors in Ssh\Client.php
image

@antonmedv
Copy link
Member

Working on it too)

@staabm
Copy link
Contributor

staabm commented Mar 9, 2021

just in case others stumbling over this:

when using php 7.0 the latest version one gets is deployer v6.7.1, but because of the above mentioned errors, which get fixed in v6.7.2 renders deployer useless (since v6.7.2 requires php 7.2).

bottom line: don't trust composer which installs deployer 6.7.1 for your php 7.0. you need to either update your php or overrule composer automatics and use 6.7.0

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

No branches or pull requests

3 participants