Catch_::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 6
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 6
loc 6
rs 9.4285
cc 1
eloc 5
nc 1
nop 4
1
<?php
2
3
namespace PhpParser\Node\Stmt;
4
5
use PhpParser\Node;
6
7 View Code Duplication
class Catch_ extends Node\Stmt
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    /** @var Node\Name Class of exception */
10
    public $type;
11
    /** @var string Variable for exception */
12
    public $var;
13
    /** @var Node[] Statements */
14
    public $stmts;
15
16
    /**
17
     * Constructs a catch node.
18
     *
19
     * @param Node\Name $type       Class of exception
20
     * @param string    $var        Variable for exception
21
     * @param Node[]    $stmts      Statements
22
     * @param array     $attributes Additional attributes
23
     */
24
    public function __construct(Node\Name $type, $var, array $stmts = array(), array $attributes = array()) {
25
        parent::__construct($attributes);
26
        $this->type = $type;
27
        $this->var = $var;
28
        $this->stmts = $stmts;
29
    }
30
31
    public function getSubNodeNames() {
32
        return array('type', 'var', 'stmts');
33
    }
34
}
35