Completed
Pull Request — master (#3788)
by Craig
01:31
created
src/system/AdminModule/Controller/AdminController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -345,7 +345,7 @@
 block discarded – undo
345 345
 
346 346
                 $links = $this->get('zikula.link_container_collector')->getLinks($adminModule['name'], 'admin');
347 347
                 // @deprecated remove at Core-2.0
348
-                $links = (false == $links) ? (array) ModUtil::apiFunc($adminModule['name'], 'admin', 'getLinks') : $links;
348
+                $links = (false == $links) ? (array)ModUtil::apiFunc($adminModule['name'], 'admin', 'getLinks') : $links;
349 349
                 try {
350 350
                     $adminIconPath = $this->get('zikula_core.common.theme.asset_helper')->resolve('@' . $adminModule['name'] . ':images/admin.png');
351 351
                 } catch (\Exception $e) {
Please login to merge, or discard this patch.
src/system/CategoriesModule/Form/Type/CategoriesType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
 
58 58
         /** @var CategoryRegistryEntity[] $registries */
59 59
         foreach ($registries as $registry) {
60
-            $queryBuilderClosure = function (CategoryRepositoryInterface $repo) use ($registry, $options) {
60
+            $queryBuilderClosure = function(CategoryRepositoryInterface $repo) use ($registry, $options) {
61 61
                 return $repo->getChildrenQueryBuilder($registry->getCategory(), $options['direct']);
62 62
             };
63
-            $choiceLabelClosure = function (CategoryEntity $category) use ($registry) {
63
+            $choiceLabelClosure = function(CategoryEntity $category) use ($registry) {
64 64
                 $indent = str_repeat('--', $category->getLvl() - $registry->getCategory()->getLvl() - 1);
65 65
 
66 66
                 return (!empty($indent) ? '|' : '') . $indent . $category->getName();
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
         $resolver->setAllowedTypes('em', [ObjectManager::class, 'null']);
123 123
 
124 124
         // remove this normalizer when the 'includeGrandChildren' option is removed
125
-        $resolver->setNormalizer('direct', function (Options $options, $value) {
125
+        $resolver->setNormalizer('direct', function(Options $options, $value) {
126 126
             return !($options['includeGrandChildren'] || !$value);
127 127
         });
128 128
 
129
-        $resolver->addAllowedValues('entityCategoryClass', function ($value) {
129
+        $resolver->addAllowedValues('entityCategoryClass', function($value) {
130 130
             return is_subclass_of($value, AbstractCategoryAssignment::class);
131 131
         });
132 132
     }
Please login to merge, or discard this patch.
src/system/RoutesModule/Form/Handler/Route/Base/AbstractEditHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@
 block discarded – undo
275 275
                 return $this->router->generate($routePrefix . 'view');
276 276
             case 'userOwnView':
277 277
             case 'adminOwnView':
278
-                return $this->router->generate($routePrefix . 'view', [ 'own' => 1 ]);
278
+                return $this->router->generate($routePrefix . 'view', ['own' => 1]);
279 279
             case 'userDisplay':
280 280
             case 'adminDisplay':
281 281
                 if ($args['commandName'] != 'delete' && !($this->templateParameters['mode'] == 'create' && $args['commandName'] == 'cancel')) {
Please login to merge, or discard this patch.
src/system/RoutesModule/Twig/TwigExtension.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,13 +107,13 @@
 block discarded – undo
107 107
         $prefix = htmlspecialchars($prefix);
108 108
         $path = htmlspecialchars($container->get('zikula_routes_module.path_builder_helper')->getPathWithBundlePrefix($route));
109 109
 
110
-        $path = preg_replace_callback('#%(.*?)%#', function ($matches) use ($container) {
110
+        $path = preg_replace_callback('#%(.*?)%#', function($matches) use ($container) {
111 111
             return '<abbr title="' . htmlspecialchars($matches[0]) . '">' . htmlspecialchars($container->getParameter($matches[1])) . '</abbr>';
112 112
         }, $path);
113 113
 
114 114
         $defaults = $route->getDefaults();
115 115
         $requirements = $route->getRequirements();
116
-        $path = preg_replace_callback('#{(.*?)}#', function ($matches) use ($defaults, $requirements) {
116
+        $path = preg_replace_callback('#{(.*?)}#', function($matches) use ($defaults, $requirements) {
117 117
             $title = '';
118 118
             if (isset($defaults[$matches[1]])) {
119 119
                 $title .= $this->__f('Default: %s', ['%s' => htmlspecialchars($defaults[$matches[1]])]);
Please login to merge, or discard this patch.
src/system/UsersModule/Controller/AccessController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,8 @@
 block discarded – undo
95 95
                 $loginFormEvent = new UserFormAwareEvent($form);
96 96
                 $dispatcher->dispatch(AccessEvents::AUTHENTICATION_FORM, $loginFormEvent);
97 97
                 $listenersHaveContent = $hasListeners ? !empty($dispatcher->dispatch(AccessEvents::LOGIN_FORM, new GenericEvent())->getData()) : false; // @deprecated
98
-                if ($listenersHaveContent || $form->count() > 3) { // count > 3 means that the AUTHENTICATION_FORM event added some form children
98
+                if ($listenersHaveContent || $form->count() > 3) {
99
+// count > 3 means that the AUTHENTICATION_FORM event added some form children
99 100
                     $form->handleRequest($request);
100 101
                     if ($form->isValid() && $form->isSubmitted()) {
101 102
                         $uid = $form->get('uid')->getData();
Please login to merge, or discard this patch.
src/lib/Zikula/Bundle/CoreBundle/EventListener/ExceptionListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@
 block discarded – undo
174 174
         if ($userLoggedIn && $this->permissionApi->hasPermission('ZikulaRoutesModule::', '::', ACCESS_ADMIN)) {
175 175
             try {
176 176
                 $url = $this->router->generate('zikularoutesmodule_route_adminreload', [], RouterInterface::ABSOLUTE_URL);
177
-                $link = '<a href="' . $url . '" title="' . __('Re-load the routes') . '">' .  __('re-loading the routes') . '</a>';
177
+                $link = '<a href="' . $url . '" title="' . __('Re-load the routes') . '">' . __('re-loading the routes') . '</a>';
178 178
                 $event->getRequest()->getSession()->getFlashBag()->add('error', __f('You might try %s for the extension in question.', $link));
179 179
             } catch (RouteNotFoundException $e) {
180 180
             }
Please login to merge, or discard this patch.
src/lib/Zikula/Bundle/CoreBundle/DependencyInjection/CoreExtension.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
             // Symfony & Zikula Core-2.0
131 131
             $finder = Finder::create()->files()
132
-                ->filter(function (\SplFileInfo $file) {
132
+                ->filter(function(\SplFileInfo $file) {
133 133
                     return 2 === substr_count($file->getBasename(), '.') && preg_match('/\.\w+$/', $file->getBasename());
134 134
                 })
135 135
                 ->in($dirs);
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                 list($domain, $locale, $format) = explode('.', $file->getBasename(), 3);
140 140
                 $translatorServiceDefinition->addMethodCall('addResource', [
141 141
                     $format,
142
-                    (string) $file,
142
+                    (string)$file,
143 143
                     $locale,
144 144
                     $domain
145 145
                 ]);
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
             // Zikula legacy @deprecated remove at Core-2.0 -->
149 149
             $zfinder = Finder::create()->files()
150
-                ->filter(function (\SplFileInfo $file) {
150
+                ->filter(function(\SplFileInfo $file) {
151 151
                     return 1 === substr_count($file->getBasename(), '.') && preg_match('/\.\w+$/', $file->getBasename());
152 152
                 })
153 153
                 ->name('*.po')
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                     list($domain) = explode('.', $file->getBasename(), 2);
162 162
                     $translatorServiceDefinition->addMethodCall('addResource', [
163 163
                         'po',
164
-                        (string) $file,
164
+                        (string)$file,
165 165
                         $locale,
166 166
                         $domain
167 167
                     ]);
Please login to merge, or discard this patch.
src/lib/Zikula/Bundle/CoreInstallerBundle/Util/VersionUtil.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
             $conn = $container->get('doctrine.dbal.default_connection');
38 38
             $version = unserialize($conn->fetchColumn("SELECT value FROM module_vars WHERE modname = 'ZConfig' AND name = 'Version_Num'"));
39 39
 
40
-            $yamlManager = new YamlDumper($container->get('kernel')->getRootDir() .'/config', 'custom_parameters.yml');
40
+            $yamlManager = new YamlDumper($container->get('kernel')->getRootDir() . '/config', 'custom_parameters.yml');
41 41
             $container->setParameter(ZikulaKernel::CORE_INSTALLED_VERSION_PARAM, $version);
42 42
             $yamlManager->setParameter(ZikulaKernel::CORE_INSTALLED_VERSION_PARAM, $version); // writes to file
43 43
         } catch (\Doctrine\DBAL\Exception\TableNotFoundException $e) {
Please login to merge, or discard this patch.
src/lib/Zikula/Bundle/HookBundle/Controller/HookController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
                 }
244 244
 
245 245
                 // does the user have admin permissions on the provider module?
246
-                if (!$this->get('zikula_permissions_module.api.permission')->hasPermission($hookproviders[$i]['name']."::", '::', ACCESS_ADMIN)) {
246
+                if (!$this->get('zikula_permissions_module.api.permission')->hasPermission($hookproviders[$i]['name'] . "::", '::', ACCESS_ADMIN)) {
247 247
                     unset($hookproviders[$i]);
248 248
                     continue;
249 249
                 }
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
         if (!\ModUtil::available($subscriber)) {
332 332
             throw new \RuntimeException($this->get('translator.default')->__f('Subscriber module "%s" is not available.', ['%s' => $subscriber]));
333 333
         }
334
-        if (!$this->get('zikula_permissions_module.api.permission')->hasPermission($subscriber.'::', '::', ACCESS_ADMIN)) {
334
+        if (!$this->get('zikula_permissions_module.api.permission')->hasPermission($subscriber . '::', '::', ACCESS_ADMIN)) {
335 335
             throw new AccessDeniedException();
336 336
         }
337 337
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
         if (!\ModUtil::available($provider)) {
351 351
             throw new \RuntimeException($this->get('translator.default')->__f('Provider module "%s" is not available.', ['%s' => $provider]));
352 352
         }
353
-        if (!$this->get('zikula_permissions_module.api.permission')->hasPermission($provider.'::', '::', ACCESS_ADMIN)) {
353
+        if (!$this->get('zikula_permissions_module.api.permission')->hasPermission($provider . '::', '::', ACCESS_ADMIN)) {
354 354
             throw new AccessDeniedException();
355 355
         }
356 356
 
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
         if (!\ModUtil::available($subscriber)) {
414 414
             throw new \RuntimeException($this->get('translator.default')->__f('Subscriber module "%s" is not available.', ['%s' => $subscriber]));
415 415
         }
416
-        if (!$this->get('zikula_permissions_module.api.permission')->hasPermission($subscriber.'::', '::', ACCESS_ADMIN)) {
416
+        if (!$this->get('zikula_permissions_module.api.permission')->hasPermission($subscriber . '::', '::', ACCESS_ADMIN)) {
417 417
             throw new AccessDeniedException();
418 418
         }
419 419
 
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
     private function isCapable($moduleName, $type)
458 458
     {
459 459
         $nonPersisted = $this->get('zikula_hook_bundle.collector.hook_collector')->isCapable($moduleName, $type);
460
-        $persisted =  $this->get('zikula_extensions_module.api.capability')->isCapable($moduleName, $type) ? true : false;
460
+        $persisted = $this->get('zikula_extensions_module.api.capability')->isCapable($moduleName, $type) ? true : false;
461 461
 
462 462
         return $nonPersisted || $persisted;
463 463
     }
Please login to merge, or discard this patch.