@@ -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); |
@@ -162,9 +162,9 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | $qb = $this->getEntityManager()->createQueryBuilder(); |
| 164 | 164 | $qb->update('Zikula\RoutesModule\Entity\RouteEntity', 'tbl') |
| 165 | - ->set('tbl.createdBy', $newUserId) |
|
| 166 | - ->where('tbl.createdBy = :creator') |
|
| 167 | - ->setParameter('creator', $userId); |
|
| 165 | + ->set('tbl.createdBy', $newUserId) |
|
| 166 | + ->where('tbl.createdBy = :creator') |
|
| 167 | + ->setParameter('creator', $userId); |
|
| 168 | 168 | $query = $qb->getQuery(); |
| 169 | 169 | $query->execute(); |
| 170 | 170 | |
@@ -195,9 +195,9 @@ discard block |
||
| 195 | 195 | |
| 196 | 196 | $qb = $this->getEntityManager()->createQueryBuilder(); |
| 197 | 197 | $qb->update('Zikula\RoutesModule\Entity\RouteEntity', 'tbl') |
| 198 | - ->set('tbl.updatedBy', $newUserId) |
|
| 199 | - ->where('tbl.updatedBy = :editor') |
|
| 200 | - ->setParameter('editor', $userId); |
|
| 198 | + ->set('tbl.updatedBy', $newUserId) |
|
| 199 | + ->where('tbl.updatedBy = :editor') |
|
| 200 | + ->setParameter('editor', $userId); |
|
| 201 | 201 | $query = $qb->getQuery(); |
| 202 | 202 | $query->execute(); |
| 203 | 203 | |
@@ -226,8 +226,8 @@ discard block |
||
| 226 | 226 | |
| 227 | 227 | $qb = $this->getEntityManager()->createQueryBuilder(); |
| 228 | 228 | $qb->delete('Zikula\RoutesModule\Entity\RouteEntity', 'tbl') |
| 229 | - ->where('tbl.createdBy = :creator') |
|
| 230 | - ->setParameter('creator', $userId); |
|
| 229 | + ->where('tbl.createdBy = :creator') |
|
| 230 | + ->setParameter('creator', $userId); |
|
| 231 | 231 | $query = $qb->getQuery(); |
| 232 | 232 | $query->execute(); |
| 233 | 233 | |
@@ -256,8 +256,8 @@ discard block |
||
| 256 | 256 | |
| 257 | 257 | $qb = $this->getEntityManager()->createQueryBuilder(); |
| 258 | 258 | $qb->delete('Zikula\RoutesModule\Entity\RouteEntity', 'tbl') |
| 259 | - ->where('tbl.updatedBy = :editor') |
|
| 260 | - ->setParameter('editor', $userId); |
|
| 259 | + ->where('tbl.updatedBy = :editor') |
|
| 260 | + ->setParameter('editor', $userId); |
|
| 261 | 261 | $query = $qb->getQuery(); |
| 262 | 262 | $query->execute(); |
| 263 | 263 | |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | { |
| 343 | 343 | if (count($exclusions) > 0) { |
| 344 | 344 | $qb->andWhere('tbl.id NOT IN (:excludedIdentifiers)') |
| 345 | - ->setParameter('excludedIdentifiers', $exclusions); |
|
| 345 | + ->setParameter('excludedIdentifiers', $exclusions); |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | return $qb; |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | $offset = ($currentPage-1) * $resultsPerPage; |
| 403 | 403 | |
| 404 | 404 | $query->setFirstResult($offset) |
| 405 | - ->setMaxResults($resultsPerPage); |
|
| 405 | + ->setMaxResults($resultsPerPage); |
|
| 406 | 406 | |
| 407 | 407 | return $query; |
| 408 | 408 | } |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | |
| 500 | 500 | $qb = $this->getEntityManager()->createQueryBuilder(); |
| 501 | 501 | $qb->select($selection) |
| 502 | - ->from('Zikula\RoutesModule\Entity\RouteEntity', 'tbl'); |
|
| 502 | + ->from('Zikula\RoutesModule\Entity\RouteEntity', 'tbl'); |
|
| 503 | 503 | |
| 504 | 504 | if (!empty($where)) { |
| 505 | 505 | $qb->andWhere($where); |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | { |
| 549 | 549 | $qb = $this->getCountQuery('', false); |
| 550 | 550 | $qb->andWhere('tbl.' . $fieldName . ' = :' . $fieldName) |
| 551 | - ->setParameter($fieldName, $fieldValue); |
|
| 551 | + ->setParameter($fieldName, $fieldValue); |
|
| 552 | 552 | |
| 553 | 553 | if ($excludeId > 0) { |
| 554 | 554 | $qb = $this->addExclusion($qb, [$excludeId]); |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | |
| 597 | 597 | $qb = $this->getEntityManager()->createQueryBuilder(); |
| 598 | 598 | $qb->select($selection) |
| 599 | - ->from('Zikula\RoutesModule\Entity\RouteEntity', 'tbl'); |
|
| 599 | + ->from('Zikula\RoutesModule\Entity\RouteEntity', 'tbl'); |
|
| 600 | 600 | |
| 601 | 601 | if (true === $useJoins) { |
| 602 | 602 | $this->addJoinsToFrom($qb); |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | if ($orderBy == 'RAND()') { |
| 625 | 625 | // random selection |
| 626 | 626 | $qb->addSelect('MOD(tbl.id, ' . mt_rand(2, 15) . ') AS HIDDEN randomIdentifiers') |
| 627 | - ->add('orderBy', 'randomIdentifiers'); |
|
| 627 | + ->add('orderBy', 'randomIdentifiers'); |
|
| 628 | 628 | |
| 629 | 629 | return $qb; |
| 630 | 630 | } |
@@ -643,12 +643,12 @@ discard block |
||
| 643 | 643 | } |
| 644 | 644 | if (false !== strpos($orderBy, 'tbl.createdBy')) { |
| 645 | 645 | $qb->addSelect('tblCreator') |
| 646 | - ->leftJoin('tbl.createdBy', 'tblCreator'); |
|
| 646 | + ->leftJoin('tbl.createdBy', 'tblCreator'); |
|
| 647 | 647 | $orderBy = str_replace('tbl.createdBy', 'tblCreator.uname', $orderBy); |
| 648 | 648 | } |
| 649 | 649 | if (false !== strpos($orderBy, 'tbl.updatedBy')) { |
| 650 | 650 | $qb->addSelect('tblUpdater') |
| 651 | - ->leftJoin('tbl.updatedBy', 'tblUpdater'); |
|
| 651 | + ->leftJoin('tbl.updatedBy', 'tblUpdater'); |
|
| 652 | 652 | $orderBy = str_replace('tbl.updatedBy', 'tblUpdater.uname', $orderBy); |
| 653 | 653 | } |
| 654 | 654 | $qb->add('orderBy', $orderBy); |
@@ -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 | { |
@@ -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 . '%'); |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | * @param PermissionRepositoryInterface $permRepository Permission repository |
| 81 | 81 | * @param UserRepositoryInterface $userRepository User repository |
| 82 | 82 | * @param CurrentUserApiInterface $currentUserApi |
| 83 | - * @param TranslatorInterface $translator Translator service instance |
|
| 83 | + * @param \Zikula\Common\Translator\IdentityTranslator $translator Translator service instance |
|
| 84 | 84 | */ |
| 85 | 85 | public function __construct( |
| 86 | 86 | PermissionRepositoryInterface $permRepository, |