@@ -73,13 +73,13 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | $this->variableApi = $variableApi; |
| 75 | 75 | |
| 76 | - $this->enabled = (bool)$variableApi->getSystemVar('updatecheck'); |
|
| 76 | + $this->enabled = (bool) $variableApi->getSystemVar('updatecheck'); |
|
| 77 | 77 | $this->currentVersion = ZikulaKernel::VERSION; |
| 78 | - $this->lastChecked = (int)$variableApi->getSystemVar('updatelastchecked'); |
|
| 79 | - $this->checkInterval = (int)$variableApi->getSystemVar('updatefrequency'); |
|
| 78 | + $this->lastChecked = (int) $variableApi->getSystemVar('updatelastchecked'); |
|
| 79 | + $this->checkInterval = (int) $variableApi->getSystemVar('updatefrequency'); |
|
| 80 | 80 | $this->updateversion = $variableApi->getSystemVar('updateversion'); |
| 81 | 81 | |
| 82 | - $this->force = (bool)$requestStack->getMasterRequest()->query->get('forceupdatecheck'); |
|
| 82 | + $this->force = (bool) $requestStack->getMasterRequest()->query->get('forceupdatecheck'); |
|
| 83 | 83 | $this->checked = false; |
| 84 | 84 | $this->releases = false; |
| 85 | 85 | |
@@ -147,9 +147,9 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if (true === $this->checked && '' !== $this->updateversion) { |
| 150 | - $this->variableApi->set(VariableApi::CONFIG, 'updatelastchecked', (int)time()); |
|
| 150 | + $this->variableApi->set(VariableApi::CONFIG, 'updatelastchecked', (int) time()); |
|
| 151 | 151 | $this->variableApi->set(VariableApi::CONFIG, 'updateversion', $this->updateversion); |
| 152 | - $this->lastChecked = (int)$this->variableApi->getSystemVar('updatelastchecked'); |
|
| 152 | + $this->lastChecked = (int) $this->variableApi->getSystemVar('updatelastchecked'); |
|
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
@@ -20,14 +20,14 @@ |
||
| 20 | 20 | { |
| 21 | 21 | public function sortAdminModsByOrder(array $adminLinks = []): array |
| 22 | 22 | { |
| 23 | - usort($adminLinks, function (array $a, array $b) { |
|
| 24 | - if ((int)$a['order'] === (int)$b['order']) { |
|
| 23 | + usort($adminLinks, function(array $a, array $b) { |
|
| 24 | + if ((int) $a['order'] === (int) $b['order']) { |
|
| 25 | 25 | return strcmp($a['moduleName'], $b['moduleName']); |
| 26 | 26 | } |
| 27 | - if ((int)$a['order'] > (int)$b['order']) { |
|
| 27 | + if ((int) $a['order'] > (int) $b['order']) { |
|
| 28 | 28 | return 1; |
| 29 | 29 | } |
| 30 | - if ((int)$a['order'] < (int)$b['order']) { |
|
| 30 | + if ((int) $a['order'] < (int) $b['order']) { |
|
| 31 | 31 | return -1; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -139,7 +139,7 @@ |
||
| 139 | 139 | $variableApi->set(VariableApi::CONFIG, 'sessionsavepath', $sessionSavePath); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - if ((bool)$sessionStoreToFile !== (bool)$variableApi->getSystemVar('sessionstoretofile')) { |
|
| 142 | + if ((bool) $sessionStoreToFile !== (bool) $variableApi->getSystemVar('sessionstoretofile')) { |
|
| 143 | 143 | // logout if going from one storage to another one |
| 144 | 144 | $causeLogout = true; |
| 145 | 145 | } |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | } |
| 107 | 107 | // remove disabled |
| 108 | 108 | foreach ($searchModules as $displayName => $moduleName) { |
| 109 | - if ((bool)$this->getVar('disable_' . $moduleName)) { |
|
| 109 | + if ((bool) $this->getVar('disable_' . $moduleName)) { |
|
| 110 | 110 | unset($searchModules[$displayName]); |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -441,7 +441,7 @@ |
||
| 441 | 441 | $form->handleRequest($request); |
| 442 | 442 | if ($form->isSubmitted() && $form->isValid()) { |
| 443 | 443 | if ($form->get('toggle')->isClicked()) { |
| 444 | - if ($user->getAttributes()->containsKey(ZAuthConstant::REQUIRE_PASSWORD_CHANGE_KEY) && (bool)$user->getAttributes()->get(ZAuthConstant::REQUIRE_PASSWORD_CHANGE_KEY)) { |
|
| 444 | + if ($user->getAttributes()->containsKey(ZAuthConstant::REQUIRE_PASSWORD_CHANGE_KEY) && (bool) $user->getAttributes()->get(ZAuthConstant::REQUIRE_PASSWORD_CHANGE_KEY)) { |
|
| 445 | 445 | $user->getAttributes()->remove(ZAuthConstant::REQUIRE_PASSWORD_CHANGE_KEY); |
| 446 | 446 | $this->addFlash('success', $this->trans('Done! A password change will no longer be required for %userName%.', ['%userName%' => $user->getUname()])); |
| 447 | 447 | } else { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | ->setParameter('excludedUid', $authenticationMappingEntity->getUid()); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if ((int)$qb->getQuery()->getSingleScalarResult() > 0) { |
|
| 75 | + if ((int) $qb->getQuery()->getSingleScalarResult() > 0) { |
|
| 76 | 76 | $this->context->buildViolation($this->translator->trans('The user name you entered (%userName%) has already been registered.', ['%userName%' => $userName], 'validators')) |
| 77 | 77 | ->atPath('uname') |
| 78 | 78 | ->addViolation(); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $qb->andWhere('m.uid != :excludedUid') |
| 92 | 92 | ->setParameter('excludedUid', $authenticationMappingEntity->getUid()); |
| 93 | 93 | } |
| 94 | - $uCount = (int)$qb->getQuery()->getSingleScalarResult(); |
|
| 94 | + $uCount = (int) $qb->getQuery()->getSingleScalarResult(); |
|
| 95 | 95 | |
| 96 | 96 | $query = $this->userVerificationRepository->createQueryBuilder('v') |
| 97 | 97 | ->select('count(v.uid)') |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | ->setParameter('email', $emailAddress) |
| 101 | 101 | ->setParameter('chgtype', ZAuthConstant::VERIFYCHGTYPE_EMAIL) |
| 102 | 102 | ->getQuery(); |
| 103 | - $vCount = (int)$query->getSingleScalarResult(); |
|
| 103 | + $vCount = (int) $query->getSingleScalarResult(); |
|
| 104 | 104 | |
| 105 | 105 | if ($uCount + $vCount > 0) { |
| 106 | 106 | $this->context->buildViolation($this->translator->trans('The email address you entered (%email%) has already been registered.', ['%email%' => $emailAddress], 'validators')) |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | if ($hasEditPermissionToUser) { |
| 105 | 105 | $userEntity = $this->userRepository->find($mapping->getUid()); |
| 106 | 106 | if (null !== $userEntity) { |
| 107 | - if ((bool)$userEntity->getAttributeValue(ZAuthConstant::REQUIRE_PASSWORD_CHANGE_KEY) |
|
| 107 | + if ((bool) $userEntity->getAttributeValue(ZAuthConstant::REQUIRE_PASSWORD_CHANGE_KEY) |
|
| 108 | 108 | && $userEntity->getAttributes()->containsKey(ZAuthConstant::REQUIRE_PASSWORD_CHANGE_KEY) |
| 109 | 109 | ) { |
| 110 | 110 | $title = $this->translator->trans('Cancel required change of password for %sub%', ['%sub%' => $mapping->getUname()]); |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | $query = $qb->getQuery(); |
| 64 | 64 | |
| 65 | - return (int)$query->getSingleScalarResult(); |
|
| 65 | + return (int) $query->getSingleScalarResult(); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | public function getLastByParent(int $parentId = 0): ?CategoryEntity |
@@ -52,12 +52,12 @@ |
||
| 52 | 52 | |
| 53 | 53 | if ($parentId > 0) { |
| 54 | 54 | $qb->andWhere('c.parent = :parentid') |
| 55 | - ->setParameter('parentid', $parentId); |
|
| 55 | + ->setParameter('parentid', $parentId); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | if (null !== $excludedId && $excludedId > 0) { |
| 59 | 59 | $qb->andWhere('c.id != :id') |
| 60 | - ->setParameter('id', $excludedId); |
|
| 60 | + ->setParameter('id', $excludedId); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $query = $qb->getQuery(); |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | if (!in_array(AbstractCategoryAssignment::class, $classParents, true)) { |
| 47 | 47 | throw new InvalidConfigurationException("Option 'entityCategoryClass' must extend Zikula\\CategoriesModule\\Entity\\AbstractCategoryAssignment"); |
| 48 | 48 | } |
| 49 | - $this->entityCategoryClass = (string)$options['entityCategoryClass']; |
|
| 50 | - $this->multiple = (bool)($options['multiple'] ?? false); |
|
| 49 | + $this->entityCategoryClass = (string) $options['entityCategoryClass']; |
|
| 50 | + $this->multiple = (bool) ($options['multiple'] ?? false); |
|
| 51 | 51 | $this->entityManager = $options['em']; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $class = $this->entityCategoryClass; |
| 58 | 58 | |
| 59 | 59 | foreach ($value as $regId => $categories) { |
| 60 | - $regId = (int)mb_substr($regId, mb_strpos($regId, '_') + 1); |
|
| 60 | + $regId = (int) mb_substr($regId, mb_strpos($regId, '_') + 1); |
|
| 61 | 61 | $subCollection = new ArrayCollection(); |
| 62 | 62 | if (!is_array($categories) && $categories instanceof CategoryEntity) { |
| 63 | 63 | $categories = [$categories]; |