cs: Fix code style (safe rules only).

This commit is contained in:
Pol Dellaiera
2021-11-23 14:06:38 +01:00
parent 149d7ce991
commit 8f96a1121d
1223 changed files with 65199 additions and 64625 deletions

View File

@@ -1,5 +1,12 @@
<?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\PersonBundle\Privacy;
/*
@@ -22,15 +29,14 @@ namespace Chill\PersonBundle\Privacy;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
use Chill\PersonBundle\Entity\Person;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Privacy\AccompanyingPeriodPrivacyEvent;
use function array_map;
class PrivacyEventSubscriber implements EventSubscriberInterface
{
/**
* @var LoggerInterface
*/
@@ -43,8 +49,6 @@ class PrivacyEventSubscriber implements EventSubscriberInterface
/**
* PrivacyEventSubscriber constructor.
*
* @param LoggerInterface $logger
*/
public function __construct(LoggerInterface $logger, TokenStorageInterface $token)
{
@@ -56,11 +60,11 @@ class PrivacyEventSubscriber implements EventSubscriberInterface
{
return [
PrivacyEvent::PERSON_PRIVACY_EVENT => [
['onPrivacyEvent']
['onPrivacyEvent'],
],
AccompanyingPeriodPrivacyEvent::ACCOMPANYING_PERIOD_PRIVACY_EVENT => [
['onAccompanyingPeriodPrivacyEvent']
]
['onAccompanyingPeriodPrivacyEvent'],
],
];
}
@@ -69,11 +73,11 @@ class PrivacyEventSubscriber implements EventSubscriberInterface
$involved = $this->getInvolved();
$involved['period_id'] = $event->getPeriod()->getId();
$involved['persons'] = $event->getPeriod()->getPersons()
->map(function(Person $p) { return $p->getId(); })
->map(function (Person $p) { return $p->getId(); })
->toArray();
$this->logger->notice(
"[Privacy Event] An accompanying period has been viewed",
'[Privacy Event] An accompanying period has been viewed',
array_merge($involved, $event->getArgs())
);
}
@@ -92,14 +96,14 @@ class PrivacyEventSubscriber implements EventSubscriberInterface
$involved['person_id'] = $event->getPerson()->getId();
if ($event->hasPersons()) {
$involved['persons'] = \array_map(
function(Person $p) { return $p->getId(); },
$involved['persons'] = array_map(
function (Person $p) { return $p->getId(); },
$event->getPersons()
);
}
$this->logger->notice(
"[Privacy Event] A Person Folder has been viewed",
'[Privacy Event] A Person Folder has been viewed',
array_merge($involved, $event->getArgs())
);
}