Example #1
0
 /**
  * Returns NULL or the extension the method belongs to
  *
  * @return ezcReflectionExtension Extension the method belongs to
  */
 public function getExtension()
 {
     if ($this->getExtensionName() === false) {
         return null;
     } else {
         if ($this->reflectionSource instanceof ReflectionMethod) {
             return new ezcReflectionExtension($this->reflectionSource->getExtension());
         } else {
             // using the name, since otherwhise the object would be treated like an
             // external reflection implementation and that would decrease performance
             return new ezcReflectionExtension(parent::getExtensionName());
         }
     }
 }
Example #2
0
 /**
  * @return Nette\Reflection\ExtensionReflection
  */
 public function getExtension()
 {
     return ($ref = parent::getExtension()) ? ExtensionReflection::import($ref) : NULL;
 }