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