Code Duplication    Length = 13-19 lines in 2 locations

src/Description/Builder/RamlBuilder.php 1 location

@@ 49-61 (lines=13) @@
46
     *
47
     * @return Path
48
     */
49
    protected function createPath(string $pathName, \stdClass $definition, array $pathParameters = [])
50
    {
51
        /** @var Operation[] $operations */
52
        $operations = [];
53
        foreach (self::$methodNames as $method) {
54
            if (isset($definition->$method)) {
55
                $operations[$method] = $this->createOperation($definition->$method, $pathName, $method);
56
            }
57
        }
58
        $pathParameters = array_merge($pathParameters, $this->extractParameters($definition));
59
60
        return new Path($pathName, $operations, $pathParameters);
61
    }
62
63
    /**
64
     * @param \stdClass $definition

src/Description/Builder/OpenApiBuilder.php 1 location

@@ 81-99 (lines=19) @@
78
     *
79
     * @return Path
80
     */
81
    protected function createPath(string $pathName, \stdClass $definition)
82
    {
83
        $pathParameters = $this->extractParameters($definition);
84
85
        /** @var Operation[] $operations */
86
        $operations = [];
87
        foreach (self::$methodNames as $method) {
88
            if (isset($definition->$method)) {
89
                $operations[$method] = $this->createOperation(
90
                    $definition->$method,
91
                    $pathName,
92
                    $method,
93
                    $pathParameters
94
                );
95
            }
96
        }
97
98
        return new Path($pathName, $operations, $pathParameters, $this->extractExtensions($definition));
99
    }
100
101
    /**
102
     * @param \stdClass $definition