SimpleFileLoader::scrapeClassesFromFile PHP Method

scrapeClassesFromFile() protected method

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.
return 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];
    }