diff --git a/application/forms/Command/Object/ToggleObjectFeaturesForm.php b/application/forms/Command/Object/ToggleObjectFeaturesForm.php index 7f0884e7..d7c73113 100644 --- a/application/forms/Command/Object/ToggleObjectFeaturesForm.php +++ b/application/forms/Command/Object/ToggleObjectFeaturesForm.php @@ -16,7 +16,7 @@ use Traversable; class ToggleObjectFeaturesForm extends CommandForm { - const LEAVE_UNCHANGED = 'noop'; + public const LEAVE_UNCHANGED = 'noop'; protected $features; diff --git a/library/Icingadb/Command/Instance/ToggleInstanceFeatureCommand.php b/library/Icingadb/Command/Instance/ToggleInstanceFeatureCommand.php index d275d9b3..ed54852f 100644 --- a/library/Icingadb/Command/Instance/ToggleInstanceFeatureCommand.php +++ b/library/Icingadb/Command/Instance/ToggleInstanceFeatureCommand.php @@ -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 diff --git a/library/Icingadb/Command/Object/ProcessCheckResultCommand.php b/library/Icingadb/Command/Object/ProcessCheckResultCommand.php index 24ae2f3a..ce006341 100644 --- a/library/Icingadb/Command/Object/ProcessCheckResultCommand.php +++ b/library/Icingadb/Command/Object/ProcessCheckResultCommand.php @@ -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 diff --git a/library/Icingadb/Command/Object/ToggleObjectFeatureCommand.php b/library/Icingadb/Command/Object/ToggleObjectFeatureCommand.php index ec662892..4b64c0d6 100644 --- a/library/Icingadb/Command/Object/ToggleObjectFeatureCommand.php +++ b/library/Icingadb/Command/Object/ToggleObjectFeatureCommand.php @@ -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 diff --git a/library/Icingadb/Command/Transport/ApiCommandTransport.php b/library/Icingadb/Command/Transport/ApiCommandTransport.php index 1bfb50e6..e8a3e2bc 100644 --- a/library/Icingadb/Command/Transport/ApiCommandTransport.php +++ b/library/Icingadb/Command/Transport/ApiCommandTransport.php @@ -25,7 +25,7 @@ class ApiCommandTransport implements CommandTransportInterface /** * Transport identifier */ - const TRANSPORT = 'api'; + public const TRANSPORT = 'api'; /** * API host diff --git a/library/Icingadb/Common/HostStates.php b/library/Icingadb/Common/HostStates.php index 06b92367..fb2656de 100644 --- a/library/Icingadb/Common/HostStates.php +++ b/library/Icingadb/Common/HostStates.php @@ -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 diff --git a/library/Icingadb/Common/Icons.php b/library/Icingadb/Common/Icons.php index c28127df..973adca8 100644 --- a/library/Icingadb/Common/Icons.php +++ b/library/Icingadb/Common/Icons.php @@ -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'; } diff --git a/library/Icingadb/Common/ServiceStates.php b/library/Icingadb/Common/ServiceStates.php index 526f95eb..27ee1831 100644 --- a/library/Icingadb/Common/ServiceStates.php +++ b/library/Icingadb/Common/ServiceStates.php @@ -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 diff --git a/library/Icingadb/Compat/UrlMigrator.php b/library/Icingadb/Compat/UrlMigrator.php index 8cc64d59..eb8d7650 100644 --- a/library/Icingadb/Compat/UrlMigrator.php +++ b/library/Icingadb/Compat/UrlMigrator.php @@ -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'], diff --git a/library/Icingadb/Data/PivotTable.php b/library/Icingadb/Data/PivotTable.php index 1aee20cc..8db09adb 100644 --- a/library/Icingadb/Data/PivotTable.php +++ b/library/Icingadb/Data/PivotTable.php @@ -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 diff --git a/library/Icingadb/Hook/ExtensionHook/BaseExtensionHook.php b/library/Icingadb/Hook/ExtensionHook/BaseExtensionHook.php index dfefdcde..13c43670 100644 --- a/library/Icingadb/Hook/ExtensionHook/BaseExtensionHook.php +++ b/library/Icingadb/Hook/ExtensionHook/BaseExtensionHook.php @@ -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 */ - const BASE_LOCATIONS = [ + public const BASE_LOCATIONS = [ self::OUTPUT_SECTION => 1000, self::GRAPH_SECTION => 1100, self::DETAIL_SECTION => 1200, diff --git a/library/Icingadb/Model/Behavior/ReRoute.php b/library/Icingadb/Model/Behavior/ReRoute.php index d054f00e..a7a3fb12 100644 --- a/library/Icingadb/Model/Behavior/ReRoute.php +++ b/library/Icingadb/Model/Behavior/ReRoute.php @@ -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) { diff --git a/library/Icingadb/ProvidedHook/Reporting/SlaReport.php b/library/Icingadb/ProvidedHook/Reporting/SlaReport.php index 8dcc64e4..3b4067ed 100644 --- a/library/Icingadb/ProvidedHook/Reporting/SlaReport.php +++ b/library/Icingadb/ProvidedHook/Reporting/SlaReport.php @@ -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 diff --git a/library/Icingadb/Setup/ApiTransportPage.php b/library/Icingadb/Setup/ApiTransportPage.php index e727e997..d46c7fd7 100644 --- a/library/Icingadb/Setup/ApiTransportPage.php +++ b/library/Icingadb/Setup/ApiTransportPage.php @@ -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; diff --git a/library/Icingadb/Setup/DbResourcePage.php b/library/Icingadb/Setup/DbResourcePage.php index 3c3cbf8d..bca0b776 100644 --- a/library/Icingadb/Setup/DbResourcePage.php +++ b/library/Icingadb/Setup/DbResourcePage.php @@ -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; diff --git a/library/Icingadb/Util/PerfData.php b/library/Icingadb/Util/PerfData.php index cc33d165..40917e8e 100644 --- a/library/Icingadb/Util/PerfData.php +++ b/library/Icingadb/Util/PerfData.php @@ -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 diff --git a/library/Icingadb/Web/Control/ViewModeSwitcher.php b/library/Icingadb/Web/Control/ViewModeSwitcher.php index 8068aeef..b4521844 100644 --- a/library/Icingadb/Web/Control/ViewModeSwitcher.php +++ b/library/Icingadb/Web/Control/ViewModeSwitcher.php @@ -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 = [ diff --git a/library/Icingadb/Web/Controller.php b/library/Icingadb/Web/Controller.php index ba59e0fb..f2cfa90b 100644 --- a/library/Icingadb/Web/Controller.php +++ b/library/Icingadb/Web/Controller.php @@ -352,7 +352,7 @@ class Controller extends CompatController } } - if (!empty($unused)) { + if (! empty($unused)) { $sql .= ' /* Unused values: "' . join('", "', $unused) . '" */'; } diff --git a/library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php b/library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php index 5e0f5557..f06cacf0 100644 --- a/library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php +++ b/library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php @@ -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; diff --git a/library/Icingadb/Widget/Detail/CheckStatistics.php b/library/Icingadb/Widget/Detail/CheckStatistics.php index ff458de5..a328d5d0 100644 --- a/library/Icingadb/Widget/Detail/CheckStatistics.php +++ b/library/Icingadb/Widget/Detail/CheckStatistics.php @@ -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; - const TOP_RIGHT_BUBBLE_FLAG = <<<'SVG' + public const TOP_RIGHT_BUBBLE_FLAG = <<<'SVG' "Ubuntu", 'days[0]' => 'mo', 'days[1]' => 'tue', diff --git a/test/php/library/Icingadb/Model/CustomvarFlatTest.php b/test/php/library/Icingadb/Model/CustomvarFlatTest.php index a69f5780..c86853d2 100644 --- a/test/php/library/Icingadb/Model/CustomvarFlatTest.php +++ b/test/php/library/Icingadb/Model/CustomvarFlatTest.php @@ -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