Align coding style to comply with latest PSR

This commit is contained in:
Sukhwinder Dhillon 2025-12-15 15:32:21 +01:00
parent 93ff449fde
commit 279839d9da
22 changed files with 76 additions and 76 deletions

View file

@ -16,7 +16,7 @@ use Traversable;
class ToggleObjectFeaturesForm extends CommandForm
{
const LEAVE_UNCHANGED = 'noop';
public const LEAVE_UNCHANGED = 'noop';
protected $features;

View file

@ -14,32 +14,32 @@ class ToggleInstanceFeatureCommand extends IcingaCommand
/**
* Feature for enabling or disabling active host checks on an Icinga instance
*/
const FEATURE_ACTIVE_HOST_CHECKS = 'active_host_checks_enabled';
public const FEATURE_ACTIVE_HOST_CHECKS = 'active_host_checks_enabled';
/**
* Feature for enabling or disabling active service checks on an Icinga instance
*/
const FEATURE_ACTIVE_SERVICE_CHECKS = 'active_service_checks_enabled';
public const FEATURE_ACTIVE_SERVICE_CHECKS = 'active_service_checks_enabled';
/**
* Feature for enabling or disabling host and service event handlers on an Icinga instance
*/
const FEATURE_EVENT_HANDLERS = 'event_handlers_enabled';
public const FEATURE_EVENT_HANDLERS = 'event_handlers_enabled';
/**
* Feature for enabling or disabling host and service flap detection on an Icinga instance
*/
const FEATURE_FLAP_DETECTION = 'flap_detection_enabled';
public const FEATURE_FLAP_DETECTION = 'flap_detection_enabled';
/**
* Feature for enabling or disabling host and service notifications on an Icinga instance
*/
const FEATURE_NOTIFICATIONS = 'notifications_enabled';
public const FEATURE_NOTIFICATIONS = 'notifications_enabled';
/**
* Feature for enabling or disabling the processing of host and service performance data on an Icinga instance
*/
const FEATURE_PERFORMANCE_DATA = 'process_performance_data';
public const FEATURE_PERFORMANCE_DATA = 'process_performance_data';
/**
* Feature that is to be enabled or disabled

View file

@ -12,32 +12,32 @@ class ProcessCheckResultCommand extends ObjectsCommand
/**
* Host up
*/
const HOST_UP = 0;
public const HOST_UP = 0;
/**
* Host down
*/
const HOST_DOWN = 1;
public const HOST_DOWN = 1;
/**
* Service ok
*/
const SERVICE_OK = 0;
public const SERVICE_OK = 0;
/**
* Service warning
*/
const SERVICE_WARNING = 1;
public const SERVICE_WARNING = 1;
/**
* Service critical
*/
const SERVICE_CRITICAL = 2;
public const SERVICE_CRITICAL = 2;
/**
* Service unknown
*/
const SERVICE_UNKNOWN = 3;
public const SERVICE_UNKNOWN = 3;
/**
* Status code of the host or service check result

View file

@ -12,31 +12,31 @@ class ToggleObjectFeatureCommand extends ObjectsCommand
/**
* Feature for enabling or disabling active checks of a host or service
*/
const FEATURE_ACTIVE_CHECKS = 'active_checks_enabled';
public const FEATURE_ACTIVE_CHECKS = 'active_checks_enabled';
/**
* Feature for enabling or disabling passive checks of a host or service
*/
const FEATURE_PASSIVE_CHECKS = 'passive_checks_enabled';
public const FEATURE_PASSIVE_CHECKS = 'passive_checks_enabled';
/**
* Feature for enabling or disabling notifications for a host or service
*
* Notifications will be sent out only if notifications are enabled on a program-wide basis as well.
*/
const FEATURE_NOTIFICATIONS = 'notifications_enabled';
public const FEATURE_NOTIFICATIONS = 'notifications_enabled';
/**
* Feature for enabling or disabling event handler for a host or service
*/
const FEATURE_EVENT_HANDLER = 'event_handler_enabled';
public const FEATURE_EVENT_HANDLER = 'event_handler_enabled';
/**
* Feature for enabling or disabling flap detection for a host or service.
*
* In order to enable flap detection flap detection must be enabled on a program-wide basis as well.
*/
const FEATURE_FLAP_DETECTION = 'flapping_enabled';
public const FEATURE_FLAP_DETECTION = 'flapping_enabled';
/**
* Feature that is to be enabled or disabled

View file

@ -25,7 +25,7 @@ class ApiCommandTransport implements CommandTransportInterface
/**
* Transport identifier
*/
const TRANSPORT = 'api';
public const TRANSPORT = 'api';
/**
* API host

View file

@ -9,11 +9,11 @@ namespace Icinga\Module\Icingadb\Common;
*/
class HostStates
{
const UP = 0;
public const UP = 0;
const DOWN = 1;
public const DOWN = 1;
const PENDING = 99;
public const PENDING = 99;
/**
* Get the integer value of the given textual host state

View file

@ -6,27 +6,27 @@ namespace Icinga\Module\Icingadb\Common;
class Icons
{
const COMMENT = 'comment';
public const COMMENT = 'comment';
const HOST_DOWN = 'sitemap';
public const HOST_DOWN = 'sitemap';
const UNREACHABLE = 'sitemap';
public const UNREACHABLE = 'sitemap';
const IN_DOWNTIME = 'plug';
public const IN_DOWNTIME = 'plug';
const IS_ACKNOWLEDGED = 'check';
public const IS_ACKNOWLEDGED = 'check';
const IS_FLAPPING = 'bolt';
public const IS_FLAPPING = 'bolt';
const IS_PERSISTENT = 'thumbtack';
public const IS_PERSISTENT = 'thumbtack';
const NOTIFICATION = 'bell';
public const NOTIFICATION = 'bell';
const REMOVE = 'trash';
public const REMOVE = 'trash';
const USER = 'user';
public const USER = 'user';
const USERGROUP = 'users';
public const USERGROUP = 'users';
const WARNING = 'exclamation-triangle';
public const WARNING = 'exclamation-triangle';
}

View file

@ -9,15 +9,15 @@ namespace Icinga\Module\Icingadb\Common;
*/
class ServiceStates
{
const OK = 0;
public const OK = 0;
const WARNING = 1;
public const WARNING = 1;
const CRITICAL = 2;
public const CRITICAL = 2;
const UNKNOWN = 3;
public const UNKNOWN = 3;
const PENDING = 99;
public const PENDING = 99;
/**
* Get the integer value of the given textual service state

View file

@ -12,13 +12,13 @@ use ipl\Web\Url;
class UrlMigrator
{
const NO_YES = ['n', 'y'];
const USE_EXPR = 'use-expr';
const SORT_ONLY = 'sort-only';
const LOWER_EXPR = 'lower-expr';
const DROP = 'drop';
public const NO_YES = ['n', 'y'];
public const USE_EXPR = 'use-expr';
public const SORT_ONLY = 'sort-only';
public const LOWER_EXPR = 'lower-expr';
public const DROP = 'drop';
const SUPPORTED_PATHS = [
public const SUPPORTED_PATHS = [
'monitoring/list/hosts' => ['hosts', 'icingadb/hosts'],
'monitoring/hosts/show' => ['multipleHosts', 'icingadb/hosts/details'],
'monitoring/host/show' => ['host', 'icingadb/host'],

View file

@ -12,7 +12,7 @@ use ipl\Stdlib\Filter;
class PivotTable
{
const SORT_ASC = 'asc';
public const SORT_ASC = 'asc';
/**
* The query to fetch as pivot table

View file

@ -11,38 +11,38 @@ abstract class BaseExtensionHook
use HookUtils;
/** @var int Used as default return value for {@see BaseExtensionHook::getLocation()} */
const IDENTIFY_LOCATION_BY_SECTION = -1;
public const IDENTIFY_LOCATION_BY_SECTION = -1;
/** @var string Output section, right at the top */
const OUTPUT_SECTION = 'output';
public const OUTPUT_SECTION = 'output';
/** @var string Graph section, below output */
const GRAPH_SECTION = 'graph';
public const GRAPH_SECTION = 'graph';
/** @var string Detail section, below graphs */
const DETAIL_SECTION = 'detail';
public const DETAIL_SECTION = 'detail';
/** @var string Action section, below action and note urls */
const ACTION_SECTION = 'action';
public const ACTION_SECTION = 'action';
/** @var string Problem section, below comments and downtimes */
const PROBLEM_SECTION = 'problem';
public const PROBLEM_SECTION = 'problem';
/** @var string Related section, below groups and notification recipients */
const RELATED_SECTION = 'related';
public const RELATED_SECTION = 'related';
/** @var string State section, below check statistics and performance data */
const STATE_SECTION = 'state';
public const STATE_SECTION = 'state';
/** @var string Config section, below custom variables and feature toggles */
const CONFIG_SECTION = 'config';
public const CONFIG_SECTION = 'config';
/**
* Base locations for all known sections
*
* @var array<string, int>
*/
const BASE_LOCATIONS = [
public const BASE_LOCATIONS = [
self::OUTPUT_SECTION => 1000,
self::GRAPH_SECTION => 1100,
self::DETAIL_SECTION => 1200,

View file

@ -17,7 +17,7 @@ class ReRoute implements RewriteFilterBehavior, RewritePathBehavior
*
* @var string[]
*/
const MIXED_TYPE_RELATIONS = ['downtime', 'comment', 'history', 'notification_history'];
public const MIXED_TYPE_RELATIONS = ['downtime', 'comment', 'history', 'notification_history'];
public function __construct(array $routes)
{

View file

@ -29,10 +29,10 @@ abstract class SlaReport extends ReportHook
use Database;
/** @var float If an SLA value is lower than the threshold, it is considered not ok */
const DEFAULT_THRESHOLD = 99.5;
public const DEFAULT_THRESHOLD = 99.5;
/** @var int The amount of decimal places for the report result */
const DEFAULT_REPORT_PRECISION = 2;
public const DEFAULT_REPORT_PRECISION = 2;
/**
* Create and return a {@link ReportData} container

View file

@ -71,7 +71,7 @@ class ApiTransportPage extends Form
return false;
}
if (! isset($formData['skip_validation']) || !$formData['skip_validation']) {
if (! isset($formData['skip_validation']) || ! $formData['skip_validation']) {
if (! $this->validateConfiguration()) {
$this->addSkipValidationCheckbox();
return false;

View file

@ -88,7 +88,7 @@ class DbResourcePage extends Form
return false;
}
if (! isset($formData['skip_validation']) || !$formData['skip_validation']) {
if (! isset($formData['skip_validation']) || ! $formData['skip_validation']) {
if (! $this->validateConfiguration()) {
$this->addSkipValidationCheckbox();
return false;

View file

@ -11,9 +11,9 @@ use LogicException;
class PerfData
{
const PERFDATA_OK = 'ok';
const PERFDATA_WARNING = 'warning';
const PERFDATA_CRITICAL = 'critical';
public const PERFDATA_OK = 'ok';
public const PERFDATA_WARNING = 'warning';
public const PERFDATA_CRITICAL = 'critical';
/**
* The performance data value being parsed

View file

@ -22,10 +22,10 @@ class ViewModeSwitcher extends Form
];
/** @var string Default view mode */
const DEFAULT_VIEW_MODE = 'common';
public const DEFAULT_VIEW_MODE = 'common';
/** @var string Default view mode param */
const DEFAULT_VIEW_MODE_PARAM = 'view';
public const DEFAULT_VIEW_MODE_PARAM = 'view';
/** @var array View mode-icon pairs */
public static $viewModes = [

View file

@ -352,7 +352,7 @@ class Controller extends CompatController
}
}
if (!empty($unused)) {
if (! empty($unused)) {
$sql .= ' /* Unused values: "' . join('", "', $unused) . '" */';
}

View file

@ -18,8 +18,8 @@ abstract class ProblemsBadge extends NavigationItemRenderer
{
use Database;
const STATE_CRITICAL = 'critical';
const STATE_UNKNOWN = 'unknown';
public const STATE_CRITICAL = 'critical';
public const STATE_UNKNOWN = 'unknown';
/** @var int Count cache */
protected $count;

View file

@ -23,7 +23,7 @@ use ipl\Web\Widget\VerticalKeyValue;
class CheckStatistics extends Card
{
const TOP_LEFT_BUBBLE_FLAG = <<<'SVG'
public const TOP_LEFT_BUBBLE_FLAG = <<<'SVG'
<svg viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'>
<path class='bg' d='M0 0L13 13L3.15334e-06 13L0 0Z'/>
<path class='border' fill-rule='evenodd' clip-rule='evenodd'
@ -31,7 +31,7 @@ class CheckStatistics extends Card
</svg>
SVG;
const TOP_RIGHT_BUBBLE_FLAG = <<<'SVG'
public const TOP_RIGHT_BUBBLE_FLAG = <<<'SVG'
<svg viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'>
<path class='bg' d="M12 0L-1 13L12 13L12 0Z"/>
<path class='border' fill-rule="evenodd" clip-rule="evenodd"

View file

@ -17,7 +17,7 @@ class MacrosTest extends TestCase
{
use Macros;
const VARS = [
public const VARS = [
'os' => "Ubuntu",
'days[0]' => 'mo',
'days[1]' => 'tue',

View file

@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase;
class CustomvarFlatTest extends TestCase
{
const EMPTY_TEST_SOURCE = [
public const EMPTY_TEST_SOURCE = [
["dict.not_empty.foo","bar","dict","{\"empty\":{},\"not_empty\":{\"foo\":\"bar\"}}"],
["dict.empty",null,"dict","{\"empty\":{},\"not_empty\":{\"foo\":\"bar\"}}"],
["list[1]",null,"list","[[\"foo\",\"bar\"],[]]"],
@ -20,7 +20,7 @@ class CustomvarFlatTest extends TestCase
["null","null","null","null"]
];
const EMPTY_TEST_RESULT = [
public const EMPTY_TEST_RESULT = [
"dict" => [
"not_empty" => [
"foo" => "bar"
@ -36,7 +36,7 @@ class CustomvarFlatTest extends TestCase
"null" => "null"
];
const SPECIAL_CHAR_TEST_SOURCE = [
public const SPECIAL_CHAR_TEST_SOURCE = [
[
"vhosts.xxxxxxxxxxxxx.mgmt.xxxxxx.com.http_port",
"443",
@ -55,7 +55,7 @@ class CustomvarFlatTest extends TestCase
["[4]","four","[4]","\"four\""]
];
const SPECIAL_CHAR_TEST_RESULT = [
public const SPECIAL_CHAR_TEST_RESULT = [
"vhosts" => [
"xxxxxxxxxxxxx.mgmt.xxxxxx.com" => [
"http_port" => 443