1 | <?php |
||
22 | abstract class AbstractPersistence implements PersistenceInterface, DataPreProcessorInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var int |
||
26 | */ |
||
27 | protected $priority = 0; |
||
28 | |||
29 | /** |
||
30 | * This is the default option class, this property can be overridden in |
||
31 | * child classes to be mapped to another option definition. |
||
32 | * |
||
33 | * @var \Romm\Formz\Persistence\Option\DefaultOptionDefinition |
||
34 | */ |
||
35 | protected $options; |
||
36 | |||
37 | /** |
||
38 | * @param AbstractOptionDefinition $options |
||
39 | */ |
||
40 | final public function __construct(AbstractOptionDefinition $options) |
||
44 | |||
45 | /** |
||
46 | * Override if needed. |
||
47 | */ |
||
48 | public function initialize() |
||
51 | |||
52 | /** |
||
53 | * Returns the priority of the middleware. The higher the priority is, the |
||
54 | * earlier the persistence will be called. |
||
55 | * |
||
56 | * @return int |
||
57 | */ |
||
58 | public function getPriority() { |
||
61 | |||
62 | /** |
||
63 | * Will inject empty options if no option has been defined at all. |
||
64 | * |
||
65 | * @param DataPreProcessor $processor |
||
66 | */ |
||
67 | public static function dataPreProcessor(DataPreProcessor $processor) |
||
77 | |||
78 | /** |
||
79 | * Checks if the instance bound to the identifier object can be fetched, |
||
80 | * throws an exception otherwise. |
||
81 | * |
||
82 | * @param FormIdentifierObject $identifierObject |
||
83 | * @throws EntryNotFoundException |
||
84 | */ |
||
85 | protected function checkInstanceCanBeFetched(FormIdentifierObject $identifierObject) |
||
91 | } |
||
92 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.