Shell: skip null parameters
authorMax Semenik <maxsem.wiki@gmail.com>
Wed, 29 Nov 2017 02:51:25 +0000 (18:51 -0800)
committerMax Semenik <maxsem.wiki@gmail.com>
Wed, 29 Nov 2017 20:38:35 +0000 (12:38 -0800)
commit36009e3ca78cb92914e72a59633ea219d601fc4f
tree6d2e3874ec3ed18e5956c3604fac569b3c9ea584
parent70a602dde40e3694f8ef8b9c779a528c17a48f42
Shell: skip null parameters

Right now they're treated as empty strings, however
this doesn't allow skipping parameters in the middle like
 $params = [
     'foo',
     $x ? '--bar' : null,
     '--baz',
 ];

In some cases this matters, e.g. `ls` works while `ls ''` doesn't.

Also, fix spacing problems the new tests uncovered:
* Extra space when using params()
* Missing space when combining params() and unsafeParams()

Change-Id: Icb29d4c48ae7f92fb5635e3865346c98f47abb01
includes/shell/Command.php
includes/shell/Shell.php
tests/phpunit/includes/shell/CommandTest.php
tests/phpunit/includes/shell/ShellTest.php