@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | namespace TheSeer\Tokenizer; |
| 3 | 3 | |
| 4 | 4 | class NamespaceUri { |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | namespace TheSeer\Tokenizer; |
| 3 | 3 | |
| 4 | 4 | class Exception extends \Exception { |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | $interfaces = $reflectionClass->getInterfaces(); |
| 61 | 61 | $tagList = array(); |
| 62 | 62 | |
| 63 | - foreach($interfaces as $interface) { |
|
| 63 | + foreach ($interfaces as $interface) { |
|
| 64 | 64 | $tagList = array_merge($tagList, $this->classRetriever->getTagList($interface)); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -60,8 +60,8 @@ |
||
| 60 | 60 | $comparator->assertEquals($argument, $this->value); |
| 61 | 61 | return 10; |
| 62 | 62 | } catch (ComparisonFailure $failure) { |
| 63 | - return false; |
|
| 64 | - } |
|
| 63 | + return false; |
|
| 64 | + } |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | // If either one is an object it should be castable to a string |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function __construct($value) |
| 28 | 28 | { |
| 29 | - $this->token = $value instanceof TokenInterface? $value : new ExactValueToken($value); |
|
| 29 | + $this->token = $value instanceof TokenInterface ? $value : new ExactValueToken($value); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -58,10 +58,10 @@ discard block |
||
| 58 | 58 | return false; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - $keyScores = array_map(array($this->key,'scoreArgument'), array_keys($argument)); |
|
| 62 | - $valueScores = array_map(array($this->value,'scoreArgument'), $argument); |
|
| 63 | - $scoreEntry = function ($value, $key) { |
|
| 64 | - return $value && $key ? min(8, ($key + $value) / 2) : false; |
|
| 61 | + $keyScores = array_map(array($this->key, 'scoreArgument'), array_keys($argument)); |
|
| 62 | + $valueScores = array_map(array($this->value, 'scoreArgument'), $argument); |
|
| 63 | + $scoreEntry = function($value, $key) { |
|
| 64 | + return $value && $key ? min(8, ($key + $value)/2) : false; |
|
| 65 | 65 | }; |
| 66 | 66 | |
| 67 | 67 | return max(array_map($scoreEntry, $valueScores, $keyScores)); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | if (!$this->key instanceof ExactValueToken) { |
| 132 | 132 | throw new InvalidArgumentException(sprintf( |
| 133 | - 'You can only use exact value tokens to match key of ArrayAccess object'.PHP_EOL. |
|
| 133 | + 'You can only use exact value tokens to match key of ArrayAccess object' . PHP_EOL . |
|
| 134 | 134 | 'But you used `%s`.', |
| 135 | 135 | $this->key |
| 136 | 136 | )); |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | return false; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return array_sum($scores) / count($scores); |
|
| 56 | + return array_sum($scores)/count($scores); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -83,8 +83,8 @@ |
||
| 83 | 83 | public function __toString() |
| 84 | 84 | { |
| 85 | 85 | if (null === $this->string) { |
| 86 | - $this->string = implode(', ', array_map(function ($token) { |
|
| 87 | - return (string) $token; |
|
| 86 | + $this->string = implode(', ', array_map(function($token) { |
|
| 87 | + return (string)$token; |
|
| 88 | 88 | }, $this->tokens)); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -162,7 +162,7 @@ |
||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | private function createUnexpectedCallException(ObjectProphecy $prophecy, $methodName, |
| 165 | - array $arguments) |
|
| 165 | + array $arguments) |
|
| 166 | 166 | { |
| 167 | 167 | $classname = get_class($prophecy->reveal()); |
| 168 | 168 | $indentationLength = 8; // looks good |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // Sort matches by their score value |
| 93 | - @usort($matches, function ($match1, $match2) { return $match2[0] - $match1[0]; }); |
|
| 93 | + @usort($matches, function($match1, $match2) { return $match2[0] - $match1[0]; }); |
|
| 94 | 94 | |
| 95 | 95 | $score = $matches[0][0]; |
| 96 | 96 | // If Highest rated method prophecy has a promise - execute it or return null instead |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $methodName = strtolower($methodName); |
| 138 | 138 | |
| 139 | 139 | return array_values( |
| 140 | - array_filter($this->recordedCalls, function (Call $call) use ($methodName, $wildcard) { |
|
| 140 | + array_filter($this->recordedCalls, function(Call $call) use ($methodName, $wildcard) { |
|
| 141 | 141 | return $methodName === strtolower($call->getMethodName()) |
| 142 | 142 | && 0 < $call->getScore($wildcard) |
| 143 | 143 | ; |
@@ -194,11 +194,11 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | return new UnexpectedCallException( |
| 196 | 196 | sprintf( |
| 197 | - "Unexpected method call on %s:\n". |
|
| 198 | - " - %s(\n". |
|
| 199 | - "%s\n". |
|
| 200 | - " )\n". |
|
| 201 | - "expected calls were:\n". |
|
| 197 | + "Unexpected method call on %s:\n" . |
|
| 198 | + " - %s(\n" . |
|
| 199 | + "%s\n" . |
|
| 200 | + " )\n" . |
|
| 201 | + "expected calls were:\n" . |
|
| 202 | 202 | "%s", |
| 203 | 203 | |
| 204 | 204 | $classname, $methodName, $argstring, implode("\n", $expected) |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | { |
| 213 | 213 | return preg_replace_callback( |
| 214 | 214 | '/^/m', |
| 215 | - function () use ($indentationLength) { |
|
| 215 | + function() use ($indentationLength) { |
|
| 216 | 216 | return str_repeat(' ', $indentationLength); |
| 217 | 217 | }, |
| 218 | 218 | $arguments |