Completed
Push — master ( f0c745...274b6a )
by Sergi Tur
01:40
created

__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Acacha\ForgePublish\Exceptions;
4
5
use Exception;
6
7
/**
8
 * Class EnvironemntVariableNotFoundException
9
 * @package Acacha\ForgePublish\Exceptions
10
 */
11
class EnvironmentVariableNotFoundException extends Exception
12
{
13
    /**
14
     * The output returned from the operation.
15
     *
16
     * @var array
17
     */
18
    public $output;
19
20
    /**
21
     * Create a new exception instance.
22
     *
23
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
24
     */
25
    public function __construct($env_var)
26
    {
27
        parent::__construct('Environment variable not found: ' . $env_var);
28
29
        $this->env_var = $env_var;
0 ignored issues
show
Bug introduced by
The property env_var does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
30
    }
31
32
    /**
33
     * The output returned from the operation.
34
     *
35
     * @return array
36
     */
37
    public function output()
38
    {
39
        return $this->output;
40
    }
41
}
42