| Conditions | 3 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 30 | public static function getOrCreate($query, $count): QueryRecording |
||
| 31 | { |
||
| 32 | $item = static::get()->filter(['Query' => trim($query)])->first(); |
||
| 33 | if (!$item || !$item->exists()) { |
||
|
1 ignored issue
–
show
|
|||
| 34 | $item = static::create([ |
||
| 35 | 'Query' => $query, |
||
| 36 | ]); |
||
| 37 | } |
||
| 38 | $item->Results = $count; |
||
| 39 | |||
| 40 | $item->write(); |
||
| 41 | |||
| 42 | return $item; |
||
| 43 | } |
||
| 45 |