<?php

namespace DigipolisGent\Robo\Task\Deploy\Scp\Factory;

use DigipolisGent\Robo\Task\Deploy\Scp\Adapter\ScpPhpseclibAdapter;
use DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth;
use phpseclib\Net\SCP;
use phpseclib\Net\SSH2;

class ScpPhpseclibFactory implements ScpFactoryInterface
{

    public static function create($host, AbstractAuth $auth, $port = 22, $timeout = 10)
    {
        $ssh = new SSH2($host, $port, $timeout);
        $auth->authenticate($ssh);
        if (!$ssh->isConnected()) {
            throw new \RuntimeException(sprintf(
                "ssh: unable to establish connection to %s on port %s",
                $this->host,
                $this->port
            ));
        }
        return new ScpPhpseclibAdapter(new SCP($ssh));
    }
}

<?php

namespace DigipolisGent\Robo\Task\Deploy\Scp\Factory;

use DigipolisGent\Robo\Task\Deploy\Scp\Adapter\ScpPhpseclibAdapter;
use DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth;
use phpseclib\Net\SCP;
use phpseclib\Net\SSH2;

class ScpPhpseclibFactory implements ScpFactoryInterface
{

    public static function create($host, AbstractAuth $auth, $port = 22, $timeout = 10)
    {
        $ssh = new SSH2($host, $port, $timeout);
        $auth->authenticate($ssh);
        if (!$ssh->isConnected()) {
            throw new \RuntimeException(sprintf(
                "ssh: unable to establish connection to %s on port %s",
                $host,
                $port
            ));
        }
        return new ScpPhpseclibAdapter(new SCP($ssh));
    }
}

Fix Static method should not contain $this reference.
Fix Static method should not contain $this reference.
