Skip to content

Commit

Permalink
Transport classes: implement use of the new `InvalidArgument::create(…
Browse files Browse the repository at this point in the history
…)` method
  • Loading branch information
jrfnl committed Sep 17, 2021
1 parent 1633f91 commit b709233
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
11 changes: 1 addition & 10 deletions src/Transport/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,7 @@ public function request($url, $headers = array(), $data = array(), $options = ar
} elseif (is_int($data) || is_float($data)) {
$data = (string) $data;
} else {
throw new InvalidArgument(
sprintf(
'%s: Argument #%d (%s) must be of type %s, %s given',
__METHOD__,
3,
'$data',
'array|string',
gettype($data)
)
);
throw InvalidArgument::create(3, '$data', 'array|string', gettype($data));
}
}

Expand Down
11 changes: 1 addition & 10 deletions src/Transport/Fsockopen.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,7 @@ public function request($url, $headers = array(), $data = array(), $options = ar
} elseif (is_int($data) || is_float($data)) {
$data = (string) $data;
} else {
throw new InvalidArgument(
sprintf(
'%s: Argument #%d (%s) must be of type %s, %s given',
__METHOD__,
3,
'$data',
'array|string',
gettype($data)
)
);
throw InvalidArgument::create(3, '$data', 'array|string', gettype($data));
}
}

Expand Down

0 comments on commit b709233

Please sign in to comment.