traderinteractive /
util-php
| 1 | #!/usr/bin/env php |
||
| 2 | <?php |
||
| 3 | chdir(__DIR__); |
||
| 4 | |||
| 5 | $returnStatus = null; |
||
| 6 | passthru('composer install', $returnStatus); |
||
| 7 | if ($returnStatus !== 0) { |
||
| 8 | exit(1); |
||
| 9 | } |
||
| 10 | |||
| 11 | require 'vendor/autoload.php'; |
||
| 12 | |||
| 13 | $phpcsCLI = new PHP_CodeSniffer_CLI(); |
||
|
0 ignored issues
–
show
|
|||
| 14 | $phpcsArguments = [ |
||
| 15 | 'standard' => ['PSR2'], |
||
| 16 | 'files' => ['src', 'tests', 'build.php'], |
||
| 17 | ]; |
||
| 18 | $phpcsViolations = $phpcsCLI->process($phpcsArguments); |
||
| 19 | if ($phpcsViolations > 0) { |
||
| 20 | exit(1); |
||
| 21 | } |
||
| 22 | |||
| 23 | $phpunitConfiguration = PHPUnit_Util_Configuration::getInstance(__DIR__ . '/phpunit.xml'); |
||
|
0 ignored issues
–
show
The type
PHPUnit_Util_Configuration was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 24 | $phpunitArguments = ['coverageHtml' => __DIR__ . '/coverage', 'configuration' => $phpunitConfiguration]; |
||
| 25 | $testRunner = new PHPUnit_TextUI_TestRunner(); |
||
|
0 ignored issues
–
show
The type
PHPUnit_TextUI_TestRunner was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 26 | $result = $testRunner->doRun($phpunitConfiguration->getTestSuiteConfiguration(), $phpunitArguments, false); |
||
| 27 | if (!$result->wasSuccessful()) { |
||
| 28 | exit(1); |
||
| 29 | } |
||
| 30 | |||
| 31 | $cloverCoverage = new PHP_CodeCoverage_Report_Clover(); |
||
|
0 ignored issues
–
show
The type
PHP_CodeCoverage_Report_Clover was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 32 | file_put_contents('clover.xml', $cloverCoverage->process($result->getCodeCoverage())); |
||
| 33 | |||
| 34 | $coverageFactory = new PHP_CodeCoverage_Report_Factory(); |
||
|
0 ignored issues
–
show
The type
PHP_CodeCoverage_Report_Factory was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 35 | $coverageReport = $coverageFactory->create($result->getCodeCoverage()); |
||
| 36 | if ($coverageReport->getNumExecutedLines() !== $coverageReport->getNumExecutableLines()) { |
||
| 37 | file_put_contents('php://stderr', "Code coverage was NOT 100%\n"); |
||
| 38 | exit(1); |
||
| 39 | } |
||
| 40 | |||
| 41 | echo "Code coverage was 100%\n"; |
||
| 42 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths