diff --git a/.php_cs.dist b/.php_cs.dist index e8db07ab1..25f560541 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -36,6 +36,7 @@ $config = PhpCsFixer\Config::create() 'heredoc_to_nowdoc' => true, 'list_syntax' => ['syntax' => 'short'], 'method_argument_space' => ['ensure_fully_multiline' => true], + 'native_function_invocation' => false, 'no_extra_consecutive_blank_lines' => [ 'tokens' => [ 'break', diff --git a/.requirement-checker/bin/check-requirements.php b/.requirement-checker/bin/check-requirements.php index 435b4b372..66af7989c 100644 --- a/.requirement-checker/bin/check-requirements.php +++ b/.requirement-checker/bin/check-requirements.php @@ -1,13 +1,13 @@ evaluateRequirements(); - $io = new \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\IO(); - self::printCheck($checkPassed, new \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\Printer($io->getVerbosity(), $io->hasColorSupport()), $requirements); + $io = new \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\IO(); + self::printCheck($checkPassed, new \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\Printer($io->getVerbosity(), $io->hasColorSupport()), $requirements); return $checkPassed; } - public static function printCheck($checkPassed, \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\Printer $printer, \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\RequirementCollection $requirements) + public static function printCheck($checkPassed, \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\Printer $printer, \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\RequirementCollection $requirements) { - if (\false === $checkPassed && \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\IO::VERBOSITY_VERY_VERBOSE > $printer->getVerbosity()) { - $printer->setVerbosity(\_HumbugBox5af565a878e76\KevinGH\RequirementChecker\IO::VERBOSITY_VERY_VERBOSE); + if (\false === $checkPassed && \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\IO::VERBOSITY_VERY_VERBOSE > $printer->getVerbosity()) { + $printer->setVerbosity(\_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\IO::VERBOSITY_VERY_VERBOSE); } - $verbosity = \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\IO::VERBOSITY_VERY_VERBOSE; + $verbosity = \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\IO::VERBOSITY_VERY_VERBOSE; $iniPath = $requirements->getPhpIniPath(); $printer->title('Box Requirements Checker', $verbosity); $printer->printv('> Using PHP ', $verbosity); @@ -49,9 +49,9 @@ public static function printCheck($checkPassed, \_HumbugBox5af565a878e76\KevinGH $errorMessages = array(); foreach ($requirements->getRequirements() as $requirement) { if ($errorMessage = $printer->getRequirementErrorMessage($requirement)) { - if (\_HumbugBox5af565a878e76\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG === $printer->getVerbosity()) { - $printer->printvln('✘ ' . $requirement->getTestMessage(), \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG, 'red'); - $printer->printv(' ', \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG); + if (\_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG === $printer->getVerbosity()) { + $printer->printvln('✘ ' . $requirement->getTestMessage(), \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG, 'red'); + $printer->printv(' ', \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG); $errorMessages[] = $errorMessage; } else { $printer->printv('E', $verbosity, 'red'); @@ -59,14 +59,14 @@ public static function printCheck($checkPassed, \_HumbugBox5af565a878e76\KevinGH } continue; } - if (\_HumbugBox5af565a878e76\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG === $printer->getVerbosity()) { - $printer->printvln('✔ ' . $requirement->getHelpText(), \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG, 'green'); - $printer->printv(' ', \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG); + if (\_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG === $printer->getVerbosity()) { + $printer->printvln('✔ ' . $requirement->getHelpText(), \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG, 'green'); + $printer->printv(' ', \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG); } else { $printer->printv('.', $verbosity, 'green'); } } - if (\_HumbugBox5af565a878e76\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG !== $printer->getVerbosity() && \count($requirements) > 0) { + if (\_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\IO::VERBOSITY_DEBUG !== $printer->getVerbosity() && \count($requirements) > 0) { $printer->printvln('', $verbosity); } if ($requirements->evaluateRequirements()) { @@ -89,9 +89,9 @@ private static function retrieveRequirements() self::$requirementsConfig = __DIR__ . '/../.requirements.php'; } $config = (require self::$requirementsConfig); - $requirements = new \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\RequirementCollection(); + $requirements = new \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\RequirementCollection(); foreach ($config as $constraint) { - $requirements->addRequirement('php' === $constraint['type'] ? new \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\IsPhpVersionFulfilled($constraint['condition']) : new \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\IsExtensionFulfilled($constraint['condition']), $constraint['message'], $constraint['helpMessage']); + $requirements->addRequirement('php' === $constraint['type'] ? new \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\IsPhpVersionFulfilled($constraint['condition']) : new \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\IsExtensionFulfilled($constraint['condition']), $constraint['message'], $constraint['helpMessage']); } return $requirements; } diff --git a/.requirement-checker/src/IO.php b/.requirement-checker/src/IO.php index fac7dbacf..d72572285 100644 --- a/.requirement-checker/src/IO.php +++ b/.requirement-checker/src/IO.php @@ -1,6 +1,6 @@ requiredPhpVersion); + return \_HumbugBox5b963fb2bb9ba\Composer\Semver\Semver::satisfies(\sprintf('%d.%d.%d', \PHP_MAJOR_VERSION, \PHP_MINOR_VERSION, \PHP_RELEASE_VERSION), $this->requiredPhpVersion); } } diff --git a/.requirement-checker/src/Printer.php b/.requirement-checker/src/Printer.php index e63b84689..ee2287041 100644 --- a/.requirement-checker/src/Printer.php +++ b/.requirement-checker/src/Printer.php @@ -1,6 +1,6 @@ getWidth(), 80); } $this->verbosity = $verbosity; @@ -59,7 +59,7 @@ public function title($title, $verbosity, $style = null) @param @return */ - public function getRequirementErrorMessage(\_HumbugBox5af565a878e76\KevinGH\RequirementChecker\Requirement $requirement) + public function getRequirementErrorMessage(\_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\Requirement $requirement) { if ($requirement->isFulfilled()) { return null; diff --git a/.requirement-checker/src/Requirement.php b/.requirement-checker/src/Requirement.php index aec9a1089..83fe6cbad 100644 --- a/.requirement-checker/src/Requirement.php +++ b/.requirement-checker/src/Requirement.php @@ -1,6 +1,6 @@ requirements[] = $requirement; } @@ -42,7 +42,7 @@ public function add(\_HumbugBox5af565a878e76\KevinGH\RequirementChecker\Requirem */ public function addRequirement($checkIsFulfilled, $testMessage, $helpText) { - $this->add(new \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\Requirement($checkIsFulfilled, $testMessage, $helpText)); + $this->add(new \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\Requirement($checkIsFulfilled, $testMessage, $helpText)); } /** @return @@ -70,7 +70,7 @@ public function evaluateRequirements() @param @return */ - function ($checkPassed, \_HumbugBox5af565a878e76\KevinGH\RequirementChecker\Requirement $requirement) { + function ($checkPassed, \_HumbugBox5b963fb2bb9ba\KevinGH\RequirementChecker\Requirement $requirement) { return $checkPassed && $requirement->isFulfilled(); }, \true diff --git a/.requirement-checker/src/Terminal.php b/.requirement-checker/src/Terminal.php index f45be0d76..0857320c5 100644 --- a/.requirement-checker/src/Terminal.php +++ b/.requirement-checker/src/Terminal.php @@ -1,6 +1,6 @@ array('pipe', 'w'), 2 => array('pipe', 'w')); $process = \proc_open('mode CON', $descriptorspec, $pipes, null, null, array('suppress_errors' => \true)); @@ -76,6 +76,7 @@ private static function getConsoleMode() return array((int) $matches[2], (int) $matches[1]); } } + return null; } /** @return diff --git a/.requirement-checker/vendor/autoload.php b/.requirement-checker/vendor/autoload.php index 05d835449..ecb82b9c0 100644 --- a/.requirement-checker/vendor/autoload.php +++ b/.requirement-checker/vendor/autoload.php @@ -4,17 +4,12 @@ require_once __DIR__ . '/composer/autoload_real.php'; -$loader = ComposerAutoloaderInitb3427d2564583967456f7a16e0a5984c::getLoader(); - - - -// scoper-autoload.php @generated by PhpScoper - - - -class_exists('_HumbugBox5af565a878e76\Composer\Semver\Semver'); - +$loader = ComposerAutoloaderInit049279a73ec758640197b035b4bb6323::getLoader(); +// Whitelist statements @generated by PHP-Scoper +// Aliases for the whitelisted classes. For more information see: +// https://github.com/humbug/php-scoper/blob/master/README.md#class-whitelisting +class_exists('_HumbugBox5b963fb2bb9ba\Composer\Semver\Semver'); return $loader; diff --git a/.requirement-checker/vendor/composer/ClassLoader.php b/.requirement-checker/vendor/composer/ClassLoader.php index dc02dfb11..95f7e0978 100644 --- a/.requirement-checker/vendor/composer/ClassLoader.php +++ b/.requirement-checker/vendor/composer/ClassLoader.php @@ -377,7 +377,7 @@ private function findFileWithExtension($class, $ext) $subPath = $class; while (false !== $lastPos = strrpos($subPath, '\\')) { $subPath = substr($subPath, 0, $lastPos); - $search = $subPath.'\\'; + $search = $subPath . '\\'; if (isset($this->prefixDirsPsr4[$search])) { $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); foreach ($this->prefixDirsPsr4[$search] as $dir) { diff --git a/.requirement-checker/vendor/composer/autoload_classmap.php b/.requirement-checker/vendor/composer/autoload_classmap.php index c993b0a3e..0c107a5f2 100644 --- a/.requirement-checker/vendor/composer/autoload_classmap.php +++ b/.requirement-checker/vendor/composer/autoload_classmap.php @@ -6,21 +6,21 @@ $baseDir = dirname($vendorDir); return array( - '_HumbugBox5af565a878e76\\Composer\\Semver\\Comparator' => $vendorDir . '/composer/semver/src/Comparator.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\Constraint\\AbstractConstraint' => $vendorDir . '/composer/semver/src/Constraint/AbstractConstraint.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\Constraint\\Constraint' => $vendorDir . '/composer/semver/src/Constraint/Constraint.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\Constraint\\ConstraintInterface' => $vendorDir . '/composer/semver/src/Constraint/ConstraintInterface.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\Constraint\\EmptyConstraint' => $vendorDir . '/composer/semver/src/Constraint/EmptyConstraint.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\Constraint\\MultiConstraint' => $vendorDir . '/composer/semver/src/Constraint/MultiConstraint.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\Semver' => $vendorDir . '/composer/semver/src/Semver.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\VersionParser' => $vendorDir . '/composer/semver/src/VersionParser.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\Checker' => $baseDir . '/src/Checker.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\IO' => $baseDir . '/src/IO.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\IsExtensionFulfilled' => $baseDir . '/src/IsExtensionFulfilled.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\IsFulfilled' => $baseDir . '/src/IsFulfilled.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\IsPhpVersionFulfilled' => $baseDir . '/src/IsPhpVersionFulfilled.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\Printer' => $baseDir . '/src/Printer.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\Requirement' => $baseDir . '/src/Requirement.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\RequirementCollection' => $baseDir . '/src/RequirementCollection.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\Terminal' => $baseDir . '/src/Terminal.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Comparator' => $vendorDir . '/composer/semver/src/Comparator.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Constraint\\AbstractConstraint' => $vendorDir . '/composer/semver/src/Constraint/AbstractConstraint.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Constraint\\Constraint' => $vendorDir . '/composer/semver/src/Constraint/Constraint.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Constraint\\ConstraintInterface' => $vendorDir . '/composer/semver/src/Constraint/ConstraintInterface.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Constraint\\EmptyConstraint' => $vendorDir . '/composer/semver/src/Constraint/EmptyConstraint.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Constraint\\MultiConstraint' => $vendorDir . '/composer/semver/src/Constraint/MultiConstraint.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Semver' => $vendorDir . '/composer/semver/src/Semver.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\VersionParser' => $vendorDir . '/composer/semver/src/VersionParser.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\Checker' => $baseDir . '/src/Checker.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\IO' => $baseDir . '/src/IO.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\IsExtensionFulfilled' => $baseDir . '/src/IsExtensionFulfilled.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\IsFulfilled' => $baseDir . '/src/IsFulfilled.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\IsPhpVersionFulfilled' => $baseDir . '/src/IsPhpVersionFulfilled.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\Printer' => $baseDir . '/src/Printer.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\Requirement' => $baseDir . '/src/Requirement.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\RequirementCollection' => $baseDir . '/src/RequirementCollection.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\Terminal' => $baseDir . '/src/Terminal.php', ); diff --git a/.requirement-checker/vendor/composer/autoload_psr4.php b/.requirement-checker/vendor/composer/autoload_psr4.php index ee8d99392..f73b6692c 100644 --- a/.requirement-checker/vendor/composer/autoload_psr4.php +++ b/.requirement-checker/vendor/composer/autoload_psr4.php @@ -6,6 +6,6 @@ $baseDir = dirname($vendorDir); return array( - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\' => array($baseDir . '/src'), - '_HumbugBox5af565a878e76\\Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'), + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\' => array($baseDir . '/src'), + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'), ); diff --git a/.requirement-checker/vendor/composer/autoload_real.php b/.requirement-checker/vendor/composer/autoload_real.php index 8ef5ebb4f..7d33a0eb6 100644 --- a/.requirement-checker/vendor/composer/autoload_real.php +++ b/.requirement-checker/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitb3427d2564583967456f7a16e0a5984c +class ComposerAutoloaderInit049279a73ec758640197b035b4bb6323 { private static $loader; @@ -19,15 +19,15 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitb3427d2564583967456f7a16e0a5984c', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit049279a73ec758640197b035b4bb6323', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInitb3427d2564583967456f7a16e0a5984c', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit049279a73ec758640197b035b4bb6323', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitb3427d2564583967456f7a16e0a5984c::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit049279a73ec758640197b035b4bb6323::getInitializer($loader)); } else { $classMap = require __DIR__ . '/autoload_classmap.php'; if ($classMap) { diff --git a/.requirement-checker/vendor/composer/autoload_static.php b/.requirement-checker/vendor/composer/autoload_static.php index 7950bccd1..2371938f3 100644 --- a/.requirement-checker/vendor/composer/autoload_static.php +++ b/.requirement-checker/vendor/composer/autoload_static.php @@ -4,53 +4,53 @@ namespace Composer\Autoload; -class ComposerStaticInitb3427d2564583967456f7a16e0a5984c +class ComposerStaticInit049279a73ec758640197b035b4bb6323 { public static $prefixLengthsPsr4 = array ( '_' => array ( - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\' => 51, - '_HumbugBox5af565a878e76\\Composer\\Semver\\' => 40, + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\' => 51, + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\' => 40, ), ); public static $prefixDirsPsr4 = array ( - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\' => + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\' => array ( 0 => __DIR__ . '/../..' . '/src', ), - '_HumbugBox5af565a878e76\\Composer\\Semver\\' => + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\' => array ( 0 => __DIR__ . '/..' . '/composer/semver/src', ), ); public static $classMap = array ( - '_HumbugBox5af565a878e76\\Composer\\Semver\\Comparator' => __DIR__ . '/..' . '/composer/semver/src/Comparator.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\Constraint\\AbstractConstraint' => __DIR__ . '/..' . '/composer/semver/src/Constraint/AbstractConstraint.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\Constraint\\Constraint' => __DIR__ . '/..' . '/composer/semver/src/Constraint/Constraint.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\Constraint\\ConstraintInterface' => __DIR__ . '/..' . '/composer/semver/src/Constraint/ConstraintInterface.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\Constraint\\EmptyConstraint' => __DIR__ . '/..' . '/composer/semver/src/Constraint/EmptyConstraint.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\Constraint\\MultiConstraint' => __DIR__ . '/..' . '/composer/semver/src/Constraint/MultiConstraint.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\Semver' => __DIR__ . '/..' . '/composer/semver/src/Semver.php', - '_HumbugBox5af565a878e76\\Composer\\Semver\\VersionParser' => __DIR__ . '/..' . '/composer/semver/src/VersionParser.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\Checker' => __DIR__ . '/../..' . '/src/Checker.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\IO' => __DIR__ . '/../..' . '/src/IO.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\IsExtensionFulfilled' => __DIR__ . '/../..' . '/src/IsExtensionFulfilled.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\IsFulfilled' => __DIR__ . '/../..' . '/src/IsFulfilled.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\IsPhpVersionFulfilled' => __DIR__ . '/../..' . '/src/IsPhpVersionFulfilled.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\Printer' => __DIR__ . '/../..' . '/src/Printer.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\Requirement' => __DIR__ . '/../..' . '/src/Requirement.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\RequirementCollection' => __DIR__ . '/../..' . '/src/RequirementCollection.php', - '_HumbugBox5af565a878e76\\KevinGH\\RequirementChecker\\Terminal' => __DIR__ . '/../..' . '/src/Terminal.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Comparator' => __DIR__ . '/..' . '/composer/semver/src/Comparator.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Constraint\\AbstractConstraint' => __DIR__ . '/..' . '/composer/semver/src/Constraint/AbstractConstraint.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Constraint\\Constraint' => __DIR__ . '/..' . '/composer/semver/src/Constraint/Constraint.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Constraint\\ConstraintInterface' => __DIR__ . '/..' . '/composer/semver/src/Constraint/ConstraintInterface.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Constraint\\EmptyConstraint' => __DIR__ . '/..' . '/composer/semver/src/Constraint/EmptyConstraint.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Constraint\\MultiConstraint' => __DIR__ . '/..' . '/composer/semver/src/Constraint/MultiConstraint.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Semver' => __DIR__ . '/..' . '/composer/semver/src/Semver.php', + '_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\VersionParser' => __DIR__ . '/..' . '/composer/semver/src/VersionParser.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\Checker' => __DIR__ . '/../..' . '/src/Checker.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\IO' => __DIR__ . '/../..' . '/src/IO.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\IsExtensionFulfilled' => __DIR__ . '/../..' . '/src/IsExtensionFulfilled.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\IsFulfilled' => __DIR__ . '/../..' . '/src/IsFulfilled.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\IsPhpVersionFulfilled' => __DIR__ . '/../..' . '/src/IsPhpVersionFulfilled.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\Printer' => __DIR__ . '/../..' . '/src/Printer.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\Requirement' => __DIR__ . '/../..' . '/src/Requirement.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\RequirementCollection' => __DIR__ . '/../..' . '/src/RequirementCollection.php', + '_HumbugBox5b963fb2bb9ba\\KevinGH\\RequirementChecker\\Terminal' => __DIR__ . '/../..' . '/src/Terminal.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitb3427d2564583967456f7a16e0a5984c::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitb3427d2564583967456f7a16e0a5984c::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitb3427d2564583967456f7a16e0a5984c::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit049279a73ec758640197b035b4bb6323::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit049279a73ec758640197b035b4bb6323::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit049279a73ec758640197b035b4bb6323::$classMap; }, null, ClassLoader::class); } diff --git a/.requirement-checker/vendor/composer/semver/src/Comparator.php b/.requirement-checker/vendor/composer/semver/src/Comparator.php index b93469aa9..0a2445ee8 100644 --- a/.requirement-checker/vendor/composer/semver/src/Comparator.php +++ b/.requirement-checker/vendor/composer/semver/src/Comparator.php @@ -1,8 +1,8 @@ matches(new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint('==', $version1)); + $constraint = new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint($operator, $version2); + return $constraint->matches(new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('==', $version1)); } } diff --git a/.requirement-checker/vendor/composer/semver/src/Constraint/AbstractConstraint.php b/.requirement-checker/vendor/composer/semver/src/Constraint/AbstractConstraint.php index 020e1110f..7a6c19856 100644 --- a/.requirement-checker/vendor/composer/semver/src/Constraint/AbstractConstraint.php +++ b/.requirement-checker/vendor/composer/semver/src/Constraint/AbstractConstraint.php @@ -1,9 +1,9 @@ matchSpecific($provider); diff --git a/.requirement-checker/vendor/composer/semver/src/Constraint/Constraint.php b/.requirement-checker/vendor/composer/semver/src/Constraint/Constraint.php index f6200130b..273c062d8 100644 --- a/.requirement-checker/vendor/composer/semver/src/Constraint/Constraint.php +++ b/.requirement-checker/vendor/composer/semver/src/Constraint/Constraint.php @@ -1,8 +1,8 @@ matchSpecific($provider); @@ -103,7 +103,7 @@ public function versionCompare($a, $b, $operator, $compareBranches = \false) @param @return */ - public function matchSpecific(\_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint $provider, $compareBranches = \false) + public function matchSpecific(\_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint $provider, $compareBranches = \false) { $noEqualOp = \str_replace('=', '', self::$transOpInt[$this->operator]); $providerNoEqualOp = \str_replace('=', '', self::$transOpInt[$provider->operator]); diff --git a/.requirement-checker/vendor/composer/semver/src/Constraint/ConstraintInterface.php b/.requirement-checker/vendor/composer/semver/src/Constraint/ConstraintInterface.php index f3574d0a1..67fbf562c 100644 --- a/.requirement-checker/vendor/composer/semver/src/Constraint/ConstraintInterface.php +++ b/.requirement-checker/vendor/composer/semver/src/Constraint/ConstraintInterface.php @@ -1,6 +1,6 @@ conjunctive) { foreach ($this->constraints as $constraint) { diff --git a/.requirement-checker/vendor/composer/semver/src/Semver.php b/.requirement-checker/vendor/composer/semver/src/Semver.php index d2fb213e5..cbe0f1a9a 100644 --- a/.requirement-checker/vendor/composer/semver/src/Semver.php +++ b/.requirement-checker/vendor/composer/semver/src/Semver.php @@ -1,8 +1,8 @@ normalize($version)); + $provider = new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('==', $versionParser->normalize($version)); $constraints = $versionParser->parseConstraints($constraints); return $constraints->matches($provider); } @@ -33,7 +33,7 @@ public static function satisfies($version, $constraints) public static function satisfiedBy(array $versions, $constraints) { $versions = \array_filter($versions, function ($version) use($constraints) { - return \_HumbugBox5af565a878e76\Composer\Semver\Semver::satisfies($version, $constraints); + return \_HumbugBox5b963fb2bb9ba\Composer\Semver\Semver::satisfies($version, $constraints); }); return \array_values($versions); } @@ -61,7 +61,7 @@ public static function rsort(array $versions) private static function usort(array $versions, $direction) { if (null === self::$versionParser) { - self::$versionParser = new \_HumbugBox5af565a878e76\Composer\Semver\VersionParser(); + self::$versionParser = new \_HumbugBox5b963fb2bb9ba\Composer\Semver\VersionParser(); } $versionParser = self::$versionParser; $normalized = array(); @@ -72,7 +72,7 @@ private static function usort(array $versions, $direction) if ($left[0] === $right[0]) { return 0; } - if (\_HumbugBox5af565a878e76\Composer\Semver\Comparator::lessThan($left[0], $right[0])) { + if (\_HumbugBox5b963fb2bb9ba\Composer\Semver\Comparator::lessThan($left[0], $right[0])) { return -$direction; } return $direction; @@ -84,4 +84,4 @@ private static function usort(array $versions, $direction) return $sorted; } } -\class_alias('_HumbugBox5af565a878e76\\Composer\\Semver\\Semver', 'Composer\\Semver\\Semver', \false); +\class_alias('_HumbugBox5b963fb2bb9ba\\Composer\\Semver\\Semver', 'Composer\\Semver\\Semver', \false); diff --git a/.requirement-checker/vendor/composer/semver/src/VersionParser.php b/.requirement-checker/vendor/composer/semver/src/VersionParser.php index 295a789b6..4562f6214 100644 --- a/.requirement-checker/vendor/composer/semver/src/VersionParser.php +++ b/.requirement-checker/vendor/composer/semver/src/VersionParser.php @@ -1,11 +1,11 @@ getConstraints()) && 2 === \count($orGroups[1]->getConstraints()) && ($a = (string) $orGroups[0]) && \substr($a, 0, 3) === '[>=' && \false !== ($posA = \strpos($a, '<', 4)) && ($b = (string) $orGroups[1]) && \substr($b, 0, 3) === '[>=' && \false !== ($posB = \strpos($b, '<', 4)) && \substr($a, $posA + 2, -1) === \substr($b, 4, $posB - 5)) { - $constraint = new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\MultiConstraint(array(new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint('>=', \substr($a, 4, $posA - 5)), new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint('<', \substr($b, $posB + 2, -1)))); + } elseif (2 === \count($orGroups) && $orGroups[0] instanceof \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\MultiConstraint && $orGroups[1] instanceof \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\MultiConstraint && 2 === \count($orGroups[0]->getConstraints()) && 2 === \count($orGroups[1]->getConstraints()) && ($a = (string) $orGroups[0]) && \substr($a, 0, 3) === '[>=' && \false !== ($posA = \strpos($a, '<', 4)) && ($b = (string) $orGroups[1]) && \substr($b, 0, 3) === '[>=' && \false !== ($posB = \strpos($b, '<', 4)) && \substr($a, $posA + 2, -1) === \substr($b, 4, $posB - 5)) { + $constraint = new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\MultiConstraint(array(new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('>=', \substr($a, 4, $posA - 5)), new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('<', \substr($b, $posB + 2, -1)))); } else { - $constraint = new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\MultiConstraint($orGroups, \false); + $constraint = new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\MultiConstraint($orGroups, \false); } $constraint->setPrettyString($prettyConstraint); return $constraint; @@ -199,7 +199,7 @@ private function parseConstraint($constraint) } } if (\preg_match('{^v?[xX*](\\.[xX*])*$}i', $constraint)) { - return array(new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\EmptyConstraint()); + return array(new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\EmptyConstraint()); } $versionRegex = 'v?(\\d++)(?:\\.(\\d++))?(?:\\.(\\d++))?(?:\\.(\\d++))?' . self::$modifierRegex . '(?:\\+[^\\s]+)?'; if (\preg_match('{^~>?' . $versionRegex . '$}i', $constraint, $matches)) { @@ -226,10 +226,10 @@ private function parseConstraint($constraint) $stabilitySuffix = '-dev'; } $lowVersion = $this->manipulateVersionString($matches, $position, 0) . $stabilitySuffix; - $lowerBound = new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint('>=', $lowVersion); + $lowerBound = new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('>=', $lowVersion); $highPosition = \max(1, $position - 1); $highVersion = $this->manipulateVersionString($matches, $highPosition, 1) . '-dev'; - $upperBound = new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint('<', $highVersion); + $upperBound = new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('<', $highVersion); return array($lowerBound, $upperBound); } if (\preg_match('{^\\^' . $versionRegex . '($)}i', $constraint, $matches)) { @@ -245,9 +245,9 @@ private function parseConstraint($constraint) $stabilitySuffix .= '-dev'; } $lowVersion = $this->normalize(\substr($constraint . $stabilitySuffix, 1)); - $lowerBound = new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint('>=', $lowVersion); + $lowerBound = new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('>=', $lowVersion); $highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev'; - $upperBound = new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint('<', $highVersion); + $upperBound = new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('<', $highVersion); return array($lowerBound, $upperBound); } if (\preg_match('{^v?(\\d++)(?:\\.(\\d++))?(?:\\.(\\d++))?(?:\\.[xX*])++$}', $constraint, $matches)) { @@ -261,9 +261,9 @@ private function parseConstraint($constraint) $lowVersion = $this->manipulateVersionString($matches, $position) . '-dev'; $highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev'; if ($lowVersion === '0.0.0.0-dev') { - return array(new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint('<', $highVersion)); + return array(new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('<', $highVersion)); } - return array(new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint('>=', $lowVersion), new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint('<', $highVersion)); + return array(new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('>=', $lowVersion), new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('<', $highVersion)); } if (\preg_match('{^(?P' . $versionRegex . ') +- +(?P' . $versionRegex . ')($)}i', $constraint, $matches)) { $lowStabilitySuffix = ''; @@ -271,17 +271,17 @@ private function parseConstraint($constraint) $lowStabilitySuffix = '-dev'; } $lowVersion = $this->normalize($matches['from']); - $lowerBound = new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint('>=', $lowVersion . $lowStabilitySuffix); + $lowerBound = new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('>=', $lowVersion . $lowStabilitySuffix); $empty = function ($x) { return $x === 0 || $x === '0' ? \false : empty($x); }; if (!$empty($matches[11]) && !$empty($matches[12]) || !empty($matches[14]) || !empty($matches[16])) { $highVersion = $this->normalize($matches['to']); - $upperBound = new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint('<=', $highVersion); + $upperBound = new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('<=', $highVersion); } else { $highMatch = array('', $matches[10], $matches[11], $matches[12], $matches[13]); $highVersion = $this->manipulateVersionString($highMatch, $empty($matches[11]) ? 1 : 2, 1) . '-dev'; - $upperBound = new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint('<', $highVersion); + $upperBound = new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint('<', $highVersion); } return array($lowerBound, $upperBound); } @@ -297,7 +297,7 @@ private function parseConstraint($constraint) } } } - return array(new \_HumbugBox5af565a878e76\Composer\Semver\Constraint\Constraint($matches[1] ?: '=', $version)); + return array(new \_HumbugBox5b963fb2bb9ba\Composer\Semver\Constraint\Constraint($matches[1] ?: '=', $version)); } catch (\Exception $e) { } } diff --git a/Makefile b/Makefile index 1122a2f07..3039f0f3b 100644 --- a/Makefile +++ b/Makefile @@ -76,7 +76,6 @@ tc: bin/phpunit .PHONY: tm tm: ## Runs Infection tm: $(TU_BOX_DEPS) - # TODO: enables it again once the bug found in Infection is fixed $(PHPNOGC) bin/infection .PHONY: e2e diff --git a/composer.json b/composer.json index 06917e063..da5c32151 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "justinrainbow/json-schema": "^5.2", "nikic/iter": "^1.6", "ocramius/package-versions": "^1.3", - "paragonie/pharaoh": "^0.4.0", + "paragonie/pharaoh": "dev-master#45f139d", "phpseclib/phpseclib": "~2.0", "seld/jsonlint": "^1.6", "symfony/console": "^3.4 || ^4.0", diff --git a/composer.lock b/composer.lock index b65fdc7c5..4d0ccf960 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fa428902e68ee386ac39e3badbec57f0", + "content-hash": "024a3cdadee8bf0a94ac74f91981f885", "packages": [ { "name": "amphp/amp", @@ -469,16 +469,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169" + "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/d2c0a83b7533d6912e8d516756ebd34f893e9169", - "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/46afded9720f40b9dc63542af4e3e43a1177acb0", + "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0", "shasum": "" }, "require": { @@ -521,20 +521,20 @@ "ssl", "tls" ], - "time": "2018-03-29T19:57:20+00:00" + "time": "2018-08-08T08:57:40+00:00" }, { "name": "composer/composer", - "version": "1.7.0", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "39edb2f375679a4eba19e69e9c9491e302976983" + "reference": "576aab9b5abb2ed11a1c52353a759363216a4ad2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/39edb2f375679a4eba19e69e9c9491e302976983", - "reference": "39edb2f375679a4eba19e69e9c9491e302976983", + "url": "https://api.github.com/repos/composer/composer/zipball/576aab9b5abb2ed11a1c52353a759363216a4ad2", + "reference": "576aab9b5abb2ed11a1c52353a759363216a4ad2", "shasum": "" }, "require": { @@ -601,7 +601,7 @@ "dependency", "package" ], - "time": "2018-08-03T13:39:07+00:00" + "time": "2018-08-16T14:57:12+00:00" }, { "name": "composer/semver", @@ -728,16 +728,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.1.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08" + "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/c919dc6c62e221fc6406f861ea13433c0aa24f08", - "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/b8e9745fb9b06ea6664d8872c4505fb16df4611c", + "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c", "shasum": "" }, "require": { @@ -768,7 +768,7 @@ "Xdebug", "performance" ], - "time": "2018-04-11T15:42:36+00:00" + "time": "2018-08-31T19:07:57+00:00" }, { "name": "doctrine/annotations", @@ -948,16 +948,16 @@ }, { "name": "humbug/php-scoper", - "version": "0.9.0", + "version": "0.9.2", "source": { "type": "git", "url": "https://github.com/humbug/php-scoper.git", - "reference": "1576510eaa9ea4b65131176f1bb13ed573e7223f" + "reference": "f595614c73243fa084caa30a6e75f2442277e631" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/humbug/php-scoper/zipball/1576510eaa9ea4b65131176f1bb13ed573e7223f", - "reference": "1576510eaa9ea4b65131176f1bb13ed573e7223f", + "url": "https://api.github.com/repos/humbug/php-scoper/zipball/f595614c73243fa084caa30a6e75f2442277e631", + "reference": "f595614c73243fa084caa30a6e75f2442277e631", "shasum": "" }, "require": { @@ -974,7 +974,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.1", - "humbug/box": "^3.0@beta", + "humbug/box": "^3.0@rc", "phpunit/phpunit": "^7.0" }, "bin": [ @@ -1007,7 +1007,7 @@ "email": "bschussek@gmail.com" }, { - "name": "Théo Fidry", + "name": "Théo FIDRY", "email": "theo.fidry@gmail.com" }, { @@ -1016,7 +1016,7 @@ } ], "description": "Prefixes all PHP namespaces in a file or directory.", - "time": "2018-08-03T20:32:17+00:00" + "time": "2018-08-10T11:35:57+00:00" }, { "name": "justinrainbow/json-schema", @@ -1349,16 +1349,16 @@ }, { "name": "paragonie/pharaoh", - "version": "v0.4.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/paragonie/pharaoh.git", - "reference": "e2a17756a5eee892ac09ee6d29f64d717ef8713e" + "reference": "45f139d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/pharaoh/zipball/e2a17756a5eee892ac09ee6d29f64d717ef8713e", - "reference": "e2a17756a5eee892ac09ee6d29f64d717ef8713e", + "url": "https://api.github.com/repos/paragonie/pharaoh/zipball/45f139d", + "reference": "45f139d", "shasum": "" }, "require": { @@ -1400,7 +1400,7 @@ "tool", "utility" ], - "time": "2018-08-04T18:01:48+00:00" + "time": "2018-08-05T14:34:39+00:00" }, { "name": "paragonie/random_compat", @@ -1454,16 +1454,16 @@ }, { "name": "paragonie/sodium_compat", - "version": "v1.6.3", + "version": "v1.6.4", "source": { "type": "git", "url": "https://github.com/paragonie/sodium_compat.git", - "reference": "7d0549c3947eaea620f4e523f42ab236cf7fd304" + "reference": "3f2fd07977541b4d630ea0365ad0eceddee5179c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/7d0549c3947eaea620f4e523f42ab236cf7fd304", - "reference": "7d0549c3947eaea620f4e523f42ab236cf7fd304", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/3f2fd07977541b4d630ea0365ad0eceddee5179c", + "reference": "3f2fd07977541b4d630ea0365ad0eceddee5179c", "shasum": "" }, "require": { @@ -1532,7 +1532,7 @@ "secret-key cryptography", "side-channel resistant" ], - "time": "2018-06-06T17:30:29+00:00" + "time": "2018-08-29T22:02:48+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -2020,7 +2020,7 @@ }, { "name": "symfony/console", - "version": "v4.1.3", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", @@ -2088,16 +2088,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.1.3", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "2e30335e0aafeaa86645555959572fe7cea22b43" + "reference": "c0f5f62db218fa72195b8b8700e4b9b9cf52eb5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/2e30335e0aafeaa86645555959572fe7cea22b43", - "reference": "2e30335e0aafeaa86645555959572fe7cea22b43", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/c0f5f62db218fa72195b8b8700e4b9b9cf52eb5e", + "reference": "c0f5f62db218fa72195b8b8700e4b9b9cf52eb5e", "shasum": "" }, "require": { @@ -2134,11 +2134,11 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:24:31+00:00" + "time": "2018-08-18T16:52:46+00:00" }, { "name": "symfony/finder", - "version": "v4.1.3", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2187,25 +2187,28 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "suggest": { + "ext-ctype": "For best performance" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -2238,20 +2241,20 @@ "polyfill", "portable" ], - "time": "2018-04-30T19:57:29+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "3296adf6a6454a050679cde90f95350ad604b171" + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", - "reference": "3296adf6a6454a050679cde90f95350ad604b171", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", "shasum": "" }, "require": { @@ -2263,7 +2266,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -2297,20 +2300,20 @@ "portable", "shim" ], - "time": "2018-04-26T10:06:28+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46" + "reference": "95c50420b0baed23852452a7f0c7b527303ed5ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/a4576e282d782ad82397f3e4ec1df8e0f0cafb46", - "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/95c50420b0baed23852452a7f0c7b527303ed5ae", + "reference": "95c50420b0baed23852452a7f0c7b527303ed5ae", "shasum": "" }, "require": { @@ -2319,7 +2322,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -2352,20 +2355,20 @@ "portable", "shim" ], - "time": "2018-04-26T10:06:28+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/process", - "version": "v4.1.3", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "f01fc7a4493572f7f506c49dcb50ad01fb3a2f56" + "reference": "86cdb930a6a855b0ab35fb60c1504cb36184f843" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/f01fc7a4493572f7f506c49dcb50ad01fb3a2f56", - "reference": "f01fc7a4493572f7f506c49dcb50ad01fb3a2f56", + "url": "https://api.github.com/repos/symfony/process/zipball/86cdb930a6a855b0ab35fb60c1504cb36184f843", + "reference": "86cdb930a6a855b0ab35fb60c1504cb36184f843", "shasum": "" }, "require": { @@ -2401,20 +2404,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:24:31+00:00" + "time": "2018-08-03T11:13:38+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.1.3", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "69e174f4c02ec43919380171c6f7550753299316" + "reference": "a05426e27294bba7b0226ffc17dd01a3c6ef9777" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/69e174f4c02ec43919380171c6f7550753299316", - "reference": "69e174f4c02ec43919380171c6f7550753299316", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/a05426e27294bba7b0226ffc17dd01a3c6ef9777", + "reference": "a05426e27294bba7b0226ffc17dd01a3c6ef9777", "shasum": "" }, "require": { @@ -2476,20 +2479,20 @@ "debug", "dump" ], - "time": "2018-07-26T11:24:31+00:00" + "time": "2018-08-02T09:24:26+00:00" }, { "name": "ulrichsg/getopt-php", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/getopt-php/getopt-php.git", - "reference": "7e95ab48bd75c595092e1a032a0809f9e1112e8f" + "reference": "6d22d6febd672954bf1b9676a4833489c5509116" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getopt-php/getopt-php/zipball/7e95ab48bd75c595092e1a032a0809f9e1112e8f", - "reference": "7e95ab48bd75c595092e1a032a0809f9e1112e8f", + "url": "https://api.github.com/repos/getopt-php/getopt-php/zipball/6d22d6febd672954bf1b9676a4833489c5509116", + "reference": "6d22d6febd672954bf1b9676a4833489c5509116", "shasum": "" }, "require": { @@ -2522,7 +2525,7 @@ ], "description": "Command line arguments parser for PHP 5.4 - 7.1", "homepage": "http://getopt-php.github.io/getopt-php", - "time": "2018-05-31T10:50:50+00:00" + "time": "2018-08-17T04:48:55+00:00" }, { "name": "webmozart/assert", @@ -2717,16 +2720,16 @@ }, { "name": "infection/infection", - "version": "0.9.2", + "version": "0.9.3", "source": { "type": "git", "url": "https://github.com/infection/infection.git", - "reference": "845ea76da4abf7b2b47d4ba1ae7aa019f2911e7d" + "reference": "98de6f13821c88dd671257d27cc7dcbca0409d2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infection/infection/zipball/845ea76da4abf7b2b47d4ba1ae7aa019f2911e7d", - "reference": "845ea76da4abf7b2b47d4ba1ae7aa019f2911e7d", + "url": "https://api.github.com/repos/infection/infection/zipball/98de6f13821c88dd671257d27cc7dcbca0409d2d", + "reference": "98de6f13821c88dd671257d27cc7dcbca0409d2d", "shasum": "" }, "require": { @@ -2798,7 +2801,7 @@ "testing", "unit testing" ], - "time": "2018-08-02T19:21:39+00:00" + "time": "2018-08-09T04:45:18+00:00" }, { "name": "mikey179/vfsStream", @@ -3431,16 +3434,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.3.0", + "version": "7.3.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0b6b29faf95c03fd7867e866438b78d5692b6f03" + "reference": "7b331efabbb628c518c408fdfcaf571156775de2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0b6b29faf95c03fd7867e866438b78d5692b6f03", - "reference": "0b6b29faf95c03fd7867e866438b78d5692b6f03", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7b331efabbb628c518c408fdfcaf571156775de2", + "reference": "7b331efabbb628c518c408fdfcaf571156775de2", "shasum": "" }, "require": { @@ -3511,7 +3514,7 @@ "testing", "xunit" ], - "time": "2018-08-03T06:02:45+00:00" + "time": "2018-09-08T15:14:29+00:00" }, { "name": "pimple/pimple", @@ -4177,16 +4180,16 @@ }, { "name": "symfony/yaml", - "version": "v4.1.3", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "46bc69aa91fc4ab78a96ce67873a6b0c148fd48c" + "reference": "b832cc289608b6d305f62149df91529a2ab3c314" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/46bc69aa91fc4ab78a96ce67873a6b0c148fd48c", - "reference": "46bc69aa91fc4ab78a96ce67873a6b0c148fd48c", + "url": "https://api.github.com/repos/symfony/yaml/zipball/b832cc289608b6d305f62149df91529a2ab3c314", + "reference": "b832cc289608b6d305f62149df91529a2ab3c314", "shasum": "" }, "require": { @@ -4232,7 +4235,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:24:31+00:00" + "time": "2018-08-18T16:52:46+00:00" }, { "name": "theseer/tokenizer", @@ -4277,7 +4280,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "paragonie/pharaoh": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/fixtures/Compactor/DummyFileExtensionCompactor.php b/fixtures/Compactor/DummyFileExtensionCompactor.php index 1ac353d88..40b9adfc7 100644 --- a/fixtures/Compactor/DummyFileExtensionCompactor.php +++ b/fixtures/Compactor/DummyFileExtensionCompactor.php @@ -15,6 +15,7 @@ namespace KevinGH\Box\Compactor; use KevinGH\Box\NotCallable; +use function func_get_args; class DummyFileExtensionCompactor extends FileExtensionCompactor { diff --git a/fixtures/Compactor/FakeCompactor.php b/fixtures/Compactor/FakeCompactor.php index 4e6945607..a131c3e31 100644 --- a/fixtures/Compactor/FakeCompactor.php +++ b/fixtures/Compactor/FakeCompactor.php @@ -16,6 +16,7 @@ use KevinGH\Box\Compactor; use KevinGH\Box\NotCallable; +use function func_get_args; class FakeCompactor implements Compactor { diff --git a/fixtures/PhpScoper/FakePhpScoper.php b/fixtures/PhpScoper/FakePhpScoper.php index d802bf60b..2dc9d70f2 100644 --- a/fixtures/PhpScoper/FakePhpScoper.php +++ b/fixtures/PhpScoper/FakePhpScoper.php @@ -17,6 +17,7 @@ use Humbug\PhpScoper\Scoper; use Humbug\PhpScoper\Whitelist; use KevinGH\Box\NotCallable; +use function func_get_args; final class FakePhpScoper implements Scoper { diff --git a/fixtures/PhpScoper/FakeScoper.php b/fixtures/PhpScoper/FakeScoper.php index 3fedf7724..c1c4ba068 100644 --- a/fixtures/PhpScoper/FakeScoper.php +++ b/fixtures/PhpScoper/FakeScoper.php @@ -16,6 +16,7 @@ use Humbug\PhpScoper\Whitelist; use KevinGH\Box\NotCallable; +use function func_get_args; final class FakeScoper implements Scoper { diff --git a/requirement-checker/src/Checker.php b/requirement-checker/src/Checker.php index b5c6408f3..ae7586d26 100644 --- a/requirement-checker/src/Checker.php +++ b/requirement-checker/src/Checker.php @@ -132,6 +132,7 @@ private static function retrieveRequirements() self::$requirementsConfig = __DIR__.'/../.requirements.php'; } + /** @var string[] $config */ $config = require self::$requirementsConfig; $requirements = new RequirementCollection(); diff --git a/requirement-checker/src/IO.php b/requirement-checker/src/IO.php index b73dca6c7..4d0340c22 100644 --- a/requirement-checker/src/IO.php +++ b/requirement-checker/src/IO.php @@ -101,7 +101,7 @@ private function checkInteractivity($shellVerbosity) return false; } - if (function_exists('posix_isatty')) { + if (\function_exists('posix_isatty')) { if (!@posix_isatty(STDOUT) && false === \getenv('SHELL_INTERACTIVE')) { return false; } @@ -178,7 +178,7 @@ private function checkColorSupport() if (\DIRECTORY_SEPARATOR === '\\') { return ( - function_exists('sapi_windows_vt100_support') + \function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(STDOUT) ) || false !== getenv('ANSICON') @@ -186,11 +186,11 @@ function_exists('sapi_windows_vt100_support') || 'xterm' === getenv('TERM'); } - if (function_exists('stream_isatty')) { + if (\function_exists('stream_isatty')) { return stream_isatty(STDOUT); } - if (function_exists('posix_isatty')) { + if (\function_exists('posix_isatty')) { return posix_isatty(STDOUT); } diff --git a/requirement-checker/src/Printer.php b/requirement-checker/src/Printer.php index 3cee0e5b0..76a239a29 100644 --- a/requirement-checker/src/Printer.php +++ b/requirement-checker/src/Printer.php @@ -79,7 +79,7 @@ public function title($title, $verbosity, $style = null) $this->printvln( str_repeat( '=', - min(strlen($title), $this->width) + min(\strlen($title), $this->width) ), $verbosity, $style @@ -118,14 +118,14 @@ public function block($title, $message, $verbosity, $style = null) $remainingMessage = $message; - while (strlen($remainingMessage) > 0) { + while (\strlen($remainingMessage) > 0) { $wrapped = wordwrap($remainingMessage, $this->width - 3, '¬'); $exploded = explode('¬', $wrapped); $line = $exploded[0]; - $remainingMessage = ltrim(substr($remainingMessage, strlen($line))); + $remainingMessage = ltrim(substr($remainingMessage, \strlen($line))); - if (strlen($remainingMessage) > 0) { - $remainingMessage = str_repeat(' ', strlen($prefix)).$remainingMessage; + if (\strlen($remainingMessage) > 0) { + $remainingMessage = str_repeat(' ', \strlen($prefix)).$remainingMessage; } $lines[] = str_pad($line, $this->width, ' ', STR_PAD_RIGHT); diff --git a/requirement-checker/src/Requirement.php b/requirement-checker/src/Requirement.php index 2f01536cd..f8ef40bc5 100644 --- a/requirement-checker/src/Requirement.php +++ b/requirement-checker/src/Requirement.php @@ -41,6 +41,9 @@ public function __construct( $this->helpText = $helpText; } + /** + * @return bool + */ public function isFulfilled() { if (null === $this->fulfilled) { @@ -51,7 +54,7 @@ public function isFulfilled() } /** - * @return string + * @return IsFulfilled */ public function getIsFullfilledChecker() { diff --git a/requirement-checker/src/RequirementCollection.php b/requirement-checker/src/RequirementCollection.php index b753dae80..e8391f949 100644 --- a/requirement-checker/src/RequirementCollection.php +++ b/requirement-checker/src/RequirementCollection.php @@ -46,7 +46,7 @@ public function getIterator() */ public function count() { - return count($this->requirements); + return \count($this->requirements); } /** @@ -60,10 +60,10 @@ public function add(Requirement $requirement) /** * Adds a mandatory requirement evaluated lazily. * - * @param string $checkIsFulfilled whether the requirement is fulfilled; This string is will be evaluated with `eval()` because - * PHP does not support the serialization or the export of closures - * @param string $testMessage The message for testing the requirement - * @param string $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + * @param IsFulfilled $checkIsFulfilled whether the requirement is fulfilled; This string is will be evaluated with `eval()` because + * PHP does not support the serialization or the export of closures + * @param string $testMessage The message for testing the requirement + * @param string $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) */ public function addRequirement($checkIsFulfilled, $testMessage, $helpText) { diff --git a/requirement-checker/tests/RequirementCollectionTest.php b/requirement-checker/tests/RequirementCollectionTest.php index f970eb9ad..027724dcb 100644 --- a/requirement-checker/tests/RequirementCollectionTest.php +++ b/requirement-checker/tests/RequirementCollectionTest.php @@ -77,7 +77,7 @@ public function test_it_can_have_and_evaluate_requirements(): void $requirementC = $retrievedRequirements[2]; $this->assertSame($check, $requirementC->getIsFullfilledChecker()); - $this->assertTrue($requirement->isFulfilled()); + $this->assertFalse($requirementC->isFulfilled()); $this->assertSame('req tC', $requirementC->getTestMessage()); $this->assertSame('req hC', $requirementC->getHelpText()); } diff --git a/src/Box.php b/src/Box.php index 80df21d48..4ad10d3ac 100644 --- a/src/Box.php +++ b/src/Box.php @@ -31,9 +31,11 @@ use function array_map; use function array_unshift; use function chdir; +use function dirname; use function extension_loaded; use function file_exists; use function getcwd; +use function is_object; use function KevinGH\Box\FileSystem\dump_file; use function KevinGH\Box\FileSystem\file_contents; use function KevinGH\Box\FileSystem\make_tmp_dir; diff --git a/src/Compactor/FileExtensionCompactor.php b/src/Compactor/FileExtensionCompactor.php index 4042a0350..992910704 100644 --- a/src/Compactor/FileExtensionCompactor.php +++ b/src/Compactor/FileExtensionCompactor.php @@ -15,6 +15,7 @@ namespace KevinGH\Box\Compactor; use Assert\Assertion; +use function in_array; /** * An abstract compactor class that handles matching supported file by their types. diff --git a/src/Compactor/Php.php b/src/Compactor/Php.php index af89a0f67..42330fcad 100644 --- a/src/Compactor/Php.php +++ b/src/Compactor/Php.php @@ -19,6 +19,9 @@ use Herrera\Annotations\Convert\ToString; use Herrera\Annotations\Tokenizer; use Herrera\Annotations\Tokens; +use function count; +use function in_array; +use function is_string; /** * A PHP source code compactor copied from Composer. diff --git a/src/Composer/ComposerOrchestrator.php b/src/Composer/ComposerOrchestrator.php index a6d99df5d..d8119baad 100644 --- a/src/Composer/ComposerOrchestrator.php +++ b/src/Composer/ComposerOrchestrator.php @@ -21,7 +21,6 @@ use RuntimeException; use Throwable; use const PHP_EOL; -use function count; use function KevinGH\Box\FileSystem\dump_file; use function KevinGH\Box\FileSystem\file_contents; use function preg_replace; @@ -74,7 +73,7 @@ public static function dumpAutoload(Whitelist $whitelist, string $prefix): void private static function generateAutoloadStatements(Whitelist $whitelist, string $prefix, string $autoload): string { - if (0 === count($whitelist->getClassWhitelistArray())) { + if ([] === $whitelist->toArray()) { return $autoload; } diff --git a/src/Configuration.php b/src/Configuration.php index f8f13c2c7..d7404d09d 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -21,6 +21,8 @@ use Herrera\Annotations\Tokenizer; use Herrera\Box\Compactor\Php as LegacyPhp; use Humbug\PhpScoper\Configuration as PhpScoperConfiguration; +use Humbug\PhpScoper\Console\ApplicationFactory; +use Humbug\PhpScoper\Scoper; use InvalidArgumentException; use KevinGH\Box\Compactor\Php; use KevinGH\Box\Compactor\PhpScoper as PhpScoperCompactor; @@ -42,12 +44,17 @@ use function array_map; use function array_merge; use function array_unique; +use function constant; +use function defined; +use function dirname; use function file_exists; -use function Humbug\PhpScoper\create_scoper; +use function in_array; +use function intval; use function is_array; use function is_bool; use function is_file; use function is_link; +use function is_object; use function is_readable; use function is_string; use function iter\fn\method; @@ -1315,7 +1322,12 @@ function (string $class) use ($raw, $basePath): Compactor { return new PhpScoperCompactor( new SimpleScoper( - create_scoper(), + (new class() extends ApplicationFactory { + public static function createScoper(): Scoper + { + return parent::createScoper(); + } + })::createScoper(), $prefix, $phpScoperConfig->getWhitelist(), $phpScoperConfig->getPatchers() diff --git a/src/Console/Command/Compile.php b/src/Console/Command/Compile.php index 06dfb8a1f..6bb06ab55 100644 --- a/src/Console/Command/Compile.php +++ b/src/Console/Command/Compile.php @@ -51,6 +51,7 @@ use function function_exists; use function get_class; use function implode; +use function is_string; use function KevinGH\Box\disable_parallel_processing; use function KevinGH\Box\FileSystem\chmod; use function KevinGH\Box\FileSystem\dump_file; diff --git a/src/Console/Command/Diff.php b/src/Console/Command/Diff.php index 86f42d8b6..910892177 100644 --- a/src/Console/Command/Diff.php +++ b/src/Console/Command/Diff.php @@ -27,7 +27,6 @@ use Symfony\Component\Console\Style\SymfonyStyle; use Throwable; use function array_map; -use function KevinGH\Box\FileSystem\remove; /** * @private @@ -100,17 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int function (string $path): Pharaoh { $path = false !== realpath($path) ? realpath($path) : $path; - return new class($path) extends Pharaoh { - // TODO: remove this once https://github.com/paragonie/pharaoh/pull/9 is merged - public function __destruct() - { - $path = $this->phar->getPath(); - - unset($this->phar); - - \Phar::unlinkArchive($path); - } - }; + return new Pharaoh($path); }, $paths ) diff --git a/src/Console/Command/Verify.php b/src/Console/Command/Verify.php index 101c2ab16..57ea81ec6 100644 --- a/src/Console/Command/Verify.php +++ b/src/Console/Command/Verify.php @@ -88,6 +88,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int $tmpPharPath = $this->createTemporaryPhar($pharPath); + $verified = false; + $signature = null; + $throwable = null; + try { $phar = new Phar($tmpPharPath); @@ -95,17 +99,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int $signature = $phar->getSignature(); } catch (Throwable $throwable) { // Continue - - $verified = false; - $signature = null; } finally { if ($tmpPharPath !== $pharPath) { remove($tmpPharPath); } } - if (false === $verified) { - isset($throwable) && '' !== $message = $throwable->getMessage() + if (false === $verified || null === $signature) { + $message = null !== $throwable && '' !== $throwable->getMessage() ? $throwable->getMessage() : 'Unknown reason.' ; @@ -117,7 +118,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int ) ); - if (isset($throwable) && $output->isDebug()) { + if (null !== $throwable && $output->isDebug()) { throw $throwable; } diff --git a/src/FileSystem/FileSystem.php b/src/FileSystem/FileSystem.php index a72fd43ef..67eec8999 100644 --- a/src/FileSystem/FileSystem.php +++ b/src/FileSystem/FileSystem.php @@ -15,10 +15,14 @@ namespace KevinGH\Box\FileSystem; use Assert\Assertion; +use FilesystemIterator; use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem; +use Traversable; use Webmozart\PathUtil\Path; use const DIRECTORY_SEPARATOR; +use function defined; +use function is_array; /** * @author Fabien Potencier @@ -485,13 +489,19 @@ public function makeTmpDir(string $namespace, string $className): string $systemTempDir = str_replace('\\', '/', realpath(sys_get_temp_dir())); $basePath = $systemTempDir.'/'.$namespace.'/'.$shortClass; + $result = false; $attempts = 0; do { $tmpDir = $this->escapePath($basePath.random_int(10000, 99999)); - $result = $this->mkdir($tmpDir, 0777, true); - ++$attempts; + try { + $this->mkdir($tmpDir, 0777); + + $result = true; + } catch (IOException $exception) { + ++$attempts; + } } while (false === $result && $attempts <= 10); return $tmpDir; @@ -506,7 +516,7 @@ public function makeTmpDir(string $namespace, string $className): string */ public function remove($files): void { - if ($files instanceof \Traversable) { + if ($files instanceof Traversable) { $files = iterator_to_array($files, false); } elseif (!is_array($files)) { $files = [$files]; @@ -526,7 +536,7 @@ public function remove($files): void throw new IOException(sprintf('Failed to remove symlink "%s": %s.', $file, $error['message'])); } } elseif (is_dir($file)) { - $this->remove(new \FilesystemIterator($file, \FilesystemIterator::CURRENT_AS_PATHNAME | \FilesystemIterator::SKIP_DOTS)); + $this->remove(new FilesystemIterator($file, FilesystemIterator::CURRENT_AS_PATHNAME | FilesystemIterator::SKIP_DOTS)); if (!@rmdir($file) && file_exists($file)) { $error = error_get_last(); diff --git a/src/functions.php b/src/functions.php index d5d1d5e0c..f3d31e16a 100644 --- a/src/functions.php +++ b/src/functions.php @@ -21,6 +21,7 @@ use function define; use function defined; use function sprintf; +use function strlen; /** * TODO: this function should be pushed down to the PHAR extension. diff --git a/tests/BoxTest.php b/tests/BoxTest.php index eec917dd2..4bb5f5828 100644 --- a/tests/BoxTest.php +++ b/tests/BoxTest.php @@ -33,6 +33,7 @@ use function array_filter; use function array_keys; use function current; +use function dirname; use function extension_loaded; use function file_put_contents; use function in_array; diff --git a/tests/Compactor/BaseCompactorTest.php b/tests/Compactor/BaseCompactorTest.php index 8d659a109..eb81db698 100644 --- a/tests/Compactor/BaseCompactorTest.php +++ b/tests/Compactor/BaseCompactorTest.php @@ -16,6 +16,7 @@ use KevinGH\Box\Compactor\BaseCompactor; use PHPUnit\Framework\TestCase; +use function func_get_args; /** * @covers \KevinGH\Box\Compactor\BaseCompactor diff --git a/tests/Compactor/FileExtensionCompactorTest.php b/tests/Compactor/FileExtensionCompactorTest.php index d7a93b2c2..2f67605e9 100644 --- a/tests/Compactor/FileExtensionCompactorTest.php +++ b/tests/Compactor/FileExtensionCompactorTest.php @@ -16,6 +16,7 @@ use KevinGH\Box\Compactor\FileExtensionCompactor; use PHPUnit\Framework\TestCase; +use function func_get_args; /** * @covers \KevinGH\Box\Compactor\FileExtensionCompactor diff --git a/tests/ConfigurationFileNoConfigTest.php b/tests/ConfigurationFileNoConfigTest.php index a9e35ea70..bd4ea1cf7 100644 --- a/tests/ConfigurationFileNoConfigTest.php +++ b/tests/ConfigurationFileNoConfigTest.php @@ -15,6 +15,7 @@ namespace KevinGH\Box; use InvalidArgumentException; +use const PHP_OS_FAMILY; use function file_put_contents; use function KevinGH\Box\FileSystem\dump_file; use function KevinGH\Box\FileSystem\remove; @@ -364,7 +365,10 @@ public function test_it_ignores_the_most_common_non_needed_files_when_guess_the_ { // Depending on the test machine: the following command might be needed: // docker run -i --rm -w /opt/box -v "$PWD":/opt/box box_php72 bin/phpunit tests/ConfigurationFileNoConfigTest.php --filter test_it_ignores_the_most_common_non_needed_files_when_guess_the_files_from_the_composer_json_file - // Indeed OSX is case insensitive... + + if ('Darwin' === PHP_OS_FAMILY) { + $this->markTestSkipped('Cannot run this test on OSX since it is case insensitive.'); + } touch('main.php~'); touch('main.php.back'); diff --git a/tests/Console/Command/CompileTest.php b/tests/Console/Command/CompileTest.php index 4cc6c698e..68a9a88ab 100644 --- a/tests/Console/Command/CompileTest.php +++ b/tests/Console/Command/CompileTest.php @@ -23,6 +23,7 @@ use KevinGH\Box\Test\RequiresPharReadonlyOff; use Phar; use PharFileInfo; +use function substr; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tester\CommandTester; @@ -37,11 +38,13 @@ use function KevinGH\Box\FileSystem\file_contents; use function KevinGH\Box\FileSystem\mirror; use function KevinGH\Box\FileSystem\rename; +use function phpversion; use function preg_match; use function preg_replace; use function sort; use function sprintf; use function str_replace; +use function strlen; /** * @covers \KevinGH\Box\Console\Command\Compile @@ -993,11 +996,17 @@ public function test_it_can_build_a_PHAR_file_in_debug_mode(): void ] ); - $xdebugLog = extension_loaded('xdebug') - ? '[debug] The xdebug extension is loaded (2.6.0) -[debug] No restart (BOX_ALLOW_XDEBUG=1)' - : '[debug] The xdebug extension is not loaded' - ; + if (extension_loaded('xdebug')) { + $xdebugVersion = sprintf( + '(%s)', + phpversion('xdebug') + ); + + $xdebugLog = "[debug] The xdebug extension is loaded $xdebugVersion +[debug] No restart (BOX_ALLOW_XDEBUG=1)"; + } else { + $xdebugLog = '[debug] The xdebug extension is not loaded'; + } $expected = <<