Merge pull request #3172 from wallabag/more-scruti

More Scrutinizer issues fixed
This commit is contained in:
Jérémy Benoist 2017-06-01 10:29:32 +02:00 committed by GitHub
commit 5d03e2d1a5
5 changed files with 9 additions and 13 deletions

View File

@ -321,8 +321,7 @@ class EntryController extends Controller
$pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false);
$entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')
->prepare($pagerAdapter, $page);
$entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')->prepare($pagerAdapter);
try {
$entries->setCurrentPage($page);

View File

@ -125,8 +125,7 @@ class TagController extends Controller
$pagerAdapter = new ArrayAdapter($entriesByTag);
$entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')
->prepare($pagerAdapter, $page);
$entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')->prepare($pagerAdapter);
try {
$entries->setCurrentPage($page);

View File

@ -20,16 +20,15 @@ class PreparePagerForEntries
/**
* @param AdapterInterface $adapter
* @param int $page
*
* @return null|Pagerfanta
*/
public function prepare(AdapterInterface $adapter, $page = 1)
public function prepare(AdapterInterface $adapter)
{
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
if (null === $user || !is_object($user)) {
return null;
return;
}
$entries = new Pagerfanta($adapter);

View File

@ -64,7 +64,7 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
protected $email;
/**
* @var date
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime")
*
@ -73,7 +73,7 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
protected $createdAt;
/**
* @var date
* @var \DateTime
*
* @ORM\Column(name="updated_at", type="datetime")
*
@ -157,7 +157,7 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
}
/**
* @return string
* @return \DateTime
*/
public function getCreatedAt()
{
@ -165,7 +165,7 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
}
/**
* @return string
* @return \DateTime
*/
public function getUpdatedAt()
{

View File

@ -5,7 +5,6 @@ namespace Wallabag\UserBundle\EventListener;
use Doctrine\ORM\EntityManager;
use FOS\UserBundle\Event\UserEvent;
use FOS\UserBundle\FOSUserEvents;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Wallabag\CoreBundle\Entity\Config;
@ -47,7 +46,7 @@ class CreateConfigListener implements EventSubscriberInterface
];
}
public function createConfig(UserEvent $event, $eventName = null, EventDispatcherInterface $eventDispatcher = null)
public function createConfig(UserEvent $event)
{
$config = new Config($event->getUser());
$config->setTheme($this->theme);