Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Uncaught TypeError: Apigee\Edge\Api\Management\Controller\AppByOwnerController::responseArrayToArrayOfEntities(): Argument #1 ($responseArray) must be of type array, #363

Closed
mxr576 opened this issue May 13, 2024 · 0 comments · Fixed by #364
Labels
bug Something isn't working

Comments

@mxr576
Copy link
Contributor

mxr576 commented May 13, 2024

Description

When a developer has no apps yet on Apigee X the following type error is triggered:

Fatal error: Uncaught TypeError: Apigee\Edge\Api\Management\Controller\AppByOwnerController::responseArrayToArrayOfEntities(): Argument #1 ($responseArray) must be of type array, bool given, called in /mnt/files/local_mount/build/vendor/apigee/apigee-client-php/src/Controller/NonPaginatedEntityListingControllerTrait.php on line 52 and defined in /mnt/files/local_mount/build/vendor/apigee/apigee-client-php/src/Controller/EntityListingControllerTrait.php:42
Stack trace:

Steps to Reproduce

<?php

require_once $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php';

use Apigee\Edge\Client;

$env = json_decode(getenv('APIGEE_SERVICE_ACCOUNT_KEY'), TRUE);

$client = new Client(new \Apigee\Edge\HttpClient\Plugin\Authentication\ApigeeOnGcpOauth2(
    $env['client_email'],
    $env['private_key'],
new \Apigee\Edge\Tests\Test\HttpClient\Plugin\InMemoryOauthTokenStorage(),
), \Apigee\Edge\ClientInterface::APIGEE_ON_GCP_ENDPOINT);


$email = 'developer' . bin2hex(random_bytes(5)) . '@example.com';
//$foo = (new \Apigee\Edge\Api\Management\Controller\OrganizationController($client))->load($env['project_id']);
(new \Apigee\Edge\Api\Management\Controller\DeveloperController(
    $env['project_id'],
    $client,
))->create(new \Apigee\Edge\Api\Management\Entity\Developer([
    'firstName' => 'John',
    'lastName' => 'Doe',
    'email' => $email,
    'userName' => $email,
]));
(new \Apigee\Edge\Api\Management\Controller\DeveloperAppController(
    $env['project_id'],
    $email,
    $client,
))->getEntities();

Actual Behavior

Expected Behavior

Screenshots

Notes

Version Info

3.0.5

@mxr576 mxr576 added the bug Something isn't working label May 13, 2024
mxr576 added a commit to mxr576/apigee-client-php that referenced this issue May 13, 2024
mxr576 added a commit to mxr576/apigee-client-php that referenced this issue May 13, 2024
mxr576 added a commit to mxr576/apigee-client-php that referenced this issue May 14, 2024
shishir-intelli added a commit that referenced this issue May 24, 2024
Closes #363

Co-authored-by: Shishir <75600200+shishir-intelli@users.noreply.github.com>
Co-authored-by: Kedar Khaire <kedark@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant