1 | <?php |
||
13 | final class PagerComponentFactory implements ComponentFactoryInterface |
||
14 | { |
||
15 | use OptionsTrait; |
||
16 | |||
17 | public const OPT_DEFAULT_PAGESIZE = 'default_size'; |
||
18 | public const OPT_AVAILABLE_PAGESIZES = 'available_sizes'; |
||
19 | public const OPT_ENABLED = 'enabled'; |
||
20 | public const OPT_TOTAL_ITEMS = 'total_items'; |
||
21 | public const OPT_DELTA = 'delta'; |
||
22 | |||
23 | /** |
||
24 | * @var PagerUriManagerInterface |
||
25 | */ |
||
26 | private $uriManager; |
||
27 | |||
28 | /** |
||
29 | * PagerComponentFactory constructor. |
||
30 | * @param array $options |
||
31 | * @param PagerUriManagerInterface|null $uriManager |
||
32 | */ |
||
33 | public function __construct(array $options = [], PagerUriManagerInterface $uriManager = null) |
||
38 | |||
39 | /** |
||
40 | * @param array $options |
||
41 | * @return array |
||
42 | * @throws \Symfony\Component\OptionsResolver\Exception\AccessException |
||
43 | * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException |
||
44 | * @throws \Symfony\Component\OptionsResolver\Exception\MissingOptionsException |
||
45 | * @throws \Symfony\Component\OptionsResolver\Exception\NoSuchOptionException |
||
46 | * @throws \Symfony\Component\OptionsResolver\Exception\OptionDefinitionException |
||
47 | * @throws \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException |
||
48 | */ |
||
49 | protected function resolveOptions(array $options): array |
||
72 | |||
73 | /** |
||
74 | * @inheritDoc |
||
75 | */ |
||
76 | public function supports(string $name): bool |
||
80 | |||
81 | /** |
||
82 | * @inheritDoc |
||
83 | * @return PagerComponent |
||
84 | */ |
||
85 | public function createComponent(UriInterface $uri, array $options = []): ComponentInterface |
||
113 | |||
114 | /** |
||
115 | * @param UriInterface $uri |
||
116 | * @param int|null $currentSize |
||
117 | * @param array $sizes |
||
118 | * @return PageSize[] |
||
119 | */ |
||
120 | private function createPageSizes(UriInterface $uri, ?int $currentSize, array $sizes): array |
||
133 | } |
||
134 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: