Jelajahi Sumber

fix phpstan warnings

Olivier Massot 1 tahun lalu
induk
melakukan
85ca977785

+ 4 - 4
src/Service/File/Factory/ImageFactory.php

@@ -35,7 +35,7 @@ class ImageFactory
      * Créer l'image retaillée et l'à stock l'image dans le cache
      * @param string $path : chemin de l'image
      * @param string $filter : nom du filtre liip à appliquer
-     * @param array<string, array<string, array<string, array<int, int>>>> $filtersOptions : options du filtre
+     * @param array<string, array<string, array<int, int>>> $filtersOptions : options du filtre
      * @return void
      */
     private function createAndStore(string $path, string $filter, array $filtersOptions){
@@ -47,10 +47,10 @@ class ImageFactory
     /**
      * Définit et retourne le tableau de config servant à cropper
      * @param string|null $config : Configuration du File
-     * @return array<string, array<string, array<string, array<int, int>>>> | array : tableau de configuration
+     * @return array<string, array<string, array<int, int>>> : tableau de configuration
      * @see ImageUtilsTest::testGetCroppingConfig()
      */
-    protected function getCropFilterOptions(?string $config): array{
+    protected function getCropFilterOptions(?string $config): array {
         if(!$config)
             return [];
 
@@ -71,4 +71,4 @@ class ImageFactory
 
         return $crop_filters_options;
     }
-}
+}

+ 3 - 2
src/Service/Twig/AssetsExtension.php

@@ -55,11 +55,12 @@ class AssetsExtension extends AbstractExtension
      *      <img src="{{ fileImagePath((licence.logo, 'sm') }}"/>
      *
      * @param File $file
+     * @param string $size  @see src/Enum/Core/FileSizeEnum.php
      * @return string
      * @throws FileNotFoundException
      */
-    public function fileImagePath(File $file, $size): string
+    public function fileImagePath(File $file, string $size): string
     {
-        return $this->fileManager->readImage($file, $size, true);
+        return $this->fileManager->getImageUrl($file, $size, true);
     }
 }

+ 1 - 1
src/Service/Utils/UrlBuilder.php

@@ -75,7 +75,7 @@ class UrlBuilder
      * Build an url
      *
      * @param string $url The base url
-     * @param array $tails la suite de l'url sous forme de tableau
+     * @param array<string> $tails la suite de l'url sous forme de tableau
      * @param list<string> $parameters A list of parameters (can be an empty array)
      * @param bool $preprendHttps Should the 'https://' be prepended if missing
      * @return string

+ 0 - 1
src/State/Provider/Core/DownloadProvider.php

@@ -43,7 +43,6 @@ final class DownloadProvider implements ProviderInterface
 
     /**
      * @param int $fileId
-     * @param array<string, mixed> $filters
      * @return Response
      * @throws FileNotFoundException
      */