Verified Commit 6425ccf2 authored by dockx thibault's avatar dockx thibault
Browse files

:ambulance: fixing phpcs auto resolve

ficing phpcs auto resolve (locally)
Showing with 13 additions and 13 deletions
+13 -13
...@@ -50,9 +50,9 @@ class IconThemeDir ...@@ -50,9 +50,9 @@ class IconThemeDir
* Defaults to 2 if not present. */ * Defaults to 2 if not present. */
private $Threshold = 2; private $Threshold = 2;
function __construct($infos) function __construct ($infos)
{ {
$this->Size = $infos['Size']; $this->Size = $infos['Size'];
$this->MinSize = $infos['Size']; $this->MinSize = $infos['Size'];
$this->MaxSize = $infos['Size']; $this->MaxSize = $infos['Size'];
foreach (['Type', 'MaxSize', 'MinSize', 'Threshold'] as $key) { foreach (['Type', 'MaxSize', 'MinSize', 'Threshold'] as $key) {
...@@ -67,7 +67,7 @@ class IconThemeDir ...@@ -67,7 +67,7 @@ class IconThemeDir
} }
} }
function MatchesSize($size) function MatchesSize ($size)
{ {
switch ($this->Type) { switch ($this->Type) {
case 'Fixed': case 'Fixed':
...@@ -79,7 +79,7 @@ class IconThemeDir ...@@ -79,7 +79,7 @@ class IconThemeDir
} }
} }
function SizeDistance($size) function SizeDistance ($size)
{ {
switch ($this->Type) { switch ($this->Type) {
case 'Fixed': case 'Fixed':
...@@ -108,10 +108,10 @@ class IconTheme ...@@ -108,10 +108,10 @@ class IconTheme
private $path; private $path;
private $parent; private $parent;
function __construct($folder, $default_parent) function __construct ($folder, $default_parent)
{ {
$this->path = $folder; $this->path = $folder;
$datas = @parse_ini_file($folder . '/index.theme', TRUE, INI_SCANNER_RAW); $datas = @parse_ini_file($folder . '/index.theme', TRUE, INI_SCANNER_RAW);
if ($datas === FALSE) { if ($datas === FALSE) {
throw new ThemeFileParsingException('Error while parsing theme file'); throw new ThemeFileParsingException('Error while parsing theme file');
} }
...@@ -131,13 +131,13 @@ class IconTheme ...@@ -131,13 +131,13 @@ class IconTheme
} }
} }
function FindIcon($context, $icon, $size) function FindIcon ($context, $icon, $size)
{ {
$context = strtolower($context); $context = strtolower($context);
return $this->FindIconHelper($context, $icon, $size); return $this->FindIconHelper($context, $icon, $size);
} }
function FindIconHelper($context, $icon, $size) function FindIconHelper ($context, $icon, $size)
{ {
$filename = $this->LookupIcon($context, $icon, $size); $filename = $this->LookupIcon($context, $icon, $size);
if ($filename != NULL) { if ($filename != NULL) {
...@@ -163,7 +163,7 @@ class IconTheme ...@@ -163,7 +163,7 @@ class IconTheme
return NULL; return NULL;
} }
function LookupIcon($context, $iconname, $size) function LookupIcon ($context, $iconname, $size)
{ {
if (!isset($this->subdirs[$context])) { if (!isset($this->subdirs[$context])) {
return NULL; return NULL;
...@@ -187,7 +187,7 @@ class IconTheme ...@@ -187,7 +187,7 @@ class IconTheme
$filename = $this->path . '/' . $path . '/' . $iconname . '.' . $extension; $filename = $this->path . '/' . $path . '/' . $iconname . '.' . $extension;
if (file_exists($filename)) { if (file_exists($filename)) {
$closest_filename = $filename; $closest_filename = $filename;
$minimal_size = $sizedistance; $minimal_size = $sizedistance;
} }
} }
} }
...@@ -207,7 +207,7 @@ class IconTheme ...@@ -207,7 +207,7 @@ class IconTheme
/* We store themes in the session. To do otherwise, override these methods. */ /* We store themes in the session. To do otherwise, override these methods. */
static public $session_var = 'IconThemes'; static public $session_var = 'IconThemes';
static public function loadThemes($path) static public function loadThemes ($path)
{ {
$themes = []; $themes = [];
if ($dir = opendir("$path")) { if ($dir = opendir("$path")) {
...@@ -228,7 +228,7 @@ class IconTheme ...@@ -228,7 +228,7 @@ class IconTheme
$_SESSION[static::$session_var] = $themes; $_SESSION[static::$session_var] = $themes;
} }
static public function findThemeIcon($theme, $context, $icon, $size) static public function findThemeIcon ($theme, $context, $icon, $size)
{ {
// We have to sanitize the $icon received from $_GET['icon']. Fixing vulnerability : CWE-35 // We have to sanitize the $icon received from $_GET['icon']. Fixing vulnerability : CWE-35
...@@ -246,7 +246,7 @@ class IconTheme ...@@ -246,7 +246,7 @@ class IconTheme
return $_SESSION[static::$session_var][static::$default_theme]->FindIcon($context, $icon, $size); return $_SESSION[static::$session_var][static::$default_theme]->FindIcon($context, $icon, $size);
} }
public function findTheme($theme) public function findTheme ($theme)
{ {
if (isset($_SESSION[static::$session_var][$theme])) { if (isset($_SESSION[static::$session_var][$theme])) {
return $_SESSION[static::$session_var][$theme]; return $_SESSION[static::$session_var][$theme];
......
Supports Markdown
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