Add phpstan level 7(#544)

This commit is contained in:
Saeed Vaziry
2025-03-12 13:31:10 +01:00
committed by GitHub
parent c22bb1fa80
commit 493cbb0849
437 changed files with 4505 additions and 2193 deletions

View File

@ -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);
}
}