1 | <?php |
||
36 | class BaseService extends BaseObject |
||
37 | { |
||
38 | use TypeConverter; |
||
39 | |||
40 | /** |
||
41 | * @var string namespace used for key generation |
||
42 | */ |
||
43 | public $namespace = ''; |
||
44 | |||
45 | /** |
||
46 | * @var Connection|array|string the MySql DB connection object or the application component ID of the DB connection. |
||
47 | */ |
||
48 | protected $db; |
||
49 | |||
50 | /** |
||
51 | * @inheritdoc |
||
52 | */ |
||
53 | public function init() |
||
58 | |||
59 | /** |
||
60 | * Compute etag based on model attributes |
||
61 | * @param BaseModelInterface $model |
||
62 | * @return string |
||
63 | * @since 1.0.0 |
||
64 | */ |
||
65 | protected function computeEtag(BaseModelInterface $model) |
||
69 | |||
70 | /** |
||
71 | * Encode attributes array |
||
72 | * |
||
73 | * @param array $attributes |
||
74 | * |
||
75 | * @return string |
||
76 | * @since 1.0.0 |
||
77 | */ |
||
78 | protected function encodeAttributes(Array $attributes) |
||
84 | |||
85 | } |
||
86 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: