Skip to content

Instantly share code, notes, and snippets.

@young-steveo
Last active June 20, 2018 17:37
Show Gist options
  • Save young-steveo/e027611f48f3d82280fe54a8533e9235 to your computer and use it in GitHub Desktop.
Save young-steveo/e027611f48f3d82280fe54a8533e9235 to your computer and use it in GitHub Desktop.
Array Oriented Programming - Search Params
<?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