#!/usr/bin/env php
<?php
declare(strict_types=1);
/**
* This file is part of PHPUnit Coverage Check.
*
* (c) Eric Sizemore <admin@secondversion.com>
* (c) Richard Regeer <rich2309@gmail.com>
*
* This source file is subject to the MIT license. For the full copyright,
* license information, and credits/acknowledgements, please view the LICENSE
* and README files that were distributed with this source code.
*/
// Attempt to load dependencies
(static function () {
$possibleLocations = [
__DIR__ . '/../../autoload.php',
__DIR__ . '/../autoload.php',
__DIR__ . '/vendor/autoload.php',
];
$loader = null;
foreach ($possibleLocations as $possibleLocation) {
if (file_exists($possibleLocation)) {
$loader = $possibleLocation;
break;
}
}
if ($loader === null) {
throw new RuntimeException(sprintf(
'You must set up the project dependencies, run the following commands:%1$s' .
'curl -sS https://getcomposer.org/installer | php%1$s' .
'php composer.phar install%1$s',
\PHP_EOL
));
}
require_once $loader;
})();
// Setup application
use Esi\CoverageCheck\Application;
use Esi\CoverageCheck\Command\CoverageCheckCommand;
use Esi\CoverageCheck\CoverageCheck;
$command = new CoverageCheckCommand(new CoverageCheck());
$commandName = $command->getName() ?? 'coverage:check';
$console = new Application();
$console->add($command);
$console->setDefaultCommand($commandName, true);
$console->run();
|