mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 15:02:34 +00:00
Add phpstan level 7(#544)
This commit is contained in:
@ -7,20 +7,26 @@
|
||||
|
||||
class FTPFake
|
||||
{
|
||||
/**
|
||||
* @var array<array{host: string, port: string, ssl: bool}>
|
||||
*/
|
||||
protected array $connections = [];
|
||||
|
||||
/**
|
||||
* @var array<array{username: string, password: string}>
|
||||
*/
|
||||
protected array $logins = [];
|
||||
|
||||
public function connect(string $host, string $port, bool $ssl = false): bool|Connection
|
||||
{
|
||||
$this->connections[] = compact('host', 'port', 'ssl');
|
||||
$this->connections[] = ['host' => $host, 'port' => $port, 'ssl' => $ssl];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function login(string $username, string $password, bool|Connection $connection): bool
|
||||
{
|
||||
$this->logins[] = compact('username', 'password');
|
||||
$this->logins[] = ['username' => $username, 'password' => $password];
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -42,7 +48,7 @@ public function delete(bool|Connection $connection, string $path): void
|
||||
|
||||
public function assertConnected(string $host): void
|
||||
{
|
||||
if (! $this->connections) {
|
||||
if ($this->connections === []) {
|
||||
Assert::fail('No connections are made');
|
||||
}
|
||||
$connected = false;
|
||||
@ -55,6 +61,5 @@ public function assertConnected(string $host): void
|
||||
if (! $connected) {
|
||||
Assert::fail('The expected host is not connected');
|
||||
}
|
||||
Assert::assertTrue(true, $connected);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user