From 09ed671734bea4f15006d2010b61cb001d32b1f6 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Mon, 26 Apr 2021 13:06:40 +0200 Subject: [PATCH] fix: Simplify statements and fix syntax. To make sure that PHP CS Fixer do not fails. --- src/Bundle/ChillMainBundle/Notification/Mailer.php | 2 +- .../ChillTaskBundle/Controller/SingleTaskController.php | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Notification/Mailer.php b/src/Bundle/ChillMainBundle/Notification/Mailer.php index 82d8822af..73debaae5 100644 --- a/src/Bundle/ChillMainBundle/Notification/Mailer.php +++ b/src/Bundle/ChillMainBundle/Notification/Mailer.php @@ -104,7 +104,7 @@ class Mailer * @param \User $to * @param array $subject Subject of the message [ 0 => $message (required), 1 => $parameters (optional), 3 => $domain (optional) ] * @param array $bodies The bodies. An array where keys are the contentType and values the bodies - * @param \callable $callback a callback to customize the message (add attachment, etc.) + * @param callable $callback a callback to customize the message (add attachment, etc.) */ public function sendNotification( $recipient, diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index bc2254ec9..1c526aa1e 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -152,7 +152,7 @@ class SingleTaskController extends AbstractController $em = $this->getDoctrine()->getManager(); $task = $em->getRepository(SingleTask::class)->find($id); - if (!is_null($task->getPerson() === !null)) { + if ($task->getPerson() !== null) { $personId = $task->getPerson()->getId(); if ($personId === null) { @@ -206,7 +206,7 @@ class SingleTaskController extends AbstractController $em = $this->getDoctrine()->getManager(); $task = $em->getRepository(SingleTask::class)->find($id); - if (!is_null($task->getPerson() === !null)) { + if ($task->getPerson() !== null) { $personId = $task->getPerson()->getId(); if ($personId === null) { return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST); @@ -303,8 +303,7 @@ class SingleTaskController extends AbstractController throw $this->createNotFoundException('Unable to find Task entity.'); } - if (!is_null($task->getPerson() === !null)) { - + if ($task->getPerson() !== null) { $personId = $task->getPerson()->getId(); if ($personId === null) { return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST);