Passed
Push — feature-FRAM-58-refactor-entit... ( fc48d1...1bdb0a )
by Vincent
05:54
created
bench/Query/JoinBench.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Bdf\Prime\Query;
4 4
 
5
-require_once __DIR__ . '/../_files/BenchData.php';
5
+require_once __DIR__.'/../_files/BenchData.php';
6 6
 
7 7
 use Bdf\Prime\Bench\BenchData;
8 8
 use Bdf\Prime\Bench\User as BenchUser;
Please login to merge, or discard this patch.
bench/Query/CustomQueriesBench.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace Bdf\Prime\Query;
4 4
 
5
-require_once __DIR__ . '/../_files/BenchData.php';
5
+require_once __DIR__.'/../_files/BenchData.php';
6 6
 
7 7
 use Bdf\Prime\Bench\BenchData;
8 8
 use Bdf\Prime\Bench\User;
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
      */
209 209
     public function bench_insert_transaction()
210 210
     {
211
-        $this->repository->transaction(function () {
211
+        $this->repository->transaction(function() {
212 212
             /** @var BulkInsertQuery $insert */
213 213
             $insert = $this->repository->queries()->make(BulkInsertQuery::class);
214 214
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
      */
233 233
     public function bench_insert_builder()
234 234
     {
235
-        $this->repository->transaction(function () {
235
+        $this->repository->transaction(function() {
236 236
             for ($i = 0; $i < 100; ++$i) {
237 237
                 $this->repository->builder()->insert([
238 238
                     'id'          => 6000000 + $i,
Please login to merge, or discard this patch.
bench/PrimeBench.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace Bdf\Prime;
4 4
 
5
-require_once __DIR__ . '/_files/BenchData.php';
5
+require_once __DIR__.'/_files/BenchData.php';
6 6
 
7 7
 use Bdf\Prime\Bench\BenchData;
8 8
 use Bdf\Prime\Bench\User as BenchUser;
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 }
116 116
 
117 117
 function convert($size) {
118
-    return number_format($size/1024).' kb';
118
+    return number_format($size / 1024).' kb';
119 119
 }
120 120
 
121 121
 function profile($callback, $times) {
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
     
136 136
     $delta = ($end - $start);
137 137
     
138
-    $bench['time'] =  $delta;
139
-    $bench['queries'] =  $times / $delta;
140
-    $bench['memory'] =  memory_get_usage(true) - $memory;
138
+    $bench['time'] = $delta;
139
+    $bench['queries'] = $times / $delta;
140
+    $bench['memory'] = memory_get_usage(true) - $memory;
141 141
     
142 142
     return $bench;
143 143
 }
144 144
\ No newline at end of file
Please login to merge, or discard this patch.
bench/Query/QueryWrapAsBench.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Bdf\Prime\Query;
4 4
 
5
-require_once __DIR__ . '/../_files/BenchData.php';
5
+require_once __DIR__.'/../_files/BenchData.php';
6 6
 
7 7
 use Bdf\Prime\Bench\BenchData;
8 8
 use Bdf\Prime\Bench\User;
Please login to merge, or discard this patch.
bench/Query/CompilerBench.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Bdf\Prime\Query;
4 4
 
5
-require_once __DIR__ . '/../_files/BenchData.php';
5
+require_once __DIR__.'/../_files/BenchData.php';
6 6
 
7 7
 use Bdf\Prime\Bench\BenchData;
8 8
 use Bdf\Prime\Bench\User;
Please login to merge, or discard this patch.
src/Query/Compiler/SqlCompiler.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         foreach ($query->statements['tables'] as $table) {
187 187
             return $query->state()->compiled = 'UPDATE '
188 188
                 . $this->quoteIdentifier($query, $table['table'])
189
-                . ' SET ' . implode(', ', $values)
189
+                . ' SET '.implode(', ', $values)
190 190
                 . $this->compileWhere($query)
191 191
             ;
192 192
         }
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
                     $from['sql'] = $this->quoteIdentifier($query, $databasePrefix.$from['table']);
525 525
                     $compiled[$from['table']] = $from;
526 526
                 } else {
527
-                    $from['sql'] = $this->quoteIdentifier($query, $databasePrefix.$from['table']) . ' ' . $this->quoteIdentifier($query, $from['alias']);
527
+                    $from['sql'] = $this->quoteIdentifier($query, $databasePrefix.$from['table']).' '.$this->quoteIdentifier($query, $from['alias']);
528 528
                     $compiled[$from['alias']] = $from;
529 529
                 }
530 530
             }
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
                 if (is_array($value)) {
698 698
                     return $this->compileIntoExpression($query, $value, $column, 'REGEXP', $converted);
699 699
                 }
700
-                return $this->quoteIdentifier($query, $column).' REGEXP '.$this->compileExpressionValue($query, (string)$value, $converted);
700
+                return $this->quoteIdentifier($query, $column).' REGEXP '.$this->compileExpressionValue($query, (string) $value, $converted);
701 701
 
702 702
             case ':like':
703 703
                 if (is_array($value)) {
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
                 return $this->quoteIdentifier($query, $column).' = '.$this->compileExpressionValue($query, $value, $converted);
762 762
 
763 763
             default:
764
-                throw new UnexpectedValueException("Unsupported operator '" . $operator . "' in WHERE clause");
764
+                throw new UnexpectedValueException("Unsupported operator '".$operator."' in WHERE clause");
765 765
         }
766 766
     }
767 767
 
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
         $sql = '('.$this->compileSelect($query).')';
850 850
 
851 851
         if ($alias) {
852
-            $sql = $sql . ' as ' . $this->quoteIdentifier($clause, $alias);
852
+            $sql = $sql.' as '.$this->quoteIdentifier($clause, $alias);
853 853
         }
854 854
 
855 855
         $this->addQueryBindings($clause, $query);
@@ -1007,12 +1007,12 @@  discard block
 block discarded – undo
1007 1007
         if ($lock !== null && !$query->statements['aggregate']) {
1008 1008
             // Lock for update
1009 1009
             if ($lock === LockMode::PESSIMISTIC_WRITE) {
1010
-                return ' ' . $this->platform()->grammar()->getWriteLockSQL();
1010
+                return ' '.$this->platform()->grammar()->getWriteLockSQL();
1011 1011
             }
1012 1012
 
1013 1013
             // Shared Lock: other process can read the row but not update it.
1014 1014
             if ($lock === LockMode::PESSIMISTIC_READ) {
1015
-                return ' ' . $this->platform()->grammar()->getReadLockSQL();
1015
+                return ' '.$this->platform()->grammar()->getReadLockSQL();
1016 1016
             }
1017 1017
         }
1018 1018
 
Please login to merge, or discard this patch.
src/Entity/EntityGenerator.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
         foreach ($file->getNamespaces() as $foundNs) {
255 255
             foreach ($foundNs->getClasses() as $foundClass) {
256
-                if ($this->mapperInfo->className() === $foundNs->getName() . '\\' . $foundClass->getName()) {
256
+                if ($this->mapperInfo->className() === $foundNs->getName().'\\'.$foundClass->getName()) {
257 257
                     $namespace = $foundNs;
258 258
                     $class = $foundClass;
259 259
                     break;
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
         }
263 263
 
264 264
         if (!$namespace || !$class) {
265
-            throw new \InvalidArgumentException('The file do not contains class definition of ' . $this->mapperInfo->className());
265
+            throw new \InvalidArgumentException('The file do not contains class definition of '.$this->mapperInfo->className());
266 266
         }
267 267
 
268 268
         $this->generateEntityBody(new EntityClassGenerator($class, $namespace));
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
                 case $property->isArray() && $property->wrapper() === null:
550 550
                     // Simple array relation
551 551
                     $generator->setDefaultValue([]);
552
-                    $generator->setVarTag($property->className() . '[]');
552
+                    $generator->setVarTag($property->className().'[]');
553 553
 
554 554
                     if ($this->useTypedProperties) {
555 555
                         $generator->setTypeHint('array');
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
                 case $property->isArray() && $property->wrapper() !== null:
560 560
                     // Array relation with wrapper
561 561
                     $repository = $this->prime->repository($property->className());
562
-                    $generator->setVarTag($repository->collectionFactory()->wrapperClass($property->wrapper()) . '|' . $property->className() . '[]');
562
+                    $generator->setVarTag($repository->collectionFactory()->wrapperClass($property->wrapper()).'|'.$property->className().'[]');
563 563
 
564 564
                     // The value is an object : so the default value must be null
565 565
                     if ($nullable) {
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
             $variableName = $this->inflector->camelize($fieldName);
615 615
             $methodName = $variableName;
616 616
         } else {
617
-            $methodName = $prefix . $this->inflector->classify($fieldName);
617
+            $methodName = $prefix.$this->inflector->classify($fieldName);
618 618
             $variableName = $this->inflector->camelize($fieldName);
619 619
         }
620 620
 
@@ -675,12 +675,12 @@  discard block
 block discarded – undo
675 675
         }
676 676
 
677 677
         $method = $generator->addMethod($metadata['method']);
678
-        $method->addComment('Get ' . $metadata['variable']);
678
+        $method->addComment('Get '.$metadata['variable']);
679 679
         $method->addComment('');
680 680
         $method->setReturnType($metadata['typeHint']);
681 681
         $method->setReturnNullable($metadata['nullable']);
682 682
         $method->setBody('return $this->?;', [$metadata['field']]);
683
-        $method->addComment('@return ' . $metadata['docType']);
683
+        $method->addComment('@return '.$metadata['docType']);
684 684
     }
685 685
 
686 686
     protected function generateSetter(EntityClassGenerator $generator, InfoInterface $propertyInfo): void
@@ -692,9 +692,9 @@  discard block
 block discarded – undo
692 692
         }
693 693
 
694 694
         $method = $generator->addMethod($metadata['method']);
695
-        $method->addComment('Set ' . $metadata['variable']);
695
+        $method->addComment('Set '.$metadata['variable']);
696 696
         $method->addComment('');
697
-        $method->addComment('@param ' . $metadata['docType'] . ' $' . $metadata['variable']);
697
+        $method->addComment('@param '.$metadata['docType'].' $'.$metadata['variable']);
698 698
         $method->addComment('');
699 699
         $method->addComment('@return $this');
700 700
         $method->setReturnType('self');
@@ -717,9 +717,9 @@  discard block
 block discarded – undo
717 717
         }
718 718
 
719 719
         $method = $generator->addMethod($metadata['method']);
720
-        $method->addComment('Add ' . $metadata['variable']);
720
+        $method->addComment('Add '.$metadata['variable']);
721 721
         $method->addComment('');
722
-        $method->addComment('@param ' . $metadata['docType'] . ' $' . $metadata['variable']);
722
+        $method->addComment('@param '.$metadata['docType'].' $'.$metadata['variable']);
723 723
         $method->addComment('');
724 724
         $method->addComment('@return $this');
725 725
         $method->setReturnType('self');
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
     public function setFieldVisibility(string $visibility): void
864 864
     {
865 865
         if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) {
866
-            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility);
866
+            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility);
867 867
         }
868 868
 
869 869
         $this->fieldVisibility = $visibility;
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
                 continue;
1131 1131
             }
1132 1132
 
1133
-            $part = $generator->simplifyType($atomicType) . ($isArray ? '[]' : '');
1133
+            $part = $generator->simplifyType($atomicType).($isArray ? '[]' : '');
1134 1134
         }
1135 1135
 
1136 1136
         return implode('|', $types);
Please login to merge, or discard this patch.