BaseStaticReflectionParser example

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 BaseStaticReflectionParser($class$finder, FALSE);

              /** @var \Drupal\Component\Annotation\AnnotationInterface $annotation */
              if ($annotation = $reader->getClassAnnotation($parser->getReflectionClass()$this->pluginDefinitionAnnotationName)) {
                $this->prepareAnnotationDefinition($annotation$class$parser);

                $id = $annotation->getId();
                $content = $annotation->get();
                $definitions[$id] = $content;
                // Explicitly serialize this to create a new object instance.                 $this->fileCache->set($fileinfo->getPathName()['id' => $id, 'content' => serialize($content)]);
              }
              
Home | Imprint | This part of the site doesn't use cookies.