Use root namespace

This commit is contained in:
Dennis Eichhorn 2018-05-30 13:39:00 +02:00
parent 3ffef29d36
commit 67a971fdd5
12 changed files with 20 additions and 20 deletions

View File

@ -38,7 +38,7 @@ class Navigation
*/
public static function install(string $path = null, DatabasePool $dbPool = null) : void
{
$navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true);
$navData = \json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true);
$class = '\\Modules\\Navigation\\Admin\\Installer';
/** @var $class \Modules\Navigation\Admin\Installer */

View File

@ -310,7 +310,7 @@ class Installer extends InstallerAbstract
);
$sth->bindValue(':id', $data['id'] ?? 0, \PDO::PARAM_INT);
$sth->bindValue(':pid', sha1(str_replace('/', '', $data['pid'] ?? '')), \PDO::PARAM_STR);
$sth->bindValue(':pid', sha1(\str_replace('/', '', $data['pid'] ?? '')), \PDO::PARAM_STR);
$sth->bindValue(':name', $data['name'] ?? '', \PDO::PARAM_STR);
$sth->bindValue(':type', $data['type'] ?? 1, \PDO::PARAM_INT);
$sth->bindValue(':subtype', $data['subtype'] ?? 2, \PDO::PARAM_INT);
@ -338,7 +338,7 @@ class Installer extends InstallerAbstract
);
$sth->bindValue(':id', $data['id'] ?? 0, \PDO::PARAM_INT);
$sth->bindValue(':pid', sha1(str_replace('/', '', $data['pid'] ?? '')), \PDO::PARAM_STR);
$sth->bindValue(':pid', sha1(\str_replace('/', '', $data['pid'] ?? '')), \PDO::PARAM_STR);
$sth->bindValue(':name', $data['name'] ?? '', \PDO::PARAM_STR);
$sth->bindValue(':type', $data['type'] ?? 1, \PDO::PARAM_INT);
$sth->bindValue(':subtype', $data['subtype'] ?? 2, \PDO::PARAM_INT);

View File

@ -36,7 +36,7 @@ class Updater extends UpdaterAbstract
public static function update(DatabasePool $dbPool, InfoManager $info) : void
{
Directory::deletePath(__DIR__ . '/Update');
mkdir('Update');
\mkdir('Update');
parent::update($dbPool, $info);
}
}

View File

@ -457,7 +457,7 @@ final class Controller extends ModuleAbstract implements WebInterface
}
$success = $this->app->appSettings->set(
json_decode((string) $request->getData('settings'), true),
\json_decode((string) $request->getData('settings'), true),
true
);
@ -555,7 +555,7 @@ final class Controller extends ModuleAbstract implements WebInterface
*
* @param RequestAbstract $request Request
*
* @return array
* @return array<string, bool>
*
* @since 1.0.0
*/
@ -738,7 +738,7 @@ final class Controller extends ModuleAbstract implements WebInterface
*
* @param RequestAbstract $request Request
*
* @return array
* @return array<string, bool>
*
* @since 1.0.0
*/

View File

@ -34,7 +34,7 @@ class AccountMapper extends DataMapperAbstract
/**
* Columns.
*
* @var array
* @var array<string, array<string, string|bool>>
* @since 1.0.0
*/
protected static $columns = [
@ -55,7 +55,7 @@ class AccountMapper extends DataMapperAbstract
/**
* Has many relation.
*
* @var array
* @var array<string, array<string, string>>
* @since 1.0.0
*/
protected static $hasMany = [

View File

@ -30,7 +30,7 @@ class AccountPermissionMapper extends DataMapperAbstract
/**
* Columns.
*
* @var array
* @var array<string, array<string, string>>
* @since 1.0.0
*/
protected static $columns = [

View File

@ -30,7 +30,7 @@ class GroupMapper extends DataMapperAbstract
/**
* Columns.
*
* @var array
* @var array<string, array<string, string>>
* @since 1.0.0
*/
protected static $columns = [

View File

@ -30,7 +30,7 @@ class GroupPermissionMapper extends DataMapperAbstract
/**
* Columns.
*
* @var array
* @var array<string, array<string, string>>
* @since 1.0.0
*/
protected static $columns = [

View File

@ -189,13 +189,13 @@ class Module
*/
public function __toString()
{
return json_encode($this->toArray());
return \json_encode($this->toArray());
}
/**
* Json serialize.
*
* @return string
* @return array<string, string|int>
*
* @since 1.0.0
*/
@ -207,7 +207,7 @@ class Module
/**
* To array
*
* @return array
* @return array<string, string|int>
*
* @since 1.0.0
*/

View File

@ -30,7 +30,7 @@ class ModuleMapper extends DataMapperAbstract
/**
* Columns.
*
* @var array
* @var array<string, array<string, string>>
* @since 1.0.0
*/
protected static $columns = [

View File

@ -41,9 +41,9 @@ $installed = $this->app->moduleManager->getInstalledModules();
<td data-label="<?= $this->getHtml('ID', 0, 0) ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module['name']['id']); ?></a>
<td data-label="<?= $this->getHtml('Name') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module['name']['external']); ?></a>
<td data-label="<?= $this->getHtml('Version') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($module['version']); ?></a>
<td data-label="<?= $this->getHtml('Status') ?>"><a href="<?= $url; ?>"><?php if (in_array($module['name']['internal'], $active))
<td data-label="<?= $this->getHtml('Status') ?>"><a href="<?= $url; ?>"><?php if (\in_array($module['name']['internal'], $active))
echo strtolower($this->getHtml('Active'));
elseif (in_array($module['name']['internal'], $installed))
elseif (\in_array($module['name']['internal'], $installed))
echo strtolower($this->getHtml('Inactive'));
else
echo strtolower($this->getHtml('Available')); ?></a>

View File

@ -46,7 +46,7 @@ $id = (string) $this->request->getData('id') ?? 1;
<td><?= $this->printHtml($modules[$id]['description'] ); ?>
<tr>
<td colspan="2">
<?php if (in_array($id, $active)) : ?>
<?php if (\in_array($id, $active)) : ?>
<button id="iModuleDeactivateButton" data-action='[
{
"key": 1, "listener": "click", "action": [
@ -54,7 +54,7 @@ $id = (string) $this->request->getData('id') ?? 1;
]
}
]'><?= $this->getHtml('Deactivate'); ?></button>
<?php elseif (in_array($id, $installed)) : ?>
<?php elseif (\in_array($id, $installed)) : ?>
<button id="iModuleUninstallButton" data-action='[
{
"key": 1, "listener": "click", "action": [