Skip to content

Commit

Permalink
Testing responses
Browse files Browse the repository at this point in the history
  • Loading branch information
ekinhbayar committed Dec 7, 2016
1 parent 859935b commit 15e0c7c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Plugins/Changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,22 @@ protected function getCommitReference(Command $command, string $path)
{
if($response->getStatus() !== 200){
$resource = ($key === 'branch') ? $branch : 'repository';
} else {
$commit = json_decode($response->getBody(), true);
}
}

var_dump($responses);
var_dump($errors);

if (isset($resource)) {
throw new ReferenceNotFoundException("Failed to fetch $resource for $path");
}

$commit = json_decode($responses['branch']->getBody(), true);
if (!isset($commit['object']['sha'])) {
return $this->chatClient->postMessage($command->getRoom(), "Failed to fetch reference SHA for $path");
}

return $commit['object']['sha'];
return (string) $commit['object']['sha'];
}

/**
Expand Down

0 comments on commit 15e0c7c

Please sign in to comment.