Test Failed
Pull Request — master (#88)
by Artem
04:05
created

ListAll::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 0
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Slides\Saml2\Commands;
4
5
use Slides\Saml2\Repositories\TenantRepository;
0 ignored issues
show
Bug introduced by
The type Slides\Saml2\Repositories\TenantRepository 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
7
class ListAll extends \Illuminate\Console\Command
8
{
9
    use RendersTenants;
0 ignored issues
show
introduced by
The trait Slides\Saml2\Commands\RendersTenants requires some properties which are not provided by Slides\Saml2\Commands\ListAll: $uuid, $relay_state_url, $idp_x509_cert, $key, $idp_entity_id, $id, $name_id_format, $metadata, $created_at, $idp_logout_url, $idp_login_url, $updated_at, $deleted_at
Loading history...
10
11
    /**
12
     * The name and signature of the console command.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'saml2:idp-list';
17
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'List all the tenants';
24
25
    /**
26
     * @var TenantRepository
27
     */
28
    protected TenantRepository $tenants;
29
30
    /**
31
     * DeleteTenant constructor.
32
     *
33
     * @param TenantRepository $tenants
34
     */
35
    public function __construct(TenantRepository $tenants)
36
    {
37
        $this->tenants = $tenants;
38
39
        parent::__construct();
40
    }
41
42
    /**
43
     * Execute the console command.
44
     *
45
     * @return void
46
     */
47
    public function handle()
48
    {
49
        $tenants = $this->tenants->all();
50
51
        if ($tenants->isEmpty()) {
52
            $this->info('No tenants found');
53
            return;
54
        }
55
56
        $this->renderTenants($tenants);
57
    }
58
}
59