Rocketeer\Services\Connections\ConnectionsHandler::getHandle PHP Method

getHandle() public method

Build the current connection's handle.
public getHandle ( string | null $connection = null, integer | null $server = null, string | null $stage = null ) : string
$connection string | null
$server integer | null
$stage string | null
return string
    public function getHandle($connection = null, $server = null, $stage = null)
    {
        // Get identifiers
        $connection = $connection ?: $this->getConnection();
        $server = $server ?: $this->getServer();
        $stage = $stage ?: $this->getStage();
        // Filter values
        $handle = [$connection, $server, $stage];
        if ($this->isMultiserver($connection)) {
            $handle = array_filter($handle, function ($value) {
                return !is_null($value);
            });
        } else {
            $handle = array_filter($handle);
        }
        // Concatenate
        $handle = implode('/', $handle);
        $this->handle = $handle;
        return $handle;
    }