public function getEnvironmentsForCheckout()
    {
        $project = $this->getWelcomeCommand()->getCurrentProject();
        if (!$project) {
            return [];
        }
        try {
            $currentEnvironment = $this->getWelcomeCommand()->getCurrentEnvironment($project, false);
        } catch (\Exception $e) {
            $currentEnvironment = false;
        }
        $environments = $this->api->getEnvironments($project, false, false);
        if ($currentEnvironment) {
            $environments = array_filter(
                $environments,
                function ($environment) use ($currentEnvironment) {
                    return $environment->id !== $currentEnvironment->id;
                }
            );
        }

        return array_keys($environments);
    }
public function getEnvironmentsForCheckout()
    {
        $project = $this->getWelcomeCommand()->getCurrentProject();
        if (!$project) {
            return [];
        }
        try {
            $currentEnvironment = $this->getWelcomeCommand()->getCurrentEnvironment($project, false);
        } catch (\Exception $e) {
            $currentEnvironment = false;
        }
        $environments = $this->api->getEnvironments($project, false, false);
        if ($currentEnvironment) {
            $environments = array_filter(
                $environments,
                function ($environment) use ($currentEnvironment) {
                    return $environment->id !== $currentEnvironment->id;
                }
            );
        }

        return array_keys($environments);
    }
public function getEnvironmentsForCheckout ( ) { $ project = $ this -> getWelcomeCommand ( ) -> getCurrentProject ( ) ; if ( ! $ project ) { return [ ] ; } try { $ currentEnvironment = $ this -> getWelcomeCommand ( ) -> getCurrentEnvironment ( $ project , false ) ; } catch ( \ Exception $ e ) { $ currentEnvironment = false ; } $ environments = $ this -> api -> getEnvironments ( $ project , false , false ) ; if ( $ currentEnvironment ) { $ environments = array_filter ( $ environments , function ( $ environment ) use ( $ currentEnvironment ) { return $ environment -> id !== $ currentEnvironment -> id ; } ) ; } return array_keys ( $ environments ) ; }
Get a list of environments IDs that can be checked out.

@return string[]
Get a list of environments IDs that can be checked out .