@@ -58,7 +58,7 @@ |
||
58 | 58 | |
59 | 59 | /** |
60 | 60 | * @param Matchable $matcher |
61 | - * @return OrTypeHint |
|
61 | + * @return TypeHint |
|
62 | 62 | */ |
63 | 63 | public function addMatcher(Matchable $matcher): Matchable |
64 | 64 | { |
@@ -82,12 +82,12 @@ |
||
82 | 82 | */ |
83 | 83 | private function matchIterable($values): bool |
84 | 84 | { |
85 | - if (! \is_iterable($values)) { |
|
85 | + if (!\is_iterable($values)) { |
|
86 | 86 | return false; |
87 | 87 | } |
88 | 88 | |
89 | 89 | foreach ($values as $value) { |
90 | - if (! $this->matchScalar($value)) { |
|
90 | + if (!$this->matchScalar($value)) { |
|
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | } |
@@ -10,7 +10,6 @@ |
||
10 | 10 | namespace Serafim\Properties; |
11 | 11 | |
12 | 12 | use Railt\Io\File; |
13 | -use Serafim\Properties\Attribute\AttributeInterface; |
|
14 | 13 | use Serafim\Properties\Exception\AccessDeniedException; |
15 | 14 | use Serafim\Properties\Exception\NotReadableException; |
16 | 15 | use Serafim\Properties\Exception\NotWritableException; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | \assert(\is_scalar($name)); |
33 | 33 | |
34 | - $attribute = Bootstrap::getInstance()->getAttribute(static::class, (string)$name); |
|
34 | + $attribute = Bootstrap::getInstance()->getAttribute(static::class, (string) $name); |
|
35 | 35 | |
36 | 36 | if ($attribute && $attribute->isReadable()) { |
37 | 37 | return $this->$name; |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | { |
54 | 54 | \assert(\is_scalar($name)); |
55 | 55 | |
56 | - $attribute = Bootstrap::getInstance()->getAttribute(static::class, (string)$name); |
|
56 | + $attribute = Bootstrap::getInstance()->getAttribute(static::class, (string) $name); |
|
57 | 57 | |
58 | 58 | if ($attribute && $attribute->isWritable()) { |
59 | - if (! $attribute->match($value)) { |
|
59 | + if (!$attribute->match($value)) { |
|
60 | 60 | $error = 'New value of %s::$%s is not compatible with type hint definition'; |
61 | 61 | $error = \sprintf($error, __CLASS__, $name); |
62 | 62 | throw $this->propertyAccessException(NotWritableException::class, $error); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | /** |
31 | 31 | * @param RuleInterface $rule |
32 | - * @return mixed|string |
|
32 | + * @return \Generator |
|
33 | 33 | */ |
34 | 34 | public function reduce(RuleInterface $rule) |
35 | 35 | { |
@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | /** |
31 | 31 | * @param RuleInterface $rule |
32 | - * @return \Generator|TypeHint |
|
32 | + * @return \Generator |
|
33 | 33 | */ |
34 | 34 | public function reduce(RuleInterface $rule): \Generator |
35 | 35 | { |
@@ -50,7 +50,7 @@ |
||
50 | 50 | public function match($value): bool |
51 | 51 | { |
52 | 52 | foreach ($this->matchable as $matcher) { |
53 | - if (! $matcher->match($value)) { |
|
53 | + if (!$matcher->match($value)) { |
|
54 | 54 | return false; |
55 | 55 | } |
56 | 56 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public function getAttribute(string $class, string $name): ?AttributeInterface |
91 | 91 | { |
92 | 92 | foreach ($this->getClassInheritance($class) as $child) { |
93 | - $result = $this->getAttributeOrBuild($child, $name, function () use ($child) { |
|
93 | + $result = $this->getAttributeOrBuild($child, $name, function() use ($child) { |
|
94 | 94 | foreach ($this->builder->buildClass($child) as $attribute) { |
95 | 95 | yield $this->getCacheKey($child, $attribute->getName()) => $attribute; |
96 | 96 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | yield from \array_keys(\class_uses($class)); |
118 | 118 | }; |
119 | 119 | |
120 | - if (! isset($this->inheritance[$class])) { |
|
120 | + if (!isset($this->inheritance[$class])) { |
|
121 | 121 | $this->inheritance[$class] = \iterator_to_array($inheritance(), false); |
122 | 122 | } |
123 | 123 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | { |
136 | 136 | $key = $this->getCacheKey($class, $name); |
137 | 137 | |
138 | - if (! $this->cache->has($key)) { |
|
138 | + if (!$this->cache->has($key)) { |
|
139 | 139 | foreach ($build() as $inner => $attribute) { |
140 | 140 | $this->cache->set($inner, $attribute); |
141 | 141 | } |