forked from wallabag/wallabag
Fix PHPStan errors
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user