foreach ($iterator as $fileinfo) { if ($fileinfo->
getExtension() == 'php'
) { if ($cached =
$this->fileCache->
get($fileinfo->
getPathName())) { if (isset($cached['id'
])) { // Explicitly unserialize this to create a new object instance.
$definitions[$cached['id'
]] =
unserialize($cached['content'
]);
} continue;
} $sub_path =
$iterator->
getSubIterator()->
getSubPath();
$sub_path =
$sub_path ?
str_replace(DIRECTORY_SEPARATOR, '\\',
$sub_path) . '\\' : '';
$class =
$namespace . '\\' .
$sub_path .
$fileinfo->
getBasename('.php'
);
// The filename is already known, so there is no need to find the
// file. However, StaticReflectionParser needs a finder, so use a
// mock version.
$finder = MockFileFinder::
create($fileinfo->
getPathName());
$parser =
new StaticReflectionParser($class,
$finder, TRUE
);
/** @var \Drupal\Component\Annotation\AnnotationInterface $annotation */
if ($annotation =
$reader->
getClassAnnotation($parser->
getReflectionClass(),
$this->pluginDefinitionAnnotationName
)) {