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,21 +1,26 @@
<?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\MainBundle\Security\Resolver;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\HasCenterInterface;
use Chill\MainBundle\Entity\HasCentersInterface;
use UnexpectedValueException;
class DefaultCenterResolver implements CenterResolverInterface
{
public function supports($entity, ?array $options = []): bool
public static function getDefaultPriority(): int
{
return $entity instanceof HasCenterInterface || $entity instanceof HasCentersInterface;
return -256;
}
/**
* @inheritDoc
*
* @param HasCenterInterface $entity
* @param array $options
*/
@@ -23,15 +28,17 @@ class DefaultCenterResolver implements CenterResolverInterface
{
if ($entity instanceof HasCenterInterface) {
return $entity->getCenter();
} elseif ($entity instanceof HasCentersInterface) {
return $entity->getCenters();
} else {
throw new \UnexpectedValueException("should be an instanceof");
}
if ($entity instanceof HasCentersInterface) {
return $entity->getCenters();
}
throw new UnexpectedValueException('should be an instanceof');
}
public static function getDefaultPriority(): int
public function supports($entity, ?array $options = []): bool
{
return -256;
return $entity instanceof HasCenterInterface || $entity instanceof HasCentersInterface;
}
}