GetStat   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 26
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 10 2
1
<?php
2
3
namespace Ngtfkx\Laradeck\AddressGenerator\Commands;
4
5
use Illuminate\Console\Command;
6
use Ngtfkx\Laradeck\AddressGenerator\Generator;
7
8
/**
9
 * Статистика
10
 *
11
 * Class ParseCityAddressRu
12
 * @package Ngtfkx\Laradeck\AddressGenerator\Commands
13
 */
14
class GetStat extends Command
15
{
16
    /**
17
     * The name and signature of the console command.
18
     *
19
     * @var string
20
     */
21
    protected $signature = 'address:stat';
22
23
    /**
24
     * The console command description.
25
     *
26
     * @var string
27
     */
28
    protected $description = 'Get stat';
29
30
    public function handle()
31
    {
32
        $generator = new Generator();
33
34
        foreach ($generator->getCities() as $key => $city) {
35
            $generator->clearAddresses()->setCities($city)->getRandomAddress();
36
37
            $addresses = $generator->getAllAddresses()[$key];
38
39
            $this->info($city . '. Адресов: ' . number_format($addresses->count(), 0, '.', ' '));
40
        }
41
    }
42
}
43