Last active
June 20, 2018 17:38
-
-
Save young-steveo/f8dd1288ccd025fab96848a1e3901679 to your computer and use it in GitHub Desktop.
Bad Example
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 | |
if (empty($data["username"])) { | |
throw new \Exception("Username is required."); | |
} | |
if (empty($data["name"])) { | |
$first = $data["first_name"] ?? ''; | |
$last = $data["last_name"] ?? ''; | |
$data["name"] = "$first $last"; | |
} | |
$params = new SearchParams($data['username'], $data['name']); | |
$model = new User(); | |
$result = $model->search($params); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment