| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 1 | public static function get($tableName) |
|
| 30 | { |
||
| 31 | 1 | if (isset(static::$tables[$tableName])) { |
|
| 32 | 1 | return static::$tables[$tableName]; |
|
| 33 | } |
||
| 34 | |||
| 35 | 1 | static::$tables[$tableName] = new AsyncTable( |
|
| 36 | 1 | Pool::getInstance(), |
|
|
|
|||
| 37 | 1 | $tableName, |
|
| 38 | 1 | App::className($tableName, 'Model/Table', 'Table') |
|
| 39 | 1 | ); |
|
| 40 | 1 | return static::$tables[$tableName]; |
|
| 41 | } |
||
| 42 | |||
| 66 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: