@@ -251,6 +251,9 @@ |
||
| 251 | 251 | return false; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | + /** |
|
| 255 | + * @param string $name |
|
| 256 | + */ |
|
| 254 | 257 | private function setSystemVar($name, $value = '') |
| 255 | 258 | { |
| 256 | 259 | return $this->container->get('zikula_extensions_module.api.variable')->set(VariableApi::CONFIG, $name, $value); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $this->setSystemVar('sessionstoretofile', Constant::SESSION_STORAGE_FILE); |
| 56 | 56 | $this->setSystemVar('sessionsavepath', ''); |
| 57 | 57 | $this->setSystemVar('gc_probability', 100); |
| 58 | - $this->setSystemVar('sessioncsrftokenonetime', 1); // 1 means use same token for entire session |
|
| 58 | + $this->setSystemVar('sessioncsrftokenonetime', 1); // 1 means use same token for entire session |
|
| 59 | 59 | $this->setSystemVar('sessionrandregenerate', 1); |
| 60 | 60 | $this->setSystemVar('sessionregenerate', 1); |
| 61 | 61 | $this->setSystemVar('sessionregeneratefreq', 10); |
@@ -77,13 +77,13 @@ discard block |
||
| 77 | 77 | $this->setSystemVar('useids', 0); |
| 78 | 78 | $this->setSystemVar('idsmail', 0); |
| 79 | 79 | $this->setSystemVar('idsrulepath', 'system/SecurityCenterModule/Resources/config/phpids_zikula_default.xml'); |
| 80 | - $this->setSystemVar('idssoftblock', 1); // do not block requests, but warn for debugging |
|
| 81 | - $this->setSystemVar('idsfilter', 'xml'); // filter type |
|
| 82 | - $this->setSystemVar('idsimpactthresholdone', 1); // db logging |
|
| 83 | - $this->setSystemVar('idsimpactthresholdtwo', 10); // mail admin |
|
| 84 | - $this->setSystemVar('idsimpactthresholdthree', 25); // block request |
|
| 85 | - $this->setSystemVar('idsimpactthresholdfour', 75); // kick user, destroy session |
|
| 86 | - $this->setSystemVar('idsimpactmode', 1); // per request per default |
|
| 80 | + $this->setSystemVar('idssoftblock', 1); // do not block requests, but warn for debugging |
|
| 81 | + $this->setSystemVar('idsfilter', 'xml'); // filter type |
|
| 82 | + $this->setSystemVar('idsimpactthresholdone', 1); // db logging |
|
| 83 | + $this->setSystemVar('idsimpactthresholdtwo', 10); // mail admin |
|
| 84 | + $this->setSystemVar('idsimpactthresholdthree', 25); // block request |
|
| 85 | + $this->setSystemVar('idsimpactthresholdfour', 75); // kick user, destroy session |
|
| 86 | + $this->setSystemVar('idsimpactmode', 1); // per request per default |
|
| 87 | 87 | $this->setSystemVar('idshtmlfields', ['POST.__wysiwyg']); |
| 88 | 88 | $this->setSystemVar('idsjsonfields', ['POST.__jsondata']); |
| 89 | 89 | $this->setSystemVar('idsexceptions', [ |
@@ -284,7 +284,7 @@ |
||
| 284 | 284 | |
| 285 | 285 | /** |
| 286 | 286 | * Remove comments, whitespace and spaces from css files |
| 287 | - * @param $contents |
|
| 287 | + * @param string $contents |
|
| 288 | 288 | * @return string |
| 289 | 289 | */ |
| 290 | 290 | private function minify($contents) |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | - $cacheName = in_array($type, ['js', 'css']) ? "{$type}Cache" : null; |
|
| 101 | + $cacheName = in_array($type, ['js', 'css']) ? "{$type}cache" : null; |
|
| 102 | 102 | /** @var CacheProvider $cacheService */ |
| 103 | 103 | $cacheService = $this->$cacheName; |
| 104 | 104 | $key = md5(serialize($assets)) . (int)$this->minify . (int)$this->compress . $this->lifetime . '.' . $type; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
| 94 | - * @return array of service aliases |
|
| 94 | + * @return integer[] of service aliases |
|
| 95 | 95 | */ |
| 96 | 96 | public function getKeys() |
| 97 | 97 | { |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
| 102 | - * @return array of active service aliases |
|
| 102 | + * @return integer[] of active service aliases |
|
| 103 | 103 | */ |
| 104 | 104 | public function getActiveKeys() |
| 105 | 105 | { |
@@ -262,6 +262,9 @@ |
||
| 262 | 262 | return $this->mailerApi->sendMessage($message, null, null, $textBody, $html); |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | + /** |
|
| 266 | + * @param string $notificationType |
|
| 267 | + */ |
|
| 265 | 268 | private function generateEmailSubject($notificationType, array $templateArgs = []) |
| 266 | 269 | { |
| 267 | 270 | $siteName = $this->variableApi->getSystemVar('sitename'); |
@@ -110,6 +110,9 @@ discard block |
||
| 110 | 110 | $this->passwordApi = $passwordApi; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | + /** |
|
| 114 | + * @param TranslatorInterface $translator |
|
| 115 | + */ |
|
| 113 | 116 | public function setTranslator($translator) |
| 114 | 117 | { |
| 115 | 118 | $this->translator = $translator; |
@@ -273,8 +276,8 @@ discard block |
||
| 273 | 276 | /** |
| 274 | 277 | * Convert errors to string and add current line. |
| 275 | 278 | * @param $errors |
| 276 | - * @param $type |
|
| 277 | - * @param $line |
|
| 279 | + * @param string $type |
|
| 280 | + * @param integer $line |
|
| 278 | 281 | * @return string |
| 279 | 282 | */ |
| 280 | 283 | private function locateErrors($errors, $type, $line) |
@@ -96,6 +96,9 @@ |
||
| 96 | 96 | return $this->mailerApi->sendMessage($message, $subject, $body, $altBody, $html); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | + /** |
|
| 100 | + * @param string $notificationType |
|
| 101 | + */ |
|
| 99 | 102 | private function generateEmailSubject($notificationType, array $templateArgs = []) |
| 100 | 103 | { |
| 101 | 104 | $siteName = $this->variableApi->getSystemVar('sitename'); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | public function getInstallerClass() |
| 55 | 55 | { |
| 56 | 56 | $ns = $this->getNamespace(); |
| 57 | - $class = $ns.'\\'.substr($ns, strrpos($ns, '\\') + 1, strlen($ns)).'Installer'; |
|
| 57 | + $class = $ns . '\\' . substr($ns, strrpos($ns, '\\') + 1, strlen($ns)) . 'Installer'; |
|
| 58 | 58 | |
| 59 | 59 | return $class; |
| 60 | 60 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function getLocalePath() |
| 78 | 78 | { |
| 79 | - return $this->getPath().'/Resources/locale'; |
|
| 79 | + return $this->getPath() . '/Resources/locale'; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function getViewsPath() |
| 88 | 88 | { |
| 89 | - return $this->getPath().'/Resources/views'; |
|
| 89 | + return $this->getPath() . '/Resources/views'; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function getConfigPath() |
| 98 | 98 | { |
| 99 | - return $this->getPath().'/Resources/config'; |
|
| 99 | + return $this->getPath() . '/Resources/config'; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -144,9 +144,9 @@ discard block |
||
| 144 | 144 | $type = $this->getNameType(); |
| 145 | 145 | $typeLower = strtolower($type); |
| 146 | 146 | if (null === $this->extension) { |
| 147 | - $basename = preg_replace('/'.$type.'/', '', $this->getName()); |
|
| 147 | + $basename = preg_replace('/' . $type . '/', '', $this->getName()); |
|
| 148 | 148 | |
| 149 | - $class = $this->getNamespace().'\\DependencyInjection\\'.$basename.'Extension'; |
|
| 149 | + $class = $this->getNamespace() . '\\DependencyInjection\\' . $basename . 'Extension'; |
|
| 150 | 150 | if (class_exists($class)) { |
| 151 | 151 | $extension = new $class(); |
| 152 | 152 | |
@@ -39,15 +39,15 @@ discard block |
||
| 39 | 39 | $translator = $options['translator']; |
| 40 | 40 | |
| 41 | 41 | $spaceReplaceCallbackTransformer = new CallbackTransformer( |
| 42 | - function ($originalDescription) { |
|
| 42 | + function($originalDescription) { |
|
| 43 | 43 | return $originalDescription; |
| 44 | 44 | }, |
| 45 | - function ($submittedDescription) { |
|
| 45 | + function($submittedDescription) { |
|
| 46 | 46 | return mb_ereg_replace(' ', '', $submittedDescription); |
| 47 | 47 | } |
| 48 | 48 | ); |
| 49 | 49 | $pageTitleLocalizationTransformer = new CallbackTransformer( |
| 50 | - function ($originalPageTitle) use ($translator) { |
|
| 50 | + function($originalPageTitle) use ($translator) { |
|
| 51 | 51 | $originalPageTitle = empty($originalPageTitle) ? '%pagetitle%' : $originalPageTitle; |
| 52 | 52 | $originalPageTitle = str_replace('%pagetitle%', $translator->__('%pagetitle%'), $originalPageTitle); |
| 53 | 53 | $originalPageTitle = str_replace('%sitename%', $translator->__('%sitename%'), $originalPageTitle); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | return $originalPageTitle; |
| 57 | 57 | }, |
| 58 | - function ($submittedPageTitle) use ($translator) { |
|
| 58 | + function($submittedPageTitle) use ($translator) { |
|
| 59 | 59 | $submittedPageTitle = str_replace($translator->__('%pagetitle%'), '%pagetitle%', $submittedPageTitle); |
| 60 | 60 | $submittedPageTitle = str_replace($translator->__('%sitename%'), '%sitename%', $submittedPageTitle); |
| 61 | 61 | $submittedPageTitle = str_replace($translator->__('%modulename%'), '%modulename%', $submittedPageTitle); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | ->add('entrypoint', TextType::class, [ |
| 102 | 102 | 'label' => $translator->__('Site entry point (front controller)'), |
| 103 | 103 | 'constraints' => new Callback([ |
| 104 | - 'callback' => function ($data, ExecutionContextInterface $context) use ($translator) { |
|
| 104 | + 'callback' => function($data, ExecutionContextInterface $context) use ($translator) { |
|
| 105 | 105 | $falseEntryPoints = ['admin.php', 'ajax.php', 'user.php', 'mo2json.php', 'jcss.php']; |
| 106 | 106 | $entryPointExt = pathinfo($data, PATHINFO_EXTENSION); |
| 107 | 107 | if (in_array($data, $falseEntryPoints) || strtolower($entryPointExt) != 'php') { |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $builder->create('permasearch', TextType::class, [ |
| 141 | 141 | 'label' => $translator->__('List to search for'), |
| 142 | 142 | 'constraints' => new Callback([ |
| 143 | - 'callback' => function ($data, ExecutionContextInterface $context) use ($translator) { |
|
| 143 | + 'callback' => function($data, ExecutionContextInterface $context) use ($translator) { |
|
| 144 | 144 | if (mb_ereg(',$', $data)) { |
| 145 | 145 | $context->addViolation($options['translator']->__('Error! In your permalink settings, strings cannot be terminated with a comma.')); |
| 146 | 146 | } |
@@ -92,6 +92,9 @@ discard block |
||
| 92 | 92 | return false; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | + /** |
|
| 96 | + * @param string $file |
|
| 97 | + */ |
|
| 95 | 98 | public function getFileContents($file) |
| 96 | 99 | { |
| 97 | 100 | return file_get_contents($file); |
@@ -142,6 +145,10 @@ discard block |
||
| 142 | 145 | return true; |
| 143 | 146 | } |
| 144 | 147 | |
| 148 | + /** |
|
| 149 | + * @param string $type |
|
| 150 | + * @param boolean $indexByShortName |
|
| 151 | + */ |
|
| 145 | 152 | private function getMetaData($type, $indexByShortName) |
| 146 | 153 | { |
| 147 | 154 | $array = []; |