Example #1
0
 public function getStaticProperty($class, $property)
 {
     $refl = new \reflectionClass($class);
     // Check that property is static AND public
     if ($refl->hasProperty($property) && $refl->getProperty($property)->isStatic() && $refl->getProperty($property)->isPublic()) {
         return $refl->getProperty($property)->getValue();
     }
     throw new \RuntimeException(sprintf('Invalid static property get for class %s and property %s', $class, $property));
 }