diff --git a/psalm_autoload.php b/psalm_autoload.php index 396827e..3e5903a 100644 --- a/psalm_autoload.php +++ b/psalm_autoload.php @@ -7,6 +7,9 @@ $helperDirs = [ 'src/Helpers', 'vendor/codeigniter4/framework/system/Helpers', + 'vendor/tatter/alerts/src/Helpers', + 'vendor/tatter/imposter/src/Helpers', + 'vendor/tatter/preferences/src/Helpers', ]; foreach ($helperDirs as $dir) { diff --git a/src/Config/Routes.php b/src/Config/Routes.php index f07c980..266a73c 100644 --- a/src/Config/Routes.php +++ b/src/Config/Routes.php @@ -5,6 +5,9 @@ if (empty(config('Files')->routeFiles)) { return; } + +$routes ??= service('routes'); + $options = [ 'filter' => 'assets:\Tatter\Files\Bundles\FilesBundle', 'namespace' => '\Tatter\Files\Controllers', diff --git a/src/Controllers/Files.php b/src/Controllers/Files.php index 60efdb1..b97a4e3 100644 --- a/src/Controllers/Files.php +++ b/src/Controllers/Files.php @@ -58,7 +58,7 @@ class Files extends Controller public function __construct(?FilesConfig $config = null, ?FileModel $model = null) { $this->config = $config ?? config('Files'); - $this->model = $model ?? model(FileModel::class); // @phpstan-ignore-line + $this->model = $model ?? model(FileModel::class); } //-------------------------------------------------------------------- diff --git a/src/Helpers/files_helper.php b/src/Helpers/files_helper.php index 014bec6..18007b0 100644 --- a/src/Helpers/files_helper.php +++ b/src/Helpers/files_helper.php @@ -110,13 +110,13 @@ function return_bytes(string $value): int switch ($unit) { case 'g': $num *= 1024; - // no break + // no break case 'm': $num *= 1024; - // no break + // no break case 'k': $num *= 1024; - // If it is not one of those modifiers then it was numerical bytes, add the final digit back - // no break + // If it is not one of those modifiers then it was numerical bytes, add the final digit back + // no break default: $num = (int) ($num . $unit); } diff --git a/src/Views/Dropzone/config.php b/src/Views/Dropzone/config.php index c404c21..a86eb32 100644 --- a/src/Views/Dropzone/config.php +++ b/src/Views/Dropzone/config.php @@ -5,13 +5,13 @@ Dropzone.options.filesDropzone = { diff --git a/tests/_support/TestCase.php b/tests/_support/TestCase.php index 7f8c0b6..cae109a 100644 --- a/tests/_support/TestCase.php +++ b/tests/_support/TestCase.php @@ -67,7 +67,7 @@ protected function setUp(): void } // Set up the model - $this->model = model(FileModel::class); // @phpstan-ignore-line + $this->model = model(FileModel::class); } protected function tearDown(): void