From b264ceeaa8a2bb994e839cf072b79e327858811b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 24 Jun 2015 00:17:54 +0200 Subject: [PATCH] improve php syntax --- Controller/ReportController.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Controller/ReportController.php b/Controller/ReportController.php index 97ac0bbb3..787ca45f8 100644 --- a/Controller/ReportController.php +++ b/Controller/ReportController.php @@ -241,7 +241,7 @@ class ReportController extends Controller $person = $em->getRepository('ChillPersonBundle:Person') ->find($person_id); - if($person === NULL OR $cFGroup === NULL) { + if($person === NULL || $cFGroup === NULL) { throw $this->createNotFoundException(); } @@ -319,7 +319,7 @@ class ReportController extends Controller $entity = $em->getRepository('ChillReportBundle:Report')->find($report_id); - if (!$entity OR !$person) { + if (!$entity || !$person) { throw $this->createNotFoundException( $this->get('translator')->trans('Unable to find this report.')); } @@ -349,7 +349,7 @@ class ReportController extends Controller } if(intval($person_id) !== intval($report->getPerson()->getId())) { - throw new Exception( + throw new \RuntimeException( $this->get('translator')->trans('This is not the report of the person.'), 1); } @@ -418,8 +418,6 @@ class ReportController extends Controller array('person_id' => $report->getPerson()->getId(), 'report_id' => $report_id))); } - $errors = $editForm->getErrorsAsString(); - $this->get('session') ->getFlashBag() ->add('danger',