Total Complexity | 5 |
Total Lines | 63 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | final class File implements FileInterface |
||
20 | { |
||
21 | use UriResolvableTrait; |
||
22 | use ReadableTrait; |
||
23 | use WritableTrait; |
||
24 | |||
25 | /** |
||
26 | * @var StorageInterface |
||
27 | */ |
||
28 | private $storage; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $pathname; |
||
34 | |||
35 | /** |
||
36 | * @var ResolverInterface|null |
||
37 | */ |
||
38 | private $resolver; |
||
39 | |||
40 | /** |
||
41 | * @param StorageInterface $storage |
||
42 | * @param string $pathname |
||
43 | * @param ResolverInterface|null $resolver |
||
44 | */ |
||
45 | public function __construct(StorageInterface $storage, string $pathname, ResolverInterface $resolver = null) |
||
46 | { |
||
47 | $this->storage = $storage; |
||
48 | $this->pathname = $pathname; |
||
49 | $this->resolver = $resolver; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * {@inheritDoc} |
||
54 | */ |
||
55 | public function __toString(): string |
||
56 | { |
||
57 | return $this->getPathname(); |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * {@inheritDoc} |
||
62 | */ |
||
63 | public function getPathname(): string |
||
64 | { |
||
65 | return $this->pathname; |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * {@inheritDoc} |
||
70 | */ |
||
71 | public function getStorage(): StorageInterface |
||
72 | { |
||
73 | return $this->storage; |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * @return ResolverInterface|null |
||
78 | */ |
||
79 | protected function getResolver(): ?ResolverInterface |
||
82 | } |
||
83 | } |
||
84 |