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 | 'requireOwner', |
||
39 | 'uniqueOwner' |
||
40 | ]; |
||
41 | |||
42 | /** |
||
43 | * @inheritdoc |
||
44 | */ |
||
45 | public $statusCodeSuccess = 200; |
||
46 | |||
47 | /** |
||
48 | * @param array $config |
||
49 | * @return array |
||
50 | */ |
||
51 | protected function normalizeSiteConfig($config = []): array |
||
60 | |||
61 | /** |
||
62 | * @inheritdoc |
||
63 | * @param Settings $model |
||
64 | * @throws \Throwable |
||
65 | */ |
||
66 | protected function performAction(Model $model): bool |
||
80 | |||
81 | /** |
||
82 | * @inheritdoc |
||
83 | * @return Settings |
||
84 | */ |
||
85 | protected function newModel(array $config = []): Model |
||
89 | |||
90 | |||
91 | /******************************************* |
||
92 | * POPULATE |
||
93 | *******************************************/ |
||
94 | |||
95 | /** |
||
96 | * @inheritdoc |
||
97 | * @param Settings $model |
||
98 | * @return Settings |
||
99 | */ |
||
100 | protected function populate(Model $model): Model |
||
108 | |||
109 | /** |
||
110 | * @param Settings $model |
||
111 | * @return Settings |
||
112 | */ |
||
113 | private function populateSiteLayout(Settings $model): Settings |
||
121 | |||
122 | /** |
||
123 | * @param Settings $model |
||
124 | * @return Settings |
||
125 | */ |
||
126 | private function populateSiteSettings(Settings $model): Settings |
||
145 | } |
||
146 |
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.