Skip to content

Commit

Permalink
Unqualified function/constant reference
Browse files Browse the repository at this point in the history
  • Loading branch information
mambax7 committed Oct 29, 2021
1 parent fde3154 commit efdf48c
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion class/Common/Breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Breadcrumb

public function __construct()
{
$this->dirname = \basename(dirname(__DIR__, 2));
$this->dirname = \basename(\dirname(__DIR__, 2));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions class/Common/FineimpuploadHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function __construct(\stdClass $claims)
*/
protected function storeUploadedFile($target, $mimeType, $uid)
{
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
require_once XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/header.php';
$this->pathUpload = \constant($moduleDirNameUpper . '_' . 'UPLOAD_IMAGE_PATH');
Expand Down Expand Up @@ -205,7 +205,7 @@ protected function storeUploadedFile($target, $mimeType, $uid)
*/
private function handleImageDB()
{
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirName = \basename(\dirname(__DIR__, 2));
require_once XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/header.php';
global $xoopsUser;
$this->getImageDim();
Expand Down
4 changes: 2 additions & 2 deletions class/Common/Images.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function getNewInsertedIdImages()
*/
public function getFormImages($action = false)
{
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
$helper = Helper::getInstance();
if (!$action) {
Expand Down Expand Up @@ -175,7 +175,7 @@ public function getFormImages($action = false)
*/
public function getValuesImages($keys = null, $format = null, $maxDepth = null)
{
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
$helper = Helper::getInstance();
$ret = $this->getValues($keys, $format, $maxDepth);
Expand Down
2 changes: 1 addition & 1 deletion class/Common/Migrate.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct()
}
$configurator = new $class();
$this->renameTables = $configurator->renameTables;
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirName = \basename(\dirname(__DIR__, 2));
parent::__construct($moduleDirName);
}

Expand Down
2 changes: 1 addition & 1 deletion class/Common/ServerStats.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trait ServerStats
public static function getServerStats()
{
//mb $wfdownloads = WfdownloadsWfdownloads::getInstance();
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
\xoops_loadLanguage('common', $moduleDirName);
$html = '';
Expand Down
4 changes: 2 additions & 2 deletions class/Common/SysUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ public static function cloneRecord(string $tableName, string $idField, int $id)
$sql = "SELECT * FROM $table WHERE $idField='" . $id . "' ";
$tempTable = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query($sql), \MYSQLI_ASSOC);
if (!$tempTable) {
trigger_error($GLOBALS['xoopsDB']->error());
\trigger_error($GLOBALS['xoopsDB']->error());
}
// set the auto-incremented id's value to blank.
unset($tempTable[$idField]);
// insert cloned copy of the original record
$sql = "INSERT INTO $table (" . \implode(', ', \array_keys($tempTable)) . ") VALUES ('" . \implode("', '", \array_values($tempTable)) . "')";
$result = $GLOBALS['xoopsDB']->queryF($sql);
if (!$result) {
trigger_error($GLOBALS['xoopsDB']->error());
\trigger_error($GLOBALS['xoopsDB']->error());
}
// Return the new id
return $GLOBALS['xoopsDB']->getInsertId();
Expand Down
6 changes: 3 additions & 3 deletions class/Common/VersionChecks.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ trait VersionChecks
*/
public static function checkVerXoops(?\XoopsModule $module = null, $requiredVer = null)
{
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
if (null === $module) {
$module = \XoopsModule::getByDirname($moduleDirName);
Expand Down Expand Up @@ -59,7 +59,7 @@ public static function checkVerXoops(?\XoopsModule $module = null, $requiredVer
*/
public static function checkVerPhp(?\XoopsModule $module = null)
{
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
if (null === $module) {
$module = \XoopsModule::getByDirname($moduleDirName);
Expand Down Expand Up @@ -90,7 +90,7 @@ public static function checkVerPhp(?\XoopsModule $module = null)
*/
public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
{
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
$update = '';
$repository = 'XoopsModules25x/' . $moduleDirName;
Expand Down
4 changes: 2 additions & 2 deletions class/Form/UploadForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
use Xmf\Request;
use XoopsModules\Tdmdownloads;

require_once dirname(__DIR__, 2) . '/include/common.php';
require_once \dirname(__DIR__, 2) . '/include/common.php';
//$moduleDirName = basename(dirname(dirname(__DIR__)));
//$helper = Tdmdownloads\Helper::getInstance();
$permHelper = new \Xmf\Module\Helper\Permission();
Expand All @@ -50,7 +50,7 @@ class UploadForm extends \XoopsThemeForm
*/
public function __construct($target)
{
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
/** @var \XoopsModules\Tdmdownloads\Helper $this- >helper */
$this->helper = $target->helper;
Expand Down
4 changes: 2 additions & 2 deletions class/Utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function getNumbersOfEntries($mytree, $categories, $entries, $cid)
public function getStatusImage($time, $status)
{
global $xoopsModuleConfig;
$moduleDirName = basename(dirname(__DIR__));
$moduleDirName = \basename(\dirname(__DIR__));
$helper = Helper::getInstance();
$count = 7;
$new = '';
Expand Down Expand Up @@ -121,7 +121,7 @@ public function getStatusImage($time, $status)
public function getPopularImage($hits)
{
global $xoopsModuleConfig;
$moduleDirName = basename(dirname(__DIR__));
$moduleDirName = \basename(\dirname(__DIR__));
$pop = '';
if ($hits >= $xoopsModuleConfig['popular']) {
$language = $GLOBALS['xoopsConfig']['language'];
Expand Down

0 comments on commit efdf48c

Please sign in to comment.