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

TenantCredentials::__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\Helpers\ConsoleHelper;
6
use Slides\Saml2\Repositories\TenantRepository;
7
8
/**
9
 * Class TenantCredentials
10
 *
11
 * @package Slides\Saml2\Commands
12
 */
13
class TenantCredentials 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...
14
{
15
    use RendersTenants;
16
17
    /**
18
     * The name and signature of the console command.
19
     *
20
     * @var string
21
     */
22
    protected $signature = 'saml2:tenant-credentials {id}';
23
24
    /**
25
     * The console command description.
26
     *
27
     * @var string
28
     */
29
    protected $description = 'List tenant credentials for IdP';
30
31
    /**
32
     * @var TenantRepository
33
     */
34
    protected $tenants;
35
36
    /**
37
     * DeleteTenant constructor.
38
     *
39
     * @param TenantRepository $tenants
40
     */
41
    public function __construct(TenantRepository $tenants)
42
    {
43
        $this->tenants = $tenants;
44
45
        parent::__construct();
46
    }
47
48
    /**
49
     * Execute the console command.
50
     *
51
     * @return void
52
     */
53
    public function handle()
54
    {
55
        if(!$tenant = $this->tenants->findById($this->argument('id'))) {
56
            $this->error('Cannot find a tenant #' . $this->argument('id'));
57
            return;
58
        }
59
60
        $this->renderTenants($tenant, 'The tenant model');
61
        $this->renderTenantCredentials($tenant);
62
63
        $this->output->newLine();
64
    }
65
}