Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 3 |
Lines | 8 |
Ratio | 100 % |
1 | <?php |
||
31 | View Code Duplication | public static function byName($identifier, self & $return = null ) |
|
32 | { |
||
33 | // Get field record by identiifer column |
||
34 | $return = static::oneByColumn(new dbQuery(), self::$_primary, 'Name'); |
||
35 | |||
36 | // If only one argument is passed - return null, otherwise bool |
||
37 | return func_num_args() > 1 ? $return == null : $return; |
||
38 | } |
||
39 | } |
||
40 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.