mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 14:24:24 +00:00
improve php syntax
This commit is contained in:
parent
adf1a5eb2c
commit
b264ceeaa8
@ -241,7 +241,7 @@ class ReportController extends Controller
|
|||||||
$person = $em->getRepository('ChillPersonBundle:Person')
|
$person = $em->getRepository('ChillPersonBundle:Person')
|
||||||
->find($person_id);
|
->find($person_id);
|
||||||
|
|
||||||
if($person === NULL OR $cFGroup === NULL) {
|
if($person === NULL || $cFGroup === NULL) {
|
||||||
throw $this->createNotFoundException();
|
throw $this->createNotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ class ReportController extends Controller
|
|||||||
|
|
||||||
$entity = $em->getRepository('ChillReportBundle:Report')->find($report_id);
|
$entity = $em->getRepository('ChillReportBundle:Report')->find($report_id);
|
||||||
|
|
||||||
if (!$entity OR !$person) {
|
if (!$entity || !$person) {
|
||||||
throw $this->createNotFoundException(
|
throw $this->createNotFoundException(
|
||||||
$this->get('translator')->trans('Unable to find this report.'));
|
$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())) {
|
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);
|
$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)));
|
array('person_id' => $report->getPerson()->getId(), 'report_id' => $report_id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
$errors = $editForm->getErrorsAsString();
|
|
||||||
|
|
||||||
$this->get('session')
|
$this->get('session')
|
||||||
->getFlashBag()
|
->getFlashBag()
|
||||||
->add('danger',
|
->add('danger',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user