fix phpcs findings

This commit is contained in:
Dennis Eichhorn 2019-09-12 19:48:00 +02:00
parent 2d554fb4e0
commit f3cc84c4a7
16 changed files with 238 additions and 230 deletions

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package Modules\Monitoring\Admin\Install
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package Modules\Monitoring\Admin\Install
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
@ -19,10 +19,10 @@ use phpOMS\DataStorage\Database\DatabasePool;
/**
* Navigation class.
*
* @package Modules\Monitoring\Admin\Install
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
* @package Modules\Monitoring\Admin\Install
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class Navigation
{
@ -34,7 +34,7 @@ class Navigation
*
* @return void
*
* @since 1.0.0
* @since 1.0.0
*/
public static function install(string $path, DatabasePool $dbPool) : void
{

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package Modules\Monitoring\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package Modules\Monitoring\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
@ -19,10 +19,10 @@ use phpOMS\Module\InstallerAbstract;
/**
* Installer class.
*
* @package Modules\Monitoring\Admin
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
* @package Modules\Monitoring\Admin
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class Installer extends InstallerAbstract
{

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package Modules\Monitoring\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package Modules\Monitoring\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
@ -19,10 +19,10 @@ use phpOMS\Module\StatusAbstract;
/**
* Navigation class.
*
* @package Modules\Monitoring\Admin
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
* @package Modules\Monitoring\Admin
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class Status extends StatusAbstract
{

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package Modules\Monitoring\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package Modules\Monitoring\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
@ -19,10 +19,10 @@ use phpOMS\Module\UninstallerAbstract;
/**
* Uninstaller class.
*
* @package Modules\Monitoring\Admin
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
* @package Modules\Monitoring\Admin
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class Uninstaller extends UninstallerAbstract
{

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package Modules\Monitoring\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package Modules\Monitoring\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
@ -19,10 +19,10 @@ use phpOMS\Module\UpdaterAbstract;
/**
* Updater class.
*
* @package Modules\Monitoring\Admin
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
* @package Modules\Monitoring\Admin
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class Updater extends UpdaterAbstract
{

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package Modules\Monitoring
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package Modules\Monitoring
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
@ -22,22 +22,24 @@ use phpOMS\Views\View;
/**
* Monitoring controller class.
*
* @package Modules\Monitoring
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
* @package Modules\Monitoring
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class BackendController extends Controller
{
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewMonitoringGeneral(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
@ -50,13 +52,15 @@ final class BackendController extends Controller
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewMonitoringLogList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
@ -69,13 +73,15 @@ final class BackendController extends Controller
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewMonitoringLogEntry(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
@ -88,13 +94,15 @@ final class BackendController extends Controller
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewMonitoringSecurityDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package Modules\Monitoring
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package Modules\Monitoring
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
@ -20,10 +20,10 @@ use phpOMS\Module\WebInterface;
/**
* Monitoring controller class.
*
* @package Modules\Monitoring
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
* @package Modules\Monitoring
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class Controller extends ModuleAbstract implements WebInterface
{
@ -31,7 +31,7 @@ class Controller extends ModuleAbstract implements WebInterface
/**
* Module path.
*
* @var string
* @var string
* @since 1.0.0
*/
public const MODULE_PATH = __DIR__ . '/../';
@ -39,7 +39,7 @@ class Controller extends ModuleAbstract implements WebInterface
/**
* Module version.
*
* @var string
* @var string
* @since 1.0.0
*/
public const MODULE_VERSION = '1.0.0';
@ -47,7 +47,7 @@ class Controller extends ModuleAbstract implements WebInterface
/**
* Module name.
*
* @var string
* @var string
* @since 1.0.0
*/
public const MODULE_NAME = 'Monitoring';
@ -55,7 +55,7 @@ class Controller extends ModuleAbstract implements WebInterface
/**
* Module id.
*
* @var int
* @var int
* @since 1.0.0
*/
public const MODULE_ID = 1000700000;
@ -63,7 +63,7 @@ class Controller extends ModuleAbstract implements WebInterface
/**
* Providing.
*
* @var string[]
* @var string[]
* @since 1.0.0
*/
protected static array $providing = [];
@ -71,7 +71,7 @@ class Controller extends ModuleAbstract implements WebInterface
/**
* Dependencies.
*
* @var string[]
* @var string[]
* @since 1.0.0
*/
protected static array $dependencies = [];

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package Modules\Monitoring
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package Modules\Monitoring
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
@ -19,10 +19,10 @@ use phpOMS\Stdlib\Base\Enum;
/**
* Permision state enum.
*
* @package Modules\Monitoring
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
* @package Modules\Monitoring
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
abstract class PermissionState extends Enum
{

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
return ['Navigation' => [
'Logs' => 'Logs',

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
$MODLANG[1] = [
'i:ModuleInstalled' => 'Installation of the module {$1} was successful.',

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
return ['Monitoring' => [
'Alerts' => 'Alerts',

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
$logs = $this->app->logger->countLogs();
$penetrators = $this->app->logger->getHighestPerpetrator();

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
/**
* @var \phpOMS\Views\View $this

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
/**
* @var \phpOMS\Views\View $this

View File

@ -4,11 +4,11 @@
*
* PHP Version 7.4
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
use phpOMS\Message\Http\Request;

View File

@ -1,112 +1,112 @@
<?php declare(strict_types=1);
/**
* Orange Management
*
* PHP Version 7.4
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
use phpOMS\Message\Http\Request;
use phpOMS\Message\Http\Rest;
use phpOMS\Security\PhpCode;
use phpOMS\System\File\Local\Directory;
use phpOMS\System\File\Local\File;
use phpOMS\Uri\Http;
echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12 col-md-4">
<section class="box wf-100">
<header><h1><?= $this->getHtml('PHPSettings'); ?></h1></header>
<div class="inner">
<table class="list wf-100">
<tbody>
<tr><td><?= $this->getHtml('DisabledFunctions'); ?><td><?= PhpCode::isDisabled(PhpCode::$disabledFunctions) ? $this->getHtml('OK') : $this->getHtml('NG'); ?>
<tr><td><button><?= $this->getHtml('Inspect'); ?></button>
</table>
</div>
</section>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box wf-100">
<table class="default">
<caption><?= $this->getHtml('Inspection') ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td><?= $this->getHtml('Status') ?>
<td class="wf-100"><?= $this->getHtml('File') ?>
<td><?= $this->getHtml('Unicode') ?>
<td><?= $this->getHtml('Deprecated') ?>
<td><?= $this->getHtml('Modified') ?>
<td><?= $this->getHtml('Integrity') ?>
<tbody>
<?php
$files = Directory::listByExtension(__DIR__ . '/../../../../phpOMS/', 'php', 'tests(\/|\\\)');
foreach ($files as $file) : $content = \file_get_contents(__DIR__ . '/../../../../phpOMS/' . $file); ?>
<tr>
<td>
<td><?= $file; ?>
<td><?= PhpCode::hasUnicode($content) ? $this->getHtml('NG') : $this->getHtml('OK'); ?>
<td><?= PhpCode::hasDeprecatedFunction($content) ? $this->getHtml('NG') : $this->getHtml('OK'); ?>
<td><?= File::changed(__DIR__ . '/../../../../phpOMS/' . $file)->format('Y-m-d'); ?>
<td>
<?= \phpOMS\Security\PhpCode::validateStringIntegrity(
$content,
Rest::request(
new Request(
new Http('https://raw.githubusercontent.com/Orange-Management/phpOMS/develop/' . $file)
)
)->getBody()
) ? $this->getHtml('OK') : $this->getHtml('NG'); ?>
<?php endforeach; ?>
<?php
$files = Directory::listByExtension(__DIR__ . '/../../../../Model/', 'php', 'tests(\/|\\\)');
foreach ($files as $file) : $content = \file_get_contents(__DIR__ . '/../../../../Model/' . $file); ?>
<tr>
<td>
<td><?= $file; ?>
<td><?= PhpCode::hasUnicode($content) ? $this->getHtml('NG') : $this->getHtml('OK'); ?>
<td><?= PhpCode::hasDeprecatedFunction($content) ? $this->getHtml('NG') : $this->getHtml('OK'); ?>
<td><?= File::changed(__DIR__ . '/../../../../Model/' . $file)->format('Y-m-d'); ?>
<td>
<?= \phpOMS\Security\PhpCode::validateStringIntegrity(
$content,
Rest::request(
new Request(
new Http('https://raw.githubusercontent.com/Orange-Management/Model/develop/' . $file)
)
)->getBody()
) ? $this->getHtml('OK') : $this->getHtml('NG'); ?>
<?php endforeach; ?>
<?php
$files = Directory::listByExtension(__DIR__ . '/../../../../Modules/', 'php', 'tests(\/|\\\)');
foreach ($files as $file) : $content = \file_get_contents(__DIR__ . '/../../../../Modules/' . $file); ?>
<tr>
<td>
<td><?= $file; ?>
<td><?= PhpCode::hasUnicode($content) ? $this->getHtml('NG') : $this->getHtml('OK'); ?>
<td><?= PhpCode::hasDeprecatedFunction($content) ? $this->getHtml('NG') : $this->getHtml('OK'); ?>
<td><?= File::changed(__DIR__ . '/../../../../Modules/' . $file)->format('Y-m-d'); ?>
<td>
<?= \phpOMS\Security\PhpCode::validateStringIntegrity(
$content,
Rest::request(
new Request(
new Http('https://raw.githubusercontent.com/Orange-Management/Modules/develop/' . $file)
)
)->getBody()
) ? $this->getHtml('OK') : $this->getHtml('NG'); ?>
<?php endforeach; ?>
</table>
</div>
</div>
</div>
<?php declare(strict_types=1);
/**
* Orange Management
*
* PHP Version 7.4
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
use phpOMS\Message\Http\Request;
use phpOMS\Message\Http\Rest;
use phpOMS\Security\PhpCode;
use phpOMS\System\File\Local\Directory;
use phpOMS\System\File\Local\File;
use phpOMS\Uri\Http;
echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12 col-md-4">
<section class="box wf-100">
<header><h1><?= $this->getHtml('PHPSettings'); ?></h1></header>
<div class="inner">
<table class="list wf-100">
<tbody>
<tr><td><?= $this->getHtml('DisabledFunctions'); ?><td><?= PhpCode::isDisabled(PhpCode::$disabledFunctions) ? $this->getHtml('OK') : $this->getHtml('NG'); ?>
<tr><td><button><?= $this->getHtml('Inspect'); ?></button>
</table>
</div>
</section>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box wf-100">
<table class="default">
<caption><?= $this->getHtml('Inspection') ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td><?= $this->getHtml('Status') ?>
<td class="wf-100"><?= $this->getHtml('File') ?>
<td><?= $this->getHtml('Unicode') ?>
<td><?= $this->getHtml('Deprecated') ?>
<td><?= $this->getHtml('Modified') ?>
<td><?= $this->getHtml('Integrity') ?>
<tbody>
<?php
$files = Directory::listByExtension(__DIR__ . '/../../../../phpOMS/', 'php', 'tests(\/|\\\)');
foreach ($files as $file) : $content = \file_get_contents(__DIR__ . '/../../../../phpOMS/' . $file); ?>
<tr>
<td>
<td><?= $file; ?>
<td><?= PhpCode::hasUnicode($content) ? $this->getHtml('NG') : $this->getHtml('OK'); ?>
<td><?= PhpCode::hasDeprecatedFunction($content) ? $this->getHtml('NG') : $this->getHtml('OK'); ?>
<td><?= File::changed(__DIR__ . '/../../../../phpOMS/' . $file)->format('Y-m-d'); ?>
<td>
<?= \phpOMS\Security\PhpCode::validateStringIntegrity(
$content,
Rest::request(
new Request(
new Http('https://raw.githubusercontent.com/Orange-Management/phpOMS/develop/' . $file)
)
)->getBody()
) ? $this->getHtml('OK') : $this->getHtml('NG'); ?>
<?php endforeach; ?>
<?php
$files = Directory::listByExtension(__DIR__ . '/../../../../Model/', 'php', 'tests(\/|\\\)');
foreach ($files as $file) : $content = \file_get_contents(__DIR__ . '/../../../../Model/' . $file); ?>
<tr>
<td>
<td><?= $file; ?>
<td><?= PhpCode::hasUnicode($content) ? $this->getHtml('NG') : $this->getHtml('OK'); ?>
<td><?= PhpCode::hasDeprecatedFunction($content) ? $this->getHtml('NG') : $this->getHtml('OK'); ?>
<td><?= File::changed(__DIR__ . '/../../../../Model/' . $file)->format('Y-m-d'); ?>
<td>
<?= \phpOMS\Security\PhpCode::validateStringIntegrity(
$content,
Rest::request(
new Request(
new Http('https://raw.githubusercontent.com/Orange-Management/Model/develop/' . $file)
)
)->getBody()
) ? $this->getHtml('OK') : $this->getHtml('NG'); ?>
<?php endforeach; ?>
<?php
$files = Directory::listByExtension(__DIR__ . '/../../../../Modules/', 'php', 'tests(\/|\\\)');
foreach ($files as $file) : $content = \file_get_contents(__DIR__ . '/../../../../Modules/' . $file); ?>
<tr>
<td>
<td><?= $file; ?>
<td><?= PhpCode::hasUnicode($content) ? $this->getHtml('NG') : $this->getHtml('OK'); ?>
<td><?= PhpCode::hasDeprecatedFunction($content) ? $this->getHtml('NG') : $this->getHtml('OK'); ?>
<td><?= File::changed(__DIR__ . '/../../../../Modules/' . $file)->format('Y-m-d'); ?>
<td>
<?= \phpOMS\Security\PhpCode::validateStringIntegrity(
$content,
Rest::request(
new Request(
new Http('https://raw.githubusercontent.com/Orange-Management/Modules/develop/' . $file)
)
)->getBody()
) ? $this->getHtml('OK') : $this->getHtml('NG'); ?>
<?php endforeach; ?>
</table>
</div>
</div>
</div>