Commit 81c9e39
committed
bug #45931 [Process] Fix Process::getEnv() when setEnv() hasn't been called before (asika32764)
This PR was merged into the 4.4 branch.
Discussion
----------
[Process] Fix Process::getEnv() when setEnv() hasn't been called before
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
-----
AS `getEnv()` return type is array, if a `Process` object has no default env and is NULL value, calling `getEnv()` will get error.
``` php
$process = $someObject->createProcess(); // Get process from some object, but we don't know the environment
// We want to check the env
$env = $process->getEnv(); // Error: return type must be array, NULL given.
```
Commits
-------
a5bf740 [Process] Fix Process::getEnv() when setEnv() hasn't been called beforeFile tree
2 files changed
+5
-2
lines changed- src/Symfony/Component/Process
- Tests
2 files changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1505 | 1505 | | |
1506 | 1506 | | |
1507 | 1507 | | |
1508 | | - | |
1509 | 1508 | | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
1510 | 1513 | | |
1511 | 1514 | | |
1512 | 1515 | | |
| |||
0 commit comments