src/Environment.php
protected function _match($environment, $params)
    {
        $cakeEnv = env('CAKE_ENV');
        if (!empty($cakeEnv)) {
            return env('CAKE_ENV') == $environment;
        }

        if (is_bool($params)) {
            return $params;
        }

        if (is_callable($params) || (is_string($params) && function_exists($params))) {
            return $params();
        }

        foreach ($params as $param => $value) {
            if (function_exists($param)) {
                $match = call_user_func($param, $value);
            } elseif (is_array($value)) {
                $match = in_array(env($param), $value);
            } else {
                $match = (env($param) === $value);
            }

            if (!$match) {
                return false;
            }
        }
        return true;
    }
protected function _match($environment, $params)
    {
        $cakeEnv = env('CAKE_ENV');
        if (!empty($cakeEnv)) {
            return env('CAKE_ENV') == $environment;
        }

        if (is_bool($params)) {
            return $params;
        }

        if (is_callable($params) || (is_string($params) && function_exists($params))) {
            return $params();
        }

        foreach ($params as $param => $value) {
            if (function_exists($param)) {
                $match = call_user_func($param, $value);
            } elseif (is_array($value)) {
                $match = in_array(env($param), $value);
            } else {
                $match = (env($param) === $value);
            }

            if (!$match) {
                return false;
            }
        }
        return true;
    }
protected function _match ( $ environment , $ params ) { $ cakeEnv = env ( 'CAKE_ENV' ) ; if ( ! empty ( $ cakeEnv ) ) { return env ( 'CAKE_ENV' ) == $ environment ; } if ( is_bool ( $ params ) ) { return $ params ; } if ( is_callable ( $ params ) || ( is_string ( $ params ) && function_exists ( $ params ) ) ) { return $ params ( ) ; } foreach ( $ params as $ param => $ value ) { if ( function_exists ( $ param ) ) { $ match = call_user_func ( $ param , $ value ) ; } elseif ( is_array ( $ value ) ) { $ match = in_array ( env ( $ param ) , $ value ) ; } else { $ match = ( env ( $ param ) === $ value ) ; } if ( ! $ match ) { return false ; } } return true ; }
Matches the current setup to a given environment

@param string $environment Name of the environment
@param array $params Array of keys to check
@return bool
Matches the current setup to a given environment