Fix new CS

This commit is contained in:
Julien Fastré 2023-09-06 16:18:28 +02:00 committed by Julie Lenaerts
parent e7a9b10d0d
commit 6f1dd5b3f2
5 changed files with 25 additions and 13 deletions

View File

@ -152,7 +152,7 @@ class EventSearch extends AbstractSearch
$orWhere = $qb->expr()->orX(); $orWhere = $qb->expr()->orX();
foreach ($reachableCenters as $center) { foreach ($reachableCenters as $center) {
$n = $n+1; $n = $n + 1;
$circles = $this->authorizationHelper->getReachableScopes( $circles = $this->authorizationHelper->getReachableScopes(
$this->security->getUser(), $this->security->getUser(),
'CHILL_EVENT_SEE', 'CHILL_EVENT_SEE',

View File

@ -1,5 +1,14 @@
<?php <?php
declare(strict_types=1);
/*
* 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 Notification\Email; namespace Notification\Email;
use Chill\MainBundle\Entity\Notification; use Chill\MainBundle\Entity\Notification;
@ -16,6 +25,10 @@ use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Email; use Symfony\Component\Mime\Email;
use Symfony\Component\Translation\Translator; use Symfony\Component\Translation\Translator;
/**
* @internal
* @coversNothing
*/
class NotificationMailerTest extends TestCase class NotificationMailerTest extends TestCase
{ {
use ProphecyTrait; use ProphecyTrait;
@ -35,7 +48,7 @@ class NotificationMailerTest extends TestCase
->setSender($user1) ->setSender($user1)
->addAddressee($user2) ->addAddressee($user2)
->addAddressee($user3) ->addAddressee($user3)
; ;
$comment = (new NotificationComment()) $comment = (new NotificationComment())
->setContent("foo bar baz") ->setContent("foo bar baz")
@ -47,14 +60,14 @@ class NotificationMailerTest extends TestCase
// a mail only to user1 and user3 should have been sent // a mail only to user1 and user3 should have been sent
$mailer->send(Argument::that(function (Email $email) { $mailer->send(Argument::that(function (Email $email) {
foreach ($email->getTo() as $address) { foreach ($email->getTo() as $address) {
if ($address->getAddress() === 'user1@foo.com' || $address->getAddress() === 'user3@foo.com') { if ($address->getAddress() === 'user1@foo.com' || $address->getAddress() === 'user3@foo.com') {
return true; return true;
}
} }
}
return false; return false;
})); }));
$objectManager = $this->prophesize(EntityManagerInterface::class); $objectManager = $this->prophesize(EntityManagerInterface::class);
@ -104,8 +117,7 @@ class NotificationMailerTest extends TestCase
private function buildNotificationMailer( private function buildNotificationMailer(
MailerInterface $mailer = null, MailerInterface $mailer = null,
): NotificationMailer ): NotificationMailer {
{
return new NotificationMailer( return new NotificationMailer(
$mailer, $mailer,
new NullLogger(), new NullLogger(),

View File

@ -214,7 +214,7 @@ final class PersonController extends AbstractController
{ {
$person = new Person(); $person = new Person();
$authorizedCenters =$this->authorizationHelper->getReachableCenters($this->getUser(), PersonVoter::CREATE); $authorizedCenters = $this->authorizationHelper->getReachableCenters($this->getUser(), PersonVoter::CREATE);
if (1 === count($authorizedCenters)) { if (1 === count($authorizedCenters)) {
$person->setCenter($authorizedCenters[0]); $person->setCenter($authorizedCenters[0]);

View File

@ -108,7 +108,7 @@ class AccompanyingPeriodContextTest extends KernelTestCase
): void { ): void {
$context = $this->buildContext(); $context = $this->buildContext();
$template = new DocGeneratorTemplate(); $template = new DocGeneratorTemplate();
$template->setName(["fr" =>"test"])->setContext(AccompanyingPeriodContext::class) $template->setName(["fr" => "test"])->setContext(AccompanyingPeriodContext::class)
->setDescription("description")->setActive(true) ->setDescription("description")->setActive(true)
->setOptions($options); ->setOptions($options);

View File

@ -102,7 +102,7 @@ final class PersonContextTest extends KernelTestCase
self::$container->get(ThirdPartyRepository::class) self::$container->get(ThirdPartyRepository::class)
); );
$template = new DocGeneratorTemplate(); $template = new DocGeneratorTemplate();
$template->setName(["fr" =>"test"])->setContext(AccompanyingPeriodContext::class) $template->setName(["fr" => "test"])->setContext(AccompanyingPeriodContext::class)
->setDescription("description")->setActive(true) ->setDescription("description")->setActive(true)
->setOptions($options); ->setOptions($options);