1 | <?php |
||
30 | class Users extends Mapper |
||
31 | { |
||
32 | use Traits\UrlHelper; |
||
33 | |||
34 | /** |
||
35 | * Fields and their visibility to clients, boolean or string of visible field name |
||
36 | * |
||
37 | * @var array $fieldsVisible |
||
38 | */ |
||
39 | public $fieldsVisible = [ |
||
40 | 'uuid' => 'id', |
||
41 | 'password' => false, |
||
42 | 'scopes' => false, |
||
43 | 'login_count' => false, |
||
44 | ]; |
||
45 | |||
46 | /** |
||
47 | * Fields that are editable to clients, boolean or string of visible field name |
||
48 | * |
||
49 | * @var array $fieldsEditable |
||
50 | */ |
||
51 | public $fieldsEditable = [ |
||
52 | 'email', |
||
53 | 'firstname', |
||
54 | 'lastname', |
||
55 | 'password_question', |
||
56 | 'password_answer', |
||
57 | ]; |
||
58 | |||
59 | /** |
||
60 | * Filter rules for fields |
||
61 | * |
||
62 | * @var array $filterRules |
||
63 | * @link https://github.com/Wixel/GUMP |
||
64 | */ |
||
65 | public $filterRules = [ |
||
66 | 'uuid' => 'trim|sanitize_string|lower', |
||
67 | 'password' => 'trim|sanitize_string', |
||
68 | 'email' => 'trim|sanitize_string|sanitize_email|lower', |
||
69 | 'firstname' => 'trim|sanitize_string', |
||
70 | 'lastname' => 'trim|sanitize_string', |
||
71 | 'scopes' => 'trim|sanitize_string|lower', |
||
72 | 'status' => 'trim|sanitize_string|lower', |
||
73 | 'password_question' => 'trim|sanitize_string', |
||
74 | 'password_answer' => 'trim|sanitize_string', |
||
75 | 'created' => 'trim|sanitize_string', |
||
76 | 'login_count' => 'sanitize_numbers|whole_number', |
||
77 | 'login_last' => 'trim|sanitize_string', |
||
78 | ]; |
||
79 | |||
80 | /** |
||
81 | * Validation rules for fields |
||
82 | * |
||
83 | * @var array $validationRules |
||
84 | * @link https://github.com/Wixel/GUMP |
||
85 | */ |
||
86 | public $validationRules = [ |
||
87 | 'uuid' => 'alpha_dash', |
||
88 | 'email' => 'valid_email', |
||
89 | 'firstname' => 'valid_name', |
||
90 | ]; |
||
91 | |||
92 | protected $profileImageFileName = 'profile.png'; |
||
93 | |||
94 | /** |
||
95 | * Return the on-the-fly dynamic image generation URL path |
||
96 | * |
||
97 | * @param array $params params to url |
||
98 | * @return string return the url path or false if not exists |
||
99 | */ |
||
100 | public function profileImageUrlDynamic(array $params = []): string |
||
105 | |||
106 | /** |
||
107 | * Return the URL path to the image if exists or false |
||
108 | * |
||
109 | * @param null|string $uuid the user uuid |
||
110 | * @return string return the url path or false if not exists |
||
111 | */ |
||
112 | public function profileImageUrlPath($filename = null): string |
||
120 | |||
121 | /** |
||
122 | * Create if needed, and return the dir to the user profile image |
||
123 | * |
||
124 | * @return string $dir to the profile image |
||
125 | */ |
||
126 | public function profileImageDirPath(): string |
||
135 | |||
136 | /** |
||
137 | * Create if needed, and return the path to the user profile image |
||
138 | * |
||
139 | * @param null|string $filename filename for image |
||
140 | * @return string $path to the profile image |
||
141 | */ |
||
142 | public function profileImageFilePath($filename = null): string |
||
149 | |||
150 | /** |
||
151 | * Return the URL path to the image if exists or false |
||
152 | * |
||
153 | * @param string $uuid the user uuid |
||
154 | * @return null|string $path to the profile image |
||
155 | * @return bool true if the profile image exists |
||
156 | */ |
||
157 | public function profileImageExists($filename = null) |
||
161 | |||
162 | /** |
||
163 | * Return the URL path to the image if exists or false |
||
164 | * |
||
165 | * @param null|string $uuid the user uuid |
||
166 | * @return false|string return the url path or false if not exists |
||
167 | */ |
||
168 | public function profileImageUrl($filename = null) |
||
176 | |||
177 | |||
178 | /** |
||
179 | * Create profile image from given file |
||
180 | * |
||
181 | * @param string $file path to file |
||
182 | * @return boolean if the file was written and and asset record created |
||
183 | */ |
||
184 | public function profileImageCreate($file) |
||
244 | } |
||
245 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: