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:
parent
083dc630fb
commit
0178c7356d
28 changed files with 63 additions and 194 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue