/** * 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 PHP_Depend_Code_ASTClassOrInterfaceReference * @since 0.9.5 */ public function getReturnClass() { if ($this->_returnClassReference === null) { return null; } return $this->_returnClassReference->getType(); }
/** * @return void * @group ast */ public function testGetTypeInvokesBuildClassOrInterface() { $class = new PHP_Depend_Code_Class(null); $builder = $this->getMock('PHP_Depend_BuilderI'); $builder->expects($this->once())->method('getClassOrInterface')->with($this->equalTo(__CLASS__))->will($this->returnValue($class)); $classOrInterfaceReference = new PHP_Depend_Code_ASTClassOrInterfaceReference($builder, __CLASS__); $this->assertType('PHP_Depend_Code_Class', $classOrInterfaceReference->getType()); }
/** * Returns the concrete type instance associated with with this placeholder. * * @return PHP_Depend_Code_AbstractClassOrInterface */ public function getType() { return $this->reference->getType(); }
/** * 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 PHP_Depend_Code_ASTClassOrInterfaceReference($context, __CLASS__); $reference->getType(); }