Skip to content

Commit e11a427

Browse files
rainerCHwing328
andauthored
changed request method from protected to public (#7603)
* changed request method from protected to public * update samples Co-authored-by: William Cheng <[email protected]>
1 parent f30d6c8 commit e11a427

File tree

8 files changed

+40
-40
lines changed

8 files changed

+40
-40
lines changed

modules/openapi-generator/src/main/resources/php/api.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ use {{invokerPackage}}\ObjectSerializer;
406406
* @throws \InvalidArgumentException
407407
* @return \GuzzleHttp\Psr7\Request
408408
*/
409-
protected function {{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}})
409+
public function {{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}})
410410
{
411411
{{#vendorExtensions.x-group-parameters}}
412412
// unbox the parameters from the associative array

samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ function ($exception) {
297297
* @throws \InvalidArgumentException
298298
* @return \GuzzleHttp\Psr7\Request
299299
*/
300-
protected function call123TestSpecialTagsRequest($client)
300+
public function call123TestSpecialTagsRequest($client)
301301
{
302302
// verify the required parameter 'client' is set
303303
if ($client === null || (is_array($client) && count($client) === 0)) {

samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ function ($exception) {
288288
* @throws \InvalidArgumentException
289289
* @return \GuzzleHttp\Psr7\Request
290290
*/
291-
protected function fooGetRequest()
291+
public function fooGetRequest()
292292
{
293293

294294
$resourcePath = '/foo';

samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php

+15-15
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ function ($exception) {
292292
* @throws \InvalidArgumentException
293293
* @return \GuzzleHttp\Psr7\Request
294294
*/
295-
protected function fakeHealthGetRequest()
295+
public function fakeHealthGetRequest()
296296
{
297297

298298
$resourcePath = '/fake/health';
@@ -507,7 +507,7 @@ function ($exception) {
507507
* @throws \InvalidArgumentException
508508
* @return \GuzzleHttp\Psr7\Request
509509
*/
510-
protected function fakeHttpSignatureTestRequest($pet, $query_1 = null, $header_1 = null)
510+
public function fakeHttpSignatureTestRequest($pet, $query_1 = null, $header_1 = null)
511511
{
512512
// verify the required parameter 'pet' is set
513513
if ($pet === null || (is_array($pet) && count($pet) === 0)) {
@@ -783,7 +783,7 @@ function ($exception) {
783783
* @throws \InvalidArgumentException
784784
* @return \GuzzleHttp\Psr7\Request
785785
*/
786-
protected function fakeOuterBooleanSerializeRequest($body = null)
786+
public function fakeOuterBooleanSerializeRequest($body = null)
787787
{
788788

789789
$resourcePath = '/fake/outer/boolean';
@@ -1038,7 +1038,7 @@ function ($exception) {
10381038
* @throws \InvalidArgumentException
10391039
* @return \GuzzleHttp\Psr7\Request
10401040
*/
1041-
protected function fakeOuterCompositeSerializeRequest($outer_composite = null)
1041+
public function fakeOuterCompositeSerializeRequest($outer_composite = null)
10421042
{
10431043

10441044
$resourcePath = '/fake/outer/composite';
@@ -1293,7 +1293,7 @@ function ($exception) {
12931293
* @throws \InvalidArgumentException
12941294
* @return \GuzzleHttp\Psr7\Request
12951295
*/
1296-
protected function fakeOuterNumberSerializeRequest($body = null)
1296+
public function fakeOuterNumberSerializeRequest($body = null)
12971297
{
12981298

12991299
$resourcePath = '/fake/outer/number';
@@ -1548,7 +1548,7 @@ function ($exception) {
15481548
* @throws \InvalidArgumentException
15491549
* @return \GuzzleHttp\Psr7\Request
15501550
*/
1551-
protected function fakeOuterStringSerializeRequest($body = null)
1551+
public function fakeOuterStringSerializeRequest($body = null)
15521552
{
15531553

15541554
$resourcePath = '/fake/outer/string';
@@ -1755,7 +1755,7 @@ function ($exception) {
17551755
* @throws \InvalidArgumentException
17561756
* @return \GuzzleHttp\Psr7\Request
17571757
*/
1758-
protected function testBodyWithFileSchemaRequest($file_schema_test_class)
1758+
public function testBodyWithFileSchemaRequest($file_schema_test_class)
17591759
{
17601760
// verify the required parameter 'file_schema_test_class' is set
17611761
if ($file_schema_test_class === null || (is_array($file_schema_test_class) && count($file_schema_test_class) === 0)) {
@@ -1973,7 +1973,7 @@ function ($exception) {
19731973
* @throws \InvalidArgumentException
19741974
* @return \GuzzleHttp\Psr7\Request
19751975
*/
1976-
protected function testBodyWithQueryParamsRequest($query, $user)
1976+
public function testBodyWithQueryParamsRequest($query, $user)
19771977
{
19781978
// verify the required parameter 'query' is set
19791979
if ($query === null || (is_array($query) && count($query) === 0)) {
@@ -2255,7 +2255,7 @@ function ($exception) {
22552255
* @throws \InvalidArgumentException
22562256
* @return \GuzzleHttp\Psr7\Request
22572257
*/
2258-
protected function testClientModelRequest($client)
2258+
public function testClientModelRequest($client)
22592259
{
22602260
// verify the required parameter 'client' is set
22612261
if ($client === null || (is_array($client) && count($client) === 0)) {
@@ -2537,7 +2537,7 @@ function ($exception) {
25372537
* @throws \InvalidArgumentException
25382538
* @return \GuzzleHttp\Psr7\Request
25392539
*/
2540-
protected function testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null)
2540+
public function testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null)
25412541
{
25422542
// verify the required parameter 'number' is set
25432543
if ($number === null || (is_array($number) && count($number) === 0)) {
@@ -2916,7 +2916,7 @@ function ($exception) {
29162916
* @throws \InvalidArgumentException
29172917
* @return \GuzzleHttp\Psr7\Request
29182918
*/
2919-
protected function testEnumParametersRequest($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg')
2919+
public function testEnumParametersRequest($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg')
29202920
{
29212921

29222922
$resourcePath = '/fake';
@@ -3219,7 +3219,7 @@ function ($exception) {
32193219
* @throws \InvalidArgumentException
32203220
* @return \GuzzleHttp\Psr7\Request
32213221
*/
3222-
protected function testGroupParametersRequest($associative_array)
3222+
public function testGroupParametersRequest($associative_array)
32233223
{
32243224
// unbox the parameters from the associative array
32253225
$required_string_group = array_key_exists('required_string_group', $associative_array) ? $associative_array['required_string_group'] : null;
@@ -3506,7 +3506,7 @@ function ($exception) {
35063506
* @throws \InvalidArgumentException
35073507
* @return \GuzzleHttp\Psr7\Request
35083508
*/
3509-
protected function testInlineAdditionalPropertiesRequest($request_body)
3509+
public function testInlineAdditionalPropertiesRequest($request_body)
35103510
{
35113511
// verify the required parameter 'request_body' is set
35123512
if ($request_body === null || (is_array($request_body) && count($request_body) === 0)) {
@@ -3728,7 +3728,7 @@ function ($exception) {
37283728
* @throws \InvalidArgumentException
37293729
* @return \GuzzleHttp\Psr7\Request
37303730
*/
3731-
protected function testJsonFormDataRequest($param, $param2)
3731+
public function testJsonFormDataRequest($param, $param2)
37323732
{
37333733
// verify the required parameter 'param' is set
37343734
if ($param === null || (is_array($param) && count($param) === 0)) {
@@ -3969,7 +3969,7 @@ function ($exception) {
39693969
* @throws \InvalidArgumentException
39703970
* @return \GuzzleHttp\Psr7\Request
39713971
*/
3972-
protected function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context)
3972+
public function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context)
39733973
{
39743974
// verify the required parameter 'pipe' is set
39753975
if ($pipe === null || (is_array($pipe) && count($pipe) === 0)) {

samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ function ($exception) {
297297
* @throws \InvalidArgumentException
298298
* @return \GuzzleHttp\Psr7\Request
299299
*/
300-
protected function testClassnameRequest($client)
300+
public function testClassnameRequest($client)
301301
{
302302
// verify the required parameter 'client' is set
303303
if ($client === null || (is_array($client) && count($client) === 0)) {

samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ function ($exception) {
269269
* @throws \InvalidArgumentException
270270
* @return \GuzzleHttp\Psr7\Request
271271
*/
272-
protected function addPetRequest($pet)
272+
public function addPetRequest($pet)
273273
{
274274
// verify the required parameter 'pet' is set
275275
if ($pet === null || (is_array($pet) && count($pet) === 0)) {
@@ -501,7 +501,7 @@ function ($exception) {
501501
* @throws \InvalidArgumentException
502502
* @return \GuzzleHttp\Psr7\Request
503503
*/
504-
protected function deletePetRequest($pet_id, $api_key = null)
504+
public function deletePetRequest($pet_id, $api_key = null)
505505
{
506506
// verify the required parameter 'pet_id' is set
507507
if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) {
@@ -776,7 +776,7 @@ function ($exception) {
776776
* @throws \InvalidArgumentException
777777
* @return \GuzzleHttp\Psr7\Request
778778
*/
779-
protected function findPetsByStatusRequest($status)
779+
public function findPetsByStatusRequest($status)
780780
{
781781
// verify the required parameter 'status' is set
782782
if ($status === null || (is_array($status) && count($status) === 0)) {
@@ -1046,7 +1046,7 @@ function ($exception) {
10461046
* @throws \InvalidArgumentException
10471047
* @return \GuzzleHttp\Psr7\Request
10481048
*/
1049-
protected function findPetsByTagsRequest($tags)
1049+
public function findPetsByTagsRequest($tags)
10501050
{
10511051
// verify the required parameter 'tags' is set
10521052
if ($tags === null || (is_array($tags) && count($tags) === 0)) {
@@ -1316,7 +1316,7 @@ function ($exception) {
13161316
* @throws \InvalidArgumentException
13171317
* @return \GuzzleHttp\Psr7\Request
13181318
*/
1319-
protected function getPetByIdRequest($pet_id)
1319+
public function getPetByIdRequest($pet_id)
13201320
{
13211321
// verify the required parameter 'pet_id' is set
13221322
if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) {
@@ -1560,7 +1560,7 @@ function ($exception) {
15601560
* @throws \InvalidArgumentException
15611561
* @return \GuzzleHttp\Psr7\Request
15621562
*/
1563-
protected function updatePetRequest($pet)
1563+
public function updatePetRequest($pet)
15641564
{
15651565
// verify the required parameter 'pet' is set
15661566
if ($pet === null || (is_array($pet) && count($pet) === 0)) {
@@ -1797,7 +1797,7 @@ function ($exception) {
17971797
* @throws \InvalidArgumentException
17981798
* @return \GuzzleHttp\Psr7\Request
17991799
*/
1800-
protected function updatePetWithFormRequest($pet_id, $name = null, $status = null)
1800+
public function updatePetWithFormRequest($pet_id, $name = null, $status = null)
18011801
{
18021802
// verify the required parameter 'pet_id' is set
18031803
if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) {
@@ -2086,7 +2086,7 @@ function ($exception) {
20862086
* @throws \InvalidArgumentException
20872087
* @return \GuzzleHttp\Psr7\Request
20882088
*/
2089-
protected function uploadFileRequest($pet_id, $additional_metadata = null, $file = null)
2089+
public function uploadFileRequest($pet_id, $additional_metadata = null, $file = null)
20902090
{
20912091
// verify the required parameter 'pet_id' is set
20922092
if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) {
@@ -2383,7 +2383,7 @@ function ($exception) {
23832383
* @throws \InvalidArgumentException
23842384
* @return \GuzzleHttp\Psr7\Request
23852385
*/
2386-
protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata = null)
2386+
public function uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata = null)
23872387
{
23882388
// verify the required parameter 'pet_id' is set
23892389
if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) {

samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ function ($exception) {
249249
* @throws \InvalidArgumentException
250250
* @return \GuzzleHttp\Psr7\Request
251251
*/
252-
protected function deleteOrderRequest($order_id)
252+
public function deleteOrderRequest($order_id)
253253
{
254254
// verify the required parameter 'order_id' is set
255255
if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) {
@@ -511,7 +511,7 @@ function ($exception) {
511511
* @throws \InvalidArgumentException
512512
* @return \GuzzleHttp\Psr7\Request
513513
*/
514-
protected function getInventoryRequest()
514+
public function getInventoryRequest()
515515
{
516516

517517
$resourcePath = '/store/inventory';
@@ -769,7 +769,7 @@ function ($exception) {
769769
* @throws \InvalidArgumentException
770770
* @return \GuzzleHttp\Psr7\Request
771771
*/
772-
protected function getOrderByIdRequest($order_id)
772+
public function getOrderByIdRequest($order_id)
773773
{
774774
// verify the required parameter 'order_id' is set
775775
if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) {
@@ -1043,7 +1043,7 @@ function ($exception) {
10431043
* @throws \InvalidArgumentException
10441044
* @return \GuzzleHttp\Psr7\Request
10451045
*/
1046-
protected function placeOrderRequest($order)
1046+
public function placeOrderRequest($order)
10471047
{
10481048
// verify the required parameter 'order' is set
10491049
if ($order === null || (is_array($order) && count($order) === 0)) {

samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ function ($exception) {
249249
* @throws \InvalidArgumentException
250250
* @return \GuzzleHttp\Psr7\Request
251251
*/
252-
protected function createUserRequest($user)
252+
public function createUserRequest($user)
253253
{
254254
// verify the required parameter 'user' is set
255255
if ($user === null || (is_array($user) && count($user) === 0)) {
@@ -466,7 +466,7 @@ function ($exception) {
466466
* @throws \InvalidArgumentException
467467
* @return \GuzzleHttp\Psr7\Request
468468
*/
469-
protected function createUsersWithArrayInputRequest($user)
469+
public function createUsersWithArrayInputRequest($user)
470470
{
471471
// verify the required parameter 'user' is set
472472
if ($user === null || (is_array($user) && count($user) === 0)) {
@@ -683,7 +683,7 @@ function ($exception) {
683683
* @throws \InvalidArgumentException
684684
* @return \GuzzleHttp\Psr7\Request
685685
*/
686-
protected function createUsersWithListInputRequest($user)
686+
public function createUsersWithListInputRequest($user)
687687
{
688688
// verify the required parameter 'user' is set
689689
if ($user === null || (is_array($user) && count($user) === 0)) {
@@ -900,7 +900,7 @@ function ($exception) {
900900
* @throws \InvalidArgumentException
901901
* @return \GuzzleHttp\Psr7\Request
902902
*/
903-
protected function deleteUserRequest($username)
903+
public function deleteUserRequest($username)
904904
{
905905
// verify the required parameter 'username' is set
906906
if ($username === null || (is_array($username) && count($username) === 0)) {
@@ -1167,7 +1167,7 @@ function ($exception) {
11671167
* @throws \InvalidArgumentException
11681168
* @return \GuzzleHttp\Psr7\Request
11691169
*/
1170-
protected function getUserByNameRequest($username)
1170+
public function getUserByNameRequest($username)
11711171
{
11721172
// verify the required parameter 'username' is set
11731173
if ($username === null || (is_array($username) && count($username) === 0)) {
@@ -1439,7 +1439,7 @@ function ($exception) {
14391439
* @throws \InvalidArgumentException
14401440
* @return \GuzzleHttp\Psr7\Request
14411441
*/
1442-
protected function loginUserRequest($username, $password)
1442+
public function loginUserRequest($username, $password)
14431443
{
14441444
// verify the required parameter 'username' is set
14451445
if ($username === null || (is_array($username) && count($username) === 0)) {
@@ -1673,7 +1673,7 @@ function ($exception) {
16731673
* @throws \InvalidArgumentException
16741674
* @return \GuzzleHttp\Psr7\Request
16751675
*/
1676-
protected function logoutUserRequest()
1676+
public function logoutUserRequest()
16771677
{
16781678

16791679
$resourcePath = '/user/logout';
@@ -1883,7 +1883,7 @@ function ($exception) {
18831883
* @throws \InvalidArgumentException
18841884
* @return \GuzzleHttp\Psr7\Request
18851885
*/
1886-
protected function updateUserRequest($username, $user)
1886+
public function updateUserRequest($username, $user)
18871887
{
18881888
// verify the required parameter 'username' is set
18891889
if ($username === null || (is_array($username) && count($username) === 0)) {

0 commit comments

Comments
 (0)