src/VagrantTransient.php
public function createEnvironment($name)
    {
        if (false == $this->vagrentExists($name)) {
            $msg = self::VAGRANT_FILE_NAME." not found in {$name}, skipping";
            $this->printLn($msg, 'error');
            return;
        }
        $environments       = $this->getEnvironments();
        $changed            = false;
        if (false == $this->environmentExists($name)) {
            $environments[] = $name;
            $changed        = true;
            $this->printLn("Environment {$name} created");
        }
        if (true == $changed) {
            $this->setEnvironments($environments);
            $environments   = array_reverse($environments);
            $this->setEnvironments($environments);
        } else {
            $message = "Environment {$name} already exists, skipping";
            $this->printLn($message, 'notice', false);
        }
        return $this;
    }
public function createEnvironment($name)
    {
        if (false == $this->vagrentExists($name)) {
            $msg = self::VAGRANT_FILE_NAME." not found in {$name}, skipping";
            $this->printLn($msg, 'error');
            return;
        }
        $environments       = $this->getEnvironments();
        $changed            = false;
        if (false == $this->environmentExists($name)) {
            $environments[] = $name;
            $changed        = true;
            $this->printLn("Environment {$name} created");
        }
        if (true == $changed) {
            $this->setEnvironments($environments);
            $environments   = array_reverse($environments);
            $this->setEnvironments($environments);
        } else {
            $message = "Environment {$name} already exists, skipping";
            $this->printLn($message, 'notice', false);
        }
        return $this;
    }
public function createEnvironment ( $ name ) { if ( false == $ this -> vagrentExists ( $ name ) ) { $ msg = self :: VAGRANT_FILE_NAME . " not found in {$name}, skipping" ; $ this -> printLn ( $ msg , 'error' ) ; return ; } $ environments = $ this -> getEnvironments ( ) ; $ changed = false ; if ( false == $ this -> environmentExists ( $ name ) ) { $ environments [ ] = $ name ; $ changed = true ; $ this -> printLn ( "Environment {$name} created" ) ; } if ( true == $ changed ) { $ this -> setEnvironments ( $ environments ) ; $ environments = array_reverse ( $ environments ) ; $ this -> setEnvironments ( $ environments ) ; } else { $ message = "Environment {$name} already exists, skipping" ; $ this -> printLn ( $ message , 'notice' , false ) ; } return $ this ; }
This method adds the environment to storage if it is not already in storage.

@param string $name is the name of the environment to create.

@return $this
This method adds the environment to storage if it is not already in storage .