File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,20 @@ public function __toString()
106106 }
107107
108108
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+
109123 /**
110124 * @return array<string, mixed>
111125 */
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ public function testFreelancer(): void
3535 Assert::same ('A ' , $ aresData ->psu (Ares \Data \SubjectFlag::RZP_4 ));
3636 Assert::same ('N ' , $ aresData ->psu (Ares \Data \SubjectFlag::NRPZS_5 ));
3737 Assert::same ('A ' , $ aresData ->psu (Ares \Data \SubjectFlag::RPDPH_6 ));
38+
39+ Assert::equal ($ aresData , unserialize (serialize ($ aresData )));
3840 }
3941
4042
You can’t perform that action at this time.
0 commit comments