src/Rocketeer/Services/Connections/Credentials/Modules/ConnectionsKeychain.php
public function syncConnectionCredentials(ConnectionKey $connection = null, array $credentials = [])
    {
        // Store credentials if any
        if (!$credentials) {
            return;
        }

        $key = 'connections.'.$connection->name.'.servers.'.$connection->server;

        $filtered = $this->filterUnsavableCredentials($connection, $credentials);
        $this->localStorage->set($key, $filtered);

        // Merge and save
        $current = (array) $this->config->get($key);
        $credentials = array_replace_recursive($current, $credentials);
        $this->config->set($key, $credentials);

        // Reset connections
        $this->connections->disconnect();

        return $credentials;
    }
public function syncConnectionCredentials(ConnectionKey $connection = null, array $credentials = [])
    {
        // Store credentials if any
        if (!$credentials) {
            return;
        }

        $key = 'connections.'.$connection->name.'.servers.'.$connection->server;

        $filtered = $this->filterUnsavableCredentials($connection, $credentials);
        $this->localStorage->set($key, $filtered);

        // Merge and save
        $current = (array) $this->config->get($key);
        $credentials = array_replace_recursive($current, $credentials);
        $this->config->set($key, $credentials);

        // Reset connections
        $this->connections->disconnect();

        return $credentials;
    }
public function syncConnectionCredentials ( ConnectionKey $ connection = null , array $ credentials = [ ] ) { // Store credentials if any if ( ! $ credentials ) { return ; } $ key = 'connections.' . $ connection -> name . '.servers.' . $ connection -> server ; $ filtered = $ this -> filterUnsavableCredentials ( $ connection , $ credentials ) ; $ this -> localStorage -> set ( $ key , $ filtered ) ; // Merge and save $ current = ( array ) $ this -> config -> get ( $ key ) ; $ credentials = array_replace_recursive ( $ current , $ credentials ) ; $ this -> config -> set ( $ key , $ credentials ) ; // Reset connections $ this -> connections -> disconnect ( ) ; return $ credentials ; }
Persists connection credentials to cache.

@param ConnectionKey|null $connection
@param array              $credentials

@return array|void
Persists connection credentials to cache .