Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
3e199fc460 |
@ -5,7 +5,7 @@ namespace goodboyalex\php_components_pack\classes;
|
||||
use DateTimeImmutable;
|
||||
use DateTimeInterface;
|
||||
use Exception;
|
||||
use ReflectionAttribute;
|
||||
use goodboyalex\php_components_pack\attributes\GetOnly;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
use ReflectionProperty;
|
||||
@ -98,7 +98,7 @@ final class ClassMapper
|
||||
}
|
||||
|
||||
// Получаем список атрибутов у данного свойства
|
||||
$attributes = $reflectionProperty->getAttributes('GetOnly', ReflectionAttribute::IS_INSTANCEOF);
|
||||
$attributes = $reflectionProperty->getAttributes(GetOnly::class);
|
||||
|
||||
// Возвращаем true, если атрибут найден, иначе false
|
||||
return !empty($attributes);
|
||||
|
@ -27,6 +27,7 @@ class ClassMapperTest extends TestCase
|
||||
{
|
||||
require_once __DIR__ . '/../data/A.php';
|
||||
require_once __DIR__ . '/../data/B.php';
|
||||
require_once __DIR__ . '/../../sources/attributes/GetOnly.php';
|
||||
require_once __DIR__ . '/../../sources/classes/classMapper.php';
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user