1 | <?php |
||
12 | class SoftDeleteable implements Buildable, Extension |
||
13 | { |
||
14 | const MACRO_METHOD = 'softDelete'; |
||
15 | |||
16 | /** |
||
17 | * @var ExtensibleClassMetadata |
||
18 | */ |
||
19 | protected $classMetadata; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $fieldName; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $value; |
||
30 | |||
31 | /** |
||
32 | * @var bool |
||
33 | */ |
||
34 | protected $timeAware = false; |
||
35 | |||
36 | /** |
||
37 | * @param ExtensibleClassMetadata $classMetadata |
||
38 | * @param string $fieldName |
||
39 | */ |
||
40 | 4 | public function __construct(ExtensibleClassMetadata $classMetadata, $fieldName) |
|
45 | |||
46 | /** |
||
47 | * Return the name of the actual extension. |
||
48 | * |
||
49 | * @return string |
||
50 | */ |
||
51 | 2 | public function getExtensionName() |
|
55 | |||
56 | /** |
||
57 | * @param bool $value |
||
58 | * @return $this |
||
59 | */ |
||
60 | 1 | public function timeAware($value = true) |
|
66 | |||
67 | /** |
||
68 | * @return void |
||
69 | */ |
||
70 | 80 | public static function enable() |
|
83 | |||
84 | /** |
||
85 | * Execute the build process |
||
86 | */ |
||
87 | 2 | public function build() |
|
95 | } |
||
96 |
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.