Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
Dave M. | 63c7dc23f9 | |
Dave M. | a4d99dfe08 | |
Dave Mc Nicoll | f199cc7085 | |
Dave Mc Nicoll | fcb332ae53 | |
Dave Mc Nicoll | 133672b347 |
|
@ -23,10 +23,7 @@ class ObjectReflection {
|
|||
$this->classname = ltrim($class instanceof ReflectionClass ? $class->getName() : $class, '\\');
|
||||
|
||||
$this->cache = $cache;
|
||||
|
||||
#if ( ! $this->cache || ! $this->cache->has($class) ) {
|
||||
$this->classReflection = $class instanceof ReflectionClass ? $class : new ReflectionClass($class);
|
||||
# }
|
||||
}
|
||||
|
||||
public static function fromClass(ReflectionClass|string $class, ? CacheInterface $cache = null) : self
|
||||
|
@ -66,7 +63,6 @@ class ObjectReflection {
|
|||
|
||||
foreach($this->classReflection->getProperties($filter) as $property) {
|
||||
$reflected = new ReflectedProperty($property->getName());
|
||||
|
||||
$reflected->attributes = AttributeReader::reflectAttributes($property);
|
||||
|
||||
if ( $reflected->hasIgnoreAttribute() ) {
|
||||
|
@ -87,11 +83,9 @@ class ObjectReflection {
|
|||
}
|
||||
|
||||
public function reflectMethods(int $filter =
|
||||
ReflectionMethod::IS_PUBLIC |
|
||||
ReflectionMethod::IS_PROTECTED |
|
||||
ReflectionMethod::IS_PRIVATE |
|
||||
ReflectionMethod::IS_STATIC |
|
||||
ReflectionMethod::IS_FINAL
|
||||
ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED |
|
||||
ReflectionMethod::IS_PRIVATE | ReflectionMethod::IS_STATIC |
|
||||
ReflectionMethod::IS_FINAL
|
||||
) : array
|
||||
{
|
||||
$list = [];
|
||||
|
|
|
@ -25,6 +25,11 @@ class Route implements \Notes\Attribute {
|
|||
"/" . ltrim($this->route, "/"), "/"), '/');
|
||||
}
|
||||
|
||||
public function getRegistrableRoute() : string
|
||||
{
|
||||
return preg_replace('/(\=.*)(?=\})/i', '', $this->getRoute());
|
||||
}
|
||||
|
||||
public function matchRouteName(string $name) : bool
|
||||
{
|
||||
return strtolower($this->name) === strtolower($name);
|
||||
|
|
Loading…
Reference in New Issue