diff --git a/application/clicommands/Icinga2Command.php b/application/clicommands/Icinga2Command.php index eb2ba5c..3ae1335 100644 --- a/application/clicommands/Icinga2Command.php +++ b/application/clicommands/Icinga2Command.php @@ -179,7 +179,7 @@ EOT * * @return array[] */ - protected function cartesianProduct(array & $input) + protected function cartesianProduct(array &$input) { $results = [[]]; diff --git a/application/controllers/GraphController.php b/application/controllers/GraphController.php index 55eb428..5f8a739 100644 --- a/application/controllers/GraphController.php +++ b/application/controllers/GraphController.php @@ -99,10 +99,10 @@ class GraphController extends MonitoringAwareController /** * Do all monitored object type independend actions * - * @param MonitoredObject $monitoredObject The monitored object to render the graphs of - * @param string $checkCommand The check command of the monitored object we supply an image for - * @param string|null $obscuredCheckCommand The "real" check command (if any) of the monitored object - * we display graphs for + * @param MonitoredObject $monitoredObject The monitored object to render the graphs of + * @param string $checkCommand The check command of the monitored object we supply an image for + * @param string|null $obscuredCheckCommand The "real" check command (if any) of the monitored object + * we display graphs for */ protected function supplyImage(MonitoredObject $monitoredObject, $checkCommand, $obscuredCheckCommand) { @@ -139,6 +139,7 @@ class GraphController extends MonitoringAwareController ->setShowLegend((bool) $this->graphParams['legend']) ->serveImage($this->getResponse()); + // not falling through, serveImage exits default: throw new HttpBadRequestException('%s', $this->translate( 'Graphite Web yields more than one metric for the given filter.' diff --git a/application/forms/TimeRangePicker/CustomForm.php b/application/forms/TimeRangePicker/CustomForm.php index a190b9d..219e434 100644 --- a/application/forms/TimeRangePicker/CustomForm.php +++ b/application/forms/TimeRangePicker/CustomForm.php @@ -130,7 +130,8 @@ class CustomForm extends Form $decorators = []; foreach ($elementDecorators as $key => $decorator) { if ($key === 'Zend_Form_Decorator_ViewHelper') { - $decorators['Zend_Form_Decorator_FormElements'] = $group->getDecorators()['Zend_Form_Decorator_FormElements']; + $decorators['Zend_Form_Decorator_FormElements'] = + $group->getDecorators()['Zend_Form_Decorator_FormElements']; } else { $decorators[$key] = (new Proxy())->setActualDecorator($decorator->setElement($element)); } diff --git a/library/Graphite/Graphing/GraphiteWebClient.php b/library/Graphite/Graphing/GraphiteWebClient.php index baa8fe3..8f78aef 100644 --- a/library/Graphite/Graphing/GraphiteWebClient.php +++ b/library/Graphite/Graphing/GraphiteWebClient.php @@ -92,7 +92,8 @@ class GraphiteWebClient * * @return string */ - public function escapeMetricPath($metricPath) { + public function escapeMetricPath($metricPath) + { return preg_replace_callback( '/[[\]]/', function (array $matches) { diff --git a/library/Graphite/Graphing/Template.php b/library/Graphite/Graphing/Template.php index 6e33752..25302aa 100644 --- a/library/Graphite/Graphing/Template.php +++ b/library/Graphite/Graphing/Template.php @@ -70,8 +70,12 @@ class Template * * @return Chart[] */ - public function getCharts(MetricsDataSource $dataSource, MonitoredObject $monitoredObject, array $filter, array & $excludeMetrics = []) - { + public function getCharts( + MetricsDataSource $dataSource, + MonitoredObject $monitoredObject, + array $filter, + array &$excludeMetrics = [] + ) { $metrics = []; $metricsUsed = 0; $metricsExcluded = 0; @@ -167,8 +171,12 @@ class Template * @param string[][] $metricsCombinations * @param string[] $currentCombination */ - protected function combineMetrics(array & $metrics, array & $possibleCombinations, array & $metricsCombinations, array $currentCombination = []) - { + protected function combineMetrics( + array &$metrics, + array &$possibleCombinations, + array &$metricsCombinations, + array $currentCombination = [] + ) { if (empty($currentCombination)) { foreach ($metrics as $curveName => & $curveMetrics) { foreach ($curveMetrics as $metric => & $_) { diff --git a/library/Graphite/Graphing/Templates.php b/library/Graphite/Graphing/Templates.php index 05736f3..12e189b 100644 --- a/library/Graphite/Graphing/Templates.php +++ b/library/Graphite/Graphing/Templates.php @@ -144,7 +144,7 @@ class Templates $templateName, $path, implode(', ', array_map( - function($option) { + function ($option) { return "\"graph.$option\""; }, $standalone diff --git a/library/Graphite/Util/InternalProcessTracker.php b/library/Graphite/Util/InternalProcessTracker.php index 8efac05..f7f2df6 100644 --- a/library/Graphite/Util/InternalProcessTracker.php +++ b/library/Graphite/Util/InternalProcessTracker.php @@ -1,6 +1,7 @@ getCharts( - static::getMetricsDataSource(), $this->monitoredObject, [], $excludeMetrics + static::getMetricsDataSource(), + $this->monitoredObject, + [], + $excludeMetrics ); if (! empty($charts)) { @@ -295,8 +298,8 @@ abstract class Graphs extends AbstractWidget $img = '\"\""width\" height=\"$this->height\"" + . "\" src=\"$src\" data-actualimageurl=\"$imageUrl\" class=\"detach graphiteImg\"" + . " alt=\"\" width=\"$this->width\" height=\"$this->height\"" . " style=\"min-width: {$this->width}px; min-height: {$this->height}px;\">"; } diff --git a/library/Graphite/Web/Widget/Graphs/Service.php b/library/Graphite/Web/Widget/Graphs/Service.php index be3b68b..c464c0a 100644 --- a/library/Graphite/Web/Widget/Graphs/Service.php +++ b/library/Graphite/Web/Widget/Graphs/Service.php @@ -35,7 +35,7 @@ class Service extends Graphs { return $url ->setParam('host.name', $this->monitoredObject->getHost()->getName()) - ->setParam('service.name', $this->monitoredObject->getName()); + ->setParam('service.name', $this->monitoredObject->getName()); } protected function getMonitoredObjectIdentifier()