-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
95 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Churn\Command\AssessComplexityCommand; | ||
use Churn\Command\RunCommand; | ||
use Composer\InstalledVersions; | ||
use Symfony\Component\Console\Application; | ||
|
||
$application = new Application('churn-php', (function (string $package): string { | ||
$version = InstalledVersions::getPrettyVersion($package); | ||
$ref = InstalledVersions::getReference($package); | ||
if ($ref) { | ||
$version .= '@' . \substr($ref, 0, 7); | ||
} | ||
|
||
return $version; | ||
})('bmitch/churn-php')); | ||
$application->add(new AssessComplexityCommand()); | ||
$application->add($run = RunCommand::newInstance()); | ||
$application->setDefaultCommand($run->getName()); | ||
|
||
return $application; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,35 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
require_once __DIR__ . '/bootstrap.php'; | ||
if (!version_compare(PHP_VERSION, PHP_VERSION, '=')) { | ||
fwrite( | ||
STDERR, | ||
sprintf( | ||
'%s declares an invalid value for PHP_VERSION.' . PHP_EOL . | ||
'This breaks fundamental functionality such as version_compare().' . PHP_EOL . | ||
'Please use a different PHP interpreter.' . PHP_EOL, | ||
PHP_BINARY | ||
) | ||
); | ||
|
||
die(1); | ||
} | ||
|
||
use Churn\Command\AssessComplexityCommand; | ||
use Churn\Command\RunCommand; | ||
use Composer\InstalledVersions; | ||
use Symfony\Component\Console\Application; | ||
if (version_compare('7.1.3', PHP_VERSION, '>=')) { | ||
fwrite( | ||
STDERR, | ||
sprintf( | ||
'The application requires the version ">=7.1.3" or greater.' . PHP_EOL . | ||
'You are using PHP %s (%s).' . PHP_EOL, | ||
PHP_VERSION, | ||
PHP_BINARY | ||
) | ||
); | ||
|
||
$application = new Application('churn-php', (function (string $package): string { | ||
$version = InstalledVersions::getPrettyVersion($package); | ||
$ref = InstalledVersions::getReference($package); | ||
if ($ref) { | ||
$version .= '@' . \substr($ref, 0, 7); | ||
} | ||
die(1); | ||
} | ||
|
||
require_once __DIR__ . '/bootstrap.php'; | ||
|
||
return $version; | ||
})('bmitch/churn-php')); | ||
$application->add(new AssessComplexityCommand()); | ||
$application->add($run = RunCommand::newInstance()); | ||
$application->setDefaultCommand($run->getName()); | ||
$application = require_once __DIR__ . '/app.php'; | ||
$application->run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"check-requirements": false, | ||
"compactors": [ | ||
"KevinGH\\Box\\Compactor\\Php" | ||
], | ||
|