Skip to content

Commit 134b705

Browse files
authored
Fix handling of php_strip_whitespace being in disable_functions (#19)
1 parent ffe442c commit 134b705

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/PhpFileParser.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public static function findClasses(string $path): array
3030
{
3131
$extraTypes = self::getExtraTypes();
3232

33+
if (!function_exists('php_strip_whitespace')) {
34+
throw new \RuntimeException('Classmap generation relies on the php_strip_whitespace function, but it has been disabled by the disable_functions directive.');
35+
}
3336
// Use @ here instead of Silencer to actively suppress 'unhelpful' output
3437
// @link https://github.com/composer/composer/pull/4886
3538
$contents = @php_strip_whitespace($path);

0 commit comments

Comments
 (0)