SimpleFileLoader::scrapeClassesFromFile PHP 메소드

scrapeClassesFromFile() 보호된 메소드

Note: This is probably too clever by half. Figuring this out after a failed test case is going to be tricky for us, never mind the user. A test case should not be included twice anyway.
protected scrapeClassesFromFile ( string $file ) : string
$file string Test File name with classes.
리턴 string classnames
    protected function scrapeClassesFromFile($file)
    {
        $content = file_get_contents($file);
        preg_match_all('~^\\s*class\\s+(\\w+)(\\s+(extends|implements)\\s+\\w+)*\\s*\\{~mi', $content, $matches);
        return $matches[1];
    }