1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

Fix PHPStan errors

This commit is contained in:
Yassine Guedidi 2024-01-01 19:51:22 +01:00
parent 083dc630fb
commit 0178c7356d
28 changed files with 63 additions and 194 deletions

View file

@ -15,6 +15,7 @@ use Wallabag\AnnotationBundle\Form\EditAnnotationType;
use Wallabag\AnnotationBundle\Form\NewAnnotationType;
use Wallabag\AnnotationBundle\Repository\AnnotationRepository;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\UserBundle\Entity\User;
class WallabagAnnotationController extends AbstractFOSRestController
{
@ -146,6 +147,17 @@ class WallabagAnnotationController extends AbstractFOSRestController
}
}
/**
* @return User|null
*/
protected function getUser()
{
$user = parent::getUser();
\assert(null === $user || $user instanceof User);
return $user;
}
private function validateAnnotation(AnnotationRepository $annotationRepository, int $annotationId, int $userId)
{
$annotation = $annotationRepository->findOneByIdAndUserId($annotationId, $userId);