Esempio n. 1
0
 /**
  * @return string
  */
 protected function _generateCode()
 {
     $typeName = $this->getSourceClassName();
     $reflection = new \ReflectionClass($typeName);
     if ($reflection->isInterface()) {
         $this->_classGenerator->setImplementedInterfaces([$typeName]);
     } else {
         $this->_classGenerator->setExtendedClass($typeName);
     }
     return parent::_generateCode();
 }
Esempio n. 2
0
 /**
  * Generate resulting class source code
  *
  * @return string
  */
 protected function _generateCode()
 {
     $typeName = $this->getSourceClassName();
     $reflection = new \ReflectionClass($typeName);
     $interfaces = [];
     if ($reflection->isInterface()) {
         $interfaces[] = $typeName;
     } else {
         $this->_classGenerator->setExtendedClass($typeName);
     }
     $this->_classGenerator->addTrait('\\Magento\\Framework\\Interception\\Interceptor');
     $interfaces[] = '\\Magento\\Framework\\Interception\\InterceptorInterface';
     $this->_classGenerator->setImplementedInterfaces($interfaces);
     return parent::_generateCode();
 }
 /**
  * {@inheritdoc}
  */
 protected function _generateCode()
 {
     $this->_classGenerator->setImplementedInterfaces([$this->_getResultClassName() . 'Interface']);
     $this->_classGenerator->setExtendedClass($this->getExtendedClass());
     return parent::_generateCode();
 }