ci: Autofix code style.

This commit is contained in:
Pol Dellaiera
2021-05-07 21:48:14 +02:00
parent ce4cbe3b8d
commit ee4e0b86fd
814 changed files with 51175 additions and 54478 deletions

View File

@@ -1,20 +1,25 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\MyBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class ItemController extends Controller {
class ItemController extends Controller
{
public function yourAction()
{
$em = $this->getDoctrine()->getManager();
// first, get the number of total item are available
$total = $em
->createQuery("SELECT COUNT (item.id) FROM ChillMyBundle:Item item")
->getSingleScalarResult();
->createQuery('SELECT COUNT (item.id) FROM ChillMyBundle:Item item')
->getSingleScalarResult();
// get the PaginatorFactory
$paginatorFactory = $this->get('chill_main.paginator_factory');
@@ -25,7 +30,7 @@ class ItemController extends Controller {
// launch your query on item. Limit the query to the results
// for the current page using the paginator
$items = $em->createQuery("SELECT item FROM ChillMyBundle:Item item WHERE <your clause>")
$items = $em->createQuery('SELECT item FROM ChillMyBundle:Item item WHERE <your clause>')
// use the paginator to get the first item number
->setFirstResult($paginator->getCurrentPage()->getFirstItemNumber())
// use the paginator to get the number of items to display
@@ -34,12 +39,10 @@ class ItemController extends Controller {
return $this
->render(
'ChillMyBundle:Item:list.html.twig',
array(
[
'items' => $items,
'paginator' => $paginator
)
'paginator' => $paginator,
]
);
}
}