-
Notifications
You must be signed in to change notification settings - Fork 8
/
CacheReflectionClass.php
51 lines (43 loc) · 1.01 KB
/
CacheReflectionClass.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
declare(strict_types=1);
namespace ClassTransformer\Reflection;
use RuntimeException;
use ReflectionException;
use ClassTransformer\Exceptions\ClassNotFoundException;
use ClassTransformer\Contracts\ReflectionClassRepository;
/**
* Class RuntimeReflectionClass
*
* @psalm-api
* @template T
*/
final class CacheReflectionClass implements ReflectionClassRepository
{
/** @var string $class */
private string $class;
/** @var array CacheReflectionProperty[] */
private array $properties;
/**
* @param string $class
* @param CacheReflectionProperty[] $properties
*/
public function __construct(string $class, array $properties)
{
$this->class = $class;
$this->properties = $properties;
}
/**
* @return CacheReflectionProperty[]
*/
public function getProperties(): array
{
return $this->properties;
}
/**
* @return string
*/
public function getClass(): string
{
return $this->class;
}
}