1 | <?php |
||
30 | class ApiMediaType extends AbstractType implements LoggerAwareInterface |
||
31 | { |
||
32 | use LoggerAwareTrait; |
||
33 | |||
34 | /** |
||
35 | * @var Pool |
||
36 | */ |
||
37 | protected $mediaPool; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $class; |
||
43 | |||
44 | /** |
||
45 | * @param string $class |
||
46 | */ |
||
47 | public function __construct(Pool $mediaPool, $class) |
||
53 | |||
54 | public function buildForm(FormBuilderInterface $builder, array $options): void |
||
66 | |||
67 | public function configureOptions(OptionsResolver $resolver): void |
||
74 | |||
75 | public function getParent() |
||
79 | |||
80 | public function getBlockPrefix() |
||
84 | |||
85 | /** |
||
86 | * NEXT_MAJOR: Remove this method. |
||
87 | * |
||
88 | * @deprecated since sonata-project/media-bundle 3.22, to be removed in version 4.0. |
||
89 | */ |
||
90 | public function getName() |
||
94 | } |
||
95 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.