Skip to content

Commit 4fd5876

Browse files
owencontiacrobat
authored andcommitted
Allow tags to be created without the tagger object. (#780)
* Allow tags to be created without the tagger object. * Drop hhvm support * Allow tags to be created without the tagger object. * Allow tags to be created without the tagger object.
1 parent fceb3b4 commit 4fd5876

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

lib/Github/Api/GitData/Tags.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ public function create($username, $repository, array $params)
5656
throw new MissingArgumentException(['tag', 'message', 'object', 'type']);
5757
}
5858

59-
if (!isset($params['tagger'])) {
60-
throw new MissingArgumentException('tagger');
61-
}
62-
63-
if (!isset($params['tagger']['name'], $params['tagger']['email'], $params['tagger']['date'])) {
59+
if (isset($params['tagger']) && !isset($params['tagger']['name'], $params['tagger']['email'], $params['tagger']['date'])) {
6460
throw new MissingArgumentException(['tagger.name', 'tagger.email', 'tagger.date']);
6561
}
6662

test/Github/Tests/Api/GitData/TagsTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,8 @@ public function shouldNotCreateTagWithoutMessageParam()
8989

9090
/**
9191
* @test
92-
* @expectedException \Github\Exception\MissingArgumentException
9392
*/
94-
public function shouldNotCreateTagWithoutTaggerParam()
93+
public function shouldCreateTagWithoutTaggerParam()
9594
{
9695
$data = [
9796
'message' => 'some message',
@@ -101,7 +100,7 @@ public function shouldNotCreateTagWithoutTaggerParam()
101100
];
102101

103102
$api = $this->getApiMock();
104-
$api->expects($this->never())
103+
$api->expects($this->once())
105104
->method('post');
106105

107106
$api->create('KnpLabs', 'php-github-api', $data);

0 commit comments

Comments
 (0)