Total Complexity | 3 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class AccountStatsRepository extends BaseRepository |
||
14 | { |
||
15 | public function model(): string |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * @param string $uuid |
||
22 | * @return \Illuminate\Database\Eloquent\Model|AccountStats|null |
||
23 | */ |
||
24 | public function createEmptyStatsForUuid(string $uuid): ?AccountStats |
||
25 | { |
||
26 | return $this->create([ |
||
27 | 'uuid' => $uuid, |
||
28 | 'count_search' => 0, |
||
29 | 'count_request' => 0, |
||
30 | 'time_search' => 0, |
||
31 | 'time_request' => 0, |
||
32 | ]); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Increment request counter. |
||
37 | * |
||
38 | * @param string $uuid User UUID |
||
39 | */ |
||
40 | public function incrementRequestCounter(string $uuid = ''): void |
||
47 | ]); |
||
48 | } |
||
50 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: