diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml
index 8311e74..716b580 100644
--- a/.github/workflows/php.yml
+++ b/.github/workflows/php.yml
@@ -39,4 +39,4 @@ jobs:
- name: PHP CodeSniffer
if: success() || matrix.allow_failure
- run: phpcs
+ run: phpcs -wps --colors
diff --git a/.phpcs.xml b/.phpcs.xml
deleted file mode 100644
index d1d0ed7..0000000
--- a/.phpcs.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
- Sniff our code a while
-
- ./
-
- vendor/*
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/application/clicommands/Icinga2Command.php b/application/clicommands/Icinga2Command.php
index 3ae1335..816e063 100644
--- a/application/clicommands/Icinga2Command.php
+++ b/application/clicommands/Icinga2Command.php
@@ -1,4 +1,5 @@
cartesianProduct($macros) as $macroValues) {
- if (preg_match(
- '/\A\.[^.]+\.(.+)\.[^.]+\z/',
- $metricFilter->resolve($macroValues),
- $match
- )) {
+ if (
+ preg_match(
+ '/\A\.[^.]+\.(.+)\.[^.]+\z/',
+ $metricFilter->resolve($macroValues),
+ $match
+ )
+ ) {
$perfdata[$match[1]] = $max;
}
}
diff --git a/application/forms/TimeRangePicker/CommonForm.php b/application/forms/TimeRangePicker/CommonForm.php
index 395ebe0..21e2096 100644
--- a/application/forms/TimeRangePicker/CommonForm.php
+++ b/application/forms/TimeRangePicker/CommonForm.php
@@ -145,10 +145,13 @@ class CommonForm extends Form
$params = $this->getRedirectUrl()->getParams();
$seconds = TimeRangePickerTools::getRelativeSeconds($params);
- if ($seconds === null && count(array_intersect_key(
- $params->toArray(false),
- array_keys(TimeRangePickerTools::getAllRangeParameters())
- )) === 0) {
+ if (
+ $seconds === null
+ && count(array_intersect_key(
+ $params->toArray(false),
+ array_keys(TimeRangePickerTools::getAllRangeParameters())
+ )) === 0
+ ) {
$seconds = TimeRangePickerTools::getDefaultRelativeTimeRange();
}
diff --git a/library/Graphite/Graphing/Template.php b/library/Graphite/Graphing/Template.php
index aaf967e..a030fb7 100644
--- a/library/Graphite/Graphing/Template.php
+++ b/library/Graphite/Graphing/Template.php
@@ -134,7 +134,8 @@ class Template
if (! isset($handledCurves[$curveName2])) {
foreach ($metrics1 as $metric1 => & $vars1) {
foreach ($metrics2 as $metric2 => & $vars2) {
- if (count(array_intersect_assoc($vars1, $vars2))
+ if (
+ count(array_intersect_assoc($vars1, $vars2))
=== count(array_intersect_key($vars1, $vars2))
) {
$possibleCombinations[$curveName1][$curveName2][$metric1][$metric2] = true;
diff --git a/library/Graphite/Graphing/Templates.php b/library/Graphite/Graphing/Templates.php
index 12e189b..0765e46 100644
--- a/library/Graphite/Graphing/Templates.php
+++ b/library/Graphite/Graphing/Templates.php
@@ -71,14 +71,16 @@ class Templates
*/
public function loadDir($path)
{
- foreach (new RecursiveIteratorIterator(
- new RecursiveDirectoryIterator(
- $path,
- RecursiveDirectoryIterator::KEY_AS_PATHNAME | RecursiveDirectoryIterator::CURRENT_AS_FILEINFO
+ foreach (
+ new RecursiveIteratorIterator(
+ new RecursiveDirectoryIterator(
+ $path,
+ RecursiveDirectoryIterator::KEY_AS_PATHNAME | RecursiveDirectoryIterator::CURRENT_AS_FILEINFO
| RecursiveDirectoryIterator::SKIP_DOTS | RecursiveDirectoryIterator::FOLLOW_SYMLINKS
- ),
- RecursiveIteratorIterator::LEAVES_ONLY
- ) as $filepath => $fileinfo) {
+ ),
+ RecursiveIteratorIterator::LEAVES_ONLY
+ ) as $filepath => $fileinfo
+ ) {
/** @var SplFileInfo $fileinfo */
if ($fileinfo->isFile() && preg_match('/\A[^.].*\.ini\z/si', $fileinfo->getFilename())) {
@@ -171,10 +173,12 @@ class Templates
);
}
- if (count(array_intersect(
- $curves[$curve][0]->getMacros(),
- ['host_name_template', 'service_name_template']
- )) !== 1) {
+ if (
+ count(array_intersect(
+ $curves[$curve][0]->getMacros(),
+ ['host_name_template', 'service_name_template']
+ )) !== 1
+ ) {
throw new ConfigurationError(
'Bad metrics filter "%s" for curve "%s" of template "%s" in file "%s": must include'
. ' either the macro $host_name_template$ or $service_name_template$, but not both',
diff --git a/library/Graphite/ProvidedHook/Icingadb/IcingadbSupport.php b/library/Graphite/ProvidedHook/Icingadb/IcingadbSupport.php
index a4522d4..8f0f38e 100644
--- a/library/Graphite/ProvidedHook/Icingadb/IcingadbSupport.php
+++ b/library/Graphite/ProvidedHook/Icingadb/IcingadbSupport.php
@@ -6,5 +6,4 @@ use Icinga\Module\Icingadb\Hook\IcingadbSupportHook;
class IcingadbSupport extends IcingadbSupportHook
{
-
}
diff --git a/library/Graphite/ProvidedHook/Icingadb/ServiceDetailExtension.php b/library/Graphite/ProvidedHook/Icingadb/ServiceDetailExtension.php
index 3e79430..63c2b79 100644
--- a/library/Graphite/ProvidedHook/Icingadb/ServiceDetailExtension.php
+++ b/library/Graphite/ProvidedHook/Icingadb/ServiceDetailExtension.php
@@ -3,7 +3,6 @@
namespace Icinga\Module\Graphite\ProvidedHook\Icingadb;
use Icinga\Application\Icinga;
-
use Icinga\Module\Graphite\Util\InternalProcessTracker as IPT;
use Icinga\Module\Graphite\Web\Controller\TimeRangePickerTrait;
use Icinga\Module\Graphite\Web\Widget\Graphs;
diff --git a/library/Graphite/Web/Widget/Graphs.php b/library/Graphite/Web/Widget/Graphs.php
index cdab2cf..e18b8da 100644
--- a/library/Graphite/Web/Widget/Graphs.php
+++ b/library/Graphite/Web/Widget/Graphs.php
@@ -246,10 +246,12 @@ abstract class Graphs extends AbstractWidget
IPT::recordf("Icinga check command: %s", $this->checkCommand);
IPT::recordf("Obscured check command: %s", $this->obscuredCheckCommand);
- foreach ([
+ foreach (
+ [
['template', $concreteTemplates, []],
['default_template', $allTemplates->getDefaultTemplates(), $excludedMetrics],
- ] as $templateSet) {
+ ] as $templateSet
+ ) {
list($urlParam, $templates, $excludeMetrics) = $templateSet;
if ($urlParam === 'template') {
diff --git a/library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbHost.php b/library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbHost.php
index 5ce769a..2b0a614 100644
--- a/library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbHost.php
+++ b/library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbHost.php
@@ -5,7 +5,7 @@ namespace Icinga\Module\Graphite\Web\Widget\Graphs\Icingadb;
use Icinga\Module\Graphite\Graphing\Template;
use Icinga\Module\Graphite\Web\Widget\Graphs;
use Icinga\Web\Url;
-use \Icinga\Module\Icingadb\Model\Host;
+use Icinga\Module\Icingadb\Model\Host;
class IcingadbHost extends Graphs
{
diff --git a/library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbService.php b/library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbService.php
index e3da8c2..7827e86 100644
--- a/library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbService.php
+++ b/library/Graphite/Web/Widget/Graphs/Icingadb/IcingadbService.php
@@ -5,7 +5,7 @@ namespace Icinga\Module\Graphite\Web\Widget\Graphs\Icingadb;
use Icinga\Module\Graphite\Graphing\Template;
use Icinga\Module\Graphite\Web\Widget\Graphs;
use Icinga\Web\Url;
-use \Icinga\Module\Icingadb\Model\Service;
+use Icinga\Module\Icingadb\Model\Service;
class IcingadbService extends Graphs
{
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644
index 0000000..37e0e27
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,15 @@
+
+
+
+ ./
+
+ vendor/*
+
+
+
+
+
+
+
+
+