final public function getMetadata()
  {
    $item = Container::cache('target')->getItem('metadata');

    if (!$item->isHit()) {
      $metadata = [];
      $reflection = new \ReflectionClass($this);
      $interfaces = $reflection->getInterfaces();
      $reader = new AnnotationReader();

      foreach ($interfaces as $interface) {
        $methods = $interface->getMethods(\ReflectionMethod::IS_PUBLIC);
        foreach ($methods as $method) {
          $annotation = $reader->getMethodAnnotation($method, 'Drutiny\Annotation\Metadata');
          if (empty($annotation)) {
            continue;
          }
          $metadata[$annotation->name] = $method->name;
        }
      }
      Container::cache('target')->save($item->set($metadata));
    }
    return $item->get();
  }
final public function getMetadata()
  {
    $item = Container::cache('target')->getItem('metadata');

    if (!$item->isHit()) {
      $metadata = [];
      $reflection = new \ReflectionClass($this);
      $interfaces = $reflection->getInterfaces();
      $reader = new AnnotationReader();

      foreach ($interfaces as $interface) {
        $methods = $interface->getMethods(\ReflectionMethod::IS_PUBLIC);
        foreach ($methods as $method) {
          $annotation = $reader->getMethodAnnotation($method, 'Drutiny\Annotation\Metadata');
          if (empty($annotation)) {
            continue;
          }
          $metadata[$annotation->name] = $method->name;
        }
      }
      Container::cache('target')->save($item->set($metadata));
    }
    return $item->get();
  }
final public function getMetadata ( ) { $ item = Container :: cache ( 'target' ) -> getItem ( 'metadata' ) ; if ( ! $ item -> isHit ( ) ) { $ metadata = [ ] ; $ reflection = new \ ReflectionClass ( $ this ) ; $ interfaces = $ reflection -> getInterfaces ( ) ; $ reader = new AnnotationReader ( ) ; foreach ( $ interfaces as $ interface ) { $ methods = $ interface -> getMethods ( \ ReflectionMethod :: IS_PUBLIC ) ; foreach ( $ methods as $ method ) { $ annotation = $ reader -> getMethodAnnotation ( $ method , 'Drutiny\Annotation\Metadata' ) ; if ( empty ( $ annotation ) ) { continue ; } $ metadata [ $ annotation -> name ] = $ method -> name ; } } Container :: cache ( 'target' ) -> save ( $ item -> set ( $ metadata ) ) ; } return $ item -> get ( ) ; }
Pull metadata from Drutiny\Target\Metadata interfaces.

@return array of metatdata keyed by metadata name.
Pull metadata from Drutiny \ Target \ Metadata interfaces .