-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Type: fixed resolving of 'static' [Closes nette/di#295]
- Loading branch information
Showing
4 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Nette Framework (https://nette.org) | ||
* Copyright (c) 2004 David Grudl (https://davidgrudl.com) | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Nette\Utils; | ||
|
||
|
||
/** | ||
* Fix for original ReflectionMethod | ||
* @internal | ||
*/ | ||
final class ReflectionMethod extends \ReflectionMethod | ||
{ | ||
private \ReflectionClass $originalClass; | ||
|
||
|
||
public function __construct(object|string $objectOrMethod, ?string $method = null) | ||
{ | ||
if (is_string($objectOrMethod) && str_contains($objectOrMethod, '::')) { | ||
[$objectOrMethod, $method] = explode('::', $objectOrMethod, 2); | ||
} | ||
parent::__construct($objectOrMethod, $method); | ||
$this->originalClass = new \ReflectionClass($objectOrMethod); | ||
} | ||
|
||
|
||
public function getOriginalClass(): \ReflectionClass | ||
{ | ||
return $this->originalClass; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters