Code Duplication    Length = 28-28 lines in 3 locations

lib/PhpParser/Node/Expr/MethodCall.php 1 location

@@ 8-35 (lines=28) @@
5
use PhpParser\Node\Arg;
6
use PhpParser\Node\Expr;
7
8
class MethodCall extends Expr
9
{
10
    /** @var Expr Variable holding object */
11
    public $var;
12
    /** @var string|Expr Method name */
13
    public $name;
14
    /** @var Arg[] Arguments */
15
    public $args;
16
17
    /**
18
     * Constructs a function call node.
19
     *
20
     * @param Expr        $var        Variable holding object
21
     * @param string|Expr $name       Method name
22
     * @param Arg[]       $args       Arguments
23
     * @param array       $attributes Additional attributes
24
     */
25
    public function __construct(Expr $var, $name, array $args = array(), array $attributes = array()) {
26
        parent::__construct($attributes);
27
        $this->var = $var;
28
        $this->name = $name;
29
        $this->args = $args;
30
    }
31
32
    public function getSubNodeNames() {
33
        return array('var', 'name', 'args');
34
    }
35
}
36

lib/PhpParser/Node/Expr/StaticCall.php 1 location

@@ 8-35 (lines=28) @@
5
use PhpParser\Node;
6
use PhpParser\Node\Expr;
7
8
class StaticCall extends Expr
9
{
10
    /** @var Node\Name|Expr Class name */
11
    public $class;
12
    /** @var string|Expr Method name */
13
    public $name;
14
    /** @var Node\Arg[] Arguments */
15
    public $args;
16
17
    /**
18
     * Constructs a static method call node.
19
     *
20
     * @param Node\Name|Expr $class      Class name
21
     * @param string|Expr    $name       Method name
22
     * @param Node\Arg[]     $args       Arguments
23
     * @param array          $attributes Additional attributes
24
     */
25
    public function __construct($class, $name, array $args = array(), array $attributes = array()) {
26
        parent::__construct($attributes);
27
        $this->class = $class;
28
        $this->name = $name;
29
        $this->args = $args;
30
    }
31
32
    public function getSubNodeNames() {
33
        return array('class', 'name', 'args');
34
    }
35
}
36

lib/PhpParser/Node/Expr/Ternary.php 1 location

@@ 7-34 (lines=28) @@
4
5
use PhpParser\Node\Expr;
6
7
class Ternary extends Expr
8
{
9
    /** @var Expr Condition */
10
    public $cond;
11
    /** @var null|Expr Expression for true */
12
    public $if;
13
    /** @var Expr Expression for false */
14
    public $else;
15
16
    /**
17
     * Constructs a ternary operator node.
18
     *
19
     * @param Expr      $cond       Condition
20
     * @param null|Expr $if         Expression for true
21
     * @param Expr      $else       Expression for false
22
     * @param array                    $attributes Additional attributes
23
     */
24
    public function __construct(Expr $cond, $if, Expr $else, array $attributes = array()) {
25
        parent::__construct($attributes);
26
        $this->cond = $cond;
27
        $this->if = $if;
28
        $this->else = $else;
29
    }
30
31
    public function getSubNodeNames() {
32
        return array('cond', 'if', 'else');
33
    }
34
}
35