PHPStan level 3

This commit is contained in:
Yassine Guedidi
2023-08-08 02:27:21 +01:00
parent 85065b509f
commit 0f17a8cf8a
25 changed files with 86 additions and 74 deletions

View File

@ -3,6 +3,7 @@
namespace Wallabag\CoreBundle\Helper;
use Pagerfanta\Adapter\AdapterInterface;
use Pagerfanta\Adapter\NullAdapter;
use Pagerfanta\Pagerfanta;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Wallabag\UserBundle\Entity\User;
@ -19,7 +20,7 @@ class PreparePagerForEntries
/**
* @param User $user If user isn't logged in, we can force it (like for feed)
*
* @return Pagerfanta|null
* @return Pagerfanta
*/
public function prepare(AdapterInterface $adapter, User $user = null)
{
@ -28,7 +29,7 @@ class PreparePagerForEntries
}
if (!$user instanceof User) {
return;
return new Pagerfanta(new NullAdapter());
}
$entries = new Pagerfanta($adapter);