Skip to content

Array to string conversion in UnionHandler #5

@G4Zz0L1

Description

@G4Zz0L1

When calling getAllLibraries(), the SDK fails with "Array to string conversion" in UnionHandler.php line 172.

Root cause:

$unionName = implode('|', $type['params']);

However, $type['params'] contains arrays, not strings. When implode() tries to join them, PHP throws the warning.

ErrorException {#3002
  #message: "Array to string conversion"
  #code: 0
  #file: "./vendor/lukehagar/plex-api/src/Utils/UnionHandler.php"
  #line: 172
  #severity: E_WARNING
  trace: {
    ./vendor/lukehagar/plex-api/src/Utils/UnionHandler.php:172 { …}
    ./vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:258 { …}
    Illuminate\Foundation\Bootstrap\HandleExceptions->{closure:Illuminate\Foundation\Bootstrap\HandleExceptions::forwardsTo():257}() {}
    ./vendor/lukehagar/plex-api/src/Utils/UnionHandler.php:172 { …}
    ./vendor/speakeasy/serializer/src/GraphNavigator/DeserializationGraphNavigator.php:162 { …}
    ./vendor/speakeasy/serializer/src/JsonDeserializationVisitor.php:188 { …}
    ./vendor/speakeasy/serializer/src/GraphNavigator/DeserializationGraphNavigator.php:216 { …}
    ./vendor/speakeasy/serializer/src/Serializer.php:256 { …}
    ./vendor/speakeasy/serializer/src/Serializer.php:182 { …}
    ./vendor/lukehagar/plex-api/src/Library.php:266 { …}
    ./app/fileThatTriggersTheError.php {
      ›     $response = $sdk->library->getAllLibraries();
    }
    ./vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 { …}
    ./vendor/laravel/framework/src/Illuminate/Container/Util.php:43 { …}
    ./vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:96 { …}
    ./vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:35 { …}
    ./vendor/laravel/framework/src/Illuminate/Container/Container.php:799 { …}
    ./vendor/laravel/framework/src/Illuminate/Console/Command.php:211 { …}
    ./vendor/symfony/console/Command/Command.php:341 { …}
    ./vendor/laravel/framework/src/Illuminate/Console/Command.php:180 { …}
    ./vendor/symfony/console/Application.php:1102 { …}
    ./vendor/symfony/console/Application.php:356 { …}
    ./vendor/symfony/console/Application.php:195 { …}
    ./vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:197 { …}
    ./vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1235 { …}
    ./artisan:16 { …}
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions