This commit is contained in:
2021-08-04 16:32:28 +08:00
parent 2507c49e67
commit 0367ac2c6c
2 changed files with 8 additions and 14 deletions
+4 -4
View File
@@ -9,7 +9,6 @@ use Exception;
use ReflectionClass;
use ReflectionException;
use Snowflake\Abstracts\BaseObject;
use Snowflake\Exception\NotFindClassException;
use Snowflake\Snowflake;
use Throwable;
@@ -48,6 +47,7 @@ class Loader extends BaseObject
* @param string $class
* @param string $property
* @return mixed
* @throws ReflectionException
*/
public function getProperty(string $class, string $property = ''): mixed
{
@@ -67,7 +67,6 @@ class Loader extends BaseObject
* @param string $class
* @param object $handler
* @return $this
* @throws NotFindClassException
* @throws ReflectionException
* @throws Exception
*/
@@ -138,7 +137,9 @@ class Loader extends BaseObject
return;
}
$replace = $this->getReflect($path, $namespace);
if (!$replace->getAttributes(Target::class)) {
return;
}
$this->appendFileToDirectory($path->getRealPath(), $replace->getName());
static::$_classes[] = $replace->getName();
@@ -152,7 +153,6 @@ class Loader extends BaseObject
* @param DirectoryIterator $path
* @param string $namespace
* @return ReflectionClass|null
* @throws ReflectionException
*/
private function getReflect(DirectoryIterator $path, string $namespace): ?ReflectionClass
{