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

escapeArgument deprecation error #1023

Closed
JKingweb opened this issue Feb 26, 2021 · 6 comments · Fixed by #1039
Closed

escapeArgument deprecation error #1023

JKingweb opened this issue Feb 26, 2021 · 6 comments · Fixed by #1039

Comments

@JKingweb
Copy link

Steps to reproduce

$this->taskExec("php")->option("-d", "zend.assertions=1")->arg("example.php")->run();

Expected behavior

Robo should run the task without issue

Actual behavior

Robo runs the task and then prints this message:

ERROR: The Robo\Common\ProcessUtils::escapeArgument() method is a copy of a method that was deprecated by Symfony 3.3 and removed in Symfony 4; it will be removed in Robo 2.0.
in ./vendor/consolidation/robo/src/Common/ProcessUtils.php:39

This is despite running Robo 3.0. :P Using ->option() is the source of the problem; I including an argument for clarity because one must otherwise quit PHP with Ctrl+D to make the error appear.

System Configuration

Which O.S. and PHP version are you using?

PHP 8.0.2, Linux

@greg-1-anderson
Copy link
Member

Looks like that deprecated method is overdue for being removed. Run without E_USER_DEPRECATED to avoid seeing deprecated warnings.

PRs to clean up taskExec welcome.

@markdorison
Copy link
Contributor

I see a PR was created for this against 3.x which is fantastic. What should the approach to 2.x be? Should this be backported if committed or should the error message be updated to note that it will be removed in 3.x (instead of 2.0)?

@greg-1-anderson
Copy link
Member

If that PR does land on the 3.x branch, it could probably be backported to 2.x. If it ends up with bc breaks, then it will have to be 4.x, in which case there might be the possibility of making a simpler version for 2.x and 3.x.

@greg-1-anderson
Copy link
Member

Oh, I was thinking of #1038, not #1036.

@greg-1-anderson
Copy link
Member

#1038 does not address the problem with escape in a way that solves this issue. Maybe the best solution is to simply un-deprecate this method in 2.x and 3.x (replace the trigger_error with a comment), and re-deprecate it once there is an actual replacement for escapeArgument. I think I was wrong in my Feb comment; this deprecation was premature; it therefore could be removed as a bugfix.

markdorison added a commit to markdorison/Robo that referenced this issue Jul 7, 2021
Undeprecate escapeArgument and replace error with updated method
documentation per
consolidation#1023 (comment).
greg-1-anderson pushed a commit that referenced this issue Jul 7, 2021
Undeprecate escapeArgument and replace error with updated method
documentation per
#1023 (comment).
@greg-1-anderson
Copy link
Member

Also, for all who visit here, I will also mention that it is also advisable to just use Symfony Process directly if you want to exec a process and get some result that you use to build your task list. TaskExec is good for adding operations in the middle of a task list where you do not need to capture the result, or as the last operation in a task list.

markdorison added a commit to markdorison/Robo that referenced this issue Jul 7, 2021
Undeprecate escapeArgument and replace error with updated method
documentation per
consolidation#1023 (comment).
greg-1-anderson pushed a commit that referenced this issue Jul 7, 2021
Undeprecate escapeArgument and replace error with updated method
documentation per
#1023 (comment).
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 a pull request may close this issue.

3 participants