Passed
Push — master ( e8b00c...89139c )
by Anton
07:46
created
src/Attributes/src/Internal/Key/ModificationTimeKeyGenerator.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function forClass(\ReflectionClass $class): string
27 27
     {
28
-        if ($class->isUserDefined()) {
28
+        if ($class->isUserDefined()){
29 29
             return (string)\filemtime(
30 30
                 $class->getFileName()
31 31
             );
@@ -61,23 +61,23 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function forFunction(\ReflectionFunctionAbstract $fn): string
63 63
     {
64
-        if ($fn instanceof \ReflectionMethod) {
64
+        if ($fn instanceof \ReflectionMethod){
65 65
             return $this->forClass(
66 66
                 $fn->getDeclaringClass()
67 67
             );
68 68
         }
69 69
 
70
-        if ($fn->isUserDefined()) {
70
+        if ($fn->isUserDefined()){
71 71
             return (string)\filemtime(
72 72
                 $fn->getFileName()
73 73
             );
74 74
         }
75 75
 
76
-        if ($extension = $fn->getExtension()) {
76
+        if ($extension = $fn->getExtension()){
77 77
             return $extension->getVersion();
78 78
         }
79 79
 
80
-        throw new \LogicException('Can not determine modification time of [' . $fn->getName() . ']');
80
+        throw new \LogicException('Can not determine modification time of ['.$fn->getName().']');
81 81
     }
82 82
 
83 83
     /**
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,8 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function forClass(\ReflectionClass $class): string
27 27
     {
28
-        if ($class->isUserDefined()) {
28
+        if ($class->isUserDefined())
29
+        {
29 30
             return (string)\filemtime(
30 31
                 $class->getFileName()
31 32
             );
@@ -61,19 +62,22 @@  discard block
 block discarded – undo
61 62
      */
62 63
     public function forFunction(\ReflectionFunctionAbstract $fn): string
63 64
     {
64
-        if ($fn instanceof \ReflectionMethod) {
65
+        if ($fn instanceof \ReflectionMethod)
66
+        {
65 67
             return $this->forClass(
66 68
                 $fn->getDeclaringClass()
67 69
             );
68 70
         }
69 71
 
70
-        if ($fn->isUserDefined()) {
72
+        if ($fn->isUserDefined())
73
+        {
71 74
             return (string)\filemtime(
72 75
                 $fn->getFileName()
73 76
             );
74 77
         }
75 78
 
76
-        if ($extension = $fn->getExtension()) {
79
+        if ($extension = $fn->getExtension())
80
+        {
77 81
             return $extension->getVersion();
78 82
         }
79 83
 
Please login to merge, or discard this patch.
src/Attributes/src/Internal/FallbackAttributeReader.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     {
97 97
         // 1) Can not parse internal classes
98 98
         // 2) Anonymous classes don't support attributes (PHP semantic)
99
-        if ($class->isInternal() || $class->isAnonymous()) {
99
+        if ($class->isInternal() || $class->isAnonymous()){
100 100
             return [];
101 101
         }
102 102
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     protected function getFunctionAttributes(\ReflectionFunctionAbstract $function, ?string $name): iterable
112 112
     {
113 113
         // Can not parse internal functions
114
-        if ($function->isInternal()) {
114
+        if ($function->isInternal()){
115 115
             return [];
116 116
         }
117 117
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         $class = $property->getDeclaringClass();
130 130
 
131 131
         // Can not parse property of internal class
132
-        if ($class->isInternal()) {
132
+        if ($class->isInternal()){
133 133
             return [];
134 134
         }
135 135
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         $class = $const->getDeclaringClass();
147 147
 
148 148
         // Can not parse internal classes
149
-        if ($class->isInternal()) {
149
+        if ($class->isInternal()){
150 150
             return [];
151 151
         }
152 152
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         $function = $param->getDeclaringFunction();
164 164
 
165 165
         // Can not parse parameter of internal function
166
-        if ($function->isInternal()) {
166
+        if ($function->isInternal()){
167 167
             return [];
168 168
         }
169 169
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
      */
183 183
     private function parseAttributes(string $file, int $context): array
184 184
     {
185
-        if (!isset($this->attributes[$file])) {
185
+        if (!isset($this->attributes[$file])){
186 186
             $found = $this->parser->parse($file);
187 187
 
188 188
             $this->attributes[$file] = [
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
      */
205 205
     private function format(iterable $attributes, ?string $name, \Reflector $context): iterable
206 206
     {
207
-        foreach ($attributes as $prototype) {
208
-            if ($prototype->name !== $name && $name !== null && !\is_subclass_of($prototype->name, $name)) {
207
+        foreach ($attributes as $prototype){
208
+            if ($prototype->name !== $name && $name !== null && !\is_subclass_of($prototype->name, $name)){
209 209
                 continue;
210 210
             }
211 211
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
          */
246 246
         $line = $function->getEndLine();
247 247
 
248
-        if ($result = $attributes[$line] ?? null) {
248
+        if ($result = $attributes[$line] ?? null){
249 249
             return $result;
250 250
         }
251 251
 
@@ -270,9 +270,9 @@  discard block
 block discarded – undo
270 270
          *  $ast->getEndLine(); // 2 (last significant character of a function)
271 271
          * </code>
272 272
          */
273
-        if ($function->isClosure()) {
274
-            while ($line-- > $function->getStartLine()) {
275
-                if ($result = $attributes[$line] ?? null) {
273
+        if ($function->isClosure()){
274
+            while ($line-- > $function->getStartLine()){
275
+                if ($result = $attributes[$line] ?? null){
276 276
                     return $result;
277 277
                 }
278 278
             }
Please login to merge, or discard this patch.
Braces   +24 added lines, -12 removed lines patch added patch discarded remove patch
@@ -96,7 +96,8 @@  discard block
 block discarded – undo
96 96
     {
97 97
         // 1) Can not parse internal classes
98 98
         // 2) Anonymous classes don't support attributes (PHP semantic)
99
-        if ($class->isInternal() || $class->isAnonymous()) {
99
+        if ($class->isInternal() || $class->isAnonymous())
100
+        {
100 101
             return [];
101 102
         }
102 103
 
@@ -111,7 +112,8 @@  discard block
 block discarded – undo
111 112
     protected function getFunctionAttributes(\ReflectionFunctionAbstract $function, ?string $name): iterable
112 113
     {
113 114
         // Can not parse internal functions
114
-        if ($function->isInternal()) {
115
+        if ($function->isInternal())
116
+        {
115 117
             return [];
116 118
         }
117 119
 
@@ -129,7 +131,8 @@  discard block
 block discarded – undo
129 131
         $class = $property->getDeclaringClass();
130 132
 
131 133
         // Can not parse property of internal class
132
-        if ($class->isInternal()) {
134
+        if ($class->isInternal())
135
+        {
133 136
             return [];
134 137
         }
135 138
 
@@ -146,7 +149,8 @@  discard block
 block discarded – undo
146 149
         $class = $const->getDeclaringClass();
147 150
 
148 151
         // Can not parse internal classes
149
-        if ($class->isInternal()) {
152
+        if ($class->isInternal())
153
+        {
150 154
             return [];
151 155
         }
152 156
 
@@ -163,7 +167,8 @@  discard block
 block discarded – undo
163 167
         $function = $param->getDeclaringFunction();
164 168
 
165 169
         // Can not parse parameter of internal function
166
-        if ($function->isInternal()) {
170
+        if ($function->isInternal())
171
+        {
167 172
             return [];
168 173
         }
169 174
 
@@ -182,7 +187,8 @@  discard block
 block discarded – undo
182 187
      */
183 188
     private function parseAttributes(string $file, int $context): array
184 189
     {
185
-        if (!isset($this->attributes[$file])) {
190
+        if (!isset($this->attributes[$file]))
191
+        {
186 192
             $found = $this->parser->parse($file);
187 193
 
188 194
             $this->attributes[$file] = [
@@ -204,8 +210,10 @@  discard block
 block discarded – undo
204 210
      */
205 211
     private function format(iterable $attributes, ?string $name, \Reflector $context): iterable
206 212
     {
207
-        foreach ($attributes as $prototype) {
208
-            if ($prototype->name !== $name && $name !== null && !\is_subclass_of($prototype->name, $name)) {
213
+        foreach ($attributes as $prototype)
214
+        {
215
+            if ($prototype->name !== $name && $name !== null && !\is_subclass_of($prototype->name, $name))
216
+            {
209 217
                 continue;
210 218
             }
211 219
 
@@ -245,7 +253,8 @@  discard block
 block discarded – undo
245 253
          */
246 254
         $line = $function->getEndLine();
247 255
 
248
-        if ($result = $attributes[$line] ?? null) {
256
+        if ($result = $attributes[$line] ?? null)
257
+        {
249 258
             return $result;
250 259
         }
251 260
 
@@ -270,9 +279,12 @@  discard block
 block discarded – undo
270 279
          *  $ast->getEndLine(); // 2 (last significant character of a function)
271 280
          * </code>
272 281
          */
273
-        if ($function->isClosure()) {
274
-            while ($line-- > $function->getStartLine()) {
275
-                if ($result = $attributes[$line] ?? null) {
282
+        if ($function->isClosure())
283
+        {
284
+            while ($line-- > $function->getStartLine())
285
+            {
286
+                if ($result = $attributes[$line] ?? null)
287
+                {
276 288
                     return $result;
277 289
                 }
278 290
             }
Please login to merge, or discard this patch.
src/Attributes/src/Bridge/DoctrineReaderBridge.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@
 block discarded – undo
110 110
      */
111 111
     private function iterableToArray(iterable $meta): array
112 112
     {
113
-        if ($meta instanceof \Traversable) {
113
+        if ($meta instanceof \Traversable){
114 114
             return \iterator_to_array($meta, false);
115 115
         }
116 116
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,8 @@
 block discarded – undo
110 110
      */
111 111
     private function iterableToArray(iterable $meta): array
112 112
     {
113
-        if ($meta instanceof \Traversable) {
113
+        if ($meta instanceof \Traversable)
114
+        {
114 115
             return \iterator_to_array($meta, false);
115 116
         }
116 117
 
Please login to merge, or discard this patch.
src/Attributes/src/NamedArgumentConstructor.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@
 block discarded – undo
22 22
 //
23 23
 // In this case, it should be loaded explicitly.
24 24
 //
25
-if (!\class_exists(DoctrineNamedArgumentConstructor::class, false)) {
26
-    require_once __DIR__ . '/polyfill.php';
25
+if (!\class_exists(DoctrineNamedArgumentConstructor::class, false)){
26
+    require_once __DIR__.'/polyfill.php';
27 27
 }
28 28
 
29 29
 /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@
 block discarded – undo
22 22
 //
23 23
 // In this case, it should be loaded explicitly.
24 24
 //
25
-if (!\class_exists(DoctrineNamedArgumentConstructor::class, false)) {
25
+if (!\class_exists(DoctrineNamedArgumentConstructor::class, false))
26
+{
26 27
     require_once __DIR__ . '/polyfill.php';
27 28
 }
28 29
 
Please login to merge, or discard this patch.
tests/Instantiator/Fixtures/DoctrineLikeArrayConstructorFixture.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@
 block discarded – undo
22 22
      */
23 23
     public function __construct(array $values)
24 24
     {
25
-        foreach ($values as $name => $value) {
26
-            if (\property_exists($this, $name)) {
25
+        foreach ($values as $name => $value){
26
+            if (\property_exists($this, $name)){
27 27
                 $this->$name = $value;
28 28
             }
29 29
         }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,10 @@
 block discarded – undo
22 22
      */
23 23
     public function __construct(array $values)
24 24
     {
25
-        foreach ($values as $name => $value) {
26
-            if (\property_exists($this, $name)) {
25
+        foreach ($values as $name => $value)
26
+        {
27
+            if (\property_exists($this, $name))
28
+            {
27 29
                 $this->$name = $value;
28 30
             }
29 31
         }
Please login to merge, or discard this patch.
src/Validation/src/Checker/StringChecker.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
      */
89 89
     public function range($value, int $min, int $max): bool
90 90
     {
91
-        if (!is_string($value)) {
91
+        if (!is_string($value)){
92 92
             return false;
93 93
         }
94 94
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,8 @@
 block discarded – undo
88 88
      */
89 89
     public function range($value, int $min, int $max): bool
90 90
     {
91
-        if (!is_string($value)) {
91
+        if (!is_string($value))
92
+        {
92 93
             return false;
93 94
         }
94 95
 
Please login to merge, or discard this patch.
src/Translator/src/Catalogue.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public function has(string $domain, string $id): bool
59 59
     {
60
-        if (!isset($this->data[$domain])) {
60
+        if (!isset($this->data[$domain])){
61 61
             return false;
62 62
         }
63 63
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function get(string $domain, string $id): string
71 71
     {
72
-        if (!$this->has($domain, $id)) {
72
+        if (!$this->has($domain, $id)){
73 73
             throw new CatalogueException("Undefined string in domain '{$domain}'");
74 74
         }
75 75
 
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function mergeFrom(MessageCatalogue $catalogue, bool $follow = true): void
101 101
     {
102
-        foreach ($catalogue->all() as $domain => $messages) {
103
-            if (!isset($this->data[$domain])) {
102
+        foreach ($catalogue->all() as $domain => $messages){
103
+            if (!isset($this->data[$domain])){
104 104
                 $this->data[$domain] = [];
105 105
             }
106 106
 
107
-            if ($follow) {
107
+            if ($follow){
108 108
                 //MessageCatalogue string has higher priority that string stored in memory
109 109
                 $this->data[$domain] = array_merge($messages, $this->data[$domain]);
110
-            } else {
110
+            }else{
111 111
                 $this->data[$domain] = array_merge($this->data[$domain], $messages);
112 112
             }
113 113
         }
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,7 +57,8 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public function has(string $domain, string $id): bool
59 59
     {
60
-        if (!isset($this->data[$domain])) {
60
+        if (!isset($this->data[$domain]))
61
+        {
61 62
             return false;
62 63
         }
63 64
 
@@ -69,7 +70,8 @@  discard block
 block discarded – undo
69 70
      */
70 71
     public function get(string $domain, string $id): string
71 72
     {
72
-        if (!$this->has($domain, $id)) {
73
+        if (!$this->has($domain, $id))
74
+        {
73 75
             throw new CatalogueException("Undefined string in domain '{$domain}'");
74 76
         }
75 77
 
@@ -99,15 +101,20 @@  discard block
 block discarded – undo
99 101
      */
100 102
     public function mergeFrom(MessageCatalogue $catalogue, bool $follow = true): void
101 103
     {
102
-        foreach ($catalogue->all() as $domain => $messages) {
103
-            if (!isset($this->data[$domain])) {
104
+        foreach ($catalogue->all() as $domain => $messages)
105
+        {
106
+            if (!isset($this->data[$domain]))
107
+            {
104 108
                 $this->data[$domain] = [];
105 109
             }
106 110
 
107
-            if ($follow) {
111
+            if ($follow)
112
+            {
108 113
                 //MessageCatalogue string has higher priority that string stored in memory
109 114
                 $this->data[$domain] = array_merge($messages, $this->data[$domain]);
110
-            } else {
115
+            }
116
+            else
117
+            {
111 118
                 $this->data[$domain] = array_merge($this->data[$domain], $messages);
112 119
             }
113 120
         }
Please login to merge, or discard this patch.
src/Distribution/src/Resolver/ExpirationAwareResolver.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
      */
114 114
     private function resolveExpirationInterval($expiration): \DateInterval
115 115
     {
116
-        if ($expiration === null) {
116
+        if ($expiration === null){
117 117
             return $this->expiration;
118 118
         }
119 119
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,8 @@
 block discarded – undo
113 113
      */
114 114
     private function resolveExpirationInterval($expiration): \DateInterval
115 115
     {
116
-        if ($expiration === null) {
116
+        if ($expiration === null)
117
+        {
117 118
             return $this->expiration;
118 119
         }
119 120
 
Please login to merge, or discard this patch.
src/Distribution/src/Internal/DateTimeIntervalFactory.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function create($duration): \DateInterval
41 41
     {
42
-        try {
42
+        try{
43 43
             return $this->createOrFail($duration);
44
-        } catch (\InvalidArgumentException $e) {
44
+        }catch (\InvalidArgumentException $e){
45 45
             throw $e;
46
-        } catch (\Throwable $e) {
46
+        }catch (\Throwable $e){
47 47
             throw new \InvalidArgumentException($e->getMessage(), (int)$e->getCode(), $e);
48 48
         }
49 49
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     private function createOrFail($duration): \DateInterval
67 67
     {
68
-        switch (true) {
68
+        switch (true){
69 69
             case $duration instanceof \DateInterval:
70 70
                 return $duration;
71 71
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                 return new \DateInterval($duration);
77 77
 
78 78
             case \is_int($duration):
79
-                return new \DateInterval('PT' . $duration . 'S');
79
+                return new \DateInterval('PT'.$duration.'S');
80 80
 
81 81
             case $duration === null:
82 82
                 return new \DateInterval('PT0S');
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,11 +39,16 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function create($duration): \DateInterval
41 41
     {
42
-        try {
42
+        try
43
+        {
43 44
             return $this->createOrFail($duration);
44
-        } catch (\InvalidArgumentException $e) {
45
+        }
46
+        catch (\InvalidArgumentException $e)
47
+        {
45 48
             throw $e;
46
-        } catch (\Throwable $e) {
49
+        }
50
+        catch (\Throwable $e)
51
+        {
47 52
             throw new \InvalidArgumentException($e->getMessage(), (int)$e->getCode(), $e);
48 53
         }
49 54
     }
@@ -65,7 +70,8 @@  discard block
 block discarded – undo
65 70
      */
66 71
     private function createOrFail($duration): \DateInterval
67 72
     {
68
-        switch (true) {
73
+        switch (true)
74
+        {
69 75
             case $duration instanceof \DateInterval:
70 76
                 return $duration;
71 77
 
Please login to merge, or discard this patch.