Code Duplication    Length = 3-6 lines in 4 locations

lib/PhpParser/Node/Stmt/Class_.php 2 locations

@@ 51-53 (lines=3) @@
48
        $this->implements = isset($subNodes['implements']) ? $subNodes['implements'] : array();
49
        $this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
50
51
        if (null !== $this->name && isset(self::$specialNames[strtolower($this->name)])) {
52
            throw new Error(sprintf('Cannot use \'%s\' as class name as it is reserved', $this->name));
53
        }
54
55
        if (isset(self::$specialNames[strtolower($this->extends)])) {
56
            throw new Error(
@@ 55-60 (lines=6) @@
52
            throw new Error(sprintf('Cannot use \'%s\' as class name as it is reserved', $this->name));
53
        }
54
55
        if (isset(self::$specialNames[strtolower($this->extends)])) {
56
            throw new Error(
57
                sprintf('Cannot use \'%s\' as class name as it is reserved', $this->extends),
58
                $this->extends->getAttributes()
59
            );
60
        }
61
62
        foreach ($this->implements as $interface) {
63
            if (isset(self::$specialNames[strtolower($interface)])) {

lib/PhpParser/Node/Stmt/Interface_.php 1 location

@@ 34-36 (lines=3) @@
31
        $this->extends = isset($subNodes['extends']) ? $subNodes['extends'] : array();
32
        $this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
33
34
        if (isset(self::$specialNames[strtolower($this->name)])) {
35
            throw new Error(sprintf('Cannot use \'%s\' as class name as it is reserved', $this->name));
36
        }
37
38
        foreach ($this->extends as $interface) {
39
            if (isset(self::$specialNames[strtolower($interface)])) {

lib/PhpParser/Node/Stmt/Namespace_.php 1 location

@@ 33-38 (lines=6) @@
30
        $this->name = $name;
31
        $this->stmts = $stmts;
32
33
        if (isset(self::$specialNames[strtolower($this->name)])) {
34
            throw new Error(
35
                sprintf('Cannot use \'%s\' as namespace name', $this->name),
36
                $this->name->getAttributes()
37
            );
38
        }
39
40
        if (null !== $this->stmts) {
41
            foreach ($this->stmts as $stmt) {