for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\NewsBundle\Entity;
use Doctrine\ORM\EntityRepository;
class BasePostRepository extends EntityRepository
{
/**
* return last post query builder.
* @param int $limit
* @return \Doctrine\ORM\QueryBuilder
public function findLastPostQueryBuilder($limit)
$limit
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
return $this->createQueryBuilder('p')
->where('p.enabled = true')
->orderby('p.createdAt', 'DESC');
}
* return count comments QueryBuilder.
* @param Sonata\NewsBundle\Model\PostInterface
public function countCommentsQuery($post)
return $this->getEntityManager()->createQuery('SELECT COUNT(c.id)
FROM Application\Sonata\NewsBundle\Entity\Comment c
WHERE c.status = 1
AND c.post = :post')
->setParameters(array('post' => $post));
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.