Compare commits

..

No commits in common. "fcb332ae537edd412281ffcf584be212a14c36d1" and "15992843347bef7d37d1da39831584d38bc4375e" have entirely different histories.

3 changed files with 16 additions and 30 deletions

View File

@ -99,8 +99,6 @@ class AnnotationReader
case $reflect instanceof ReflectionClass :
return $reflect->name;
}
return "#UNKNOWN#";
}
protected function getObjectNamespace(Reflector $reflect) : string

View File

@ -10,8 +10,6 @@ use RuntimeException, DirectoryIterator, Generator;
class Breadcrumb extends RouteFetcher {
public bool $ignoreSoleRoute = true;
public function getRouteTree(\Notes\Route\Attribute\Method\Route $route) : array
{
$tree = [];
@ -38,11 +36,7 @@ class Breadcrumb extends RouteFetcher {
else {
$route = null;
}
}
if ($this->ignoreSoleRoute && count($tree) === 1) {
return [];
}
};
return array_reverse($tree);
}

View File

@ -20,7 +20,7 @@ class ObjectReflection {
$this->classname = ltrim($class, '\\');
$this->cache = $cache;
# if ( ! $this->cache || ! $this->cache->has($class) ) {
#if ( ! $this->cache || ! $this->cache->has($class) ) {
$this->classReflection = $class instanceof ReflectionClass ? $class : new ReflectionClass($class);
$this->annotationReader = $annotationReader ?: AnnotationReader::fromClass($class);
# }
@ -109,32 +109,28 @@ class ObjectReflection {
'name' => $property->getName()
];
$current['tags'] = $this->annotationReader->getProperty($property);
if ( $this->ignoreElementAnnotation($current['tags']) ) {
continue;
}
# Default value can be 'null', so isset() it not suitable here
if ( array_key_exists($current['name'], $defaultValues) ) {
$current['value'] = $defaultValues[ $current['name'] ];
}
if ( $property->hasType() ) {
$type = $property->getType();
if ($type instanceof \ReflectionUnionType ) {
foreach($type->getTypes() as $type) {
# dump($type->getName(), $type->isBuiltin(), $type->allowsNull());
}
}
else {
if (! $type instanceof \ReflectionUnionType ) {
$current['type'] = $type->getName();
$current['builtin'] = $type->isBuiltIn();
$current['nullable'] = $type->allowsNull();
}
}
$current['tags'] = $this->annotationReader->getProperty($property);
if ( $this->ignoreElementAnnotation($current['tags']) ) {
continue;
}
$list[ $current['name'] ] = $current;
}
@ -224,8 +220,6 @@ class ObjectReflection {
protected function getUsesStatements() : array
{
return [];
$uses = [];
$tokens = token_get_all( $c = $this->readCode() );