Added another front page space for Yaffs info. Added roave security for composer.
[yaffs-website] / web / core / lib / Drupal / Component / Annotation / Reflection / MockFileFinder.php
1 <?php
2
3 namespace Drupal\Component\Annotation\Reflection;
4
5 use Doctrine\Common\Reflection\ClassFinderInterface;
6
7 /**
8  * Defines a mock file finder that only returns a single filename.
9  *
10  * This can be used with Doctrine\Common\Reflection\StaticReflectionParser if
11  * the filename is known and inheritance is not a concern (for example, if
12  * only the class annotation is needed).
13  */
14 class MockFileFinder implements ClassFinderInterface {
15
16   /**
17    * The only filename this finder ever returns.
18    *
19    * @var string
20    */
21   protected $filename;
22
23   /**
24    * {@inheritdoc}
25    */
26   public function findFile($class) {
27     return $this->filename;
28   }
29
30   /**
31    * Creates new mock file finder objects.
32    */
33   static public function create($filename) {
34     $object = new static();
35     $object->filename = $filename;
36     return $object;
37   }
38
39 }