Code Duplication    Length = 13-19 lines in 2 locations

src/Description/Builder/OpenApiBuilder.php 1 location

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

src/Description/Builder/RamlBuilder.php 1 location

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