Skip to content

Commit 58a09e1

Browse files
committed
Upgrade coding standard
1 parent 902d233 commit 58a09e1

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
},
4444
"require-dev": {
4545
"ext-xdebug": "*",
46-
"aplus/coding-standard": "^2.0",
46+
"aplus/coding-standard": "^2.8",
4747
"ergebnis/composer-normalize": "^2.25",
4848
"jetbrains/phpstorm-attributes": "^1.0",
4949
"phpmd/phpmd": "^2.14",

src/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Client
3434
/**
3535
* Create a new Request instance.
3636
*
37-
* @param string|URL $url
37+
* @param URL|string $url
3838
*
3939
* @return Request
4040
*/

src/Request.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Request extends Message implements RequestInterface
7676
/**
7777
* Request constructor.
7878
*
79-
* @param string|URL $url
79+
* @param URL|string $url
8080
*/
8181
public function __construct(URL | string $url)
8282
{
@@ -195,12 +195,12 @@ protected function getFileInfo(CURLFile | CURLStringFile | string $file) : array
195195
}
196196

197197
/**
198-
* @param string|URL $url
198+
* @param URL|string $url
199199
*
200200
* @return static
201201
*/
202202
#[Override]
203-
public function setUrl(string | URL $url) : static
203+
public function setUrl(URL | string $url) : static
204204
{
205205
if (!$url instanceof URL) {
206206
$url = new URL($url);
@@ -307,7 +307,7 @@ public function setBody(array | string $body) : static
307307
*
308308
* @return static
309309
*/
310-
public function setJson(mixed $data, int $flags = null, int $depth = 512) : static
310+
public function setJson(mixed $data, ?int $flags = null, int $depth = 512) : static
311311
{
312312
if ($flags === null) {
313313
$flags = $this->getJsonFlags();
@@ -539,7 +539,7 @@ public function setBearerAuth(#[SensitiveParameter] string $token) : static
539539
*
540540
* @return static
541541
*/
542-
public function setUserAgent(string $userAgent = null) : static
542+
public function setUserAgent(?string $userAgent = null) : static
543543
{
544544
$userAgent ??= 'Aplus HTTP Client';
545545
return $this->setHeader(RequestHeader::USER_AGENT, $userAgent);

src/Response.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ protected function setHeader(string $name, string $value) : static
207207
*
208208
* @return array<string,mixed>|false|object
209209
*/
210-
public function getJson(bool $assoc = false, int $flags = null, int $depth = 512) : array | object | false
210+
public function getJson(bool $assoc = false, ?int $flags = null, int $depth = 512) : array | false | object
211211
{
212212
if ($flags === null) {
213213
$flags = $this->getJsonFlags();

0 commit comments

Comments
 (0)