File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 22
33namespace Ray \WebContextParam \Annotation ;
44
5+ use function is_array ;
6+ use function is_string ;
7+
58abstract class AbstractWebContextParam
69{
710 /**
@@ -24,13 +27,18 @@ abstract class AbstractWebContextParam
2427 public $ param ;
2528
2629 /**
27- * @param array $values{key?: string, param?: string}
28- * @param string $key
29- * @param string $param
30+ * @param string|array{key?: string, param?: string} $values
3031 */
31- public function __construct (array $ values = [], $ key = '' , $ param = '' )
32+ public function __construct ($ key )
3233 {
33- $ this ->key = isset ($ values ['key ' ]) ? $ values ['key ' ] : $ key ;
34- $ this ->param = isset ($ values ['param ' ]) ? $ values ['param ' ] : $ param ;
34+ if (is_array ($ key )) {
35+ $ this ->key = $ key ['key ' ];
36+ $ this ->param = $ key ['param ' ];
37+
38+ return ;
39+ }
40+ if (is_string ($ key )) {
41+ $ this ->key = $ key ;
42+ }
3543 }
3644}
You can’t perform that action at this time.
0 commit comments