Completed
Pull Request — master (#4135)
by Craig
05:24
created
src/system/ZAuthModule/Validator/Constraints/ValidUserFieldsValidator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'))
Please login to merge, or discard this patch.
src/system/ZAuthModule/Helper/AdministrationActionsHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
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()]);
Please login to merge, or discard this patch.
src/system/ZAuthModule/Helper/FileIOHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             }
161 161
 
162 162
             // validate password
163
-            $pass = (string)trim($importValues[$counter - 1]['pass']);
163
+            $pass = (string) trim($importValues[$counter - 1]['pass']);
164 164
             $errors = $this->validator->validate($pass, [new NotNull(), new ValidPassword()]);
165 165
             if ($errors->count() > 0) {
166 166
                 return $this->locateErrors($errors, 'password', $counter);
@@ -174,14 +174,14 @@  discard block
 block discarded – undo
174 174
             }
175 175
 
176 176
             // validate activation value
177
-            $importValues[$counter - 1]['activated'] = isset($importValues[$counter - 1]['activated']) ? (int)$importValues[$counter - 1]['activated'] : UsersConstant::ACTIVATED_ACTIVE;
177
+            $importValues[$counter - 1]['activated'] = isset($importValues[$counter - 1]['activated']) ? (int) $importValues[$counter - 1]['activated'] : UsersConstant::ACTIVATED_ACTIVE;
178 178
             $activated = $importValues[$counter - 1]['activated'];
179 179
             if ((UsersConstant::ACTIVATED_INACTIVE !== $activated) && (UsersConstant::ACTIVATED_ACTIVE !== $activated)) {
180 180
                 return $this->locateErrors($this->trans('Error! The CSV is not valid: the "activated" column must contain 0 or 1 only.'), 'activated', $counter);
181 181
             }
182 182
 
183 183
             // validate sendmail
184
-            $importValues[$counter - 1]['sendmail'] = isset($importValues[$counter - 1]['sendmail']) ? (int)$importValues[$counter - 1]['sendmail'] : 0;
184
+            $importValues[$counter - 1]['sendmail'] = isset($importValues[$counter - 1]['sendmail']) ? (int) $importValues[$counter - 1]['sendmail'] : 0;
185 185
             if ($importValues[$counter - 1]['sendmail'] < 0 || $importValues[$counter - 1]['sendmail'] > 1) {
186 186
                 return $this->locateErrors($this->trans('Error! The CSV is not valid: the "sendmail" column must contain 0 or 1 only.'), 'sendmail', $counter);
187 187
             }
Please login to merge, or discard this patch.
CategoriesModule/Form/DataTransformer/CategoriesCollectionTransformer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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];
Please login to merge, or discard this patch.
src/Zikula/CoreInstallerBundle/Command/UpgradeCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -192,8 +192,8 @@
 block discarded – undo
192 192
         $count = $this->migrationHelper->countUnMigratedUsers();
193 193
         if ($count > 0) {
194 194
             $io->text($this->translator->trans('Beginning user migration...'));
195
-            $userMigrationMaxuid = (int)$this->migrationHelper->getMaxUnMigratedUid();
196
-            $progressBar = new ProgressBar($output, (int)ceil($count / MigrationHelper::BATCH_LIMIT));
195
+            $userMigrationMaxuid = (int) $this->migrationHelper->getMaxUnMigratedUid();
196
+            $progressBar = new ProgressBar($output, (int) ceil($count / MigrationHelper::BATCH_LIMIT));
197 197
             $progressBar->start();
198 198
             $lastUid = 0;
199 199
             do {
Please login to merge, or discard this patch.
src/Zikula/CoreInstallerBundle/Helper/ControllerHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@
 block discarded – undo
134 134
         $results['phpsatisfied'] = version_compare($phpVersion, ZikulaKernel::PHP_MINIMUM_VERSION, '>=');
135 135
         $results['pdo'] = extension_loaded('pdo');
136 136
         $supportsUnicode = preg_match('/^\p{L}+$/u', 'TheseAreLetters');
137
-        $results['pcreUnicodePropertiesEnabled'] = (isset($supportsUnicode) && (bool)$supportsUnicode);
137
+        $results['pcreUnicodePropertiesEnabled'] = (isset($supportsUnicode) && (bool) $supportsUnicode);
138 138
         $requirementsMet = true;
139 139
         foreach ($results as $check) {
140 140
             if (!$check) {
Please login to merge, or discard this patch.
src/Zikula/HookBundle/Hook/ValidationResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,6 +75,6 @@
 block discarded – undo
75 75
 
76 76
     public function hasErrors(): bool
77 77
     {
78
-        return (bool)$this->errors;
78
+        return (bool) $this->errors;
79 79
     }
80 80
 }
Please login to merge, or discard this patch.
src/Zikula/CoreBundle/YamlDumper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -163,11 +163,11 @@
 block discarded – undo
163 163
         $html = '';
164 164
 
165 165
         foreach ($value as $key => $val) {
166
-            $html .= '<li><strong>' . htmlspecialchars((string)$key, ENT_QUOTES) . ':</strong>';
166
+            $html .= '<li><strong>' . htmlspecialchars((string) $key, ENT_QUOTES) . ':</strong>';
167 167
             if (is_array($val)) {
168 168
                 $html .= $this->formatValue($val) . "</li>\n";
169 169
             } else {
170
-                $val = !empty($val) ? htmlspecialchars((string)$val, ENT_QUOTES) : '<em>null</em>';
170
+                $val = !empty($val) ? htmlspecialchars((string) $val, ENT_QUOTES) : '<em>null</em>';
171 171
                 $html .= ' ' . $val . "</li>\n";
172 172
             }
173 173
         }
Please login to merge, or discard this patch.
src/Zikula/CoreBundle/EventListener/SiteOffListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
             return;
110 110
         }
111 111
 
112
-        $siteOff = (bool)$this->variableApi->getSystemVar('siteoff');
112
+        $siteOff = (bool) $this->variableApi->getSystemVar('siteoff');
113 113
         $hasAdminPerms = $this->permissionApi->hasPermission('ZikulaSettingsModule::', 'SiteOff::', ACCESS_ADMIN);
114 114
 
115 115
         // Check for site closed
Please login to merge, or discard this patch.