Passed
Push — master ( a39fbe...df2b14 )
by Iakov
03:38
created
RequestProcessor/Step/Filter/FilterStep.php 1 patch
Spacing   +6 added lines, -9 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             /** @var \ReflectionClass $reflection */
69 69
             $reflection = $this->getArtifact('reflection');
70 70
 
71
-            if(strpos($config['property'], '.')) {
71
+            if (strpos($config['property'], '.')) {
72 72
                 $this->applyFilterToRelation($config, $reflection, $queryBuilder, '_'.$index);
73 73
             } else {
74 74
                 $this->applyRegularFilter($config, $reflection, $queryBuilder, '_'.$index);
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
                 $this->checkAccessForRelatedProperty($reflection, $propertyRelatedModel);
120 120
                 $config['property'] = Inflector::camelize($propertyRelatedModel);
121 121
                 $shortcut = Inflector::camelize($relatedModelName);
122
-                if($queryBuilder->getDQLPart('join')){
122
+                if ($queryBuilder->getDQLPart('join')) {
123 123
                     $joins = $queryBuilder->getDQLPart('join')['e'];
124
-                    foreach ($joins as $join){
125
-                        if($join->getAlias() != $relatedModelName) {
124
+                    foreach ($joins as $join) {
125
+                        if ($join->getAlias() != $relatedModelName) {
126 126
                             $queryBuilder->leftJoin(sprintf('e.%s', $relatedModelName), $relatedModelName);
127 127
                         }
128 128
                     }
129
-                } else{
129
+                } else {
130 130
                     $queryBuilder->leftJoin(sprintf('e.%s', $relatedModelName), $relatedModelName);
131 131
                 }
132 132
                 call_user_func([$this, sprintf('apply%sFilter', $config['type'])], $config, $queryBuilder, $shortcut, $index);
@@ -150,10 +150,7 @@  discard block
 block discarded – undo
150 150
     protected function getRelationAnnotation(\ReflectionProperty $property): Annotation
151 151
     {
152 152
         /** @var Annotation $annotation */
153
-        $annotation = $this->reader->getPropertyAnnotation($property, OneToOne::class) ?:
154
-            $this->reader->getPropertyAnnotation($property, OneToMany::class) ?:
155
-                $this->reader->getPropertyAnnotation($property, ManyToMany::class) ?:
156
-                    $this->reader->getPropertyAnnotation($property, ManyToOne::class);
153
+        $annotation = $this->reader->getPropertyAnnotation($property, OneToOne::class) ?: $this->reader->getPropertyAnnotation($property, OneToMany::class) ?: $this->reader->getPropertyAnnotation($property, ManyToMany::class) ?: $this->reader->getPropertyAnnotation($property, ManyToOne::class);
157 154
         if (!$annotation) {
158 155
             throw new BadRequestHttpException(sprintf('Property %s is not configured for filtering', $property->getName()));
159 156
         }
Please login to merge, or discard this patch.