1 | <?php |
||
26 | class Update extends CreateModel |
||
27 | { |
||
28 | use SiteSettingAttributesTrait { |
||
29 | normalizeSiteConfig as parentNormalizeSiteConfig; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * These are the default body params that we're accepting. You can lock down specific Client attributes this way. |
||
34 | * |
||
35 | * @return array |
||
36 | */ |
||
37 | public $validBodyParams = [ |
||
38 | 'defaultUserState' |
||
39 | ]; |
||
40 | |||
41 | /** |
||
42 | * @inheritdoc |
||
43 | */ |
||
44 | public $statusCodeSuccess = 200; |
||
45 | |||
46 | /** |
||
47 | * @param array $config |
||
48 | * @return array |
||
49 | */ |
||
50 | protected function normalizeSiteConfig($config = []): array |
||
59 | |||
60 | /** |
||
61 | * @inheritdoc |
||
62 | * @param Settings $model |
||
63 | * @throws \Throwable |
||
64 | */ |
||
65 | protected function performAction(Model $model): bool |
||
79 | |||
80 | /** |
||
81 | * @inheritdoc |
||
82 | * @return Settings |
||
83 | */ |
||
84 | protected function newModel(array $config = []): Model |
||
88 | |||
89 | |||
90 | /******************************************* |
||
91 | * POPULATE |
||
92 | *******************************************/ |
||
93 | |||
94 | /** |
||
95 | * @inheritdoc |
||
96 | * @param Settings $model |
||
97 | * @return Settings |
||
98 | */ |
||
99 | protected function populate(Model $model): Model |
||
107 | |||
108 | /** |
||
109 | * @param Settings $model |
||
110 | * @return Settings |
||
111 | */ |
||
112 | private function populateSiteLayout(Settings $model): Settings |
||
120 | |||
121 | /** |
||
122 | * @param Settings $model |
||
123 | * @return Settings |
||
124 | */ |
||
125 | private function populateSiteSettings(Settings $model): Settings |
||
144 | } |
||
145 |
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.