Skip to content

Commit

Permalink
bug #27902 Fix the detection of the Process new argument (stof)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.4 branch.

Discussion
----------

Fix the detection of the Process new argument

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

This fixes the detection of the new method signature when triggering the deprecation warning. The new `$env` parameter is the second argument, not the first one.

Commits
-------

57e95f3 Fix the detection of the Process new argument
  • Loading branch information
nicolas-grekas committed Jul 9, 2018
2 parents 4c7f29f + 57e95f3 commit 0fcc874
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Process/Process.php
Expand Up @@ -272,7 +272,7 @@ public function start(callable $callback = null/*, array $env = array()*/)
} else {
if (__CLASS__ !== static::class) {
$r = new \ReflectionMethod($this, __FUNCTION__);
if (__CLASS__ !== $r->getDeclaringClass()->getName() && (2 > $r->getNumberOfParameters() || 'env' !== $r->getParameters()[0]->name)) {
if (__CLASS__ !== $r->getDeclaringClass()->getName() && (2 > $r->getNumberOfParameters() || 'env' !== $r->getParameters()[1]->name)) {
@trigger_error(sprintf('The %s::start() method expects a second "$env" argument since Symfony 3.3. It will be made mandatory in 4.0.', static::class), E_USER_DEPRECATED);
}
}
Expand Down

0 comments on commit 0fcc874

Please sign in to comment.