Last active
November 23, 2020 11:37
-
-
Save RayhanYulanda/79ec1bfe302da41666698bb0bee2759c to your computer and use it in GitHub Desktop.
Revisions
-
RayhanYulanda revised this gist
Nov 23, 2020 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,4 @@ <?php class User { public $name; public $email; -
RayhanYulanda revised this gist
Nov 23, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,7 @@ public function formatJson() { } public function validate($data) { if (!isset($data['name'])) { new \Exception("Bad Request, User Requires A Name")}; if (!isset($data['email'])) { new \Exception("Bad Request, User Email Required")}; } } ?> -
RayhanYulanda revised this gist
Nov 23, 2020 . 1 changed file with 17 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,18 @@ <?php class User { public $name; public $email; public function __construct($data) { $this->name = $data['name']; $this->email = $data['email']; } public function formatJson() { return json_encode(['name' => $this->name, 'email' => $this->email]); } public function validate($data) { if (!isset($data['name'])) { new \Exception("Bad Request, User Requires A Name")}; if (!isset($data['email'])) { new \Exception("Bad Request, User Email Required"); } ?> -
RayhanYulanda created this gist
Nov 16, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ class User { }