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