Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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