@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | continue; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if (! $this->sameType($initialValue, $currentValue, $type)) { |
|
| 36 | + if (!$this->sameType($initialValue, $currentValue, $type)) { |
|
| 37 | 37 | continue; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | private function getAvailableTypesString(): string |
| 78 | 78 | { |
| 79 | - return implode(', ', array_map(function (Type $type) { |
|
| 79 | + return implode(', ', array_map(function(Type $type) { |
|
| 80 | 80 | return (string) $type; |
| 81 | 81 | }, $this->types)); |
| 82 | 82 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | public function validate($value) |
| 23 | 23 | { |
| 24 | 24 | if ( |
| 25 | - ! $value instanceof $this->type |
|
| 25 | + !$value instanceof $this->type |
|
| 26 | 26 | ) { |
| 27 | 27 | throw WrongType::withMessage("must be of type {$this->type}"); |
| 28 | 28 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | public function __construct(...$types) |
| 23 | 23 | { |
| 24 | 24 | foreach ($types as $field => $type) { |
| 25 | - if (! $type instanceof Type) { |
|
| 25 | + if (!$type instanceof Type) { |
|
| 26 | 26 | $this->values[$field] = $type; |
| 27 | 27 | |
| 28 | 28 | $type = T::infer($type); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | public function offsetGet($offset) |
| 49 | 49 | { |
| 50 | - if (! array_key_exists($offset, $this->values)) { |
|
| 50 | + if (!array_key_exists($offset, $this->values)) { |
|
| 51 | 51 | throw UninitialisedError::forField("index {$offset}"); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -56,13 +56,13 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | public function offsetSet($offset, $value) |
| 58 | 58 | { |
| 59 | - if ($offset === null || ! is_numeric($offset)) { |
|
| 59 | + if ($offset === null || !is_numeric($offset)) { |
|
| 60 | 60 | throw WrongType::withMessage('You must specify a numeric offset'); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $type = $this->types[$offset] ?? null; |
| 64 | 64 | |
| 65 | - if (! $type) { |
|
| 65 | + if (!$type) { |
|
| 66 | 66 | throw WrongType::withMessage("No type was configured for this tuple at offset {$offset}"); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | public function __construct(array $types) |
| 22 | 22 | { |
| 23 | 23 | foreach ($types as $field => $type) { |
| 24 | - if (! $type instanceof Type) { |
|
| 24 | + if (!$type instanceof Type) { |
|
| 25 | 25 | $this->values[$field] = $type; |
| 26 | 26 | |
| 27 | 27 | $type = T::infer($type); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | public function set(array $data): self |
| 35 | 35 | { |
| 36 | 36 | foreach ($this->types as $name => $type) { |
| 37 | - if (! array_key_exists($name, $data)) { |
|
| 37 | + if (!array_key_exists($name, $data)) { |
|
| 38 | 38 | $type = serialize($type); |
| 39 | 39 | |
| 40 | 40 | throw WrongType::withMessage("Missing field for this struct: {$name}:{$type}"); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public function offsetGet($offset) |
| 52 | 52 | { |
| 53 | - if (! array_key_exists($offset, $this->values)) { |
|
| 53 | + if (!array_key_exists($offset, $this->values)) { |
|
| 54 | 54 | throw UninitialisedError::forField($offset); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $type = $this->types[$offset] ?? null; |
| 67 | 67 | |
| 68 | - if (! $type) { |
|
| 68 | + if (!$type) { |
|
| 69 | 69 | throw WrongType::withMessage("No type was configured for this field {$offset}"); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | |
| 96 | 96 | $type = gettype($value); |
| 97 | 97 | |
| 98 | - if (! method_exists(self::class, $type)) { |
|
| 98 | + if (!method_exists(self::class, $type)) { |
|
| 99 | 99 | throw InferredTypeError::cannotInferType($type); |
| 100 | 100 | } |
| 101 | 101 | |