for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Symfony\Component\HttpFoundation\Request;
class NewsController extends CRUDController
{
public function showAction(News $article)
return array("article" => $article, "categories" => $this->getCategories());
}
public function listAction(Request $request, NewsCategory $category = null)
$request
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$qb = $this->getQueryBuilder();
$currentPage = $this->getCurrentPage();
$news = $qb->sortBy('created')->reverse()
->where('category')->is($category)
->limit(5)->fromPage($currentPage)
->getModels();
return array(
"news" => $news,
"categories" => $this->getCategories(),
"category" => $category,
"currentPage" => $currentPage,
"totalPages" => $qb->countPages()
);
public function createAction(Player $me)
return $this->create($me);
public function editAction(Player $me, News $article)
return $this->edit($article, $me, "article");
public function deleteAction(Player $me, News $article)
return $this->delete($article, $me);
private function getCategories()
return $this->getQueryBuilder('NewsCategory')
->sortBy('name')
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.