apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -13,14 +13,9 @@ namespace Chill\PersonBundle\Form\ChoiceLoader;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Repository\PersonRepository;
use RuntimeException;
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
use function call_user_func;
use function count;
use function in_array;
/**
* Allow to load a list of person.
*/
@@ -32,7 +27,7 @@ class PersonChoiceLoader implements ChoiceLoaderInterface
public function __construct(
protected PersonRepository $personRepository,
?array $centers = null
array $centers = null
) {
if (null !== $centers) {
$this->centers = $centers;
@@ -46,7 +41,7 @@ class PersonChoiceLoader implements ChoiceLoaderInterface
{
return new \Symfony\Component\Form\ChoiceList\ArrayChoiceList(
$this->lazyLoadedPersons,
static fn (Person $p) => call_user_func($value, $p)
static fn (Person $p) => \call_user_func($value, $p)
);
}
@@ -68,9 +63,9 @@ class PersonChoiceLoader implements ChoiceLoaderInterface
if (
$this->hasCenterFilter()
&& !in_array($person->getCenter(), $this->centers, true)
&& !\in_array($person->getCenter(), $this->centers, true)
) {
throw new RuntimeException('chosen a person not in correct center');
throw new \RuntimeException('chosen a person not in correct center');
}
$choices[] = $person;
@@ -95,7 +90,7 @@ class PersonChoiceLoader implements ChoiceLoaderInterface
continue;
}
$id = call_user_func($value, $choice);
$id = \call_user_func($value, $choice);
$values[] = $id;
$this->lazyLoadedPersons[$id] = $choice;
}
@@ -108,6 +103,6 @@ class PersonChoiceLoader implements ChoiceLoaderInterface
*/
protected function hasCenterFilter()
{
return count($this->centers) > 0;
return \count($this->centers) > 0;
}
}