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,10 +7,5 @@
abstract class AbstractStorageProvider implements StorageProviderContract
{
protected StorageProvider $storageProvider;
public function __construct(StorageProvider $storageProvider)
{
$this->storageProvider = $storageProvider;
}
public function __construct(protected StorageProvider $storageProvider) {}
}

View File

@ -8,6 +8,9 @@
class FTP extends AbstractStorageProvider
{
/**
* @return array<string, mixed>
*/
public function validationRules(): array
{
return [
@ -63,8 +66,8 @@ private function connection(): bool|Connection
return \App\Facades\FTP::connect(
$credentials['host'],
$credentials['port'],
$credentials['ssl']
(int) $credentials['port'],
(bool) $credentials['ssl']
);
}

View File

@ -16,6 +16,9 @@ class S3 extends AbstractStorageProvider
protected ?S3Client $client = null;
/**
* @var array<string, mixed>
*/
protected array $clientConfig = [];
public function getApiUrl(): string
@ -37,6 +40,8 @@ public function getClient(): S3Client
/**
* Build the configuration array for the S3 client.
* This method can be overridden by child classes to modify the configuration.
*
* @return array<string, mixed>
*/
public function buildClientConfig(): array
{

View File

@ -7,8 +7,15 @@
interface StorageProvider
{
/**
* @return array<string, string>
*/
public function validationRules(): array;
/**
* @param array<string, mixed> $input
* @return array<string, mixed>
*/
public function credentialData(array $input): array;
public function connect(): bool;