Passed
Push — master ( 9a6e88...b49093 )
by Denis
03:14
created

GetStat::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 10
rs 9.4285
1
<?php
2
3
namespace Ngtfkx\Laradeck\AddressGenerator\Commands;
4
5
use Illuminate\Console\Command;
1 ignored issue
show
Bug introduced by
The type Illuminate\Console\Command was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Illuminate\Support\Collection;
7
use Illuminate\Support\Facades\Storage;
8
use Ngtfkx\Laradeck\AddressGenerator\Generator;
9
use Symfony\Component\DomCrawler\Crawler;
1 ignored issue
show
Bug introduced by
The type Symfony\Component\DomCrawler\Crawler was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

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