Passed
Push — master ( e45ec1...0662c2 )
by Михаил
04:14 queued 01:11
created
Query/Hydrator/SelectQueryHydrator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $entityPrimaryKeyField = $this->schema->getEntityPrimaryKeyField();
60 60
         $primaryKeyValues = [];
61 61
         $orderValue = count($documentsArray);
62
-        foreach($documentsArray as $documentRow) {
62
+        foreach ($documentsArray as $documentRow) {
63 63
             if (!array_key_exists($discriminatorField->getDocumentFieldName(), $documentRow)) {
64 64
                 throw new DiscriminatorFieldException(
65 65
                     sprintf('Discriminator field "%s" must be presented in dataset', $discriminatorField->getDocumentFieldName())
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
         $entities = $this->entityRepository
91 91
             ->createQueryBuilder('entity')
92
-            ->addSelect(sprintf('(CASE %s ELSE 0 END) AS HIDDEN score', join(' ' ,$scoreStatements)))
92
+            ->addSelect(sprintf('(CASE %s ELSE 0 END) AS HIDDEN score', join(' ', $scoreStatements)))
93 93
             ->where(
94 94
                 sprintf('entity.%s in (:ids)', $entityPrimaryKeyField->getEntityFieldName())
95 95
             )
Please login to merge, or discard this patch.
Query/Update/UpdateQuery.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@
 block discarded – undo
177 177
             throw new UpdateQueryException('It seems you did not end the entity');
178 178
         }
179 179
 
180
-        foreach($this->deleteConditions as $documentFieldName => $value) {
180
+        foreach ($this->deleteConditions as $documentFieldName => $value) {
181 181
             $this->solrQuery->addDeleteQuery(
182 182
                 sprintf('%s:"%s"', $documentFieldName, $value)
183 183
             );
Please login to merge, or discard this patch.
Query/SelectQueryBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
         $this->config = $config;
40 40
         $this->clientRegistry = $clientRegistry;
41 41
 
42
-        foreach($config->getIndexedEntities() as $entityConfig) {
42
+        foreach ($config->getIndexedEntities() as $entityConfig) {
43 43
             $this->hydrators[$entityConfig['class']] = $hydratorBuilder->buildSelectQueryHydratorByClass($entityConfig['class']);
44 44
         }
45 45
     }
Please login to merge, or discard this patch.
Query/Select/MultiClassSelectQuery.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
     protected function initDiscriminatorConditions()
75 75
     {
76 76
         $discriminatorConfigField = $this->getSchema()->getDiscriminatorConfigField();
77
-        foreach($this->entityConfigs as $entityConfig) {
77
+        foreach ($this->entityConfigs as $entityConfig) {
78 78
             $this->discriminatorConditions[] = sprintf(
79 79
                 '%s:"%s"',
80 80
                 $discriminatorConfigField->getDocumentFieldName(),
Please login to merge, or discard this patch.
Query/Select/AbstractSelectQuery.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             $entityFieldNames = [$entityFieldNames];
142 142
         }
143 143
 
144
-        foreach($entityFieldNames as $entityFieldName) {
144
+        foreach ($entityFieldNames as $entityFieldName) {
145 145
             $this->getField($entityFieldName);
146 146
         }
147 147
 
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
      */
335 335
     public function groupConditionsAsOr()
336 336
     {
337
-        $this->addOrCondition = [ $this->buildGroupCondition() ];
337
+        $this->addOrCondition = [$this->buildGroupCondition()];
338 338
         $this->addAndCondition = [];
339 339
 
340 340
         return $this;
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
      */
346 346
     public function groupConditionsAsAnd()
347 347
     {
348
-        $this->addAndCondition = [ $this->buildGroupCondition() ];
348
+        $this->addAndCondition = [$this->buildGroupCondition()];
349 349
         $this->addOrCondition = [];
350 350
 
351 351
         return $this;
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
             $format = $fieldPartFormat . sprintf('(%s)^%%s', $valuePartFormat);
487 487
             $condition = sprintf($format, $field->getDocumentFieldName(), $searchTerm, $field->getPriority());
488 488
         } else {
489
-            $condition = sprintf($fieldPartFormat . $valuePartFormat , $field->getDocumentFieldName(), $searchTerm);
489
+            $condition = sprintf($fieldPartFormat . $valuePartFormat, $field->getDocumentFieldName(), $searchTerm);
490 490
         }
491 491
 
492 492
         $condition = $isNegative ? $this->buildNegativeCondition($condition) : $condition;
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
         $condition = $fieldPartFormat . $valuePartFormat;
513 513
 
514 514
 
515
-        $condition = $isNegative ?  $this->buildNegativeCondition($condition) : $condition;
515
+        $condition = $isNegative ? $this->buildNegativeCondition($condition) : $condition;
516 516
 
517 517
         return sprintf(
518 518
             $condition,
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
         if (strpos($searchTerm, ' ') > 0) {
545 545
             $parts = explode(' ', $searchTerm);
546 546
             $formattedParts = [];
547
-            foreach ($parts as $part)  {
547
+            foreach ($parts as $part) {
548 548
                 $formattedParts[] = sprintf('%s~%u', $part, $distance);
549 549
             }
550 550
             $valuePartFormat = '"%s"';
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
         }
557 557
 
558 558
         $condition = $fieldPartFormat . $valuePartFormat;
559
-        $condition = $isNegative ?  $this->buildNegativeCondition($condition) : $condition;
559
+        $condition = $isNegative ? $this->buildNegativeCondition($condition) : $condition;
560 560
 
561 561
         return sprintf(
562 562
             $condition,
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
         if ($currentOrConditions && $currentAndConditions) {
574 574
             $groupedCondition = sprintf('(%s AND %s)', $currentOrConditions, $currentAndConditions);
575 575
         } else {
576
-            $conditions =  $currentOrConditions ?: $currentAndConditions;
576
+            $conditions = $currentOrConditions ?: $currentAndConditions;
577 577
             $groupedCondition = sprintf('(%s)', $conditions);
578 578
         }
579 579
 
@@ -650,12 +650,12 @@  discard block
 block discarded – undo
650 650
             throw new QueryException('SearchTerm argument must be a scalar');
651 651
         }
652 652
 
653
-        $specialSymbols = ['+','-','&&','||','!','(',')','{','}','[',']','^','"','~',':','/'];
654
-        $escapedSpecialSymbols = ['\+','\-','\&&','\||','\!','\(','\)','\{','\}','\[','\]','\^','\"','\~','\:','\/'];
653
+        $specialSymbols = ['+', '-', '&&', '||', '!', '(', ')', '{', '}', '[', ']', '^', '"', '~', ':', '/'];
654
+        $escapedSpecialSymbols = ['\+', '\-', '\&&', '\||', '\!', '\(', '\)', '\{', '\}', '\[', '\]', '\^', '\"', '\~', '\:', '\/'];
655 655
 
656 656
         if (!$wildcard) {
657
-            $specialSymbols = array_merge($specialSymbols, ['*','?']);
658
-            $escapedSpecialSymbols = array_merge($escapedSpecialSymbols, ['\*','\?']);
657
+            $specialSymbols = array_merge($specialSymbols, ['*', '?']);
658
+            $escapedSpecialSymbols = array_merge($escapedSpecialSymbols, ['\*', '\?']);
659 659
         }
660 660
 
661 661
         $searchTerm = preg_replace('/[^a-zA-Z\s0-9-_=+.?*!:)(\]\[ ]/', '', $searchTerm);
Please login to merge, or discard this patch.
Schema/Field/Entity/ArrayField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
         $entityValue = $this->getEntityFieldValue($entity);
17 17
         if (!is_null($entityValue)) {
18 18
             if (is_scalar($entityValue)) {
19
-                $entityValue =  [ $entityValue ];
19
+                $entityValue = [$entityValue];
20 20
             } elseif (
21 21
                 !is_array($entityValue) &&
22 22
                 ((!$entityValue instanceof \Iterator) && (!$entityValue instanceof \IteratorAggregate))
Please login to merge, or discard this patch.
Config/ConfigValidator.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -217,7 +217,7 @@
 block discarded – undo
217 217
             }
218 218
         } else {
219 219
             throw new RequiredFieldException(
220
-                 sprintf(
220
+                    sprintf(
221 221
                     'Either getter method "%s" or isser method "%s" is not found in %s.',
222 222
                     $getterMethodName,
223 223
                     $isserMethodName,
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
                         )
104 104
                     );
105 105
                 }
106
-                $this->discriminatorValues[] =  $discriminatorValue;
106
+                $this->discriminatorValues[] = $discriminatorValue;
107 107
             }
108 108
         }
109 109
     }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                 true
139 139
             );
140 140
 
141
-            foreach($entityConfig['filters'] as $filterName) {
141
+            foreach ($entityConfig['filters'] as $filterName) {
142 142
                 if (!array_key_exists($filterName, $filtersKeys)) {
143 143
                     throw new FilterConfigException(
144 144
                         sprintf('Filter "%s" is not defined in "filters" section', $filterName)
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      */
167 167
     private function checkDocumentFieldNamesAreUnique($schemaConfig)
168 168
     {
169
-        $schemaFields = [ $schemaConfig['config_entity_fields'], $schemaConfig['fields'] ];
169
+        $schemaFields = [$schemaConfig['config_entity_fields'], $schemaConfig['fields']];
170 170
         $documentFieldsNames = [];
171 171
 
172 172
         while ($fieldsConfig = array_shift($schemaFields)) {
Please login to merge, or discard this patch.
Tests/Query/Hydrator/SelectQueryHydratorTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         $entity = new \stdClass();
89 89
         $entity->$primaryKeyFieldName = 32;
90 90
 
91
-        $query = new Query([ $entity ]);
91
+        $query = new Query([$entity]);
92 92
 
93 93
         $this->entityRepository->expects($this->at(0))
94 94
             ->method('createQueryBuilder')
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         $entityConfig = [
125 125
             'class' => $entityConfigClass,
126 126
             'config' => [
127
-                [ 'name' => $configFieldName, 'value' => $configFieldValue]
127
+                ['name' => $configFieldName, 'value' => $configFieldValue]
128 128
             ]
129 129
         ];
130 130
         $discriminatorField = new ConfigEntityField($configFieldName, $configDocumentFieldName, true, 10);
Please login to merge, or discard this patch.
Tests/Query/Select/MultiClassSelectQueryTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@
 block discarded – undo
16 16
         $documentFieldName = 'd_type';
17 17
         $configFieldValue1 = 'article';
18 18
         $configFieldValue2 = 'news';
19
-        $entityConfig1 =  [
19
+        $entityConfig1 = [
20 20
             'config' => [
21
-                [ 'name' => $configFieldName, 'value' => $configFieldValue1 ]
21
+                ['name' => $configFieldName, 'value' => $configFieldValue1]
22 22
             ]
23 23
         ];
24 24
 
25
-        $entityConfig2 =  [
25
+        $entityConfig2 = [
26 26
             'config' => [
27
-                [ 'name' => $configFieldName, 'value' => $configFieldValue2 ]
27
+                ['name' => $configFieldName, 'value' => $configFieldValue2]
28 28
             ]
29 29
         ];
30 30
 
Please login to merge, or discard this patch.