Last active
June 20, 2018 17:37
-
-
Save young-steveo/e027611f48f3d82280fe54a8533e9235 to your computer and use it in GitHub Desktop.
Array Oriented Programming - Search Params
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 characters
<?php | |
final class SearchParams { | |
private $username; | |
private $name; | |
public function __construct(string $username, string $name) { | |
$this->username = $username; | |
$this->name = $name; | |
} | |
public function toArray() : array { | |
return [ | |
"username" => $this->username, | |
"name" => $this->name | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment