Completed
Push — master ( 277953...d7c954 )
by Бабичев
02:28 queued 10s
created

WarmUpCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 20
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 4 1
1
<?php
2
3
namespace Bavix\WalletVacuum\Commands;
4
5
use Bavix\Wallet\Models\Wallet;
6
use Illuminate\Console\Command;
7
8
class WarmUpCommand extends Command
9
{
10
11
    /**
12
     * @var string
13
     */
14
    protected $name = 'wallet:warm-up';
15
16
    /**
17
     * @var string
18
     */
19
    protected $description = 'Needed to quickly warm up the cache';
20
21
    /**
22
     * @return void
23
     */
24
    public function handle(): void
25
    {
26
        Wallet::query()->each(static function (Wallet $wallet) {
27
            return $wallet->refreshBalance();
28
        });
29
    }
30
31
}
32