Passed
Push — master ( e8b00c...89139c )
by Anton
07:46
created
src/Validation/src/CheckerRule.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         string $method,
42 42
         array $args = [],
43 43
         ?string $message = null
44
-    ) {
44
+    ){
45 45
         $this->checker = $checker;
46 46
         $this->method = $method;
47 47
         $this->args = $args;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function getMessage(string $field, $value): string
71 71
     {
72
-        if (!empty($this->message)) {
72
+        if (!empty($this->message)){
73 73
             return $this->say(
74 74
                 $this->message,
75 75
                 array_merge([$value, $field], $this->args)
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,8 @@
 block discarded – undo
69 69
      */
70 70
     public function getMessage(string $field, $value): string
71 71
     {
72
-        if (!empty($this->message)) {
72
+        if (!empty($this->message))
73
+        {
73 74
             return $this->say(
74 75
                 $this->message,
75 76
                 array_merge([$value, $field], $this->args)
Please login to merge, or discard this patch.
src/Bridge/DataGrid/src/Specification/Sorter/InjectionSorter.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
     public function __construct(SpecificationInterface $expression)
21 21
     {
22
-        if (!$expression instanceof AbstractSorter) {
22
+        if (!$expression instanceof AbstractSorter){
23 23
             throw new \LogicException('Only sorters allowed');
24 24
         }
25 25
 
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $injector = static::INJECTION;
35 35
 
36
-        if (!class_exists($injector)) {
36
+        if (!class_exists($injector)){
37 37
             throw new \LogicException(
38 38
                 sprintf('Class "%s" does not exist', $injector)
39 39
             );
40 40
         }
41 41
 
42
-        if (!is_subclass_of($injector, FragmentInterface::class)) {
42
+        if (!is_subclass_of($injector, FragmentInterface::class)){
43 43
             throw new \LogicException(
44 44
                 'INJECTION class does not implement FragmentInterface'
45 45
             );
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@  discard block
 block discarded – undo
19 19
 
20 20
     public function __construct(SpecificationInterface $expression)
21 21
     {
22
-        if (!$expression instanceof AbstractSorter) {
22
+        if (!$expression instanceof AbstractSorter)
23
+        {
23 24
             throw new \LogicException('Only sorters allowed');
24 25
         }
25 26
 
@@ -33,13 +34,15 @@  discard block
 block discarded – undo
33 34
     {
34 35
         $injector = static::INJECTION;
35 36
 
36
-        if (!class_exists($injector)) {
37
+        if (!class_exists($injector))
38
+        {
37 39
             throw new \LogicException(
38 40
                 sprintf('Class "%s" does not exist', $injector)
39 41
             );
40 42
         }
41 43
 
42
-        if (!is_subclass_of($injector, FragmentInterface::class)) {
44
+        if (!is_subclass_of($injector, FragmentInterface::class))
45
+        {
43 46
             throw new \LogicException(
44 47
                 'INJECTION class does not implement FragmentInterface'
45 48
             );
Please login to merge, or discard this patch.
src/Bridge/DataGrid/src/Writer/QueryWriter.php 2 patches
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -53,23 +53,23 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function write($source, SpecificationInterface $specification, Compiler $compiler)
55 55
     {
56
-        if (!$this->targetAcceptable($source)) {
56
+        if (!$this->targetAcceptable($source)){
57 57
             return null;
58 58
         }
59 59
 
60
-        if ($specification instanceof Specification\FilterInterface) {
60
+        if ($specification instanceof Specification\FilterInterface){
61 61
             return $this->writeFilter($source, $specification, $compiler);
62 62
         }
63 63
 
64
-        if ($specification instanceof Specification\SorterInterface) {
64
+        if ($specification instanceof Specification\SorterInterface){
65 65
             return $this->writeSorter($source, $specification, $compiler);
66 66
         }
67 67
 
68
-        if ($specification instanceof Specification\Pagination\Limit) {
68
+        if ($specification instanceof Specification\Pagination\Limit){
69 69
             return $source->limit($specification->getValue());
70 70
         }
71 71
 
72
-        if ($specification instanceof Specification\Pagination\Offset) {
72
+        if ($specification instanceof Specification\Pagination\Offset){
73 73
             return $source->offset($specification->getValue());
74 74
         }
75 75
 
@@ -84,15 +84,15 @@  discard block
 block discarded – undo
84 84
      */
85 85
     protected function writeFilter($source, Specification\FilterInterface $filter, Compiler $compiler)
86 86
     {
87
-        if ($filter instanceof Specification\Filter\All || $filter instanceof Specification\Filter\Map) {
87
+        if ($filter instanceof Specification\Filter\All || $filter instanceof Specification\Filter\Map){
88 88
             return $source->where(static function () use ($compiler, $filter, $source): void {
89 89
                 $compiler->compile($source, ...$filter->getFilters());
90 90
             });
91 91
         }
92 92
 
93
-        if ($filter instanceof Specification\Filter\Any) {
93
+        if ($filter instanceof Specification\Filter\Any){
94 94
             return $source->where(static function () use ($compiler, $filter, $source): void {
95
-                foreach ($filter->getFilters() as $subFilter) {
95
+                foreach ($filter->getFilters() as $subFilter){
96 96
                     $source->orWhere(static function () use ($compiler, $subFilter, $source): void {
97 97
                         $compiler->compile($source, $subFilter);
98 98
                     });
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
             });
101 101
         }
102 102
 
103
-        if ($filter instanceof Specification\Filter\InjectionFilter) {
103
+        if ($filter instanceof Specification\Filter\InjectionFilter){
104 104
             $expression = $filter->getFilter();
105
-            if ($expression instanceof Specification\Filter\Expression) {
105
+            if ($expression instanceof Specification\Filter\Expression){
106 106
                 return $source->where(
107 107
                     $filter->getInjection(),
108 108
                     $this->getExpressionOperator($expression),
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             }
112 112
         }
113 113
 
114
-        if ($filter instanceof Specification\Filter\Expression) {
114
+        if ($filter instanceof Specification\Filter\Expression){
115 115
             return $source->where(
116 116
                 $filter->getExpression(),
117 117
                 $this->getExpressionOperator($filter),
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
      */
129 129
     protected function getExpressionOperator(Specification\Filter\Expression $filter): string
130 130
     {
131
-        if ($filter instanceof Specification\Filter\Like) {
131
+        if ($filter instanceof Specification\Filter\Like){
132 132
             return 'LIKE';
133 133
         }
134 134
 
135
-        if ($filter instanceof Specification\Filter\InArray || $filter instanceof Specification\Filter\NotInArray) {
135
+        if ($filter instanceof Specification\Filter\InArray || $filter instanceof Specification\Filter\NotInArray){
136 136
             return static::ARRAY_OPERATORS[get_class($filter)];
137 137
         }
138 138
 
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
      */
146 146
     protected function getExpressionArgs(Specification\Filter\Expression $filter): array
147 147
     {
148
-        if ($filter instanceof Specification\Filter\Like) {
148
+        if ($filter instanceof Specification\Filter\Like){
149 149
             return [sprintf($filter->getPattern(), $this->fetchValue($filter->getValue()))];
150 150
         }
151 151
 
152
-        if ($filter instanceof Specification\Filter\InArray || $filter instanceof Specification\Filter\NotInArray) {
152
+        if ($filter instanceof Specification\Filter\InArray || $filter instanceof Specification\Filter\NotInArray){
153 153
             return [new Parameter($this->fetchValue($filter->getValue()))];
154 154
         }
155 155
 
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
      */
165 165
     protected function writeSorter($source, Specification\SorterInterface $sorter, Compiler $compiler)
166 166
     {
167
-        if ($sorter instanceof Specification\Sorter\SorterSet) {
168
-            foreach ($sorter->getSorters() as $subSorter) {
167
+        if ($sorter instanceof Specification\Sorter\SorterSet){
168
+            foreach ($sorter->getSorters() as $subSorter){
169 169
                 $source = $compiler->compile($source, $subSorter);
170 170
             }
171 171
 
@@ -175,18 +175,18 @@  discard block
 block discarded – undo
175 175
         if (
176 176
             $sorter instanceof Specification\Sorter\AscSorter
177 177
             || $sorter instanceof Specification\Sorter\DescSorter
178
-        ) {
178
+        ){
179 179
             $direction = static::SORTER_DIRECTIONS[get_class($sorter)];
180
-            foreach ($sorter->getExpressions() as $expression) {
180
+            foreach ($sorter->getExpressions() as $expression){
181 181
                 $source = $source->orderBy($expression, $direction);
182 182
             }
183 183
 
184 184
             return $source;
185 185
         }
186 186
 
187
-        if ($sorter instanceof InjectionSorter) {
187
+        if ($sorter instanceof InjectionSorter){
188 188
             $direction = static::SORTER_DIRECTIONS[get_class($sorter)] ?? 'ASC';
189
-            foreach ($sorter->getInjections() as $injection) {
189
+            foreach ($sorter->getInjections() as $injection){
190 190
                 $source = $source->orderBy($injection, $direction);
191 191
             }
192 192
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
      */
205 205
     protected function fetchValue($value)
206 206
     {
207
-        if ($value instanceof Specification\ValueInterface) {
207
+        if ($value instanceof Specification\ValueInterface){
208 208
             throw new CompilerException('Value expects user input, none given');
209 209
         }
210 210
 
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
      */
218 218
     protected function targetAcceptable($target): bool
219 219
     {
220
-        if (class_exists(SelectQuery::class) && $target instanceof SelectQuery) {
220
+        if (class_exists(SelectQuery::class) && $target instanceof SelectQuery){
221 221
             return true;
222 222
         }
223 223
 
224
-        if (class_exists(Select::class) && $target instanceof Select) {
224
+        if (class_exists(Select::class) && $target instanceof Select){
225 225
             return true;
226 226
         }
227 227
 
Please login to merge, or discard this patch.
Braces   +46 added lines, -23 removed lines patch added patch discarded remove patch
@@ -53,23 +53,28 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function write($source, SpecificationInterface $specification, Compiler $compiler)
55 55
     {
56
-        if (!$this->targetAcceptable($source)) {
56
+        if (!$this->targetAcceptable($source))
57
+        {
57 58
             return null;
58 59
         }
59 60
 
60
-        if ($specification instanceof Specification\FilterInterface) {
61
+        if ($specification instanceof Specification\FilterInterface)
62
+        {
61 63
             return $this->writeFilter($source, $specification, $compiler);
62 64
         }
63 65
 
64
-        if ($specification instanceof Specification\SorterInterface) {
66
+        if ($specification instanceof Specification\SorterInterface)
67
+        {
65 68
             return $this->writeSorter($source, $specification, $compiler);
66 69
         }
67 70
 
68
-        if ($specification instanceof Specification\Pagination\Limit) {
71
+        if ($specification instanceof Specification\Pagination\Limit)
72
+        {
69 73
             return $source->limit($specification->getValue());
70 74
         }
71 75
 
72
-        if ($specification instanceof Specification\Pagination\Offset) {
76
+        if ($specification instanceof Specification\Pagination\Offset)
77
+        {
73 78
             return $source->offset($specification->getValue());
74 79
         }
75 80
 
@@ -84,15 +89,18 @@  discard block
 block discarded – undo
84 89
      */
85 90
     protected function writeFilter($source, Specification\FilterInterface $filter, Compiler $compiler)
86 91
     {
87
-        if ($filter instanceof Specification\Filter\All || $filter instanceof Specification\Filter\Map) {
92
+        if ($filter instanceof Specification\Filter\All || $filter instanceof Specification\Filter\Map)
93
+        {
88 94
             return $source->where(static function () use ($compiler, $filter, $source): void {
89 95
                 $compiler->compile($source, ...$filter->getFilters());
90 96
             });
91 97
         }
92 98
 
93
-        if ($filter instanceof Specification\Filter\Any) {
99
+        if ($filter instanceof Specification\Filter\Any)
100
+        {
94 101
             return $source->where(static function () use ($compiler, $filter, $source): void {
95
-                foreach ($filter->getFilters() as $subFilter) {
102
+                foreach ($filter->getFilters() as $subFilter)
103
+                {
96 104
                     $source->orWhere(static function () use ($compiler, $subFilter, $source): void {
97 105
                         $compiler->compile($source, $subFilter);
98 106
                     });
@@ -100,9 +108,11 @@  discard block
 block discarded – undo
100 108
             });
101 109
         }
102 110
 
103
-        if ($filter instanceof Specification\Filter\InjectionFilter) {
111
+        if ($filter instanceof Specification\Filter\InjectionFilter)
112
+        {
104 113
             $expression = $filter->getFilter();
105
-            if ($expression instanceof Specification\Filter\Expression) {
114
+            if ($expression instanceof Specification\Filter\Expression)
115
+            {
106 116
                 return $source->where(
107 117
                     $filter->getInjection(),
108 118
                     $this->getExpressionOperator($expression),
@@ -111,7 +121,8 @@  discard block
 block discarded – undo
111 121
             }
112 122
         }
113 123
 
114
-        if ($filter instanceof Specification\Filter\Expression) {
124
+        if ($filter instanceof Specification\Filter\Expression)
125
+        {
115 126
             return $source->where(
116 127
                 $filter->getExpression(),
117 128
                 $this->getExpressionOperator($filter),
@@ -128,11 +139,13 @@  discard block
 block discarded – undo
128 139
      */
129 140
     protected function getExpressionOperator(Specification\Filter\Expression $filter): string
130 141
     {
131
-        if ($filter instanceof Specification\Filter\Like) {
142
+        if ($filter instanceof Specification\Filter\Like)
143
+        {
132 144
             return 'LIKE';
133 145
         }
134 146
 
135
-        if ($filter instanceof Specification\Filter\InArray || $filter instanceof Specification\Filter\NotInArray) {
147
+        if ($filter instanceof Specification\Filter\InArray || $filter instanceof Specification\Filter\NotInArray)
148
+        {
136 149
             return static::ARRAY_OPERATORS[get_class($filter)];
137 150
         }
138 151
 
@@ -145,11 +158,13 @@  discard block
 block discarded – undo
145 158
      */
146 159
     protected function getExpressionArgs(Specification\Filter\Expression $filter): array
147 160
     {
148
-        if ($filter instanceof Specification\Filter\Like) {
161
+        if ($filter instanceof Specification\Filter\Like)
162
+        {
149 163
             return [sprintf($filter->getPattern(), $this->fetchValue($filter->getValue()))];
150 164
         }
151 165
 
152
-        if ($filter instanceof Specification\Filter\InArray || $filter instanceof Specification\Filter\NotInArray) {
166
+        if ($filter instanceof Specification\Filter\InArray || $filter instanceof Specification\Filter\NotInArray)
167
+        {
153 168
             return [new Parameter($this->fetchValue($filter->getValue()))];
154 169
         }
155 170
 
@@ -164,8 +179,10 @@  discard block
 block discarded – undo
164 179
      */
165 180
     protected function writeSorter($source, Specification\SorterInterface $sorter, Compiler $compiler)
166 181
     {
167
-        if ($sorter instanceof Specification\Sorter\SorterSet) {
168
-            foreach ($sorter->getSorters() as $subSorter) {
182
+        if ($sorter instanceof Specification\Sorter\SorterSet)
183
+        {
184
+            foreach ($sorter->getSorters() as $subSorter)
185
+            {
169 186
                 $source = $compiler->compile($source, $subSorter);
170 187
             }
171 188
 
@@ -177,16 +194,19 @@  discard block
 block discarded – undo
177 194
             || $sorter instanceof Specification\Sorter\DescSorter
178 195
         ) {
179 196
             $direction = static::SORTER_DIRECTIONS[get_class($sorter)];
180
-            foreach ($sorter->getExpressions() as $expression) {
197
+            foreach ($sorter->getExpressions() as $expression)
198
+            {
181 199
                 $source = $source->orderBy($expression, $direction);
182 200
             }
183 201
 
184 202
             return $source;
185 203
         }
186 204
 
187
-        if ($sorter instanceof InjectionSorter) {
205
+        if ($sorter instanceof InjectionSorter)
206
+        {
188 207
             $direction = static::SORTER_DIRECTIONS[get_class($sorter)] ?? 'ASC';
189
-            foreach ($sorter->getInjections() as $injection) {
208
+            foreach ($sorter->getInjections() as $injection)
209
+            {
190 210
                 $source = $source->orderBy($injection, $direction);
191 211
             }
192 212
 
@@ -204,7 +224,8 @@  discard block
 block discarded – undo
204 224
      */
205 225
     protected function fetchValue($value)
206 226
     {
207
-        if ($value instanceof Specification\ValueInterface) {
227
+        if ($value instanceof Specification\ValueInterface)
228
+        {
208 229
             throw new CompilerException('Value expects user input, none given');
209 230
         }
210 231
 
@@ -217,11 +238,13 @@  discard block
 block discarded – undo
217 238
      */
218 239
     protected function targetAcceptable($target): bool
219 240
     {
220
-        if (class_exists(SelectQuery::class) && $target instanceof SelectQuery) {
241
+        if (class_exists(SelectQuery::class) && $target instanceof SelectQuery)
242
+        {
221 243
             return true;
222 244
         }
223 245
 
224
-        if (class_exists(Select::class) && $target instanceof Select) {
246
+        if (class_exists(Select::class) && $target instanceof Select)
247
+        {
225 248
             return true;
226 249
         }
227 250
 
Please login to merge, or discard this patch.
src/SendIt/tests/RenderTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@
 block discarded – undo
26 26
     public function setUp(): void
27 27
     {
28 28
         $this->app = App::init([
29
-            'root' => __DIR__ . '/App',
30
-            'app'  => __DIR__ . '/App'
29
+            'root' => __DIR__.'/App',
30
+            'app'  => __DIR__.'/App'
31 31
         ]);
32 32
     }
33 33
 
34 34
     public function tearDown(): void
35 35
     {
36
-        foreach (glob(__DIR__ . '/App/runtime/cache/views/*.php') as $file) {
36
+        foreach (glob(__DIR__.'/App/runtime/cache/views/*.php') as $file){
37 37
             @unlink($file);
38 38
         }
39 39
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@
 block discarded – undo
33 33
 
34 34
     public function tearDown(): void
35 35
     {
36
-        foreach (glob(__DIR__ . '/App/runtime/cache/views/*.php') as $file) {
36
+        foreach (glob(__DIR__ . '/App/runtime/cache/views/*.php') as $file)
37
+        {
37 38
             @unlink($file);
38 39
         }
39 40
     }
Please login to merge, or discard this patch.
src/Attributes/src/Psr6CachedReader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         ReaderInterface $reader,
33 33
         CacheItemPoolInterface $cache,
34 34
         KeyGeneratorInterface $generator = null
35
-    ) {
35
+    ){
36 36
         $this->cache = $cache;
37 37
 
38 38
         parent::__construct($reader, $generator);
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         $item = $this->cache->getItem($key);
48 48
 
49
-        if (!$item->isHit()) {
49
+        if (!$item->isHit()){
50 50
             $this->cache->save(
51 51
                 $item->set($then())
52 52
             );
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,8 @@
 block discarded – undo
46 46
     {
47 47
         $item = $this->cache->getItem($key);
48 48
 
49
-        if (!$item->isHit()) {
49
+        if (!$item->isHit())
50
+        {
50 51
             $this->cache->save(
51 52
                 $item->set($then())
52 53
             );
Please login to merge, or discard this patch.
src/Attributes/src/Psr16CachedReader.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
      */
42 42
     protected function cached(string $key, callable $then): iterable
43 43
     {
44
-        if (!$this->cache->has($key)) {
44
+        if (!$this->cache->has($key)){
45 45
             $this->cache->set($key, $then());
46 46
         }
47 47
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,8 @@
 block discarded – undo
41 41
      */
42 42
     protected function cached(string $key, callable $then): iterable
43 43
     {
44
-        if (!$this->cache->has($key)) {
44
+        if (!$this->cache->has($key))
45
+        {
45 46
             $this->cache->set($key, $then());
46 47
         }
47 48
 
Please login to merge, or discard this patch.
src/Attributes/src/Internal/Instantiator/NamedArgumentsInstantiator.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -34,17 +34,17 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function instantiate(\ReflectionClass $attr, array $arguments, \Reflector $context = null): object
36 36
     {
37
-        if ($this->isNamedArgumentsSupported()) {
38
-            try {
37
+        if ($this->isNamedArgumentsSupported()){
38
+            try{
39 39
                 return $attr->newInstanceArgs($arguments);
40
-            } catch (\Throwable $e) {
40
+            }catch (\Throwable $e){
41 41
                 throw Exception::withLocation($e, $attr->getFileName(), $attr->getStartLine());
42 42
             }
43 43
         }
44 44
 
45 45
         $constructor = $this->getConstructor($attr);
46 46
 
47
-        if ($constructor === null) {
47
+        if ($constructor === null){
48 48
             return $attr->newInstanceWithoutConstructor();
49 49
         }
50 50
 
@@ -72,16 +72,16 @@  discard block
 block discarded – undo
72 72
     {
73 73
         $passed = [];
74 74
 
75
-        try {
76
-            foreach ($constructor->getParameters() as $parameter) {
75
+        try{
76
+            foreach ($constructor->getParameters() as $parameter){
77 77
                 $passed[] = $this->resolveParameter($ctx, $parameter, $arguments);
78 78
             }
79 79
 
80
-            if (\count($arguments)) {
80
+            if (\count($arguments)){
81 81
                 $message = \sprintf(self::ERROR_UNKNOWN_ARGUMENT, \array_key_first($arguments));
82 82
                 throw new \BadMethodCallException($message);
83 83
             }
84
-        } catch (\Throwable $e) {
84
+        }catch (\Throwable $e){
85 85
             throw Exception::withLocation($e, $constructor->getFileName(), $constructor->getStartLine());
86 86
         }
87 87
 
@@ -97,19 +97,19 @@  discard block
 block discarded – undo
97 97
      */
98 98
     private function resolveParameter(\ReflectionClass $ctx, \ReflectionParameter $param, array &$arguments)
99 99
     {
100
-        switch (true) {
100
+        switch (true){
101 101
             case \array_key_exists($param->getName(), $arguments):
102
-                try {
102
+                try{
103 103
                     return $arguments[$param->getName()];
104
-                } finally {
104
+                }finally{
105 105
                     unset($arguments[$param->getName()]);
106 106
                 }
107 107
                 // no actual falling through
108 108
 
109 109
             case \array_key_exists($param->getPosition(), $arguments):
110
-                try {
110
+                try{
111 111
                     return $arguments[$param->getPosition()];
112
-                } finally {
112
+                }finally{
113 113
                     unset($arguments[$param->getPosition()]);
114 114
                 }
115 115
                 // no actual falling through
Please login to merge, or discard this patch.
Braces   +30 added lines, -13 removed lines patch added patch discarded remove patch
@@ -34,17 +34,22 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function instantiate(\ReflectionClass $attr, array $arguments, \Reflector $context = null): object
36 36
     {
37
-        if ($this->isNamedArgumentsSupported()) {
38
-            try {
37
+        if ($this->isNamedArgumentsSupported())
38
+        {
39
+            try
40
+            {
39 41
                 return $attr->newInstanceArgs($arguments);
40
-            } catch (\Throwable $e) {
42
+            }
43
+            catch (\Throwable $e)
44
+            {
41 45
                 throw Exception::withLocation($e, $attr->getFileName(), $attr->getStartLine());
42 46
             }
43 47
         }
44 48
 
45 49
         $constructor = $this->getConstructor($attr);
46 50
 
47
-        if ($constructor === null) {
51
+        if ($constructor === null)
52
+        {
48 53
             return $attr->newInstanceWithoutConstructor();
49 54
         }
50 55
 
@@ -72,16 +77,21 @@  discard block
 block discarded – undo
72 77
     {
73 78
         $passed = [];
74 79
 
75
-        try {
76
-            foreach ($constructor->getParameters() as $parameter) {
80
+        try
81
+        {
82
+            foreach ($constructor->getParameters() as $parameter)
83
+            {
77 84
                 $passed[] = $this->resolveParameter($ctx, $parameter, $arguments);
78 85
             }
79 86
 
80
-            if (\count($arguments)) {
87
+            if (\count($arguments))
88
+            {
81 89
                 $message = \sprintf(self::ERROR_UNKNOWN_ARGUMENT, \array_key_first($arguments));
82 90
                 throw new \BadMethodCallException($message);
83 91
             }
84
-        } catch (\Throwable $e) {
92
+        }
93
+        catch (\Throwable $e)
94
+        {
85 95
             throw Exception::withLocation($e, $constructor->getFileName(), $constructor->getStartLine());
86 96
         }
87 97
 
@@ -97,19 +107,26 @@  discard block
 block discarded – undo
97 107
      */
98 108
     private function resolveParameter(\ReflectionClass $ctx, \ReflectionParameter $param, array &$arguments)
99 109
     {
100
-        switch (true) {
110
+        switch (true)
111
+        {
101 112
             case \array_key_exists($param->getName(), $arguments):
102
-                try {
113
+                try
114
+                {
103 115
                     return $arguments[$param->getName()];
104
-                } finally {
116
+                }
117
+                finally
118
+                {
105 119
                     unset($arguments[$param->getName()]);
106 120
                 }
107 121
                 // no actual falling through
108 122
 
109 123
             case \array_key_exists($param->getPosition(), $arguments):
110
-                try {
124
+                try
125
+                {
111 126
                     return $arguments[$param->getPosition()];
112
-                } finally {
127
+                }
128
+                finally
129
+                {
113 130
                     unset($arguments[$param->getPosition()]);
114 131
                 }
115 132
                 // no actual falling through
Please login to merge, or discard this patch.
src/Attributes/src/Internal/CachedReader.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
124 124
      */
125 125
     protected function iterableToArray(iterable $attributes): array
126 126
     {
127
-        if ($attributes instanceof \Traversable) {
127
+        if ($attributes instanceof \Traversable){
128 128
             return \iterator_to_array($attributes, false);
129 129
         }
130 130
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,8 @@
 block discarded – undo
114 114
      */
115 115
     protected function iterableToArray(iterable $attributes): array
116 116
     {
117
-        if ($attributes instanceof \Traversable) {
117
+        if ($attributes instanceof \Traversable)
118
+        {
118 119
             return \iterator_to_array($attributes, false);
119 120
         }
120 121
 
Please login to merge, or discard this patch.
src/Attributes/src/Internal/Key/NameKeyGenerator.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function forClass(\ReflectionClass $class): string
57 57
     {
58
-        if ($class->isAnonymous()) {
58
+        if ($class->isAnonymous()){
59 59
             return \vsprintf(self::TPL_ANONYMOUS_CLASS, [
60 60
                 $class->getFileName(),
61 61
                 $class->getStartLine(),
@@ -104,14 +104,14 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function forFunction(\ReflectionFunctionAbstract $fn): string
106 106
     {
107
-        if ($fn instanceof \ReflectionMethod) {
107
+        if ($fn instanceof \ReflectionMethod){
108 108
             return \vsprintf(self::TPL_METHOD, [
109 109
                 $this->forClass($fn->getDeclaringClass()),
110 110
                 $fn->getName(),
111 111
             ]);
112 112
         }
113 113
 
114
-        if ($fn->isClosure()) {
114
+        if ($fn->isClosure()){
115 115
             return \vsprintf(self::TPL_ANONYMOUS_FN, [
116 116
                 $fn->getFileName(),
117 117
                 $fn->getStartLine(),
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,8 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function forClass(\ReflectionClass $class): string
57 57
     {
58
-        if ($class->isAnonymous()) {
58
+        if ($class->isAnonymous())
59
+        {
59 60
             return \vsprintf(self::TPL_ANONYMOUS_CLASS, [
60 61
                 $class->getFileName(),
61 62
                 $class->getStartLine(),
@@ -104,14 +105,16 @@  discard block
 block discarded – undo
104 105
      */
105 106
     public function forFunction(\ReflectionFunctionAbstract $fn): string
106 107
     {
107
-        if ($fn instanceof \ReflectionMethod) {
108
+        if ($fn instanceof \ReflectionMethod)
109
+        {
108 110
             return \vsprintf(self::TPL_METHOD, [
109 111
                 $this->forClass($fn->getDeclaringClass()),
110 112
                 $fn->getName(),
111 113
             ]);
112 114
         }
113 115
 
114
-        if ($fn->isClosure()) {
116
+        if ($fn->isClosure())
117
+        {
115 118
             return \vsprintf(self::TPL_ANONYMOUS_FN, [
116 119
                 $fn->getFileName(),
117 120
                 $fn->getStartLine(),
Please login to merge, or discard this patch.