GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Export   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 4
dl 0
loc 66
ccs 0
cts 19
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A handle() 0 8 1
A export() 0 13 2
1
<?php
2
3
namespace Talal\Exporter\Console\Command;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Filesystem\Filesystem;
7
use Talal\Exporter\Exporter;
8
9
class Export extends Command
10
{
11
    /**
12
     * The name and signature of the console command.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'env:export {server : A supported web server} 
17
                                       {--file=.env : The environment file}';
18
19
    /**
20
     * The console command description.
21
     *
22
     * @var string
23
     */
24
    protected $description = 'Export the environment file to a capable web server format.';
25
26
    /**
27
     * @var \Illuminate\Filesystem\Filesystem
28
     */
29
    protected $filesystem;
30
31
    /**
32
     * Create a new export command instance.
33
     *
34
     * @param \Illuminate\Filesystem\Filesystem $filesystem
35
     */
36
    public function __construct(Filesystem $filesystem)
37
    {
38
        $this->filesystem = $filesystem;
39
40
        parent::__construct();
41
    }
42
43
    /**
44
     * Execute the console command.
45
     */
46
    public function handle()
47
    {
48
        $fileContents = $this->filesystem->get(
49
            $this->laravel->basePath() . '/' . $this->option('file')
50
        );
51
52
        $this->export($fileContents);
53
    }
54
55
    /**
56
     * Export the environment file.
57
     *
58
     * @param $fileContents
59
     * @return int
60
     */
61
    protected function export($fileContents)
62
    {
63
        $server = strtolower($this->argument('server'));
64
        $server = sprintf('Talal\Exporter\Output\%s', ucfirst($server));
65
66
        if (! class_exists($server)) {
67
            $this->error('The provided server is not exportable.');
68
            return 0;
69
        }
70
71
        $exporter = new Exporter(new $server($fileContents));
72
        $this->line($exporter->output());
73
    }
74
}
75