LaravelCafebazaarConsole::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Nikandlv\LaravelCafebazaar;
4
5
use App\User;
6
use App\DripEmailer;
7
use Illuminate\Console\Command;
8
9
class LaravelCafebazaarConsole extends Command {
10
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'Cafebazaar {action}';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Cafebazaar console commands';
23
24
    /**
25
     * Create a new command instance.
26
     *
27
     */
28
    public function __construct()
29
    {
30
        parent::__construct();
31
    }
32
33
    /**
34
     * Execute the console command.
35
     *
36
     * @return mixed
37
     */
38
    public function handle()
39
    {
40
        $action = $this->argument('action');
41
        $client_id = config('laravel-cafebazaar.client_id');
42
        $redirect_uri = config('laravel-cafebazaar.redirect_uri');
43
        switch($action) {
44
            case 'code':
45
                echo "Visit this and grant access\n";
46
                echo "https://pardakht.cafebazaar.ir/devapi/v2/auth/authorize/?response_type=code&access_type=offline&redirect_uri=$redirect_uri&client_id=$client_id\n";
47
                break;
48
        }
49
    }
50
}