self::PROD, 'development' => self::DEV, 'devel' => self::DEV, ); /** * Resolve the current environment. * * @return string One of the ALLOWED values (prod, dev, test). */ public function get() { $value = $this->readConstant(); if ( ! $value ) { return self::PROD; } if ( in_array( $value, self::ALLOWED, true ) ) { return $value; } $aliases = self::ALIASES; if ( isset( $aliases[ $value ] ) ) { return $aliases[ $value ]; } return self::PROD; } /** * Read the IMUNIFY_SECURITY_SENTRY_ENV constant value. * * @return string|null The constant value, or null if not defined. */ public function readConstant() { if ( defined( 'IMUNIFY_SECURITY_SENTRY_ENV' ) && is_string( IMUNIFY_SECURITY_SENTRY_ENV ) && '' !== IMUNIFY_SECURITY_SENTRY_ENV ) { return IMUNIFY_SECURITY_SENTRY_ENV; } return null; } }