Completed
Push — master ( cda577...82aa13 )
by Christian
02:25
created

ExistsCheck   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A checkEnv() 0 14 2
1
<?php
2
3
namespace N98\Magento\Command\System\Check\Env;
4
5
use N98\Magento\Command\System\Check\Result;
6
7
class ExistsCheck extends CheckAbstract
8
{
9
    /**
10
     * Check if env.php exists
11
     */
12
    public function checkEnv()
13
    {
14
        $result = $this->_results->createResult();
15
        if (file_exists($this->_envFilePath)) {
16
            $status = Result::STATUS_OK;
17
            $message = '<info>Env file <comment>app/etc/env.php</comment> found!</info>';
18
        } else {
19
            $status = Result::STATUS_ERROR;
20
            $message = '<error>Env file <comment>app/etc/env.php</comment> not found!</error>';
21
        }
22
23
        $result->setStatus($status);
24
        $result->setMessage($message);
25
    }
26
}
27