Skip to content

Commit

Permalink
Merge pull request #1005 from spiral/feature/lazy-prototype-registry
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Oct 19, 2023
1 parent 1e78bc9 commit c684305
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/FileDeclaration.php
Expand Up @@ -48,6 +48,11 @@ public static function fromCode(string $code): static
return self::fromElement((new Factory())->fromCode($code));
}

public static function fromReflection(\ReflectionClass $reflection): static
{
return self::fromElement((new Factory())->fromCode(\file_get_contents($reflection->getFileName())));
}

public function addNamespace(string|PhpNamespace $namespace): PhpNamespace
{
if ($namespace instanceof PhpNamespace) {
Expand Down

0 comments on commit c684305

Please sign in to comment.