Code Duplication    Length = 5-6 lines in 2 locations

src/Description/Description.php 1 location

@@ 121-125 (lines=5) @@
118
     */
119
    public function getPath(string $path): Path
120
    {
121
        if (!isset($this->paths[$path])) {
122
            throw new \InvalidArgumentException(
123
                "Path '$path' does not exist (have " . implode(', ', array_keys($this->paths)) . ')'
124
            );
125
        }
126
127
        return $this->paths[$path];
128
    }

src/Description/Path.php 1 location

@@ 91-96 (lines=6) @@
88
    {
89
        $method = strtolower($method);
90
91
        if (!isset($this->operations[$method])) {
92
            throw new \InvalidArgumentException(
93
                "Path '{$this->getPath()}' does not support '$method'" .
94
                " (supports " . implode(', ', array_keys($this->operations)) . ')'
95
            );
96
        }
97
98
        return $this->operations[$method];
99
    }