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

@@ -18,26 +18,24 @@ declare(strict_types=1);
namespace Chill\MainBundle\Form\DataTransformer;
use Closure;
use Doctrine\Persistence\ObjectRepository;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
use function call_user_func;
/**
* @template T
*/
class IdToEntityDataTransformer implements DataTransformerInterface
{
private readonly Closure $getId;
private readonly \Closure $getId;
/**
* @param Closure $getId
* @param \Closure $getId
*/
public function __construct(
private readonly ObjectRepository $repository,
private readonly bool $multiple = false,
?callable $getId = null
callable $getId = null
) {
$this->getId = $getId ?? static fn (object $o) => $o->getId();
}
@@ -82,7 +80,7 @@ class IdToEntityDataTransformer implements DataTransformerInterface
$ids = [];
foreach ($value as $v) {
$ids[] = $id = call_user_func($this->getId, $v);
$ids[] = $id = \call_user_func($this->getId, $v);
if (null === $id) {
throw new TransformationFailedException('id is null');
@@ -96,7 +94,7 @@ class IdToEntityDataTransformer implements DataTransformerInterface
return '';
}
$id = call_user_func($this->getId, $value);
$id = \call_user_func($this->getId, $value);
if (null === $id) {
throw new TransformationFailedException('id is null');