From 99123cb798bd360987c2fbbf900ce3e734503f7d Mon Sep 17 00:00:00 2001 From: Owen Conti Date: Fri, 15 Mar 2019 15:10:15 -0600 Subject: [PATCH 1/4] Allow tags to be created without the tagger object. --- lib/Github/Api/GitData/Tags.php | 6 +----- test/Github/Tests/Api/GitData/TagsTest.php | 5 ++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/Github/Api/GitData/Tags.php b/lib/Github/Api/GitData/Tags.php index 09f48bc0a80..11bf200a31f 100644 --- a/lib/Github/Api/GitData/Tags.php +++ b/lib/Github/Api/GitData/Tags.php @@ -56,11 +56,7 @@ public function create($username, $repository, array $params) throw new MissingArgumentException(['tag', 'message', 'object', 'type']); } - if (!isset($params['tagger'])) { - throw new MissingArgumentException('tagger'); - } - - if (!isset($params['tagger']['name'], $params['tagger']['email'], $params['tagger']['date'])) { + if (isset($params['tagger']) && !isset($params['tagger']['name'], $params['tagger']['email'], $params['tagger']['date'])) { throw new MissingArgumentException(['tagger.name', 'tagger.email', 'tagger.date']); } diff --git a/test/Github/Tests/Api/GitData/TagsTest.php b/test/Github/Tests/Api/GitData/TagsTest.php index 06543edeace..acc8dab6550 100644 --- a/test/Github/Tests/Api/GitData/TagsTest.php +++ b/test/Github/Tests/Api/GitData/TagsTest.php @@ -89,9 +89,8 @@ public function shouldNotCreateTagWithoutMessageParam() /** * @test - * @expectedException \Github\Exception\MissingArgumentException */ - public function shouldNotCreateTagWithoutTaggerParam() + public function shouldCreateTagWithoutTaggerParam() { $data = [ 'message' => 'some message', @@ -101,7 +100,7 @@ public function shouldNotCreateTagWithoutTaggerParam() ]; $api = $this->getApiMock(); - $api->expects($this->never()) + $api->expects($this->once()) ->method('post'); $api->create('KnpLabs', 'php-github-api', $data); From 16ff893203974c00655ebe49194db3189387c9c8 Mon Sep 17 00:00:00 2001 From: Jeroen Thora Date: Sat, 16 Mar 2019 21:31:53 +0100 Subject: [PATCH 2/4] Drop hhvm support --- .travis.yml | 2 -- composer.json | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6a9b3776ba5..e0f45b1e0df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,6 @@ php: matrix: include: - - php: hhvm - dist: trusty - php: 7.2 name: Backward compatibillity check env: DEPENDENCIES="roave/backward-compatibility-check" TEST_COMMAND="./vendor/bin/roave-backward-compatibility-check" diff --git a/composer.json b/composer.json index 4c1fcea4e9d..1e701df8b7c 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "prefer-stable": true, "extra": { "branch-alias": { - "dev-master": "2.11.x-dev" + "dev-master": "2.12.x-dev" } } } From a698e98a73fba564088b341dde8e2b2658d01d14 Mon Sep 17 00:00:00 2001 From: Owen Conti Date: Fri, 15 Mar 2019 15:10:15 -0600 Subject: [PATCH 3/4] Allow tags to be created without the tagger object. --- lib/Github/Api/GitData/Tags.php | 6 +----- test/Github/Tests/Api/GitData/TagsTest.php | 5 ++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/Github/Api/GitData/Tags.php b/lib/Github/Api/GitData/Tags.php index 09f48bc0a80..11bf200a31f 100644 --- a/lib/Github/Api/GitData/Tags.php +++ b/lib/Github/Api/GitData/Tags.php @@ -56,11 +56,7 @@ public function create($username, $repository, array $params) throw new MissingArgumentException(['tag', 'message', 'object', 'type']); } - if (!isset($params['tagger'])) { - throw new MissingArgumentException('tagger'); - } - - if (!isset($params['tagger']['name'], $params['tagger']['email'], $params['tagger']['date'])) { + if (isset($params['tagger']) && !isset($params['tagger']['name'], $params['tagger']['email'], $params['tagger']['date'])) { throw new MissingArgumentException(['tagger.name', 'tagger.email', 'tagger.date']); } diff --git a/test/Github/Tests/Api/GitData/TagsTest.php b/test/Github/Tests/Api/GitData/TagsTest.php index 06543edeace..acc8dab6550 100644 --- a/test/Github/Tests/Api/GitData/TagsTest.php +++ b/test/Github/Tests/Api/GitData/TagsTest.php @@ -89,9 +89,8 @@ public function shouldNotCreateTagWithoutMessageParam() /** * @test - * @expectedException \Github\Exception\MissingArgumentException */ - public function shouldNotCreateTagWithoutTaggerParam() + public function shouldCreateTagWithoutTaggerParam() { $data = [ 'message' => 'some message', @@ -101,7 +100,7 @@ public function shouldNotCreateTagWithoutTaggerParam() ]; $api = $this->getApiMock(); - $api->expects($this->never()) + $api->expects($this->once()) ->method('post'); $api->create('KnpLabs', 'php-github-api', $data); From 9fc0afff282da783612c1158b2a3a2c8780a8bee Mon Sep 17 00:00:00 2001 From: Owen Conti Date: Fri, 15 Mar 2019 15:10:15 -0600 Subject: [PATCH 4/4] Allow tags to be created without the tagger object. --- lib/Github/Api/GitData/Tags.php | 6 +----- test/Github/Tests/Api/GitData/TagsTest.php | 5 ++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/Github/Api/GitData/Tags.php b/lib/Github/Api/GitData/Tags.php index 09f48bc0a80..11bf200a31f 100644 --- a/lib/Github/Api/GitData/Tags.php +++ b/lib/Github/Api/GitData/Tags.php @@ -56,11 +56,7 @@ public function create($username, $repository, array $params) throw new MissingArgumentException(['tag', 'message', 'object', 'type']); } - if (!isset($params['tagger'])) { - throw new MissingArgumentException('tagger'); - } - - if (!isset($params['tagger']['name'], $params['tagger']['email'], $params['tagger']['date'])) { + if (isset($params['tagger']) && !isset($params['tagger']['name'], $params['tagger']['email'], $params['tagger']['date'])) { throw new MissingArgumentException(['tagger.name', 'tagger.email', 'tagger.date']); } diff --git a/test/Github/Tests/Api/GitData/TagsTest.php b/test/Github/Tests/Api/GitData/TagsTest.php index 06543edeace..acc8dab6550 100644 --- a/test/Github/Tests/Api/GitData/TagsTest.php +++ b/test/Github/Tests/Api/GitData/TagsTest.php @@ -89,9 +89,8 @@ public function shouldNotCreateTagWithoutMessageParam() /** * @test - * @expectedException \Github\Exception\MissingArgumentException */ - public function shouldNotCreateTagWithoutTaggerParam() + public function shouldCreateTagWithoutTaggerParam() { $data = [ 'message' => 'some message', @@ -101,7 +100,7 @@ public function shouldNotCreateTagWithoutTaggerParam() ]; $api = $this->getApiMock(); - $api->expects($this->never()) + $api->expects($this->once()) ->method('post'); $api->create('KnpLabs', 'php-github-api', $data);