Passed
Push — master ( 540970...be3f6e )
by Jakub
02:13
created
src/Annotations/Reader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         $this->engines[] = $engine;
23 23
     }
24 24
 
25
-    public function hasAnnotation(string $name, string|object $class, string $method = null): bool
25
+    public function hasAnnotation(string $name, string | object $class, string $method = null): bool
26 26
     {
27 27
         foreach ($this->engines as $engine) {
28 28
             if ($engine->hasAnnotation($name, $class, $method)) {
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         return false;
33 33
     }
34 34
 
35
-    public function getAnnotation(string $name, string|object $class, string $method = null): mixed
35
+    public function getAnnotation(string $name, string | object $class, string $method = null): mixed
36 36
     {
37 37
         foreach ($this->engines as $engine) {
38 38
             $value = $engine->getAnnotation($name, $class, $method);
Please login to merge, or discard this patch.
src/Annotations/PhpAttributesEngine.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      * @param class-string|object $class
23 23
      * @throws ReflectionException
24 24
      */
25
-    public function hasAnnotation(string $name, string|object $class, string $method = null): bool
25
+    public function hasAnnotation(string $name, string | object $class, string $method = null): bool
26 26
     {
27 27
         return count($this->getReflection($class, $method)->getAttributes($this->getClassName($name))) > 0;
28 28
     }
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      * @param class-string|object $class
32 32
      * @throws ReflectionException
33 33
      */
34
-    public function getAnnotation(string $name, string|object $class, string $method = null): mixed
34
+    public function getAnnotation(string $name, string | object $class, string $method = null): mixed
35 35
     {
36 36
         $attributes = $this->getReflection($class, $method)->getAttributes($this->getClassName($name));
37 37
         if (count($attributes) === 0) {
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      * @param class-string|object $class
52 52
      * @throws ReflectionException
53 53
      */
54
-    private function getReflection(string|object $class, string $method = null): ReflectionClass|ReflectionMethod
54
+    private function getReflection(string | object $class, string $method = null): ReflectionClass | ReflectionMethod
55 55
     {
56 56
         if ($method !== null) {
57 57
             $reflection = new ReflectionMethod(is_object($class) ? get_class($class) : $class, $method);
Please login to merge, or discard this patch.
src/Job.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     /** @var callable Task */
22 22
     protected $callback;
23 23
     public readonly array $params;
24
-    public readonly bool|string $skip;
24
+    public readonly bool | string $skip;
25 25
     protected JobResult $result = JobResult::PASSED;
26 26
     protected string $output = "";
27 27
     /** @var callable[] */
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         string $name,
32 32
         callable $callback,
33 33
         array $params = [],
34
-        bool|string $skip = false,
34
+        bool | string $skip = false,
35 35
         array $onAfterExecute = []
36 36
     ) {
37 37
         $this->name = $name;
Please login to merge, or discard this patch.
src/SkipChecker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     /**
50 50
      * Check whether to skip a test method
51 51
      */
52
-    public function shouldSkip(string $class, string $method): bool|string
52
+    public function shouldSkip(string $class, string $method): bool | string
53 53
     {
54 54
         $value = $this->getSkipValue($class, $method);
55 55
         if (is_scalar($value)) {
Please login to merge, or discard this patch.
src/Annotations/IAnnotationsReaderEngine.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
  */
11 11
 interface IAnnotationsReaderEngine
12 12
 {
13
-    public function hasAnnotation(string $name, string|object $class, string $method = null): bool;
13
+    public function hasAnnotation(string $name, string | object $class, string $method = null): bool;
14 14
 
15
-    public function getAnnotation(string $name, string|object $class, string $method = null): mixed;
15
+    public function getAnnotation(string $name, string | object $class, string $method = null): mixed;
16 16
 }
Please login to merge, or discard this patch.
tests/Annotations/DummyEngine.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@
 block discarded – undo
11 11
  */
12 12
 final class DummyEngine implements IAnnotationsReaderEngine
13 13
 {
14
-    public function hasAnnotation(string $name, string|object $class, string $method = null): bool
14
+    public function hasAnnotation(string $name, string | object $class, string $method = null): bool
15 15
     {
16 16
         return true;
17 17
     }
18 18
 
19
-    public function getAnnotation(string $name, string|object $class, string $method = null): mixed
19
+    public function getAnnotation(string $name, string | object $class, string $method = null): mixed
20 20
     {
21 21
         return "abc";
22 22
     }
Please login to merge, or discard this patch.
src/TestCase.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     /**
100 100
      * Get name of a test suite
101 101
      */
102
-    protected function getSuiteName(string|object|null $class = null): string
102
+    protected function getSuiteName(string | object | null $class = null): string
103 103
     {
104 104
         $class = $class ?? static::class;
105 105
         $annotation = $this->annotationsReader->getAnnotation(static::ANNOTATION_TEST_SUITE, $class);
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     /**
113 113
      * Get name for a job
114 114
      */
115
-    protected function getJobName(string|object $class, string $method): string
115
+    protected function getJobName(string | object $class, string $method): string
116 116
     {
117 117
         $annotation = $this->annotationsReader->getAnnotation(static::ANNOTATION_TEST, $class, $method);
118 118
         if ($annotation !== null) {
Please login to merge, or discard this patch.
tests/AssertTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $this->assertMatchesRegExp('/abc/', "1abc2");
68 68
         $this->assertArrayOfClass(
69 69
             \stdClass::class,
70
-            [new stdClass(), new stdClass(),]
70
+            [new stdClass(), new stdClass(), ]
71 71
         );
72 72
     }
73 73
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         $this->assertOutput(function () {
171 171
             $this->assertArrayOfClass(
172 172
                 \stdClass::class,
173
-                [new stdClass(), new DummyEngine(), "abc",]
173
+                [new stdClass(), new DummyEngine(), "abc", ]
174 174
             );
175 175
         }, "Test 57 failed. The array does not contain only instances of stdClass.\n");
176 176
         $this->assertOutput(function () {
Please login to merge, or discard this patch.
src/TAssertions.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         return $this->taskCount;
51 51
     }
52 52
 
53
-    protected function showStringOrArray(string|array $variable): string
53
+    protected function showStringOrArray(string | array $variable): string
54 54
     {
55 55
         return (is_string($variable) ? "'$variable'" : var_export($variable, true));
56 56
     }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     /**
92 92
      * Is $actual greater than $expected?
93 93
      */
94
-    protected function assertGreaterThan(int|float $expected, int|float $actual): void
94
+    protected function assertGreaterThan(int | float $expected, int | float $actual): void
95 95
     {
96 96
         $success = ($actual > $expected);
97 97
         $message = ($success) ? "" : "$actual is not greater than $expected.";
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     /**
102 102
      * Is $actual less than $expected?
103 103
      */
104
-    protected function assertLessThan(int|float $expected, int|float $actual): void
104
+    protected function assertLessThan(int | float $expected, int | float $actual): void
105 105
     {
106 106
         $success = ($actual < $expected);
107 107
         $message = ($success) ? "" : "$actual is not less than $expected.";
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     /**
172 172
      * Does $actual contain $needle?
173 173
      */
174
-    protected function assertContains(string|array $needle, string|array $actual): void
174
+    protected function assertContains(string | array $needle, string | array $actual): void
175 175
     {
176 176
         if (is_string($actual) && is_string($needle)) {
177 177
             $success = ($needle !== "" && str_contains($actual, $needle));
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     /**
190 190
      * Does $actual not contain $needle?
191 191
      */
192
-    protected function assertNotContains(string|array $needle, string|array $actual): void
192
+    protected function assertNotContains(string | array $needle, string | array $actual): void
193 193
     {
194 194
         if (is_string($actual) && is_string($needle)) {
195 195
             $success = ($needle === "" || !str_contains($actual, $needle));
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     /**
208 208
      * Does $value contain $count items?
209 209
      */
210
-    protected function assertCount(int $count, string|array|\Countable $value): void
210
+    protected function assertCount(int $count, string | array | \Countable $value): void
211 211
     {
212 212
         if (!is_array($value) && !$value instanceof \Countable) {
213 213
             trigger_error("Passing string as parameter \$value to " . __METHOD__ . " is deprecated", E_USER_DEPRECATED);
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
     /**
224 224
      * Does $value not contain $count items?
225 225
      */
226
-    protected function assertNotCount(int $count, string|array|\Countable $value): void
226
+    protected function assertNotCount(int $count, string | array | \Countable $value): void
227 227
     {
228 228
         if (!is_array($value) && !$value instanceof \Countable) {
229 229
             trigger_error("Passing string as parameter \$value to " . __METHOD__ . " is deprecated", E_USER_DEPRECATED);
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     /**
240 240
      * Is $value of type $type?
241 241
      */
242
-    protected function assertType(string|object $type, mixed $value): void
242
+    protected function assertType(string | object $type, mixed $value): void
243 243
     {
244 244
         if (
245 245
             in_array($type, [
Please login to merge, or discard this patch.