Scalr\Api\Rest\ApiApplication::handleEnvironment PHP Method

handleEnvironment() public method

It extracts :environment group parameter from the route and sets application setting
public handleEnvironment ( Scalr\Api\Rest\Routing\Route $route )
$route Scalr\Api\Rest\Routing\Route A route
    public function handleEnvironment($route)
    {
        $params = $route->getParams();
        if (!is_numeric($params['environment']) || $params['environment'] <= 0) {
            throw new ApiErrorException(400, ErrorMessage::ERR_INVALID_VALUE, "Environment has not been provided with the request");
        }
        $this->settings[self::SETTING_SCALR_ENVIRONMENT] = (int) $params['environment'];
        unset($params['environment']);
        $route->setParams($params);
    }