Passed
Pull Request — master (#736)
by Abdul Malik
06:39
created
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.
src/Storage/src/File/UriResolvableTrait.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     {
32 32
         $resolver = $this->getResolver();
33 33
 
34
-        if ($resolver === null) {
34
+        if ($resolver === null){
35 35
             throw new \LogicException('Can not generate public url: File not accessible by HTTP');
36 36
         }
37 37
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@
 block discarded – undo
31 31
     {
32 32
         $resolver = $this->getResolver();
33 33
 
34
-        if ($resolver === null) {
34
+        if ($resolver === null)
35
+        {
35 36
             throw new \LogicException('Can not generate public url: File not accessible by HTTP');
36 37
         }
37 38
 
Please login to merge, or discard this patch.
src/Storage/tests/TestCase.php 2 patches
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,20 +63,26 @@
 block discarded – undo
63 63
         );
64 64
 
65 65
         /** @var \SplFileInfo $file */
66
-        foreach($iterator as $file) {
67
-            if ($file->getFilename() === '.gitignore') {
66
+        foreach($iterator as $file)
67
+        {
68
+            if ($file->getFilename() === '.gitignore')
69
+            {
68 70
                 continue;
69 71
             }
70 72
 
71 73
             \error_clear_last();
72 74
 
73
-            if ($file->isDir()) {
75
+            if ($file->isDir())
76
+            {
74 77
                 @\rmdir($file->getPathname());
75
-            } else {
78
+            }
79
+            else
80
+            {
76 81
                 @\unlink($file->getPathname());
77 82
             }
78 83
 
79
-            if ($error = \error_get_last()) {
84
+            if ($error = \error_get_last())
85
+            {
80 86
                 $prefix = 'An error occurred while clear temporary local storage directory: ';
81 87
                 $this->addWarning($prefix . $error['message']);
82 88
             }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     /**
15 15
      * @var string
16 16
      */
17
-    protected const LOCAL_STORAGE_DIRECTORY = __DIR__ . '/storage';
17
+    protected const LOCAL_STORAGE_DIRECTORY = __DIR__.'/storage';
18 18
 
19 19
     /**
20 20
      * @var BucketInterface
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         );
39 39
 
40 40
         $this->second = Bucket::fromAdapter(
41
-            new LocalFilesystemAdapter(self::LOCAL_STORAGE_DIRECTORY . '/second')
41
+            new LocalFilesystemAdapter(self::LOCAL_STORAGE_DIRECTORY.'/second')
42 42
         );
43 43
     }
44 44
 
@@ -63,22 +63,22 @@  discard block
 block discarded – undo
63 63
         );
64 64
 
65 65
         /** @var \SplFileInfo $file */
66
-        foreach($iterator as $file) {
67
-            if ($file->getFilename() === '.gitignore') {
66
+        foreach ($iterator as $file){
67
+            if ($file->getFilename() === '.gitignore'){
68 68
                 continue;
69 69
             }
70 70
 
71 71
             \error_clear_last();
72 72
 
73
-            if ($file->isDir()) {
73
+            if ($file->isDir()){
74 74
                 @\rmdir($file->getPathname());
75
-            } else {
75
+            }else{
76 76
                 @\unlink($file->getPathname());
77 77
             }
78 78
 
79
-            if ($error = \error_get_last()) {
79
+            if ($error = \error_get_last()){
80 80
                 $prefix = 'An error occurred while clear temporary local storage directory: ';
81
-                $this->addWarning($prefix . $error['message']);
81
+                $this->addWarning($prefix.$error['message']);
82 82
             }
83 83
         }
84 84
     }
Please login to merge, or discard this patch.