@@ -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 | } |
@@ -44,21 +44,21 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | public function match($values): bool |
| 46 | 46 | { |
| 47 | - if (! \is_iterable($values)) { |
|
| 47 | + if (!\is_iterable($values)) { |
|
| 48 | 48 | return false; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if (! parent::match($values)) { |
|
| 51 | + if (!parent::match($values)) { |
|
| 52 | 52 | return false; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | if ($this->value || $this->key) { |
| 56 | 56 | foreach ($values as $key => $value) { |
| 57 | - if ($this->key && ! $this->key->match($key)) { |
|
| 57 | + if ($this->key && !$this->key->match($key)) { |
|
| 58 | 58 | return false; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - if ($this->value && ! $this->value->match($value)) { |
|
| 61 | + if ($this->value && !$this->value->match($value)) { |
|
| 62 | 62 | return false; |
| 63 | 63 | } |
| 64 | 64 | } |
@@ -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 | } |
@@ -20,12 +20,12 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | public function match($values): bool |
| 22 | 22 | { |
| 23 | - if (! \is_iterable($values)) { |
|
| 23 | + if (!\is_iterable($values)) { |
|
| 24 | 24 | return false; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | foreach ($values as $value) { |
| 28 | - if (! parent::match($value)) { |
|
| 28 | + if (!parent::match($value)) { |
|
| 29 | 29 | return false; |
| 30 | 30 | } |
| 31 | 31 | } |
@@ -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 $attribute->getValueFrom($this); |
@@ -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); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | \assert(\is_scalar($name)); |
| 107 | 107 | |
| 108 | - $attribute = Bootstrap::getInstance()->getAttribute(static::class, (string)$name); |
|
| 108 | + $attribute = Bootstrap::getInstance()->getAttribute(static::class, (string) $name); |
|
| 109 | 109 | |
| 110 | 110 | if ($attribute && $attribute->isWritable()) { |
| 111 | 111 | unset($this->$name); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | private function getFromAttribute($context) |
| 86 | 86 | { |
| 87 | - return (function (string $name) { |
|
| 87 | + return (function(string $name) { |
|
| 88 | 88 | return \property_exists($this, $name) ? $this->$name : null; |
| 89 | 89 | })->call($context, $this->name); |
| 90 | 90 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | private function getUsingGetter($context, string $getter, $value) |
| 107 | 107 | { |
| 108 | - return (function ($getter) use ($value) { |
|
| 108 | + return (function($getter) use ($value) { |
|
| 109 | 109 | return $this->$getter($value); |
| 110 | 110 | })->call($context, $getter); |
| 111 | 111 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | private function setUsingSetter($context, string $setter, $value): void |
| 152 | 152 | { |
| 153 | - (function () use ($setter, $value) { |
|
| 153 | + (function() use ($setter, $value) { |
|
| 154 | 154 | $this->$setter($value); |
| 155 | 155 | })->call($context); |
| 156 | 156 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | private function setToAttribute($context, $value): void |
| 163 | 163 | { |
| 164 | - (function (string $name) use ($value) { |
|
| 164 | + (function(string $name) use ($value) { |
|
| 165 | 165 | return $this->$name = $value; |
| 166 | 166 | })->call($context, $this->name); |
| 167 | 167 | } |