Skip to content

Commit

Permalink
Fix: Add missing and update existing docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz authored and pbrisbin committed Jan 11, 2017
1 parent caea1cb commit d37628d
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/System/Git/GitCommand.php
Expand Up @@ -7,13 +7,19 @@ class GitCommand extends SystemCommand
{
protected $commandPath = 'git';

/**
* @return string
*/
public function getHead()
{
$command = $this->createCommand("log -1 --pretty=format:'%H'");

return current($this->executeCommand($command));
}

/**
* @return string|null
*/
public function getBranch()
{
$command = $this->createCommand("branch");
Expand All @@ -28,6 +34,9 @@ public function getBranch()
return null;
}

/**
* @return int
*/
public function getCommittedAt()
{
$command = $this->createCommand("log -1 --pretty=format:'%ct'");
Expand Down
3 changes: 3 additions & 0 deletions src/TestReporter/ApiClient.php
Expand Up @@ -5,6 +5,9 @@

class ApiClient
{
/**
* @var string
*/
protected $apiHost = "https://codeclimate.com";

/**
Expand Down
15 changes: 13 additions & 2 deletions src/TestReporter/CoverageCollector.php
Expand Up @@ -7,6 +7,9 @@

class CoverageCollector
{
/**
* @var Jobs
*/
protected $api;

/**
Expand All @@ -15,6 +18,11 @@ class CoverageCollector
*/
protected $cloverPaths = [ ];

/**
* CoverageCollector constructor.
*
* @param string[] $paths
*/
public function __construct($paths)
{
$rootDir = getcwd();
Expand All @@ -35,7 +43,7 @@ public function __construct($paths)
/**
* Set a list of Clover XML paths
*
* @param array $paths Array of relative paths to Clovers XML files
* @param string[] $paths Array of relative paths to Clovers XML files
*/
public function setCloverPaths($paths)
{
Expand All @@ -44,13 +52,16 @@ public function setCloverPaths($paths)

/**
* Get a list of Clover XML paths
* @return array Array of relative Clover XML file locations
* @return string[] Array of relative Clover XML file locations
*/
public function getCloverPaths()
{
return $this->cloverPaths;
}

/**
* @return JsonFile
*/
public function collectAsJson()
{
$cloverJsonFile = $this->api->collectCloverXml()->getJsonFile();
Expand Down
27 changes: 27 additions & 0 deletions src/TestReporter/Entity/CiInfo.php
Expand Up @@ -3,6 +3,9 @@

class CiInfo
{
/**
* @return array
*/
public function toArray()
{
if (isset($_SERVER["TRAVIS"])) {
Expand Down Expand Up @@ -40,6 +43,9 @@ public function toArray()
return [ ];
}

/**
* @return array
*/
protected function travisProperties()
{
return [
Expand All @@ -50,6 +56,9 @@ protected function travisProperties()
];
}

/**
* @return array
*/
protected function circleProperties()
{
return [
Expand All @@ -60,6 +69,9 @@ protected function circleProperties()
];
}

/**
* @return array
*/
protected function semaphoreProperties()
{
return [
Expand All @@ -69,6 +81,9 @@ protected function semaphoreProperties()
];
}

/**
* @return array
*/
protected function jenkinsProperties()
{
return [
Expand All @@ -80,6 +95,9 @@ protected function jenkinsProperties()
];
}

/**
* @return array
*/
protected function tddiumProperties()
{
return [
Expand All @@ -89,6 +107,9 @@ protected function tddiumProperties()
];
}

/**
* @return array
*/
protected function codeshipProperties()
{
return [
Expand All @@ -100,6 +121,9 @@ protected function codeshipProperties()
];
}

/**
* @return array
*/
protected function buildkiteProperties()
{
return [
Expand All @@ -112,6 +136,9 @@ protected function buildkiteProperties()
];
}

/**
* @return array
*/
protected function werckerProperties()
{
return [
Expand Down
16 changes: 16 additions & 0 deletions src/TestReporter/Entity/JsonFile.php
Expand Up @@ -31,6 +31,9 @@ public function getRepoToken()
return $_SERVER["CODECLIMATE_REPO_TOKEN"];
}

/**
* @return array
*/
protected function getEnvironment()
{
return [
Expand All @@ -39,6 +42,9 @@ protected function getEnvironment()
];
}

/**
* @return array
*/
protected function collectGitInfo()
{
$command = new GitCommand();
Expand All @@ -50,13 +56,19 @@ protected function collectGitInfo()
];
}

/**
* @return array
*/
protected function collectCiServiceInfo()
{
$ciInfo = new CiInfo();

return $ciInfo->toArray();
}

/**
* @return array
*/
protected function collectSourceFiles()
{
return array_map(function (SourceFile $sourceFile) {
Expand All @@ -68,6 +80,10 @@ protected function collectSourceFiles()
}, $this->getSourceFiles());
}

/**
* @param SourceFile $sourceFile
* @return string
*/
protected function calculateBlobId(SourceFile $sourceFile)
{
$content = file_get_contents($sourceFile->getPath());
Expand Down
5 changes: 4 additions & 1 deletion tests/Unit/ApplicationTest.php
Expand Up @@ -8,7 +8,10 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
{
const PROJECT_DIR = "/tmp/php-test-reporter-example-project";

private $srcDir;
/**
* @var string
*/
protected $srcDir;

protected function setUp()
{
Expand Down

0 comments on commit d37628d

Please sign in to comment.