@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $this->metadata[$spec] = $value; |
41 | 41 | return $this; |
42 | 42 | } |
43 | - if (! is_array($spec) && ! $spec instanceof Traversable) { |
|
43 | + if (!is_array($spec) && !$spec instanceof Traversable) { |
|
44 | 44 | throw new Exception\InvalidArgumentException(sprintf( |
45 | 45 | 'Expected a string, array, or Traversable argument in first position; received "%s"', |
46 | 46 | (is_object($spec) ? get_class($spec) : gettype($spec)) |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | return $this->metadata; |
67 | 67 | } |
68 | 68 | |
69 | - if (! is_scalar($key)) { |
|
69 | + if (!is_scalar($key)) { |
|
70 | 70 | throw new Exception\InvalidArgumentException('Non-scalar argument provided for key'); |
71 | 71 | } |
72 | 72 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | (string) $value |
113 | 113 | ); |
114 | 114 | } |
115 | - $request .= "\r\n" . $this->getContent(); |
|
115 | + $request .= "\r\n".$this->getContent(); |
|
116 | 116 | return $request; |
117 | 117 | } |
118 | 118 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | foreach ($this->highlightMap as $key => $color) { |
79 | 79 | $pattern = sprintf('#<%s>(.*?)</%s>#s', $key, $key); |
80 | 80 | $color = $this->supportsColor ? $color : ''; |
81 | - $string = preg_replace($pattern, $color . '$1' . $reset, $string); |
|
81 | + $string = preg_replace($pattern, $color.'$1'.$reset, $string); |
|
82 | 82 | } |
83 | 83 | return $string; |
84 | 84 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function writeLine($string, $colorize = true, $resource = STDOUT) |
110 | 110 | { |
111 | - $this->write($string . $this->eol, $colorize, $resource); |
|
111 | + $this->write($string.$this->eol, $colorize, $resource); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public static function start($errorLevel = \E_WARNING) |
53 | 53 | { |
54 | - if (! static::$stack) { |
|
54 | + if (!static::$stack) { |
|
55 | 55 | set_error_handler([get_called_class(), 'addError'], $errorLevel); |
56 | 56 | } |
57 | 57 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | if (static::$stack) { |
73 | 73 | $errorException = array_pop(static::$stack); |
74 | 74 | |
75 | - if (! static::$stack) { |
|
75 | + if (!static::$stack) { |
|
76 | 76 | restore_error_handler(); |
77 | 77 | } |
78 | 78 |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function insert($value, $priority) |
92 | 92 | { |
93 | - if (! is_int($priority)) { |
|
93 | + if (!is_int($priority)) { |
|
94 | 94 | throw new Exception\InvalidArgumentException('The priority must be an integer'); |
95 | 95 | } |
96 | 96 | $this->values[$priority][] = $value; |
97 | - if (! isset($this->priorities[$priority])) { |
|
97 | + if (!isset($this->priorities[$priority])) { |
|
98 | 98 | $this->priorities[$priority] = $priority; |
99 | 99 | $this->maxPriority = $this->maxPriority === null ? $priority : max($priority, $this->maxPriority); |
100 | 100 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function extract() |
111 | 111 | { |
112 | - if (! $this->valid()) { |
|
112 | + if (!$this->valid()) { |
|
113 | 113 | return false; |
114 | 114 | } |
115 | 115 | $value = $this->current(); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | $dataName = 'Argument', |
30 | 30 | $exceptionClass = 'Zend\Stdlib\Exception\InvalidArgumentException' |
31 | 31 | ) { |
32 | - if (! is_array($data) && ! ($data instanceof Traversable)) { |
|
32 | + if (!is_array($data) && !($data instanceof Traversable)) { |
|
33 | 33 | $message = sprintf( |
34 | 34 | "%s must be an array or Traversable, [%s] given", |
35 | 35 | $dataName, |
@@ -36,7 +36,7 @@ |
||
36 | 36 | */ |
37 | 37 | public function insert($datum, $priority) |
38 | 38 | { |
39 | - if (! is_array($priority)) { |
|
39 | + if (!is_array($priority)) { |
|
40 | 40 | $priority = [$priority, $this->serial--]; |
41 | 41 | } |
42 | 42 | parent::insert($datum, $priority); |
@@ -37,7 +37,7 @@ |
||
37 | 37 | { |
38 | 38 | $extractionStrategies = ArrayUtils::iteratorToArray($extractionStrategies); |
39 | 39 | $this->extractionStrategies = array_map( |
40 | - function (StrategyInterface $strategy) { |
|
40 | + function(StrategyInterface $strategy) { |
|
41 | 41 | // this callback is here only to ensure type-safety |
42 | 42 | return $strategy; |
43 | 43 | }, |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function __construct(HydratorInterface $objectHydrator, string $objectClassName) |
40 | 40 | { |
41 | - if (! class_exists($objectClassName)) { |
|
41 | + if (!class_exists($objectClassName)) { |
|
42 | 42 | throw new Exception\InvalidArgumentException(sprintf( |
43 | 43 | 'Object class name needs to be the name of an existing class, got "%s" instead.', |
44 | 44 | $objectClassName |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function extract($value, ?object $object = null) |
60 | 60 | { |
61 | - if (! is_array($value)) { |
|
61 | + if (!is_array($value)) { |
|
62 | 62 | throw new Exception\InvalidArgumentException(sprintf( |
63 | 63 | 'Value needs to be an array, got "%s" instead.', |
64 | 64 | is_object($value) ? get_class($value) : gettype($value) |
65 | 65 | )); |
66 | 66 | } |
67 | 67 | |
68 | - return array_map(function ($object) { |
|
69 | - if (! $object instanceof $this->objectClassName) { |
|
68 | + return array_map(function($object) { |
|
69 | + if (!$object instanceof $this->objectClassName) { |
|
70 | 70 | throw new Exception\InvalidArgumentException(sprintf( |
71 | 71 | 'Value needs to be an instance of "%s", got "%s" instead.', |
72 | 72 | $this->objectClassName, |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function hydrate($value, ?array $data = null) |
89 | 89 | { |
90 | - if (! is_array($value)) { |
|
90 | + if (!is_array($value)) { |
|
91 | 91 | throw new Exception\InvalidArgumentException(sprintf( |
92 | 92 | 'Value needs to be an array, got "%s" instead.', |
93 | 93 | is_object($value) ? get_class($value) : gettype($value) |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | $reflection = new ReflectionClass($this->objectClassName); |
98 | 98 | |
99 | - return array_map(function ($data) use ($reflection) { |
|
99 | + return array_map(function($data) use ($reflection) { |
|
100 | 100 | return $this->objectHydrator->hydrate( |
101 | 101 | $data, |
102 | 102 | $reflection->newInstanceWithoutConstructor() |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function __construct($trueValue, $falseValue) |
43 | 43 | { |
44 | - if (! is_int($trueValue) && ! is_string($trueValue)) { |
|
44 | + if (!is_int($trueValue) && !is_string($trueValue)) { |
|
45 | 45 | throw new InvalidArgumentException(sprintf( |
46 | 46 | 'Unable to instantiate BooleanStrategy. Expected int or string as $trueValue. %s was given', |
47 | 47 | is_object($trueValue) ? get_class($trueValue) : gettype($trueValue) |
48 | 48 | )); |
49 | 49 | } |
50 | 50 | |
51 | - if (! is_int($falseValue) && ! is_string($falseValue)) { |
|
51 | + if (!is_int($falseValue) && !is_string($falseValue)) { |
|
52 | 52 | throw new InvalidArgumentException(sprintf( |
53 | 53 | 'Unable to instantiate BooleanStrategy. Expected int or string as $falseValue. %s was given', |
54 | 54 | is_object($falseValue) ? get_class($falseValue) : gettype($falseValue) |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function extract($value, ?object $object = null) |
70 | 70 | { |
71 | - if (! is_bool($value)) { |
|
71 | + if (!is_bool($value)) { |
|
72 | 72 | throw new InvalidArgumentException(sprintf( |
73 | 73 | 'Unable to extract. Expected bool. %s was given.', |
74 | 74 | is_object($value) ? get_class($value) : gettype($value) |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | return $value; |
92 | 92 | } |
93 | 93 | |
94 | - if (! is_string($value) && ! is_int($value)) { |
|
94 | + if (!is_string($value) && !is_int($value)) { |
|
95 | 95 | throw new InvalidArgumentException(sprintf( |
96 | 96 | 'Unable to hydrate. Expected bool, string or int. %s was given.', |
97 | 97 | is_object($value) ? get_class($value) : gettype($value) |