namespace Wallabag\CoreBundle\ParamConverter;
-use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface;
use Doctrine\Common\Persistence\ManagerRegistry;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
+use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
-use Wallabag\CoreBundle\Entity\User;
+use Wallabag\UserBundle\Entity\User;
/**
* ParamConverter used in the RSS controller to retrieve the right user according to
$em = $this->registry->getManagerForClass($configuration->getClass());
// Check, if class name is what we need
- if ('Wallabag\CoreBundle\Entity\User' !== $em->getClassMetadata($configuration->getClass())->getName()) {
+ if (null !== $em && 'Wallabag\UserBundle\Entity\User' !== $em->getClassMetadata($configuration->getClass())->getName()) {
return false;
}
$username = $request->attributes->get('username');
$rssToken = $request->attributes->get('token');
- // Check, if route attributes exists
- if (null === $username || null === $rssToken) {
- throw new \InvalidArgumentException('Route attribute is missing');
+ if (!$request->attributes->has('username') || !$request->attributes->has('token')) {
+ return false;
}
// Get actual entity manager for class