@@ -26,7 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | public function __construct() |
| 28 | 28 | { |
| 29 | - $this->compiler = Llk::load(new Read(__DIR__ . '/type.pp')); |
|
| 29 | + $this->compiler = Llk::load(new Read(__DIR__.'/type.pp')); |
|
| 30 | 30 | $this->visitor = new TypeVisitor(); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | if ($typeNode instanceof UnionTypeNode) { |
| 87 | 87 | return new UnionType( |
| 88 | 88 | ...array_map( |
| 89 | - function (TypeNode $type) use ($scope) : Type { |
|
| 89 | + function(TypeNode $type) use ($scope) : Type { |
|
| 90 | 90 | return $this->resolveType($type, $scope); |
| 91 | 91 | }, |
| 92 | 92 | $typeNode->types |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | if ($typeNode instanceof IntersectionTypeNode) { |
| 98 | 98 | return new IntersectionType( |
| 99 | 99 | ...array_map( |
| 100 | - function (TypeNode $type) use ($scope) : Type { |
|
| 100 | + function(TypeNode $type) use ($scope) : Type { |
|
| 101 | 101 | return $this->resolveType($type, $scope); |
| 102 | 102 | }, |
| 103 | 103 | $typeNode->types |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if ($element->getId() === Nodes::UNION) { |
| 111 | 111 | return new UnionType( |
| 112 | 112 | ...array_map( |
| 113 | - function (TreeNode $node) : Type { |
|
| 113 | + function(TreeNode $node) : Type { |
|
| 114 | 114 | return $this->visit($node); |
| 115 | 115 | }, |
| 116 | 116 | $element->getChildren() |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | if ($element->getId() === Nodes::INTERSECTION) { |
| 122 | 122 | return new IntersectionType( |
| 123 | 123 | ...array_map( |
| 124 | - function (TreeNode $node) : Type { |
|
| 124 | + function(TreeNode $node) : Type { |
|
| 125 | 125 | return $this->visit($node); |
| 126 | 126 | }, |
| 127 | 127 | $element->getChildren() |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | return implode( |
| 30 | 30 | '&', |
| 31 | 31 | array_map( |
| 32 | - static function (Type $subType) : string { |
|
| 32 | + static function(Type $subType) : string { |
|
| 33 | 33 | if ($subType instanceof CompositeType) { |
| 34 | 34 | return sprintf('(%s)', $subType->describe()); |
| 35 | 35 | } |
@@ -50,16 +50,16 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | public function validate($value) : bool |
| 52 | 52 | { |
| 53 | - if (! is_array($value)) { |
|
| 53 | + if (!is_array($value)) { |
|
| 54 | 54 | return false; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | foreach ($value as $key => $innerValue) { |
| 58 | - if (! $this->keyType->validate($key)) { |
|
| 58 | + if (!$this->keyType->validate($key)) { |
|
| 59 | 59 | return false; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - if (! $this->valueType->validate($innerValue)) { |
|
| 62 | + if (!$this->valueType->validate($innerValue)) { |
|
| 63 | 63 | return false; |
| 64 | 64 | } |
| 65 | 65 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function validate($value) : bool |
| 37 | 37 | { |
| 38 | - if (! is_array($value)) { |
|
| 38 | + if (!is_array($value)) { |
|
| 39 | 39 | return false; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | return false; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if (! $this->valueType->validate($innerValue)) { |
|
| 48 | + if (!$this->valueType->validate($innerValue)) { |
|
| 49 | 49 | return false; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | return implode( |
| 31 | 31 | '|', |
| 32 | 32 | array_map( |
| 33 | - static function (Type $subType) : string { |
|
| 33 | + static function(Type $subType) : string { |
|
| 34 | 34 | if ($subType instanceof CompositeType) { |
| 35 | 35 | return sprintf('(%s)', $subType->describe()); |
| 36 | 36 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | public function validate($value) : bool |
| 49 | 49 | { |
| 50 | 50 | foreach ($this->subTypes as $subType) { |
| 51 | - if (! $subType->validate($value)) { |
|
| 51 | + if (!$subType->validate($value)) { |
|
| 52 | 52 | continue; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | public function acceptsNull() : bool |
| 62 | 62 | { |
| 63 | 63 | foreach ($this->subTypes as $subType) { |
| 64 | - if (! $subType->acceptsNull()) { |
|
| 64 | + if (!$subType->acceptsNull()) { |
|
| 65 | 65 | continue; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Doctrine\Annotations\TypeParser\NativeTypeParser; |
| 4 | 4 | |
| 5 | -require_once __DIR__ . '/vendor/autoload.php'; |
|
| 5 | +require_once __DIR__.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | $parser = new NativeTypeParser(); |
| 8 | 8 | $type = $parser->parsePropertyType('@var array<int, array<int, stdClass[]>>[]', []); |