Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 16 |
Ratio | 100 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
30 | View Code Duplication | public function lookupByScreenName($screen_name, $params = []) |
|
31 | { |
||
32 | $_screen_name = (string) $screen_name; |
||
33 | if (strlen($_screen_name) >= User::SCREEN_NAME_MINIMUM_LENGTH) { |
||
34 | $statement = $this->database()->prepare(" |
||
35 | SELECT * |
||
36 | FROM `" . $this->databaseTable() . "` |
||
37 | WHERE |
||
38 | `screen_name` = :screen_name |
||
39 | "); |
||
40 | if ($statement->execute(['screen_name' => $_screen_name])) { |
||
41 | return $this->instantiateObject($statement->fetch(), $params); |
||
42 | } |
||
43 | } |
||
44 | return null; |
||
45 | } |
||
46 | |||
52 |