File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -36,4 +36,10 @@ interface Event extends IO
3636 * @return string snake_case
3737 */
3838 public function getName (): string ;
39+
40+ public function setLanguage (string $ lang );
41+ public function setPageLocation (string $ url );
42+ public function setPageReferrer (string $ url );
43+ public function setPageTitle (string $ title );
44+ public function setScreenResolution (string $ wxh );
3945}
Original file line number Diff line number Diff line change 77
88abstract class AbstractEvent extends AbstractIO implements Event
99{
10+ protected null |string $ language ;
11+ protected null |string $ page_location ;
12+ protected null |string $ page_referrer ;
13+ protected null |string $ page_title ;
14+ protected null |string $ screen_resolution ;
15+
16+ public function setLanguage (string $ lang )
17+ {
18+ $ this ->language = $ lang ;
19+ return $ this ;
20+ }
21+
22+ public function setPageLocation (string $ url )
23+ {
24+ $ this ->page_location = $ url ;
25+ return $ this ;
26+ }
27+
28+ public function setPageReferrer (string $ url )
29+ {
30+ $ this ->page_referrer = $ url ;
31+ return $ this ;
32+ }
33+
34+ public function setPageTitle (string $ title )
35+ {
36+ $ this ->page_title = $ title ;
37+ return $ this ;
38+ }
39+
40+ public function setScreenResolution (string $ wxh )
41+ {
42+ $ this ->screen_resolution = $ wxh ;
43+ return $ this ;
44+ }
45+
1046 public function toArray (): array
1147 {
1248 $ return = [];
@@ -34,6 +70,21 @@ public function toArray(): array
3470 return $ return ;
3571 }
3672
73+ public function getAllParams (): array
74+ {
75+ return array_unique (array_merge (
76+ [
77+ 'language ' ,
78+ 'page_location ' ,
79+ 'page_referrer ' ,
80+ 'page_title ' ,
81+ 'screen_resolution ' ,
82+ ],
83+ $ this ->getParams (),
84+ $ this ->getRequiredParams ()
85+ ));
86+ }
87+
3788 public static function new (): static
3889 {
3990 return new static ();
You can’t perform that action at this time.
0 commit comments