apply rules rector

This commit is contained in:
2023-07-19 22:48:26 +02:00
parent 6e6f19c499
commit 74ed34ba97
40 changed files with 250 additions and 697 deletions

View File

@@ -28,7 +28,6 @@ final readonly class FilterOrderGetActiveFilterHelper
/**
* Return all the data required to display the active filters
*
* @param FilterOrderHelper $filterOrderHelper
* @return array<array{label: string, value: string, position: string, name: string}>
*/
public function getActiveFilters(FilterOrderHelper $filterOrderHelper): array
@@ -65,7 +64,7 @@ final readonly class FilterOrderGetActiveFilterHelper
$value = $this->propertyAccessor->getValue($selected, $options['choice_label']);
} else {
if (!$selected instanceof \Stringable) {
throw new \UnexpectedValueException(sprintf("we are not able to transform the value of %s to a string. Implements \\Stringable or add a 'choice_label' option to the filterFormBuilder", get_class($selected)));
throw new \UnexpectedValueException(sprintf("we are not able to transform the value of %s to a string. Implements \\Stringable or add a 'choice_label' option to the filterFormBuilder", $selected::class));
}
$value = (string)$selected;

View File

@@ -23,10 +23,6 @@ class FilterOrderHelperBuilder
private array $dateRanges = [];
private FormFactoryInterface $formFactory;
private RequestStack $requestStack;
private ?array $searchBoxFields = null;
/**
@@ -44,12 +40,8 @@ class FilterOrderHelperBuilder
*/
private array $userPickers = [];
public function __construct(
FormFactoryInterface $formFactory,
RequestStack $requestStack,
) {
$this->formFactory = $formFactory;
$this->requestStack = $requestStack;
public function __construct(private FormFactoryInterface $formFactory, private RequestStack $requestStack)
{
}
public function addSingleCheckbox(string $name, string $label): self

View File

@@ -18,16 +18,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class FilterOrderHelperFactory implements FilterOrderHelperFactoryInterface
{
private FormFactoryInterface $formFactory;
private RequestStack $requestStack;
public function __construct(
FormFactoryInterface $formFactory,
RequestStack $requestStack,
) {
$this->formFactory = $formFactory;
$this->requestStack = $requestStack;
public function __construct(private FormFactoryInterface $formFactory, private RequestStack $requestStack)
{
}
public function create(string $context, ?array $options = []): FilterOrderHelperBuilder