|
102 | 102 | /* Quirk to receive className, since it is hidden in a protected variable */ |
103 | 103 | $reflectionOfRoute = new \ReflectionObject($route); |
104 | 104 | $protectedCallable = $reflectionOfRoute->getProperty('callable'); |
105 | | - $protectedCallable->setAccessible(true); |
106 | 105 | $reflectionCallable = ($protectedCallable->getValue($route)); |
107 | 106 |
|
108 | 107 | /* Assume only one method per route call */ |
|
123 | 122 | $class = new $apiClassName($app->getContainer()); |
124 | 123 |
|
125 | 124 | if (!($class instanceof AbstractModelAPI)) { |
126 | | - $name = $class::class; |
| 125 | + $name_parts = explode('\\', $class::class); |
| 126 | + $name = end($name_parts); |
127 | 127 | $apiMethod = ($apiMethod == "processPost" && $name != "ImportFileHelperAPI") ? "actionPost" : $apiMethod; |
128 | | - $reflectionApiMethod = new ReflectionMethod($name, $apiMethod); |
| 128 | + $reflectionApiMethod = new ReflectionMethod($class::class, $apiMethod); |
129 | 129 | $paths[$path][$method]["description"] = OpenAPISchemaUtils::parsePhpDoc($reflectionApiMethod->getDocComment()); |
130 | 130 | $parameters = $class->getCreateValidFeatures(); |
131 | 131 | $properties = OpenAPISchemaUtils::makeProperties($parameters); |
|
135 | 135 | "properties" => $properties, |
136 | 136 | ]; |
137 | 137 | if ($method == "post") { |
138 | | - $reflectionMethodFormFields = new ReflectionMethod($name, "getFormFields"); |
| 138 | + $reflectionMethodFormFields = new ReflectionMethod($class::class, "getFormFields"); |
139 | 139 | $bodyDescription = OpenAPISchemaUtils::parsePhpDoc($reflectionMethodFormFields->getDocComment()); |
140 | 140 | $paths[$path][$method]["requestBody"] = [ |
141 | 141 | "description" => $bodyDescription, |
|
188 | 188 |
|
189 | 189 | /* Quick to find out if single parameter object is used */ |
190 | 190 | $singleObject = ((strstr($path, '/{id:')) !== false); |
191 | | - $name = substr($class->getDBAClass(), 4); |
| 191 | + $name_parts = explode('\\', $class->getDBAClass()); |
| 192 | + $name = end($name_parts); |
192 | 193 | $uri = $class->getBaseUri(); |
193 | 194 |
|
194 | 195 | $isRelation = (strstr($path, "/relationships/")) !== false; |
|
0 commit comments