Skip to content

Commit

Permalink
Make it work on >PHP 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Théo FIDRY authored and theofidry committed Oct 9, 2017
1 parent 6e22b3c commit d98edbd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
14 changes: 11 additions & 3 deletions bin/php-scoper
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use Humbug\PhpScoper\Autoload\Requirements;
use RuntimeException;
use Symfony\Requirements\Requirement;

$autoload = (function () {
$findAutoload = function () {
if (file_exists($autoload = __DIR__.'/../../../autoload.php')) {
// Is installed via composer
return $autoload;
Expand All @@ -33,7 +33,9 @@ $autoload = (function () {
}

throw new RuntimeException('Unable to find the Composer or PHP-Scoper autoloader.');
})();
};

$autoload = $findAutoload();

require_once $autoload;

Expand All @@ -56,12 +58,18 @@ $isVeryVerbose = array_reduce(
false
);

if ('phar:' === substr(__FILE__, 0, 5)) {
//if ('phar:' === substr(__FILE__, 0, 5)) {
$checkPassed = check_requirements($autoload, $isVeryVerbose);

if (false === $checkPassed) {
exit(1);
}
//}

require __DIR__.'/../src/functions.php';

if (file_exists(__DIR__.'/../tests/functions.php')) {
require __DIR__.'/../tests/functions.php';
}

$app = create_application();
Expand Down
8 changes: 2 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,13 @@
"Humbug\\PhpScoper\\": "src/"
},
"files": [
"src/check.php",
"src/functions.php"
"src/check.php"
]
},
"autoload-dev": {
"psr-4": {
"Humbug\\PhpScoper\\": "tests/"
},
"files": [
"tests/functions.php"
]
}
},

"config": {
Expand Down
2 changes: 0 additions & 2 deletions src/check.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/*
* This file is part of the humbug/php-scoper package.
*
Expand Down

0 comments on commit d98edbd

Please sign in to comment.