1111
1212final class Environment
1313{
14- public const DEVELOPMENT = 'development ' ;
15- public const TESTING = 'testing ' ;
16- public const PRODUCTION = 'production ' ;
14+ public const DEV = 'dev ' ;
15+ public const TEST = 'test ' ;
16+ public const PROD = 'prod ' ;
1717
1818 private static array $ values = [];
1919
@@ -35,17 +35,17 @@ public static function environment(): string
3535
3636 public static function isDevelopment (): bool
3737 {
38- return self ::environment () === self ::DEVELOPMENT ;
38+ return self ::environment () === self ::DEV ;
3939 }
4040
4141 public static function isTesting (): bool
4242 {
43- return self ::environment () === self ::TESTING ;
43+ return self ::environment () === self ::TEST ;
4444 }
4545
4646 public static function isProduction (): bool
4747 {
48- return self ::environment () === self ::PRODUCTION ;
48+ return self ::environment () === self ::PROD ;
4949 }
5050
5151 public static function yiiC3 (): bool
@@ -63,7 +63,7 @@ public static function yiiDebug(): bool
6363 private static function setEnvironment (): void
6464 {
6565 $ environment = self ::getRawValue ('YII_ENV ' );
66- if (!in_array ($ environment , [self ::DEVELOPMENT , self ::TESTING , self ::PRODUCTION ], true )) {
66+ if (!in_array ($ environment , [self ::DEV , self ::TEST , self ::PROD ], true )) {
6767 throw new RuntimeException (
6868 sprintf ('"%s" is invalid environment. ' , $ environment ?? '' )
6969 );
0 commit comments