Skip to content

Commit

Permalink
Fix #748 - correct paths that stopped working
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed May 30, 2018
1 parent 1858772 commit fabe60a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion box.json.dist
Expand Up @@ -12,5 +12,5 @@
"KevinGH\\Box\\Compactor\\PhpScoper"
],
"chmod" : "0755",
"compression": "GZ"
"compression": "NONE"
}
22 changes: 11 additions & 11 deletions scoper.inc.php
Expand Up @@ -6,7 +6,7 @@ function ($filePath, $prefix, $contents) {
//
// PHP-Parser patch
//
if ($filePath === realpath(__DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php')) {
if ($filePath === 'vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php') {
$length = 15 + strlen($prefix) + 1;

return preg_replace(
Expand All @@ -26,7 +26,7 @@ function ($filePath, $prefix, $contents) {
);
},
function ($filePath, $prefix, $contents) {
if ($filePath === realpath(__DIR__ . '/src/Psalm/Config.php')) {
if ($filePath === 'src/Psalm/Config.php') {
return str_replace(
$prefix . '\Composer\Autoload\ClassLoader',
'Composer\Autoload\ClassLoader',
Expand All @@ -37,7 +37,7 @@ function ($filePath, $prefix, $contents) {
return $contents;
},
function ($filePath, $prefix, $contents) {
if (strpos($filePath, realpath(__DIR__ . '/src/Psalm')) === 0) {
if (strpos($filePath, 'src/Psalm') === 0) {
return str_replace(
[' \\Psalm\\', ' \\PhpParser\\'],
[' \\' . $prefix . '\\Psalm\\', ' \\' . $prefix . '\\PhpParser\\'],
Expand All @@ -48,7 +48,7 @@ function ($filePath, $prefix, $contents) {
return $contents;
},
function ($filePath, $prefix, $contents) {
if (strpos($filePath, realpath(__DIR__ . '/vendor/openlss')) === 0) {
if (strpos($filePath, 'vendor/openlss') === 0) {
return str_replace(
$prefix . '\\DomDocument',
'DomDocument',
Expand All @@ -59,10 +59,10 @@ function ($filePath, $prefix, $contents) {
return $contents;
},
function ($filePath, $prefix, $contents) {
if ($filePath === realpath(__DIR__ . '/src/Psalm/PropertyMap.php')
|| $filePath === realpath(__DIR__ . '/src/Psalm/CallMap.php')
|| $filePath === realpath(__DIR__ . '/src/Psalm/Stubs/CoreGenericFunctions.php')
|| $filePath === realpath(__DIR__ . '/src/Psalm/Stubs/CoreGenericClasses.php')
if ($filePath === 'src/Psalm/PropertyMap.php'
|| $filePath === 'src/Psalm/CallMap.php'
|| $filePath === 'src/Psalm/Stubs/CoreGenericFunctions.php'
|| $filePath === 'src/Psalm/Stubs/CoreGenericClasses.php'
) {
$contents = str_replace(
['namespace ' . $prefix . ';', $prefix . '\\\\', $prefix . '\\'],
Expand All @@ -82,7 +82,7 @@ function ($filePath, $prefix, $contents) {
return $contents;
},
function ($filePath, $prefix, $contents) {
if ($filePath === realpath(__DIR__ . '/src/Psalm/Checker/Statements/Expression/Call/MethodCallChecker.php')) {
if ($filePath === 'src/Psalm/Checker/Statements/Expression/Call/MethodCallChecker.php') {
return str_replace(
'case \'Psalm\\\\',
'case \'' . $prefix . '\\\\Psalm\\\\',
Expand All @@ -93,7 +93,7 @@ function ($filePath, $prefix, $contents) {
return $contents;
},
function ($filePath, $prefix, $contents) {
if ($filePath === realpath(__DIR__ . '/src/Psalm/Type.php')) {
if ($filePath === 'src/Psalm/Type.php') {
return str_replace(
'get_class($type) === \'Psalm\\\\',
'get_class($type) === \'' . $prefix . '\\\\Psalm\\\\',
Expand All @@ -104,7 +104,7 @@ function ($filePath, $prefix, $contents) {
return $contents;
},
function ($filePath, $prefix, $contents) {
if ($filePath === realpath(__DIR__ . '/src/psalm.php')) {
if ($filePath === 'src/psalm.php') {
return str_replace(
'\\' . $prefix . '\\PSALM_VERSION',
'PSALM_VERSION',
Expand Down

0 comments on commit fabe60a

Please sign in to comment.