Nette\DI\ServiceDefinition::getImplement PHP Méthode

getImplement() public méthode

public getImplement ( ) : string | null
Résultat string | null
    public function getImplement()
    {
        return $this->implement;
    }

Usage Example

Exemple #1
0
 /**
  * @param ServiceDefinition
  * @return string|null
  */
 protected static function detectClass(ServiceDefinition $def)
 {
     if ($def->getClass()) {
         return $def->getClass();
     } elseif ($interface = $def->getImplement()) {
         $rc = Reflection\ClassType::from($interface);
         $method = $rc->hasMethod('create') ? 'create' : ($rc->hasMethod('get') ? 'get' : NULL);
         if ($method === NULL) {
             return NULL;
         }
         if (!($returnType = $rc->getMethod($method)->getAnnotation('return'))) {
             return NULL;
         }
         return Reflection\AnnotationsParser::expandClassName(preg_replace('#[|\\s].*#', '', $returnType), $rc);
     }
     return NULL;
 }
All Usage Examples Of Nette\DI\ServiceDefinition::getImplement