Pantheon\Terminus\Commands\SSHKey\RemoveCommand::delete PHP Метод

delete() публичный Метод

Remove an SSH key from the logged-in user's account
public delete ( string $ssh_key_id )
$ssh_key_id string The ID or label of the SSH key to be deleted
    public function delete($ssh_key_id)
    {
        // Remove ':' to allow the id to be specified in ssh thumbnail format.
        $ssh_key_id = str_replace(':', '', $ssh_key_id);
        // Find the key. Will throw an exception if it doesn't exist.
        $key = $this->session()->getUser()->getSSHKeys()->get($ssh_key_id);
        $context = ['key' => $key->id];
        $this->log()->notice('Deleting SSH key {key} ...', $context);
        $key->delete();
        $this->log()->notice('Deleted SSH key {key}!', $context);
    }
RemoveCommand