]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/front/controller/admin/ThumbnailsController.php
Add strict types for bookmarks management
[github/shaarli/Shaarli.git] / application / front / controller / admin / ThumbnailsController.php
index e53085105e15a0b69a8c0d2faec0f706757a8f74..4dc09d388c86b932c9fe7cb0618a9aa222f8712a 100644 (file)
@@ -5,6 +5,7 @@ declare(strict_types=1);
 namespace Shaarli\Front\Controller\Admin;
 
 use Shaarli\Bookmark\Exception\BookmarkNotFoundException;
+use Shaarli\Render\TemplatePage;
 use Slim\Http\Request;
 use Slim\Http\Response;
 
@@ -36,7 +37,7 @@ class ThumbnailsController extends ShaarliAdminController
             t('Thumbnails update') .' - '. $this->container->conf->get('general.title', 'Shaarli')
         );
 
-        return $response->write($this->render('thumbnails'));
+        return $response->write($this->render(TemplatePage::THUMBNAILS));
     }
 
     /**
@@ -51,7 +52,7 @@ class ThumbnailsController extends ShaarliAdminController
         }
 
         try {
-            $bookmark = $this->container->bookmarkService->get($id);
+            $bookmark = $this->container->bookmarkService->get((int) $id);
         } catch (BookmarkNotFoundException $e) {
             return $response->withStatus(404);
         }
@@ -61,19 +62,4 @@ class ThumbnailsController extends ShaarliAdminController
 
         return $response->withJson($this->container->formatterFactory->getFormatter('raw')->format($bookmark));
     }
-
-    /**
-     * @param mixed[] $data Variables passed to the template engine
-     *
-     * @return mixed[] Template data after active plugins render_picwall hook execution.
-     */
-    protected function executeHooks(array $data): array
-    {
-        $this->container->pluginManager->executeHooks(
-            'render_tools',
-            $data
-        );
-
-        return $data;
-    }
 }