Skip to content

Commit

Permalink
refactor(util.meta): organize stuffs
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Aug 25, 2018
1 parent ba42bd0 commit 9883ab7
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/Util/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ public function forClass(string $classFqcn, bool $docblock = false): array

public function forReflectionClass(\ReflectionClass $class, bool $docblock = false): array
{
$methods = [];

foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC) as $m) {
if ($m->class !== $classFqcn) {
continue;
}

// $methods[$m->name] = $this->getMethodMetadata($m);
}

$metadata = [
'classFqcn' => $classFqcn,
'classPath' => $class->getFilePath(),
Expand All @@ -49,7 +39,15 @@ public function forReflectionClass(\ReflectionClass $class, bool $docblock = fal
$metadata += \compact('title', 'texts');
}

$metadata['methods'] = $methods;
$metadata['methods'] = [];

foreach ($class->getMethods() as $method) {
if ($method->class !== $classFqcn) {
continue;
}

$metadata['methods'][$method->name] = $this->forReflectionMethod($method, $docblock);
}

return $metadata;
}
Expand Down

0 comments on commit 9883ab7

Please sign in to comment.