@@ 51-63 (lines=13) @@ | ||
48 | * |
|
49 | * @return Path |
|
50 | */ |
|
51 | protected function createPath(string $pathName, \stdClass $definition, array $pathParameters = []) |
|
52 | { |
|
53 | /** @var Operation[] $operations */ |
|
54 | $operations = []; |
|
55 | foreach (self::$methodNames as $method) { |
|
56 | if (isset($definition->$method)) { |
|
57 | $operations[$method] = $this->createOperation($definition->$method, $pathName, $method); |
|
58 | } |
|
59 | } |
|
60 | $pathParameters = array_merge($pathParameters, $this->extractParameters($definition)); |
|
61 | ||
62 | return new Path($pathName, $operations, $pathParameters); |
|
63 | } |
|
64 | ||
65 | /** |
|
66 | * @param \stdClass $definition |
@@ 99-117 (lines=19) @@ | ||
96 | * |
|
97 | * @return Path |
|
98 | */ |
|
99 | protected function createPath(string $pathName, \stdClass $definition) |
|
100 | { |
|
101 | $pathParameters = $this->extractParameters($definition); |
|
102 | ||
103 | /** @var Operation[] $operations */ |
|
104 | $operations = []; |
|
105 | foreach (self::$methodNames as $method) { |
|
106 | if (isset($definition->$method)) { |
|
107 | $operations[$method] = $this->createOperation( |
|
108 | $definition->$method, |
|
109 | $pathName, |
|
110 | $method, |
|
111 | $pathParameters |
|
112 | ); |
|
113 | } |
|
114 | } |
|
115 | ||
116 | return new Path($pathName, $operations, $pathParameters, $this->extractExtensions($definition)); |
|
117 | } |
|
118 | ||
119 | /** |
|
120 | * @param \stdClass $definition |