@@ -58,6 +58,6 @@ |
||
58 | 58 | */ |
59 | 59 | public function __toString(): string |
60 | 60 | { |
61 | - return $this->getName() . ': ' . $this->getHint()->getFullyQualifiedName(); |
|
61 | + return $this->getName().': '.$this->getHint()->getFullyQualifiedName(); |
|
62 | 62 | } |
63 | 63 | } |
@@ -81,7 +81,7 @@ |
||
81 | 81 | $arguments = []; |
82 | 82 | |
83 | 83 | foreach ($this->arguments as $name => $value) { |
84 | - $arguments[] = $name . ': ' . $value; |
|
84 | + $arguments[] = $name.': '.$value; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | return \sprintf('%s<%s>', $this->name->getFullyQualifiedName(), \implode(', ', $arguments)); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | /** @noinspection SuspiciousAssignmentsInspection */ |
244 | 244 | $value = $this->store->add($value); |
245 | 245 | |
246 | - if (! $value->getOffset()) { |
|
246 | + if (!$value->getOffset()) { |
|
247 | 247 | $value->definedIn($offset); |
248 | 248 | } |
249 | 249 | |
@@ -268,8 +268,8 @@ discard block |
||
268 | 268 | */ |
269 | 269 | private function after(ContextInterface $context): \Generator |
270 | 270 | { |
271 | - $after = $this->store->extract(function (DeferredInterface $deferred): bool { |
|
272 | - return ! $deferred instanceof Identifiable || ! $deferred->getDefinition()->isGeneric(); |
|
271 | + $after = $this->store->extract(function(DeferredInterface $deferred): bool { |
|
272 | + return !$deferred instanceof Identifiable || !$deferred->getDefinition()->isGeneric(); |
|
273 | 273 | }); |
274 | 274 | |
275 | 275 | foreach ($after as $deferred) { |
@@ -44,12 +44,12 @@ discard block |
||
44 | 44 | /** @var ValueInterface $value */ |
45 | 45 | $value = yield $rule->getChild(0); |
46 | 46 | |
47 | - if (! $value->getType()->typeOf(Type::string())) { |
|
47 | + if (!$value->getType()->typeOf(Type::string())) { |
|
48 | 48 | $error = 'Argument of include should be a string, but %s given'; |
49 | 49 | throw new InvalidArgumentException(\sprintf($error, $value->getType())); |
50 | 50 | } |
51 | 51 | |
52 | - yield from $this->loadFile($this->include($ctx, (string)$value->getValue())); |
|
52 | + yield from $this->loadFile($this->include($ctx, (string) $value->getValue())); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | return $inclusion; |
97 | 97 | } |
98 | 98 | |
99 | - $pathname = \dirname($file->getPathname()) . \DIRECTORY_SEPARATOR . $inclusion; |
|
99 | + $pathname = \dirname($file->getPathname()).\DIRECTORY_SEPARATOR.$inclusion; |
|
100 | 100 | $pathname = \str_replace('/./', '/', $pathname); |
101 | 101 | |
102 | 102 | return $pathname; |
@@ -45,7 +45,7 @@ |
||
45 | 45 | /** @var DefinitionInterface $definition */ |
46 | 46 | $definition = yield $rule->first('> #TypeDefinition'); |
47 | 47 | |
48 | - yield new NamedDeferred($definition, $ctx, function (ContextInterface $local) use ($definition, $rule) { |
|
48 | + yield new NamedDeferred($definition, $ctx, function(ContextInterface $local) use ($definition, $rule) { |
|
49 | 49 | $struct = new ObjectDefinitionValueObject(); |
50 | 50 | |
51 | 51 | $struct->type = Type::object($definition->getName()->getFullyQualifiedName()); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | yield from $name = $this->getArgumentName($argument); |
48 | 48 | yield from $value = $this->getArgumentValue($argument); |
49 | 49 | |
50 | - $definition->addArgument((string)$name->getReturn(), $value->getReturn()); |
|
50 | + $definition->addArgument((string) $name->getReturn(), $value->getReturn()); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | return $definition; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | $isConst = $name->getType()->typeOf(Type::const()); |
82 | 82 | |
83 | - if (! $isConst) { |
|
83 | + if (!$isConst) { |
|
84 | 84 | $error = 'Generic argument name must be a const but %s given'; |
85 | 85 | $exception = new TypeConflictException(\sprintf($error, $name)); |
86 | 86 | $exception->throwsIn($ctx->getFile(), $rule->getOffset()); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | throw $exception; |
89 | 89 | } |
90 | 90 | |
91 | - return Name::fromString((string)$name->getValue()); |
|
91 | + return Name::fromString((string) $name->getValue()); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | $isType = $value->getType()->typeOf(Type::type()); |
105 | 105 | |
106 | - if (! $isType) { |
|
106 | + if (!$isType) { |
|
107 | 107 | $error = 'Generic argument value must be a valid type, but %s given'; |
108 | 108 | $exception = new TypeConflictException(\sprintf($error, $value)); |
109 | 109 | $exception->throwsIn($ctx->getFile(), $rule->getOffset()); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | switch (true) { |
130 | 130 | case $isConst: |
131 | - return new InvocationPrimitive(Name::fromString((string)$name->getValue())); |
|
131 | + return new InvocationPrimitive(Name::fromString((string) $name->getValue())); |
|
132 | 132 | |
133 | 133 | case $isType: |
134 | 134 | /** @var InvocationPrimitive $value */ |
@@ -111,28 +111,28 @@ |
||
111 | 111 | |
112 | 112 | case \is_object($value): |
113 | 113 | if (\method_exists($value, '__toString')) { |
114 | - return 'o:' . $value; |
|
114 | + return 'o:'.$value; |
|
115 | 115 | } |
116 | 116 | |
117 | - return 'h:' . \spl_object_hash($value); |
|
117 | + return 'h:'.\spl_object_hash($value); |
|
118 | 118 | |
119 | 119 | case \is_numeric($value): |
120 | - return 'n:' . (int)$value; |
|
120 | + return 'n:'.(int) $value; |
|
121 | 121 | |
122 | 122 | case \is_bool($value): |
123 | - return 'b:' . (int)$value; |
|
123 | + return 'b:'.(int) $value; |
|
124 | 124 | |
125 | 125 | case \is_string($value): |
126 | - return 's:' . $value; |
|
126 | + return 's:'.$value; |
|
127 | 127 | |
128 | 128 | case \is_resource($value): |
129 | - return 'r:' . $value; |
|
129 | + return 'r:'.$value; |
|
130 | 130 | |
131 | 131 | case \is_array($value): |
132 | - return 'a:' . \md5(\serialize($value)); |
|
132 | + return 'a:'.\md5(\serialize($value)); |
|
133 | 133 | |
134 | 134 | default: |
135 | - return 'v:' . \gettype($value) . ':' . \serialize($value); |
|
135 | + return 'v:'.\gettype($value).':'.\serialize($value); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 |
@@ -30,6 +30,6 @@ |
||
30 | 30 | */ |
31 | 31 | public static function match(string $lexeme, string $value): bool |
32 | 32 | { |
33 | - return (bool)\preg_match(self::pattern($lexeme), $value); |
|
33 | + return (bool) \preg_match(self::pattern($lexeme), $value); |
|
34 | 34 | } |
35 | 35 | } |