Test Failed
Branch master (52949b)
by Artem
05:53
created

ListTenants::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Slides\Saml2\Commands;
4
5
use Slides\Saml2\Repositories\TenantRepository;
6
7
/**
8
 * Class ListTenants
9
 *
10
 * @package Slides\Saml2\Commands
11
 */
12
class ListTenants extends \Illuminate\Console\Command
0 ignored issues
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...
13
{
14
    use RendersTenants;
15
16
    /**
17
     * The name and signature of the console command.
18
     *
19
     * @var string
20
     */
21
    protected $signature = 'saml2:list-tenants';
22
23
    /**
24
     * The console command description.
25
     *
26
     * @var string
27
     */
28
    protected $description = 'List all the tenants';
29
30
    /**
31
     * @var TenantRepository
32
     */
33
    protected $tenants;
34
35
    /**
36
     * DeleteTenant constructor.
37
     *
38
     * @param TenantRepository $tenants
39
     */
40
    public function __construct(TenantRepository $tenants)
41
    {
42
        $this->tenants = $tenants;
43
44
        parent::__construct();
45
    }
46
47
    /**
48
     * Execute the console command.
49
     *
50
     * @return void
51
     */
52
    public function handle()
53
    {
54
        $tenants = $this->tenants->all();
55
56
        if($tenants->isEmpty()) {
57
            $this->info('No tenants found');
58
            return;
59
        }
60
61
        $this->renderTenants($tenants);
62
    }
63
}