Completed
Push — main ( a102d3...f9c7f4 )
by Emmanuel
03:55
created

TicketStatusInitialize   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 20 3
1
<?php
2
3
namespace Epmnzava\Eticket\Console;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Support\Facades\File;
7
8
class TicketStatusInitialize extends Command
9
{
10
    protected $signature = 'eticket:setstatus';
11
12
    protected $description = 'Set initial ticket statuses';
13
14
    public function handle()
15
    {
16
        $this->info('Begining to set ticket statuses');
17
18
19
        
20
        if (! $this->configExists('blogpackage.php')) {
0 ignored issues
show
Documentation Bug introduced by
The method configExists does not exist on object<Epmnzava\Eticket\...TicketStatusInitialize>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
21
            $this->publishConfiguration();
0 ignored issues
show
Documentation Bug introduced by
The method publishConfiguration does not exist on object<Epmnzava\Eticket\...TicketStatusInitialize>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
22
            $this->info('Published configuration');
23
        } else {
24
            if ($this->shouldOverwriteConfig()) {
0 ignored issues
show
Documentation Bug introduced by
The method shouldOverwriteConfig does not exist on object<Epmnzava\Eticket\...TicketStatusInitialize>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
25
                $this->info('Overwriting configuration file...');
26
                $this->publishConfiguration($force = true);
0 ignored issues
show
Documentation Bug introduced by
The method publishConfiguration does not exist on object<Epmnzava\Eticket\...TicketStatusInitialize>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
27
            } else {
28
                $this->info('Existing configuration was not overwritten');
29
            }
30
        }
31
        
32
        $this->info('End setting ticket status');
33
    }
34
    
35
   
36
}