@@ -22,7 +22,7 @@ |
||
| 22 | 22 | $configuration = new Configuration(); |
| 23 | 23 | $config = $this->processConfiguration($configuration, $configs); |
| 24 | 24 | |
| 25 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 25 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 26 | 26 | $loader->load('services.yml'); |
| 27 | 27 | } |
| 28 | 28 | } |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | $this->fields = array_keys($this->getClassMetadata()->fieldMappings); |
| 41 | 41 | |
| 42 | - $entityName = explode('\\', strtolower($this->getEntityName()) ); |
|
| 43 | - $entityName = $entityName[count($entityName)-1]; |
|
| 42 | + $entityName = explode('\\', strtolower($this->getEntityName())); |
|
| 43 | + $entityName = $entityName[count($entityName) - 1]; |
|
| 44 | 44 | $entityAlias = $entityName[0]; |
| 45 | 45 | $this->entityAlias = $entityAlias; |
| 46 | 46 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | foreach ($orFilters as $key => $filter) { |
| 123 | 123 | if (is_array($filter)) { |
| 124 | 124 | foreach ($filter as $keyInternal => $internal) { |
| 125 | - $filterOrCorrected[$keyInternal .'|' . $count] = $internal; |
|
| 125 | + $filterOrCorrected[$keyInternal . '|' . $count] = $internal; |
|
| 126 | 126 | $count = $count + 1; |
| 127 | 127 | } |
| 128 | 128 | } else { |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | foreach ($orFilters as $key => $filter) { |
| 175 | 175 | if (is_array($filter)) { |
| 176 | 176 | foreach ($filter as $keyInternal => $internal) { |
| 177 | - $filterOrCorrected[$keyInternal .'|' . $count] = $internal; |
|
| 177 | + $filterOrCorrected[$keyInternal . '|' . $count] = $internal; |
|
| 178 | 178 | $count = $count + 1; |
| 179 | 179 | } |
| 180 | 180 | } else { |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | foreach ($orFilters as $key => $filter) { |
| 222 | 222 | if (is_array($filter)) { |
| 223 | 223 | foreach ($filter as $keyInternal => $internal) { |
| 224 | - $filterOrCorrected[$keyInternal .'|' . $count] = $internal; |
|
| 224 | + $filterOrCorrected[$keyInternal . '|' . $count] = $internal; |
|
| 225 | 225 | $count = $count + 1; |
| 226 | 226 | } |
| 227 | 227 | } else { |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $pagerAdapter = new DoctrineORMAdapter($queryBuilder); |
| 279 | 279 | |
| 280 | 280 | $query = $pagerAdapter->getQuery(); |
| 281 | - if(isset($this->use_result_cache) and $this->use_result_cache){ |
|
| 281 | + if (isset($this->use_result_cache) and $this->use_result_cache) { |
|
| 282 | 282 | $query->useResultCache(true, 600); |
| 283 | 283 | } |
| 284 | 284 | |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | $params[$itemValue] = $this->queryOptions->get($itemValue); |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | - if(!isset($this->route_name)){ |
|
| 320 | + if (!isset($this->route_name)) { |
|
| 321 | 321 | $this->route_name = $this->queryOptions->get('_route'); |
| 322 | 322 | } |
| 323 | 323 | |
@@ -346,8 +346,8 @@ discard block |
||
| 346 | 346 | |
| 347 | 347 | public function getEntityAlias(string $entityName) : string |
| 348 | 348 | { |
| 349 | - $arrayEntityName = explode('\\', strtolower($entityName) ); |
|
| 350 | - return $arrayEntityName[count($arrayEntityName)-1]; |
|
| 349 | + $arrayEntityName = explode('\\', strtolower($entityName)); |
|
| 350 | + return $arrayEntityName[count($arrayEntityName) - 1]; |
|
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | protected function relationship($queryBuilder) |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $this->mapper = $mapper; |
| 47 | 47 | $this->logger = $logger; |
| 48 | 48 | |
| 49 | - $this->appendRootEntityToSubject = function($subject, $rootEntity) { |
|
| 49 | + $this->appendRootEntityToSubject = function($subject, $rootEntity) { |
|
| 50 | 50 | $subject[] = $rootEntity; |
| 51 | 51 | return $subject; |
| 52 | 52 | }; |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | $entities = $this->getEntitiesPath(); |
| 277 | 277 | $lastEntityFound = end($entities); |
| 278 | 278 | $this->removeStep($lastEntityFound); |
| 279 | - } catch(\Mado\QueryBundle\Component\Meta\Exceptions\UnexpectedValueException $e) { |
|
| 279 | + } catch (\Mado\QueryBundle\Component\Meta\Exceptions\UnexpectedValueException $e) { |
|
| 280 | 280 | return; |
| 281 | 281 | } |
| 282 | 282 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | $needle = $prevEntityAlias . '_' . $currentEntityAlias; |
| 117 | 117 | |
| 118 | - return ! in_array($needle, $this->joins); |
|
| 118 | + return !in_array($needle, $this->joins); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | private function storeJoin($prevEntityAlias, $currentEntityAlias) |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | $relationEntityAlias = $this->getRelationEntityAlias(); |
| 275 | 275 | |
| 276 | 276 | $embeddedFields = explode('.', $filterObject->getFieldName()); |
| 277 | - $embeddedFieldName = $this->parser->camelize($embeddedFields[count($embeddedFields)-1]); |
|
| 277 | + $embeddedFieldName = $this->parser->camelize($embeddedFields[count($embeddedFields) - 1]); |
|
| 278 | 278 | |
| 279 | 279 | $salt = '_' . random_int(111, 999); |
| 280 | 280 | |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | $relationEntityAlias = $this->getRelationEntityAlias(); |
| 368 | 368 | |
| 369 | 369 | $embeddedFields = explode('.', $filterObject->getFieldName()); |
| 370 | - $embeddableFieldName = $this->parser->camelize($embeddedFields[count($embeddedFields)-1]); |
|
| 370 | + $embeddableFieldName = $this->parser->camelize($embeddedFields[count($embeddedFields) - 1]); |
|
| 371 | 371 | |
| 372 | 372 | $salt = '_' . random_int(111, 999); |
| 373 | 373 | |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | if ($filterObject->isListType()) { |
| 378 | 378 | $whereCondition .= ' (:field_' . $embeddableFieldName . $salt . ')'; |
| 379 | 379 | } else { |
| 380 | - $whereCondition .=' :field_' . $embeddableFieldName . $salt; |
|
| 380 | + $whereCondition .= ' :field_' . $embeddableFieldName . $salt; |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | if (null != $orCondition['orCondition']) { |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | if (in_array($fieldName, $this->fields)) { |
| 430 | 430 | $direction = ($val === self::DIRECTION_AZ) ? self::DIRECTION_AZ : self::DIRECTION_ZA; |
| 431 | 431 | $this->ensureQueryBuilderIsDefined(); |
| 432 | - $this->qBuilder->addOrderBy($this->entityAlias .'.'. $fieldName, $direction); |
|
| 432 | + $this->qBuilder->addOrderBy($this->entityAlias . '.' . $fieldName, $direction); |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | if (strstr($sort, '_embedded.')) { |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | $fieldName = $this->parser->camelize($embeddedFields[2]); |
| 441 | 441 | $direction = ($val === self::DIRECTION_AZ) ? self::DIRECTION_AZ : self::DIRECTION_ZA; |
| 442 | 442 | |
| 443 | - $this->qBuilder->addOrderBy($relationEntityAlias.'.'.$fieldName, $direction); |
|
| 443 | + $this->qBuilder->addOrderBy($relationEntityAlias . '.' . $fieldName, $direction); |
|
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | } |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | return $this->pageLength; |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | - public function setSelect( $select) : QueryBuilderFactory |
|
| 518 | + public function setSelect($select) : QueryBuilderFactory |
|
| 519 | 519 | { |
| 520 | 520 | $this->select = $select; |
| 521 | 521 | |