Added global application config (config.yml) option

'php-censor.build.allow_public_artifacts' for allow/deny to generate
public artifacts (PHPUnit code coverage html report, Pdepend html
reports). Issue #107.
This commit is contained in:
Dmitry Khomutov 2018-03-08 00:47:09 +07:00
commit 2a933a7ecb
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
8 changed files with 82 additions and 47 deletions

View file

@ -943,8 +943,10 @@ class Build extends Model
/**
* Removes the build directory.
*
* @param boolean $withArtifacts
*/
public function removeBuildDirectory()
public function removeBuildDirectory($withArtifacts = false)
{
// Get the path and remove the trailing slash as this may prompt PHP
// to see this as a directory even if it's a link.
@ -964,10 +966,12 @@ class Build extends Model
$fileSystem->remove($buildPath);
}
$buildDirectory = $this->getBuildDirectory();
if ($withArtifacts) {
$buildDirectory = $this->getBuildDirectory();
$fileSystem->remove(PUBLIC_DIR . 'artifacts/pdepend/' . $buildDirectory);
$fileSystem->remove(PUBLIC_DIR . 'artifacts/phpunit/' . $buildDirectory);
$fileSystem->remove(PUBLIC_DIR . 'artifacts/pdepend/' . $buildDirectory);
$fileSystem->remove(PUBLIC_DIR . 'artifacts/phpunit/' . $buildDirectory);
}
} catch (\Exception $e) {
}