File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,20 @@ public function __toString()
106
106
}
107
107
108
108
109
+ public function __serialize (): array
110
+ {
111
+ return $ this ->getData ();
112
+ }
113
+
114
+
115
+ public function __unserialize (array $ data ): void
116
+ {
117
+ foreach ($ data as $ name => $ value ) {
118
+ $ this ->$ name = $ value ;
119
+ }
120
+ }
121
+
122
+
109
123
/**
110
124
* @return array<string, mixed>
111
125
*/
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ public function testFreelancer(): void
35
35
Assert::same ('A ' , $ aresData ->psu (Ares \Data \SubjectFlag::RZP_4 ));
36
36
Assert::same ('N ' , $ aresData ->psu (Ares \Data \SubjectFlag::NRPZS_5 ));
37
37
Assert::same ('A ' , $ aresData ->psu (Ares \Data \SubjectFlag::RPDPH_6 ));
38
+
39
+ Assert::equal ($ aresData , unserialize (serialize ($ aresData )));
38
40
}
39
41
40
42
You can’t perform that action at this time.
0 commit comments