Ejemplo n.º 1
0
 /**
  * Attempts to find the example contents for the given descriptor.
  *
  * @param ExampleDescriptor $descriptor
  *
  * @return string
  */
 public function find(ExampleDescriptor $descriptor)
 {
     $filename = $descriptor->getFilePath();
     $file = $this->getExampleFileContents($filename);
     if (!$file) {
         return "** File not found : {$filename} **";
     }
     return implode('', array_slice($file, $descriptor->getStartingLine() - 1, $descriptor->getLineCount()));
 }