MultiAuthListThemes   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 85
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 3
dl 0
loc 85
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 19 2
A githubLinksForFreeThemes() 0 6 1
A listFreeThemes() 0 6 1
A listPaidThemes() 0 7 1
A listSupportedThemes() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: imokhles
5
 * Date: 2019-05-27
6
 * Time: 12:37
7
 */
8
9
namespace iMokhles\MultiAuthCommand\Command;
10
11
use Illuminate\Database\Console\Migrations\BaseCommand;
12
13
class MultiAuthListThemes extends BaseCommand
14
{
15
16
    /**
17
     * The name and signature of the console command.
18
     *
19
     * @var string
20
     */
21
    protected $signature = 'make:multi_auth:list_themes';
22
23
    /**
24
     * The console command description.
25
     *
26
     * @var string
27
     */
28
    protected $description = 'list MultiAuthCommand supported themes';
29
30
    /**
31
     * @var
32
     */
33
    protected $progressBar;
34
35
    /**
36
     * Execute the console command.
37
     *
38
     * @return boolean
39
     */
40
    public function handle()
41
    {
42
        $themes = self::listSupportedThemes();
43
44
        $this->progressBar = $this->output->createProgressBar(count($themes));
45
        $this->progressBar->start();
46
47
        $this->line(" Listing supported themes. Please wait...");
48
        $this->progressBar->advance();
49
50
        foreach ($themes as $theme => $link) {
51
            $this->line(" THEME_NAME: $theme\nTHEME_LINK: $link\n");
52
            $this->progressBar->advance();
53
        }
54
55
        $this->progressBar->finish();
56
        $this->info(" Finished  listed themes.");
57
        return true;
58
    }
59
60
    /**
61
     * @return array
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<string,string>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
62
     */
63
    public static function githubLinksForFreeThemes() {
64
        return [
65
            'adminlte2' => 'https://github.com/ColorlibHQ/AdminLTE/archive/master.zip',
66
            'tabler' => 'https://github.com/tabler/tabler/archive/master.zip',
67
        ];
68
    }
69
70
    /**
71
     * @return array
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<string,string>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
72
     */
73
    public static function listFreeThemes() {
74
        return [
75
            'adminlte2' => 'https://adminlte.io/themes/AdminLTE/index2.html',
76
            'tabler' => 'https://preview.tabler.io/',
77
        ];
78
    }
79
80
    /**
81
     * @return array
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<string,string>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
82
     */
83
    public static function listPaidThemes() {
84
        return [
85
            'highadmin' => 'https://themeforest.net/item/highdmin-responsive-bootstrap-4-admin-dashboard/21233941',
86
            'startui' => 'https://themeforest.net/item/startui-premium-bootstrap-4-admin-dashboard-template/15228250',
87
            'oneui' => 'https://themeforest.net/item/oneui-bootstrap-admin-dashboard-template-ui-framework-angularjs/11820082',
88
        ];
89
    }
90
    /**
91
     * @return array
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<string,string>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
92
     */
93
    public static function listSupportedThemes() {
94
95
        return array_merge(self::listFreeThemes(), self::listPaidThemes());
96
    }
97
}