Code Duplication    Length = 10-10 lines in 2 locations

src/PhpJsonRpc/Client/RequestBuilder.php 1 location

@@ 68-77 (lines=10) @@
65
     *
66
     * @return AbstractInvoke
67
     */
68
    private function preBuild(AbstractInvoke $invoke): AbstractInvoke
69
    {
70
        $result = $this->preBuild->handle(new BuilderContainer($this, $invoke));
71
72
        if ($result instanceof BuilderContainer) {
73
            return $result->getInvoke();
74
        }
75
76
        throw new \RuntimeException();
77
    }
78
}
79

src/PhpJsonRpc/Server/Processor.php 1 location

@@ 114-123 (lines=10) @@
111
     *
112
     * @return AbstractInvoke
113
     */
114
    private function preProcess(AbstractInvoke $invoke): AbstractInvoke
115
    {
116
        $result = $this->preProcess->handle(new ProcessorContainer($this, $invoke));
117
118
        if ($result instanceof ProcessorContainer) {
119
            return $result->getInvoke();
120
        }
121
122
        throw new \RuntimeException();
123
    }
124
125
    /**
126
     * @param Invoke\Invoke $unit