function ExampleFinder::find
Attempts to find the example contents for the given descriptor.
File
-
vendor/
phpdocumentor/ reflection-docblock/ src/ DocBlock/ ExampleFinder.php, line 42
Class
- ExampleFinder
- Class used to find an example file's location based on a given ExampleDescriptor.
Namespace
phpDocumentor\Reflection\DocBlockCode
public function find(Example $example) : string {
$filename = $example->getFilePath();
$file = $this->getExampleFileContents($filename);
if ($file === null) {
return sprintf('** File not found : %s **', $filename);
}
return implode('', array_slice($file, $example->getStartingLine() - 1, $example->getLineCount()));
}