Skip to content

Commit

Permalink
fix: Use correct appTest argument type
Browse files Browse the repository at this point in the history
  • Loading branch information
keriati committed Nov 26, 2022
1 parent f0b60fc commit a12c1d5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/SupportedApps.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ abstract class SupportedApps
/**
* @param $url
* @param array $attrs
* @param bool $overridevars
* @return object
* @throws GuzzleException
*/
public function appTest($url, array $attrs = [], bool $overridevars = false): object
public function appTest($url, array $attrs = []): object
{
if (empty($this->config->url)) {
return (object) [
Expand Down Expand Up @@ -63,20 +63,20 @@ public function appTest($url, array $attrs = [], bool $overridevars = false): ob
/**
* @param $url
* @param array $attrs
* @param bool $overridevars
* @param bool $overridemethod
* @param array|null $overridevars
* @param string|null $overridemethod
* @return ResponseInterface|null
* @throws GuzzleException
*/
public function execute(
$url,
array $attrs = [],
bool $overridevars = false,
bool $overridemethod = false
array $overridevars = null,

This comment has been minimized.

Copy link
@rholeszczuk

rholeszczuk Nov 29, 2022

i think, this causes lot of problems with Supported apps integrations:
local.ERROR: App\SupportedApps::execute(): Argument #3 ($overridevars) must be of type ?array, bool given, called in /config/www/SupportedApps/openmediavault/openmediavault.php on line 34 {"userId":1,"exception":"[object] (TypeError(code: 0): App\\SupportedApps::execute(): Argument #3 ($overridevars) must be of type ?array, bool given, called in /config/www/SupportedApps/openmediavault/openmediavault.php on line 34 at /app/www/app/SupportedApps.php:71)

This comment has been minimized.

Copy link
@keriati

keriati Nov 29, 2022

Author Collaborator

oh my, in what version did you encounter this?

This comment has been minimized.

Copy link
@rholeszczuk

rholeszczuk Nov 29, 2022

i'm using docker latest so it is - - 2.5.3

This comment has been minimized.

Copy link
@keriati

keriati Nov 29, 2022

Author Collaborator

see #1048

string $overridemethod = null
): ?ResponseInterface {
$res = null;

$vars = ($overridevars !== false) ?
$vars = ($overridevars !== null) ?
$overridevars : [
'http_errors' => false,
'timeout' => 15,
Expand All @@ -85,7 +85,7 @@ public function execute(

$client = new Client($vars);

$method = ($overridemethod !== false) ? $overridemethod : $this->method;
$method = ($overridemethod !== null) ? $overridemethod : $this->method;

try {
return $client->request($method, $url, $attrs);
Expand Down

0 comments on commit a12c1d5

Please sign in to comment.