@@ -131,8 +131,8 @@ |
||
131 | 131 | { |
132 | 132 | $string = preg_replace_callback( |
133 | 133 | '/(.)@(.)/s', |
134 | - function ($m) { |
|
135 | - return "&#" . sprintf("%03d", ord($m[1])) . ";@&#" .sprintf("%03d", ord($m[2])) . ";"; |
|
134 | + function($m) { |
|
135 | + return "&#" . sprintf("%03d", ord($m[1])) . ";@&#" . sprintf("%03d", ord($m[2])) . ";"; |
|
136 | 136 | }, |
137 | 137 | $string |
138 | 138 | ); |
@@ -64,7 +64,7 @@ |
||
64 | 64 | { |
65 | 65 | $variableApi = $this->getMockBuilder(VariableApiInterface::class)->getMock(); |
66 | 66 | $variableApi->method('getSystemVar')->willReturnCallback( |
67 | - function ($string, $default) use ($htmlEntities, $outputFilter) { |
|
67 | + function($string, $default) use ($htmlEntities, $outputFilter) { |
|
68 | 68 | switch ($string) { |
69 | 69 | case 'outputfilter': |
70 | 70 | return $outputFilter; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public function load(array $configs, ContainerBuilder $container) |
28 | 28 | { |
29 | - $loader = new YamlFileLoader($container, new FileLocator(realpath(__DIR__.'/../Resources/config'))); |
|
29 | + $loader = new YamlFileLoader($container, new FileLocator(realpath(__DIR__ . '/../Resources/config'))); |
|
30 | 30 | |
31 | 31 | $loader->load('services.yml'); |
32 | 32 | $loader->load('doctrine.yml'); |
@@ -104,9 +104,9 @@ |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | // ensure proper variable types |
107 | - $value = (string) $value; |
|
108 | - $type = (string) $type; |
|
109 | - $weight = (int) $weight; |
|
107 | + $value = (string)$value; |
|
108 | + $type = (string)$type; |
|
109 | + $weight = (int)$weight; |
|
110 | 110 | |
111 | 111 | if ('stylesheet' == $type) { |
112 | 112 | $this->styleSheets->add([$value => $weight]); |
@@ -106,7 +106,7 @@ |
||
106 | 106 | 'attr' => [ |
107 | 107 | 'maxlength' => 255, |
108 | 108 | 'title' => $this->__('Enter the route entries per page.') . ' ' . $this->__('Only digits are allowed.') |
109 | - ],'scale' => 0 |
|
109 | + ], 'scale' => 0 |
|
110 | 110 | ]) |
111 | 111 | ; |
112 | 112 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | /** |
46 | 46 | * Retrieves an array with all fields which can be used for sorting instances. |
47 | 47 | * |
48 | - * @return array Sorting fields array |
|
48 | + * @return string[] Sorting fields array |
|
49 | 49 | */ |
50 | 50 | public function getAllowedSortingFields() |
51 | 51 | { |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | /** |
305 | 305 | * Selects an object from the database. |
306 | 306 | * |
307 | - * @param mixed $id The id (or array of ids) to use to retrieve the object (optional) (default=0) |
|
307 | + * @param integer $id The id (or array of ids) to use to retrieve the object (optional) (default=0) |
|
308 | 308 | * @param boolean $useJoins Whether to include joining related objects (optional) (default=true) |
309 | 309 | * @param boolean $slimMode If activated only some basic fields are selected without using any joins (optional) (default=false) |
310 | 310 | * |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | * Adds where clauses excluding desired identifiers from selection. |
343 | 343 | * |
344 | 344 | * @param QueryBuilder $qb Query builder to be enhanced |
345 | - * @param array $excludesions Array of ids to be excluded from selection |
|
345 | + * @param array $exclusions Array of ids to be excluded from selection |
|
346 | 346 | * |
347 | 347 | * @return QueryBuilder Enriched query builder instance |
348 | 348 | */ |
@@ -407,7 +407,7 @@ |
||
407 | 407 | public function getSelectWherePaginatedQuery(QueryBuilder $qb, $currentPage = 1, $resultsPerPage = 25) |
408 | 408 | { |
409 | 409 | $query = $this->getQueryFromBuilder($qb); |
410 | - $offset = ($currentPage-1) * $resultsPerPage; |
|
410 | + $offset = ($currentPage - 1) * $resultsPerPage; |
|
411 | 411 | |
412 | 412 | $query->setFirstResult($offset) |
413 | 413 | ->setMaxResults($resultsPerPage); |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | |
151 | 151 | $qb = $this->getEntityManager()->createQueryBuilder(); |
152 | 152 | $qb->update($this->mainEntityClass, 'tbl') |
153 | - ->set('tbl.createdBy', $newUserId) |
|
154 | - ->where('tbl.createdBy = :creator') |
|
155 | - ->setParameter('creator', $userId); |
|
153 | + ->set('tbl.createdBy', $newUserId) |
|
154 | + ->where('tbl.createdBy = :creator') |
|
155 | + ->setParameter('creator', $userId); |
|
156 | 156 | $query = $qb->getQuery(); |
157 | 157 | $query->execute(); |
158 | 158 | |
@@ -183,9 +183,9 @@ discard block |
||
183 | 183 | |
184 | 184 | $qb = $this->getEntityManager()->createQueryBuilder(); |
185 | 185 | $qb->update($this->mainEntityClass, 'tbl') |
186 | - ->set('tbl.updatedBy', $newUserId) |
|
187 | - ->where('tbl.updatedBy = :editor') |
|
188 | - ->setParameter('editor', $userId); |
|
186 | + ->set('tbl.updatedBy', $newUserId) |
|
187 | + ->where('tbl.updatedBy = :editor') |
|
188 | + ->setParameter('editor', $userId); |
|
189 | 189 | $query = $qb->getQuery(); |
190 | 190 | $query->execute(); |
191 | 191 | |
@@ -214,8 +214,8 @@ discard block |
||
214 | 214 | |
215 | 215 | $qb = $this->getEntityManager()->createQueryBuilder(); |
216 | 216 | $qb->delete($this->mainEntityClass, 'tbl') |
217 | - ->where('tbl.createdBy = :creator') |
|
218 | - ->setParameter('creator', $userId); |
|
217 | + ->where('tbl.createdBy = :creator') |
|
218 | + ->setParameter('creator', $userId); |
|
219 | 219 | $query = $qb->getQuery(); |
220 | 220 | $query->execute(); |
221 | 221 | |
@@ -244,8 +244,8 @@ discard block |
||
244 | 244 | |
245 | 245 | $qb = $this->getEntityManager()->createQueryBuilder(); |
246 | 246 | $qb->delete($this->mainEntityClass, 'tbl') |
247 | - ->where('tbl.updatedBy = :editor') |
|
248 | - ->setParameter('editor', $userId); |
|
247 | + ->where('tbl.updatedBy = :editor') |
|
248 | + ->setParameter('editor', $userId); |
|
249 | 249 | $query = $qb->getQuery(); |
250 | 250 | $query->execute(); |
251 | 251 | |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | { |
331 | 331 | if (count($exclusions) > 0) { |
332 | 332 | $qb->andWhere('tbl.id NOT IN (:excludedIdentifiers)') |
333 | - ->setParameter('excludedIdentifiers', $exclusions); |
|
333 | + ->setParameter('excludedIdentifiers', $exclusions); |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | return $qb; |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | $offset = ($currentPage-1) * $resultsPerPage; |
391 | 391 | |
392 | 392 | $query->setFirstResult($offset) |
393 | - ->setMaxResults($resultsPerPage); |
|
393 | + ->setMaxResults($resultsPerPage); |
|
394 | 394 | |
395 | 395 | return $query; |
396 | 396 | } |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | |
488 | 488 | $qb = $this->getEntityManager()->createQueryBuilder(); |
489 | 489 | $qb->select($selection) |
490 | - ->from($this->mainEntityClass, 'tbl'); |
|
490 | + ->from($this->mainEntityClass, 'tbl'); |
|
491 | 491 | |
492 | 492 | if (!empty($where)) { |
493 | 493 | $qb->andWhere($where); |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | { |
537 | 537 | $qb = $this->getCountQuery('', false); |
538 | 538 | $qb->andWhere('tbl.' . $fieldName . ' = :' . $fieldName) |
539 | - ->setParameter($fieldName, $fieldValue); |
|
539 | + ->setParameter($fieldName, $fieldValue); |
|
540 | 540 | |
541 | 541 | if ($excludeId > 0) { |
542 | 542 | $qb = $this->addExclusion($qb, [$excludeId]); |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | |
580 | 580 | $qb = $this->getEntityManager()->createQueryBuilder(); |
581 | 581 | $qb->select($selection) |
582 | - ->from($this->mainEntityClass, 'tbl'); |
|
582 | + ->from($this->mainEntityClass, 'tbl'); |
|
583 | 583 | |
584 | 584 | if (true === $useJoins) { |
585 | 585 | $this->addJoinsToFrom($qb); |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | if ($orderBy == 'RAND()') { |
608 | 608 | // random selection |
609 | 609 | $qb->addSelect('MOD(tbl.id, ' . mt_rand(2, 15) . ') AS HIDDEN randomIdentifiers') |
610 | - ->add('orderBy', 'randomIdentifiers'); |
|
610 | + ->add('orderBy', 'randomIdentifiers'); |
|
611 | 611 | |
612 | 612 | return $qb; |
613 | 613 | } |
@@ -626,12 +626,12 @@ discard block |
||
626 | 626 | } |
627 | 627 | if (false !== strpos($orderBy, 'tbl.createdBy')) { |
628 | 628 | $qb->addSelect('tblCreator') |
629 | - ->leftJoin('tbl.createdBy', 'tblCreator'); |
|
629 | + ->leftJoin('tbl.createdBy', 'tblCreator'); |
|
630 | 630 | $orderBy = str_replace('tbl.createdBy', 'tblCreator.uname', $orderBy); |
631 | 631 | } |
632 | 632 | if (false !== strpos($orderBy, 'tbl.updatedBy')) { |
633 | 633 | $qb->addSelect('tblUpdater') |
634 | - ->leftJoin('tbl.updatedBy', 'tblUpdater'); |
|
634 | + ->leftJoin('tbl.updatedBy', 'tblUpdater'); |
|
635 | 635 | $orderBy = str_replace('tbl.updatedBy', 'tblUpdater.uname', $orderBy); |
636 | 636 | } |
637 | 637 | $qb->add('orderBy', $orderBy); |
@@ -13,17 +13,16 @@ |
||
13 | 13 | namespace Zikula\RoutesModule\Entity\Repository\Base; |
14 | 14 | |
15 | 15 | use Doctrine\Common\Collections\ArrayCollection; |
16 | -use Gedmo\Sortable\Entity\Repository\SortableRepository; |
|
17 | - |
|
18 | 16 | use Doctrine\ORM\Query; |
19 | 17 | use Doctrine\ORM\QueryBuilder; |
20 | 18 | use Doctrine\ORM\Tools\Pagination\Paginator; |
19 | +use Gedmo\Sortable\Entity\Repository\SortableRepository; |
|
21 | 20 | use InvalidArgumentException; |
22 | 21 | use Psr\Log\LoggerInterface; |
23 | 22 | use Zikula\Common\Translator\TranslatorInterface; |
24 | -use Zikula\UsersModule\Api\ApiInterface\CurrentUserApiInterface; |
|
25 | 23 | use Zikula\RoutesModule\Entity\RouteEntity; |
26 | 24 | use Zikula\RoutesModule\Helper\CollectionFilterHelper; |
25 | +use Zikula\UsersModule\Api\ApiInterface\CurrentUserApiInterface; |
|
27 | 26 | |
28 | 27 | /** |
29 | 28 | * Repository class used to implement own convenience methods for performing certain DQL queries. |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @param string $context Usage context (allowed values: controllerAction, api, helper, actionHandler, block, contentType, util) |
89 | 89 | * @param array $args Additional arguments |
90 | 90 | * |
91 | - * @return array List of allowed object types |
|
91 | + * @return string[] List of allowed object types |
|
92 | 92 | */ |
93 | 93 | public function getObjectTypes($context = '', array $args = []) |
94 | 94 | { |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | * @param string $context Usage context (allowed values: controllerAction, api, actionHandler, block, contentType) |
382 | 382 | * @param array $args Additional arguments |
383 | 383 | * |
384 | - * @return array List of template variables to be assigned |
|
384 | + * @return string List of template variables to be assigned |
|
385 | 385 | */ |
386 | 386 | public function addTemplateParameters($objectType = '', array $parameters = [], $context = '', array $args = []) |
387 | 387 | { |
@@ -262,7 +262,7 @@ |
||
262 | 262 | * |
263 | 263 | * @param EntityAccess $entity The given entity |
264 | 264 | * |
265 | - * @return Event The created event instance |
|
265 | + * @return string The created event instance |
|
266 | 266 | */ |
267 | 267 | protected function createFilterEvent($entity) |
268 | 268 | { |
@@ -24,7 +24,6 @@ |
||
24 | 24 | use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
25 | 25 | use Zikula\Core\Doctrine\EntityAccess; |
26 | 26 | use Zikula\RoutesModule\RoutesEvents; |
27 | -use Zikula\RoutesModule\Event\FilterRouteEvent; |
|
28 | 27 | |
29 | 28 | /** |
30 | 29 | * Event subscriber base class for entity lifecycle events. |
@@ -171,14 +171,14 @@ discard block |
||
171 | 171 | if ((!is_numeric($v) && $v != '') || (is_numeric($v) && $v > 0)) { |
172 | 172 | if ($k == 'workflowState' && substr($v, 0, 1) == '!') { |
173 | 173 | $qb->andWhere('tbl.' . $k . ' != :' . $k) |
174 | - ->setParameter($k, substr($v, 1, strlen($v)-1)); |
|
174 | + ->setParameter($k, substr($v, 1, strlen($v)-1)); |
|
175 | 175 | } elseif (substr($v, 0, 1) == '%') { |
176 | 176 | $qb->andWhere('tbl.' . $k . ' LIKE :' . $k) |
177 | - ->setParameter($k, '%' . $v . '%'); |
|
177 | + ->setParameter($k, '%' . $v . '%'); |
|
178 | 178 | } else { |
179 | 179 | $qb->andWhere('tbl.' . $k . ' = :' . $k) |
180 | - ->setParameter($k, $v); |
|
181 | - } |
|
180 | + ->setParameter($k, $v); |
|
181 | + } |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 | } |
@@ -282,10 +282,10 @@ discard block |
||
282 | 282 | |
283 | 283 | if (is_array($userId)) { |
284 | 284 | $qb->andWhere('tbl.createdBy IN (:userIds)') |
285 | - ->setParameter('userIds', $userId); |
|
285 | + ->setParameter('userIds', $userId); |
|
286 | 286 | } else { |
287 | 287 | $qb->andWhere('tbl.createdBy = :userId') |
288 | - ->setParameter('userId', $userId); |
|
288 | + ->setParameter('userId', $userId); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | return $qb; |
@@ -171,7 +171,7 @@ |
||
171 | 171 | if ((!is_numeric($v) && $v != '') || (is_numeric($v) && $v > 0)) { |
172 | 172 | if ($k == 'workflowState' && substr($v, 0, 1) == '!') { |
173 | 173 | $qb->andWhere('tbl.' . $k . ' != :' . $k) |
174 | - ->setParameter($k, substr($v, 1, strlen($v)-1)); |
|
174 | + ->setParameter($k, substr($v, 1, strlen($v) - 1)); |
|
175 | 175 | } elseif (substr($v, 0, 1) == '%') { |
176 | 176 | $qb->andWhere('tbl.' . $k . ' LIKE :' . $k) |
177 | 177 | ->setParameter($k, '%' . $v . '%'); |
@@ -17,8 +17,6 @@ |
||
17 | 17 | use Symfony\Component\HttpFoundation\RequestStack; |
18 | 18 | use Zikula\UsersModule\Api\ApiInterface\CurrentUserApiInterface; |
19 | 19 | use Zikula\UsersModule\Constant as UsersConstant; |
20 | -use Zikula\RoutesModule\Entity\RouteEntity; |
|
21 | -use Zikula\RoutesModule\Entity\Factory\RoutesFactory; |
|
22 | 20 | |
23 | 21 | /** |
24 | 22 | * Entity collection filter helper base class. |