Compare commits
No commits in common. "master" and "v2.0.0b" have entirely different histories.
|
@ -23,7 +23,10 @@ class ObjectReflection {
|
||||||
$this->classname = ltrim($class instanceof ReflectionClass ? $class->getName() : $class, '\\');
|
$this->classname = ltrim($class instanceof ReflectionClass ? $class->getName() : $class, '\\');
|
||||||
|
|
||||||
$this->cache = $cache;
|
$this->cache = $cache;
|
||||||
|
|
||||||
|
#if ( ! $this->cache || ! $this->cache->has($class) ) {
|
||||||
$this->classReflection = $class instanceof ReflectionClass ? $class : new ReflectionClass($class);
|
$this->classReflection = $class instanceof ReflectionClass ? $class : new ReflectionClass($class);
|
||||||
|
# }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function fromClass(ReflectionClass|string $class, ? CacheInterface $cache = null) : self
|
public static function fromClass(ReflectionClass|string $class, ? CacheInterface $cache = null) : self
|
||||||
|
@ -63,6 +66,7 @@ class ObjectReflection {
|
||||||
|
|
||||||
foreach($this->classReflection->getProperties($filter) as $property) {
|
foreach($this->classReflection->getProperties($filter) as $property) {
|
||||||
$reflected = new ReflectedProperty($property->getName());
|
$reflected = new ReflectedProperty($property->getName());
|
||||||
|
|
||||||
$reflected->attributes = AttributeReader::reflectAttributes($property);
|
$reflected->attributes = AttributeReader::reflectAttributes($property);
|
||||||
|
|
||||||
if ( $reflected->hasIgnoreAttribute() ) {
|
if ( $reflected->hasIgnoreAttribute() ) {
|
||||||
|
@ -83,8 +87,10 @@ class ObjectReflection {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reflectMethods(int $filter =
|
public function reflectMethods(int $filter =
|
||||||
ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED |
|
ReflectionMethod::IS_PUBLIC |
|
||||||
ReflectionMethod::IS_PRIVATE | ReflectionMethod::IS_STATIC |
|
ReflectionMethod::IS_PROTECTED |
|
||||||
|
ReflectionMethod::IS_PRIVATE |
|
||||||
|
ReflectionMethod::IS_STATIC |
|
||||||
ReflectionMethod::IS_FINAL
|
ReflectionMethod::IS_FINAL
|
||||||
) : array
|
) : array
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,11 +25,6 @@ class Route implements \Notes\Attribute {
|
||||||
"/" . ltrim($this->route, "/"), "/"), '/');
|
"/" . ltrim($this->route, "/"), "/"), '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRegistrableRoute() : string
|
|
||||||
{
|
|
||||||
return preg_replace('/(\=.*)(?=\})/i', '', $this->getRoute());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function matchRouteName(string $name) : bool
|
public function matchRouteName(string $name) : bool
|
||||||
{
|
{
|
||||||
return strtolower($this->name) === strtolower($name);
|
return strtolower($this->name) === strtolower($name);
|
||||||
|
|
Loading…
Reference in New Issue