Skip to content

Allow tags to be created without the tagger object. #780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"prefer-stable": true,
"extra": {
"branch-alias": {
"dev-master": "2.11.x-dev"
"dev-master": "2.12.x-dev"
}
}
}
6 changes: 1 addition & 5 deletions lib/Github/Api/GitData/Tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}

Expand Down
5 changes: 2 additions & 3 deletions test/Github/Tests/Api/GitData/TagsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ public function shouldNotCreateTagWithoutMessageParam()

/**
* @test
* @expectedException \Github\Exception\MissingArgumentException
*/
public function shouldNotCreateTagWithoutTaggerParam()
public function shouldCreateTagWithoutTaggerParam()
{
$data = [
'message' => 'some message',
Expand All @@ -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);
Expand Down