Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
parent 9d2da48f
......@@ -84,8 +84,8 @@ abstract class AbstractMinifier implements MinifierInterface
}
/**
* @param $group
* @param $layout
* @param string $group
* @param string $layout
*
* @return string
*/
......@@ -100,7 +100,7 @@ abstract class AbstractMinifier implements MinifierInterface
}
/**
* @param $layout
* @param string $layout
*
* @return array
*/
......@@ -131,7 +131,7 @@ abstract class AbstractMinifier implements MinifierInterface
// Get the enabled libraries and filter out empty entries
$files = array_filter(
$this->processLibraries($layout),
function ($var) {
function($var) {
return !empty($var);
}
);
......
......@@ -90,7 +90,7 @@ class Config
/**
* Gibt den Inhalt der Konfigurationsdateien der Module aus
*
* @param $module
* @param string $module
*
* @return array
*/
......
......@@ -74,10 +74,10 @@ class RedirectMessages
// If no path has been given, guess it automatically
if ($path === null) {
if ($this->request->area === 'admin') {
$path.= 'acp/';
$path .= 'acp/';
}
$path.= $this->request->mod . '/' . $this->request->controller;
$path .= $this->request->mod . '/' . $this->request->controller;
}
$this->redirect->temporary($path);
......
<?php
namespace ACP3\Core\Helpers;
use ACP3\Core\Exceptions;
/**
* Class Upload
* @package ACP3\Core\Helpers
......@@ -15,7 +13,7 @@ class Upload
private $directory = '';
/**
* @param $directory
* @param string $directory
*/
public function __construct($directory)
{
......
......@@ -2,7 +2,6 @@
namespace ACP3\Core\Helpers\View;
use ACP3\Core;
use ACP3\Core\View\Renderer\Smarty\Functions\Icon;
/**
* Class CheckAccess
......
......@@ -170,7 +170,7 @@ class Image
/**
* Gibt ein Bild direkt aus, ohne dieses in der Größe zu bearbeiten
*
* @return string
* @return integer
*/
protected function readFromFile()
{
......@@ -208,7 +208,7 @@ class Image
* @param integer $width
* @param integer $height
* @param integer $type
* @param null $cacheFile
* @param string $cacheFile
*/
protected function resample($newWidth, $newHeight, $width, $height, $type, $cacheFile = null)
{
......
......@@ -29,7 +29,7 @@ class Cache
/**
* Gibt die gecacheten Sprachstrings aus
*
* @param $language
* @param string $language
*
* @return array
*/
......
......@@ -292,7 +292,7 @@ class Mailer
/**
*
* @param $data
* @param string $data
*
* @return string
*/
......
......@@ -74,7 +74,7 @@ class Modules
*/
public function actionExists($path)
{
$pathArray = array_map(function ($value) {
$pathArray = array_map(function($value) {
return str_replace(' ', '', strtolower(str_replace('_', ' ', $value)));
}, explode('/', $path));
......
......@@ -475,9 +475,9 @@ abstract class AbstractInstaller extends ContainerAware implements InstallerInte
}
/**
* @param $moduleName
* @param string $moduleName
*
* @return mixed
* @return boolean
*/
public function moduleIsInstalled($moduleName)
{
......
......@@ -48,7 +48,7 @@ class View extends ContainerAware
/**
* Fetches a template and outputs its contents
*
* @param $template
* @param string $template
* @param null $cacheId
* @param null $compileId
* @param null $parent
......
......@@ -78,7 +78,7 @@ class Installer extends Modules\AbstractInstaller
'UPDATE `{pre}seo` SET `uri` = "contact/index/index/" WHERE `uri` = "contact/index/list/";',
],
36 => [
'INSERT INTO `{pre}settings` (`id`, `module_id`, `name`, `value`) VALUES ("", ' . $this->getModuleId(). ', "vat_id", "");'
'INSERT INTO `{pre}settings` (`id`, `module_id`, `name`, `value`) VALUES ("", ' . $this->getModuleId() . ', "vat_id", "");'
]
];
}
......
......@@ -46,7 +46,7 @@ class Index extends Core\Modules\Controller
$settings = $this->config->getSettings('files');
if (!empty($categoryId)) {
$categories = $this->filesModel->getAllByCategoryId((int) $categoryId, $this->date->getCurrentDateTime(), $settings['sidebar']);
$categories = $this->filesModel->getAllByCategoryId((int)$categoryId, $this->date->getCurrentDateTime(), $settings['sidebar']);
} else {
$categories = $this->filesModel->getAll($this->date->getCurrentDateTime(), $settings['sidebar']);
}
......
......@@ -83,7 +83,7 @@ class Validator extends Core\Validator\AbstractValidator
/**
* @param array $formData
* @param $newsletterAccess
* @param boolean $newsletterAccess
*
* @throws Core\Exceptions\InvalidFormToken
* @throws Core\Exceptions\ValidationFailed
......
......@@ -182,7 +182,7 @@ class Index extends Core\Modules\Controller\Admin
protected function _editPost(array $formData)
{
try {
$this->menusValidator->validate($formData, (int) $this->request->id);
$this->menusValidator->validate($formData, (int)$this->request->id);
$updateValues = [
'index_name' => $formData['index_name'],
......
......@@ -283,7 +283,7 @@ class Index extends Core\Modules\Controller\Admin
try {
$this->permissionsValidator->validate(
$formData,
(int) $this->request->id
(int)$this->request->id
);
$updateValues = [
......
......@@ -32,7 +32,7 @@ class Model extends Core\Model
public function roleExistsByName($roleName, $id = 0)
{
if ($id !== 0) {
return !empty($roleName) && $this->db->fetchColumn('SELECT COUNT(*) FROM ' . $this->db->getPrefix() . static::TABLE_NAME . ' WHERE id != ? AND name = ?', [(int) $id, $roleName]) == 1;
return !empty($roleName) && $this->db->fetchColumn('SELECT COUNT(*) FROM ' . $this->db->getPrefix() . static::TABLE_NAME . ' WHERE id != ? AND name = ?', [(int)$id, $roleName]) == 1;
} else {
return !empty($roleName) && $this->db->fetchColumn('SELECT COUNT(*) FROM ' . $this->db->getPrefix() . static::TABLE_NAME . ' WHERE name = ?', [$roleName]) == 1;
}
......
......@@ -85,13 +85,13 @@ class Installer extends Modules\AbstractInstaller
return [
2 => [
'DELETE FROM `{pre}settings` WHERE `module_id` = ' . $this->getModuleId() . ' AND `name` LIKE "seo_%";',
'UPDATE `{pre}settings` SET `module_id` = ' . $this->getModuleId(). ' WHERE `module_id` = (SELECT `id` FROM `{pre}modules` WHERE `name` = "system") AND `name` LIKE "seo_%";'
'UPDATE `{pre}settings` SET `module_id` = ' . $this->getModuleId() . ' WHERE `module_id` = (SELECT `id` FROM `{pre}modules` WHERE `name` = "system") AND `name` LIKE "seo_%";'
],
3 => [
"INSERT INTO `{pre}acl_resources` (`id`, `module_id`, `area`, `controller`, `page`, `params`, `privilege_id`) VALUES('', " . $this->getModuleId() . ", 'admin', 'index', 'settings', '', 7);",
],
4 => [
'UPDATE `{pre}settings` SET `name` = SUBSTRING(`name`, 5) WHERE `module_id` = ' . $this->getModuleId() .' AND `name` LIKE "seo_%";',
'UPDATE `{pre}settings` SET `name` = SUBSTRING(`name`, 5) WHERE `module_id` = ' . $this->getModuleId() . ' AND `name` LIKE "seo_%";',
]
];
}
......
<?php
namespace ACP3\Modules\ACP3\Seo\View\Renderer\Smarty\Modifiers;
use ACP3\Core\Config;
use ACP3\Core\Lang;
use ACP3\Core\SEO;
use ACP3\Core\View\Renderer\Smarty\Modifiers\AbstractModifier;
......
......@@ -262,7 +262,7 @@ class Installer extends Modules\AbstractInstaller
'ALTER TABLE `{pre}seo` ADD `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;',
],
50 => [
function () {
function() {
$result = true;
if ($this->container->has('seo.installer') && $this->systemModel->moduleExists('seo') === false) {
/** @var Modules\AbstractInstaller $seoInstaller */
......@@ -287,7 +287,7 @@ class Installer extends Modules\AbstractInstaller
"INSERT INTO `{pre}acl_resources` (`id`, `module_id`, `area`, `controller`, `page`, `params`, `privilege_id`) VALUES('', " . $this->getModuleId() . ", 'admin', 'maintenance', 'cache', '', 7);",
],
52 => [
function () {
function() {
$result = true;
if ($this->container->has('minify.installer') && $this->systemModel->moduleExists('minify') === false) {
/** @var Modules\AbstractInstaller $minifyInstaller */
......@@ -299,7 +299,7 @@ class Installer extends Modules\AbstractInstaller
}
],
53 => [
function () {
function() {
$result = true;
if ($this->systemModel->moduleExists('minify') === true) {
$minifyModuleId = $this->db->fetchColumn('SELECT `id` FROM `' . $this->db->getPrefix() . 'modules` WHERE `name` = "minify"');
......
......@@ -416,7 +416,7 @@ class Index extends Core\Modules\Controller\Admin
protected function _editPost(array $formData)
{
try {
$this->usersValidator->validate($formData, (int) $this->request->id);
$this->usersValidator->validate($formData, (int)$this->request->id);
$updateValues = [
'super_user' => (int)$formData['super_user'],
......@@ -444,7 +444,7 @@ class Index extends Core\Modules\Controller\Admin
'entries' => (int)$formData['entries'],
];
$this->permissionsHelpers->updateUserRoles($formData['roles'], (int) $this->request->id);
$this->permissionsHelpers->updateUserRoles($formData['roles'], (int)$this->request->id);
// Neues Passwort
if (!empty($formData['new_pwd']) && !empty($formData['new_pwd_repeat'])) {
......
......@@ -234,7 +234,7 @@ class CKEditor extends Textarea
/**
* Prints javascript code.
*
* @param $js
* @param string $js
*
* @return string
*/
......
......@@ -47,7 +47,7 @@ class Router extends Core\Router
$prefix .= $this->request->getHostname();
}
$prefix.= PHP_SELF . '/';
$prefix .= PHP_SELF . '/';
return $prefix . $path;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment