コード例 #1
0
 /**
  * Gets the static property values.
  *
  * @param string $name    The property name.
  * @param mixed  $default Optional default value.
  *
  * @return mixed
  */
 public function getStaticPropertyValue($name, $default = null)
 {
     $properties = $this->getStaticProperties();
     if (array_key_exists($name, $properties)) {
         return $properties[$name];
     }
     return parent::getStaticPropertyValue($name, $default);
 }
コード例 #2
0
 /**
  * testGetInterfaceNamesReturnsIndirectlyImplementedInterface
  *
  * @return void
  * @covers \pdepend\reflection\api\StaticReflectionClass
  * @group reflection
  * @group reflection::api
  * @group unittest
  */
 public function testGetInterfaceNamesReturnsIndirectlyImplementedInterface()
 {
     $interface = new StaticReflectionInterface('IFoo', '');
     $parentClass = new StaticReflectionInterface('ParentClass', '');
     $parentClass->initInterfaces(array($interface));
     $class = new StaticReflectionClass(__CLASS__, '', 0);
     $class->initParentClass($parentClass);
     $this->assertSame(array('IFoo'), $class->getInterfaceNames());
 }
コード例 #3
0
 /**
  * testGetPrototypeParentClassHidesParentInterface
  *
  * @return void
  * @covers \pdepend\reflection\api\StaticReflectionMethod
  * @group reflection
  * @group reflection::api
  * @group unittest
  */
 public function testGetPrototypeParentClassHidesParentInterface()
 {
     $method = new StaticReflectionMethod('foo', '', 0);
     $interface = new StaticReflectionInterface('IFoo', '');
     $interface->initMethods(array(new StaticReflectionMethod('foo', '', 0)));
     $declaringClass = new StaticReflectionClass('Bar', '', 0);
     $declaringClass->initMethods(array($method));
     $declaringClass->initInterfaces(array($interface));
     $this->assertSame($interface, $method->getPrototype()->getDeclaringClass());
 }
コード例 #4
0
 /**
  * @return void
  * @covers \pdepend\reflection\api\StaticReflectionInterface
  * @group reflection
  * @group reflection::api
  * @group unittest
  * @expectedException \LogicException
  */
 public function testInitConstantsThrowsLogicExceptionWhenCalledMoreThanOnce()
 {
     $interface = new StaticReflectionInterface(__CLASS__, '');
     $interface->initConstants(array());
     $interface->initConstants(array());
 }