Example #1
0
 /**
  * This method will return a class or interface instance that represents
  * the return value of this callable. The returned value will be <b>null</b>
  * if there is no return value or the return value is scalat.
  *
  * @return \PDepend\Source\AST\AbstractASTClassOrInterface
  * @since  0.9.5
  */
 public function getReturnClass()
 {
     if ($this->returnClassReference === null) {
         return null;
     }
     return $this->returnClassReference->getType();
 }
 /**
  * This method will return a class or interface instance that represents
  * the return value of this callable. The returned value will be <b>null</b>
  * if there is no return value or the return value is scalat.
  *
  * @return \PDepend\Source\AST\AbstractASTClassOrInterface
  * @since  0.9.5
  */
 public function getReturnClass()
 {
     if ($this->returnClassReference) {
         return $this->returnClassReference->getType();
     }
     if (($node = $this->getReturnType()) instanceof ASTClassOrInterfaceReference) {
         return $node->getType();
     }
     return null;
 }
 /**
  * testGetTypeDelegatesCallToInjectedReferenceObject
  *
  * @return void
  */
 public function testGetTypeDelegatesCallToInjectedReferenceObject()
 {
     $reference = $this->createNodeInstance();
     $this->referenceMock->expects($this->once())->method('getType');
     $reference->getType();
 }
Example #4
0
 /**
  * The magic sleep method will be called by PHP's runtime environment right
  * before an instance of this class gets serialized. It should return an
  * array with those property names that should be serialized for this class.
  *
  * @return array
  * @since  0.10.0
  */
 public function __sleep()
 {
     $this->qualifiedName = $this->getType()->getNamespaceName() . '\\' . $this->getType()->getName();
     return array_merge(array('qualifiedName'), parent::__sleep());
 }
 /**
  * testGetTypeCachesReturnValueOfBuilderContextGetClassOrInterface
  *
  * @return void
  */
 public function testGetTypeCachesReturnValueOfBuilderContextGetClassOrInterface()
 {
     $context = $this->getBuilderContextMock();
     $context->expects($this->exactly(1))->method('getClassOrInterface')->with($this->equalTo(__CLASS__))->will($this->returnValue($this));
     $reference = new ASTClassOrInterfaceReference($context, __CLASS__);
     $reference->getType();
 }
Example #6
0
 /**
  * Returns the concrete type instance associated with with this placeholder.
  *
  * @return \PDepend\Source\AST\AbstractASTClassOrInterface
  */
 public function getType()
 {
     return $this->reference->getType();
 }
Example #7
0
 /**
  * The magic sleep method will be called by PHP's runtime environment right
  * before an instance of this class gets serialized. It should return an
  * array with those property names that should be serialized for this class.
  *
  * @return array(string)
  * @since  0.10.0
  */
 public function __sleep()
 {
     return array_merge(array('reference'), parent::__sleep());
 }