From 7a527f2ed303efbe6f32f7a3890643c82daa742a Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Sat, 10 Feb 2018 14:06:25 -0600 Subject: [PATCH] Set access modifier on all enums (php 7.1) --- app/Models/Enums/AcarsType.php | 6 +++--- app/Models/Enums/AircraftState.php | 6 +++--- app/Models/Enums/AnalyticsDimensions.php | 6 +++--- app/Models/Enums/AnalyticsMetrics.php | 2 +- app/Models/Enums/Days.php | 14 ++++++------- app/Models/Enums/FlightType.php | 6 +++--- app/Models/Enums/FuelType.php | 6 +++--- app/Models/Enums/GenericState.php | 4 ++-- app/Models/Enums/NavaidType.php | 26 ++++++++++++------------ app/Models/Enums/PirepSource.php | 5 ++--- app/Models/Enums/PirepState.php | 12 +++++------ app/Models/Enums/PirepStatus.php | 8 ++++---- app/Models/Enums/UserState.php | 10 ++++----- 13 files changed, 55 insertions(+), 56 deletions(-) diff --git a/app/Models/Enums/AcarsType.php b/app/Models/Enums/AcarsType.php index 96f1ad5f..d936f6a0 100644 --- a/app/Models/Enums/AcarsType.php +++ b/app/Models/Enums/AcarsType.php @@ -8,7 +8,7 @@ namespace App\Models\Enums; */ class AcarsType extends EnumBase { - const FLIGHT_PATH = 0; - const ROUTE = 1; - const LOG = 2; + public const FLIGHT_PATH = 0; + public const ROUTE = 1; + public const LOG = 2; } diff --git a/app/Models/Enums/AircraftState.php b/app/Models/Enums/AircraftState.php index f3d1b9a2..5d141aef 100644 --- a/app/Models/Enums/AircraftState.php +++ b/app/Models/Enums/AircraftState.php @@ -8,9 +8,9 @@ namespace App\Models\Enums; */ class AircraftState extends EnumBase { - const PARKED = 0; - const IN_USE = 1; - const IN_AIR = 2; + public const PARKED = 0; + public const IN_USE = 1; + public const IN_AIR = 2; public static $labels = [ AircraftState::PARKED => 'On Ground', diff --git a/app/Models/Enums/AnalyticsDimensions.php b/app/Models/Enums/AnalyticsDimensions.php index 6291e6f0..64feb97b 100644 --- a/app/Models/Enums/AnalyticsDimensions.php +++ b/app/Models/Enums/AnalyticsDimensions.php @@ -8,7 +8,7 @@ namespace App\Models\Enums; */ class AnalyticsDimensions { - const PHP_VERSION = 1; - const DATABASE_VERSION = 2; - const PHPVMS_VERSION = 3; + public const PHP_VERSION = 1; + public const DATABASE_VERSION = 2; + public const PHPVMS_VERSION = 3; } diff --git a/app/Models/Enums/AnalyticsMetrics.php b/app/Models/Enums/AnalyticsMetrics.php index 68431b54..1cce3f3d 100644 --- a/app/Models/Enums/AnalyticsMetrics.php +++ b/app/Models/Enums/AnalyticsMetrics.php @@ -9,5 +9,5 @@ namespace App\Models\Enums; class AnalyticsMetrics { # Track the lookup time for airports from vaCentral - const AIRPORT_LOOKUP_TIME = 1; + public const AIRPORT_LOOKUP_TIME = 1; } diff --git a/app/Models/Enums/Days.php b/app/Models/Enums/Days.php index d06f6997..130a4a7e 100644 --- a/app/Models/Enums/Days.php +++ b/app/Models/Enums/Days.php @@ -11,13 +11,13 @@ namespace App\Models\Enums; */ class Days extends EnumBase { - const MONDAY = 1 << 0; - const TUESDAY = 1 << 1; - const WEDNESDAY = 1 << 2; - const THURSDAY = 1 << 3; - const FRIDAY = 1 << 4; - const SATURDAY = 1 << 5; - const SUNDAY = 1 << 6; + public const MONDAY = 1 << 0; + public const TUESDAY = 1 << 1; + public const WEDNESDAY = 1 << 2; + public const THURSDAY = 1 << 3; + public const FRIDAY = 1 << 4; + public const SATURDAY = 1 << 5; + public const SUNDAY = 1 << 6; protected static $labels = [ Days::MONDAY => 'system.days.mon', diff --git a/app/Models/Enums/FlightType.php b/app/Models/Enums/FlightType.php index 7e0a207e..9ad60373 100644 --- a/app/Models/Enums/FlightType.php +++ b/app/Models/Enums/FlightType.php @@ -5,9 +5,9 @@ namespace App\Models\Enums; class FlightType extends EnumBase { - const PASSENGER = 0; - const CARGO = 1; - const CHARTER = 2; + public const PASSENGER = 0; + public const CARGO = 1; + public const CHARTER = 2; protected static $labels = [ FlightType::PASSENGER => 'Passenger', diff --git a/app/Models/Enums/FuelType.php b/app/Models/Enums/FuelType.php index 355f6c49..726360c7 100644 --- a/app/Models/Enums/FuelType.php +++ b/app/Models/Enums/FuelType.php @@ -4,9 +4,9 @@ namespace App\Models\Enums; class FuelType extends EnumBase { - const LOW_LEAD = 0; - const JET_A = 1; - const MOGAS = 2; + public const LOW_LEAD = 0; + public const JET_A = 1; + public const MOGAS = 2; protected static $labels = [ FuelType::LOW_LEAD => '100LL', diff --git a/app/Models/Enums/GenericState.php b/app/Models/Enums/GenericState.php index fe7475c0..0d97daa8 100644 --- a/app/Models/Enums/GenericState.php +++ b/app/Models/Enums/GenericState.php @@ -8,8 +8,8 @@ namespace App\Models\Enums; */ class GenericState extends EnumBase { - const INACTIVE = 0; - const ACTIVE = 1; + public const INACTIVE = 0; + public const ACTIVE = 1; public static $labels = [ GenericState::INACTIVE => 'Inactive', diff --git a/app/Models/Enums/NavaidType.php b/app/Models/Enums/NavaidType.php index 950b6668..664d57a6 100644 --- a/app/Models/Enums/NavaidType.php +++ b/app/Models/Enums/NavaidType.php @@ -13,19 +13,19 @@ namespace App\Models\Enums; */ class NavaidType extends EnumBase { - const VOR = 1 << 0; - const VOR_DME = 1 << 1; - const LOC = 1 << 4; - const LOC_DME = 1 << 5; - const NDB = 1 << 6; - const TACAN = 1 << 7; - const UNKNOWN = 1 << 8; - const INNER_MARKER = 1 << 9; - const OUTER_MARKER = 1 << 10; - const FIX = 1 << 11; - const ANY_VOR = NavaidType::VOR | NavaidType::VOR_DME; - const ANY_LOC = NavaidType::LOC | NavaidType::LOC_DME; - const ANY = (NavaidType::UNKNOWN << 1) - 1; + public const VOR = 1 << 0; + public const VOR_DME = 1 << 1; + public const LOC = 1 << 4; + public const LOC_DME = 1 << 5; + public const NDB = 1 << 6; + public const TACAN = 1 << 7; + public const UNKNOWN = 1 << 8; + public const INNER_MARKER = 1 << 9; + public const OUTER_MARKER = 1 << 10; + public const FIX = 1 << 11; + public const ANY_VOR = NavaidType::VOR | NavaidType::VOR_DME; + public const ANY_LOC = NavaidType::LOC | NavaidType::LOC_DME; + public const ANY = (NavaidType::UNKNOWN << 1) - 1; /** * Names and titles diff --git a/app/Models/Enums/PirepSource.php b/app/Models/Enums/PirepSource.php index 26811edf..b8122324 100644 --- a/app/Models/Enums/PirepSource.php +++ b/app/Models/Enums/PirepSource.php @@ -11,12 +11,11 @@ namespace App\Models\Enums; class PirepSource extends EnumBase { - const MANUAL = 0; - const ACARS = 1; + public const MANUAL = 0; + public const ACARS = 1; protected static $labels = [ PirepSource::MANUAL => 'Manual', PirepSource::ACARS => 'ACARS', ]; - } diff --git a/app/Models/Enums/PirepState.php b/app/Models/Enums/PirepState.php index 3d820165..f0546ebd 100644 --- a/app/Models/Enums/PirepState.php +++ b/app/Models/Enums/PirepState.php @@ -5,12 +5,12 @@ namespace App\Models\Enums; class PirepState extends EnumBase { - const REJECTED = -1; - const IN_PROGRESS = 0; - const PENDING = 1; - const ACCEPTED = 2; - const CANCELLED = 3; - const DELETED = 4; + public const REJECTED = -1; + public const IN_PROGRESS = 0; + public const PENDING = 1; + public const ACCEPTED = 2; + public const CANCELLED = 3; + public const DELETED = 4; protected static $labels = [ PirepState::REJECTED => 'system.pireps.state.rejected', diff --git a/app/Models/Enums/PirepStatus.php b/app/Models/Enums/PirepStatus.php index 9eaf19d8..b8e6a5b3 100644 --- a/app/Models/Enums/PirepStatus.php +++ b/app/Models/Enums/PirepStatus.php @@ -13,10 +13,10 @@ namespace App\Models\Enums; */ class PirepStatus extends EnumBase { - const PREFILE = 0; - const SCHEDULED = 0; - const ENROUTE = 1; - const ARRIVED = 2; + public const PREFILE = 0; + public const SCHEDULED = 0; + public const ENROUTE = 1; + public const ARRIVED = 2; protected static $labels = [ PirepStatus::PREFILE => 'Prefiled', diff --git a/app/Models/Enums/UserState.php b/app/Models/Enums/UserState.php index 5d065058..ae6e0b06 100644 --- a/app/Models/Enums/UserState.php +++ b/app/Models/Enums/UserState.php @@ -7,11 +7,11 @@ namespace App\Models\Enums; class UserState extends EnumBase { - const PENDING = 0; - const ACTIVE = 1; - const REJECTED = 2; - const ON_LEAVE = 3; - const SUSPENDED = 4; + public const PENDING = 0; + public const ACTIVE = 1; + public const REJECTED = 2; + public const ON_LEAVE = 3; + public const SUSPENDED = 4; protected static $labels = [ UserState::PENDING => 'Pending',