From 33488c25b080f46097cfcb521eaf36e66f4bcc31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 10 Dec 2018 05:43:50 +0000 Subject: [PATCH 1/3] Bump phpunit/phpunit from 7.4.5 to 7.5.0 Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 7.4.5 to 7.5.0. - [Release notes](https://github.com/sebastianbergmann/phpunit/releases) - [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-7.5.md) - [Commits](https://github.com/sebastianbergmann/phpunit/compare/7.4.5...7.5.0) Signed-off-by: dependabot[bot] --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 26e0c51..ba7cf24 100644 --- a/composer.lock +++ b/composer.lock @@ -680,16 +680,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.4.5", + "version": "7.5.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "61d34e8dd6eb3555900f0f2a2fa9e7e570730102" + "reference": "520723129e2b3fc1dc4c0953e43c9d40e1ecb352" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/61d34e8dd6eb3555900f0f2a2fa9e7e570730102", - "reference": "61d34e8dd6eb3555900f0f2a2fa9e7e570730102", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/520723129e2b3fc1dc4c0953e43c9d40e1ecb352", + "reference": "520723129e2b3fc1dc4c0953e43c9d40e1ecb352", "shasum": "" }, "require": { @@ -734,7 +734,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.4-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -760,7 +760,7 @@ "testing", "xunit" ], - "time": "2018-12-03T05:01:24+00:00" + "time": "2018-12-07T07:08:12+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", From b32e46644d2bd2da9f90b988ddcee7e7699d95d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 13 Dec 2018 05:49:32 +0000 Subject: [PATCH 2/3] Bump phpunit/phpunit from 7.5.0 to 7.5.1 Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 7.5.0 to 7.5.1. - [Release notes](https://github.com/sebastianbergmann/phpunit/releases) - [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-7.5.md) - [Commits](https://github.com/sebastianbergmann/phpunit/compare/7.5.0...7.5.1) Signed-off-by: dependabot[bot] --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index ba7cf24..61274c1 100644 --- a/composer.lock +++ b/composer.lock @@ -680,16 +680,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.5.0", + "version": "7.5.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "520723129e2b3fc1dc4c0953e43c9d40e1ecb352" + "reference": "c23d78776ad415d5506e0679723cb461d71f488f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/520723129e2b3fc1dc4c0953e43c9d40e1ecb352", - "reference": "520723129e2b3fc1dc4c0953e43c9d40e1ecb352", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c23d78776ad415d5506e0679723cb461d71f488f", + "reference": "c23d78776ad415d5506e0679723cb461d71f488f", "shasum": "" }, "require": { @@ -760,7 +760,7 @@ "testing", "xunit" ], - "time": "2018-12-07T07:08:12+00:00" + "time": "2018-12-12T07:20:32+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", From 800e01eae42f573acf3d36e54738b4348c495bd7 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Thu, 3 Jan 2019 11:09:16 +0000 Subject: [PATCH 3/3] Allow nullable parameters --- src/Argument/ArgumentList.php | 2 +- src/Argument/ArgumentValueList.php | 6 +++++- src/Command/Command.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Argument/ArgumentList.php b/src/Argument/ArgumentList.php index c034924..a600c2c 100644 --- a/src/Argument/ArgumentList.php +++ b/src/Argument/ArgumentList.php @@ -57,7 +57,7 @@ protected function buildArgumentList(array $arguments):void { else { $skipNextArgument = true; $name = $arg; - $value = $arguments[$i + 1]; + $value = $arguments[$i + 1] ?? null; } if ($arg[1] === "-") { diff --git a/src/Argument/ArgumentValueList.php b/src/Argument/ArgumentValueList.php index 524d545..814389f 100644 --- a/src/Argument/ArgumentValueList.php +++ b/src/Argument/ArgumentValueList.php @@ -4,11 +4,15 @@ class ArgumentValueList { protected $valueMap = []; - public function set(string $key, string $value):void { + public function set(string $key, string $value = null):void { $this->valueMap[$key] = $value; } public function get(string $key):string { return $this->valueMap[$key]; } + + public function contains(string $key):bool { + return isset($this->valueMap[$key]); + } } \ No newline at end of file diff --git a/src/Command/Command.php b/src/Command/Command.php index 2716a7f..9758016 100644 --- a/src/Command/Command.php +++ b/src/Command/Command.php @@ -28,7 +28,7 @@ abstract class Command { /** @var Parameter[] */ protected $requiredParameterList = []; - public function setOutput(Stream $output) { + public function setOutput(Stream $output = null) { $this->output = $output; }