Skip to content

Commit 0b36b95

Browse files
committed
Scrutinizer
1 parent 5665ba3 commit 0b36b95

6 files changed

Lines changed: 20 additions & 14 deletions

File tree

class/Blanguage.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class Blanguage extends \XoopsObject
3232
{
3333
public $isBase = false;
3434
public $db;
35+
public $table;
3536

3637
/**
3738
* Blanguage constructor.

class/Common/FilesManagement.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,18 @@ public static function recurseCopy($src, $dst)
6161
if (!@mkdir($dst) && !is_dir($dst)) {
6262
throw new \RuntimeException('The directory ' . $dst . ' could not be created.');
6363
}
64-
while (false !== ($file = readdir($dir))) {
65-
if (('.' !== $file) && ('..' !== $file)) {
66-
if (is_dir($src . '/' . $file)) {
67-
self::recurseCopy($src . '/' . $file, $dst . '/' . $file);
68-
} else {
69-
copy($src . '/' . $file, $dst . '/' . $file);
64+
if (false !== $dir) {
65+
while (false !== ($file = readdir($dir))) {
66+
if (('.' !== $file) && ('..' !== $file)) {
67+
if (is_dir($src . '/' . $file)) {
68+
self::recurseCopy($src . '/' . $file, $dst . '/' . $file);
69+
} else {
70+
copy($src . '/' . $file, $dst . '/' . $file);
71+
}
7072
}
7173
}
74+
closedir($dir);
7275
}
73-
closedir($dir);
7476
}
7577

7678
/**
@@ -95,7 +97,8 @@ public static function deleteDirectory($src)
9597
$dirInfo = new \SplFileInfo($src);
9698
// validate is a directory
9799
if ($dirInfo->isDir()) {
98-
$fileList = array_diff(scandir($src, SCANDIR_SORT_NONE), ['..', '.']);
100+
$dirScan = scandir($src, SCANDIR_SORT_NONE);
101+
$fileList = array_diff($dirScan, ['..', '.']);
99102
foreach ($fileList as $k => $v) {
100103
$fileInfo = new \SplFileInfo("{$src}/{$v}");
101104
if ($fileInfo->isDir()) {

class/LanguageHandler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function loadConfig()
4141
* @param int $id
4242
* @param bool $isBase
4343
*
44-
* @return Blanguage|null|Language
44+
* @return Blanguage|Language|null
4545
*/
4646
public function get($id, $isBase = true)
4747
{
@@ -78,7 +78,7 @@ public function get($id, $isBase = true)
7878
* @param string $name
7979
* @param bool $isBase
8080
*
81-
* @return Xlanguage\Blanguage|null|Xlanguage\Language
81+
* @return Xlanguage\Blanguage|Xlanguage\Language|null
8282
*/
8383
public function getByName($name, $isBase=false)
8484
{
@@ -201,8 +201,8 @@ public function create($isNew = true, $isBase = true)
201201
}
202202

203203
/**
204-
* @param \XoopsObject $object
205-
* @return bool
204+
* @param Blanguage|Language $object
205+
* @return bool|string
206206
* @internal param object $lang
207207
*/
208208
public function insert(\XoopsObject $object)//insert(&$lang)

class/Utility.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ public static function cleanMultiLang($text)
203203
{
204204
global $xoopsConfig;
205205
global $xlanguage_langs;
206+
$patterns = [];
206207
if (!isset($xlanguage_langs)) {
207208
$xlanguage_langs = [];
208209
/** @var \XoopsModules\Xlanguage\Helper $helper */
@@ -281,7 +282,7 @@ public static function escapeBracketMultiLang($matches)
281282
}
282283

283284
/**
284-
* @param null $options
285+
* @param null|array $options
285286
* @return bool
286287
*/
287288
public static function showSelectedLanguage($options = null)

include/oninstall.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function xoops_module_install_xlanguage(\XoopsModule $module)
6969
global $xoopsModule;
7070
$moduleId = $xoopsModule->getVar('mid');
7171
// $moduleId2 = $helper->getModule()->mid();
72+
/** @var \XoopsGroupPermHandler $grouppermHandler */
7273
$grouppermHandler = xoops_getHandler('groupperm');
7374
// access rights ------------------------------------------
7475
$grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);

include/onupdate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function xoops_module_pre_update_xlanguage(\XoopsModule $module)
5959
/**
6060
* Performs tasks required during update of the module
6161
* @param \XoopsModule $module {@link XoopsModule}
62-
* @param null $previousVersion
62+
* @param null|string|int $previousVersion
6363
*
6464
* @return bool true if update successful, false if not
6565
*/

0 commit comments

Comments
 (0)