Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
Théo FIDRY committed Oct 7, 2017
1 parent f62e813 commit 441e039
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
4 changes: 0 additions & 4 deletions src/Autoload/Requirements.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@

namespace Humbug\PhpScoper\Autoload;

use Composer\Semver\Constraint\Constraint;
use Composer\Semver\Constraint\MultiConstraint;
use Composer\Semver\Semver;
use Composer\Semver\VersionParser;
use Symfony\Requirements\RequirementCollection;

final class Requirements extends RequirementCollection
Expand All @@ -30,7 +27,6 @@ public function __construct($rootDir)

$this->addPhpVersionRequirement($composerConfig);
$this->addExtensionRequirements($composerConfig);

}

private function getComposerRootDir($rootDir)
Expand Down
29 changes: 15 additions & 14 deletions src/check.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/**
* @param string $autoload
* @param bool $verbose
* @param bool $verbose
*
* @return bool
*/
Expand All @@ -32,13 +32,13 @@ function check_requirements($autoload, $verbose)
$checkPassed = array_reduce(
$requirements->getRequirements(),
/**
* @param bool $checkPassed
* @param bool $checkPassed
* @param Requirement $requirement
*
* @return bool
*/
function ($checkPassed, Requirement $requirement) use ($lineSize) {
return $checkPassed || null ===get_error_message($requirement, $lineSize);
return $checkPassed || null === get_error_message($requirement, $lineSize);
},
false
);
Expand All @@ -50,16 +50,16 @@ function ($checkPassed, Requirement $requirement) use ($lineSize) {

echo_title('PHP-Scoper Requirements Checker', null, $verbose);

vecho('> PHP is using the following php.ini file:' . PHP_EOL, $verbose);
vecho('> PHP is using the following php.ini file:'.PHP_EOL, $verbose);

if ($iniPath) {
echo_style('green', ' ' . $iniPath, $verbose);
echo_style('green', ' '.$iniPath, $verbose);
} else {
echo_style('yellow', ' WARNING: No configuration file (php.ini) used by PHP!', $verbose);
}

vecho(PHP_EOL . PHP_EOL, $verbose);
vecho('> Checking PHP-Scoper requirements:' . PHP_EOL . ' ', $verbose);
vecho(PHP_EOL.PHP_EOL, $verbose);
vecho('> Checking PHP-Scoper requirements:'.PHP_EOL.' ', $verbose);

$messages = [];

Expand Down Expand Up @@ -89,15 +89,15 @@ function ($checkPassed, Requirement $requirement) use ($lineSize) {
echo_title('Fix the following mandatory requirements', 'red', $verbose);

foreach ($messages['error'] as $helpText) {
vecho(' * ' . $helpText . PHP_EOL, $verbose);
vecho(' * '.$helpText.PHP_EOL, $verbose);
}
}

if (!empty($messages['warning'])) {
echo_title('Optional recommendations to improve your setup', 'yellow', $verbose);

foreach ($messages['warning'] as $helpText) {
vecho(' * ' . $helpText . PHP_EOL, $verbose);
vecho(' * '.$helpText.PHP_EOL, $verbose);
}
}

Expand All @@ -115,7 +115,8 @@ function vecho($message, $verbose)

/**
* @param Requirement $requirement
* @param int $lineSize
* @param int $lineSize
*
* @return string|null
*/
function get_error_message(Requirement $requirement, $lineSize)
Expand All @@ -134,9 +135,9 @@ function get_error_message(Requirement $requirement, $lineSize)
}

/**
* @param string $title
* @param string $title
* @param string|null $style
* @param bool $verbose
* @param bool $verbose
*/
function echo_title($title, $style = null, $verbose)
{
Expand All @@ -155,7 +156,7 @@ function echo_title($title, $style = null, $verbose)
/**
* @param string $style
* @param string $message
* @param bool $verbose
* @param bool $verbose
*/
function echo_style($style, $message, $verbose)
{
Expand All @@ -182,7 +183,7 @@ function echo_style($style, $message, $verbose)
* @param string $style
* @param string $title
* @param string $message
* @param bool $verbose
* @param bool $verbose
*/
function echo_block($style, $title, $message, $verbose)
{
Expand Down

0 comments on commit 441e039

Please sign in to comment.