Code Duplication    Length = 11-11 lines in 2 locations

src/Visitor/AddProxiedMethods.php 2 locations

@@ 84-94 (lines=11) @@
81
     * @param Node\Stmt\ClassMethod $method
82
     * @return Node\Stmt\ClassMethod
83
     */
84
    private function modifyReturnMethod(Node\Stmt\ClassMethod $method): Node\Stmt\ClassMethod
85
    {
86
        $method->setDocComment(PHPDoc::writeInheritdoc());
87
88
        $resolved = Expressions::resolveMethodCall('this', $this->resolverProperty, $this->resolveMethod);
89
        $stmt = new Node\Stmt\Return_(new Node\Expr\MethodCall($resolved, $method->name->name,
90
            $this->packMethodArgs($method)));
91
92
        $method->stmts[] = Expressions::throwExceptionOnNull($resolved, $stmt);
93
94
        return $method;
95
    }
96
97
    /**
@@ 101-111 (lines=11) @@
98
     * @param Node\Stmt\ClassMethod $method
99
     * @return Node\Stmt\ClassMethod
100
     */
101
    private function modifyExprMethod(Node\Stmt\ClassMethod $method): Node\Stmt\ClassMethod
102
    {
103
        $method->setDocComment(PHPDoc::writeInheritdoc());
104
105
        $resolved = Expressions::resolveMethodCall('this', $this->resolverProperty, $this->resolveMethod);
106
        $stmt = new Node\Stmt\Expression(new Node\Expr\MethodCall($resolved, $method->name->name,
107
            $this->packMethodArgs($method)));
108
109
        $method->stmts[] = Expressions::throwExceptionOnNull($resolved, $stmt);
110
111
        return $method;
112
    }
113
114
    /**