Skip to content

Commit

Permalink
Real fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Aug 25, 2021
1 parent a6ca5f7 commit bec4be4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Expand Up @@ -202,7 +202,7 @@ private function findSymbols(string $file): array
}

// strip heredocs/nowdocs
$contents = preg_replace('{<<<[ \t]*([\'"]?)(\w+)\\1(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)(?:\s*)\\2(?=\s+|[;,.)])}s', 'null', $contents);
$contents = preg_replace('{<<<[ \t]*([\'"]?)(\w+)\\1(?:\r\n|\n|\r)(?:.*(?=[\r\n]+[ \t]*\\2))[\r\n]+[ \t]*\\2(?=\s*[;,.)])}s', 'null', $contents);
if ($contents === null) {
return ['classes' => [], 'functions' => []];
}
Expand Down
Expand Up @@ -140,10 +140,9 @@ public function testBug5525(): void
$factory = self::getContainer()->getByType(OptimizedDirectorySourceLocatorFactory::class);
$locator = $factory->createByFiles([__DIR__ . '/data/bug-5525.php']);
$classReflector = new ClassReflector($locator);
$functionReflector = new FunctionReflector($locator, $classReflector);

$this->expectException(IdentifierNotFound::class);
$functionReflector->reflect('spl_autoload_register');
$class = $classReflector->reflect(\Faker\Provider\nl_BE\Text::class);
$this->assertSame(\Faker\Provider\nl_BE\Text::class, $class->getName());
}

}

0 comments on commit bec4be4

Please sign in to comment.