Skip to content

Commit 19dbb06

Browse files
authored
chore(deps): update huangdijia/php-coding-standard to ^2.4 (#911)
* chore(deps): update huangdijia/php-coding-standard to ^2.4 Updates the PHP coding standard package from ^2.0 to ^2.4 to get the latest improvements and fixes. * style: apply PHP coding standard fixes after updating to ^2.4 Reorders union types to follow null-first convention and applies other code style improvements as required by the updated huangdijia/php-coding-standard package. This commit includes automatic fixes across multiple components: - Union type reordering (Type|null → null|Type) - Consistent formatting and style improvements - No functional changes, only code style compliance --------- Co-authored-by: Deeka Wong <[email protected]>
1 parent b3775b0 commit 19dbb06

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

src/Factory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class Factory
8080
/**
8181
* The event dispatcher implementation.
8282
*
83-
* @var EventDispatcherInterface|null
83+
* @var null|EventDispatcherInterface
8484
*/
8585
protected $dispatcher;
8686

@@ -203,7 +203,7 @@ public function globalResponseMiddleware($middleware)
203203
/**
204204
* Create a new response instance for use during stubbing.
205205
*
206-
* @param array|string|null $body
206+
* @param null|array|string $body
207207
* @param int $status
208208
* @param array $headers
209209
* @return PromiseInterface
@@ -234,7 +234,7 @@ public function sequence(array $responses = [])
234234
/**
235235
* Register a stub callable that will intercept requests and be able to return stub responses.
236236
*
237-
* @param array|callable|null $callback
237+
* @param null|array|callable $callback
238238
* @return $this
239239
*/
240240
public function fake($callback = null)
@@ -461,7 +461,7 @@ public function recorded($callback = null)
461461
/**
462462
* Get the current event dispatcher implementation.
463463
*
464-
* @return EventDispatcherInterface|null
464+
* @return null|EventDispatcherInterface
465465
*/
466466
public function getDispatcher()
467467
{

src/PendingRequest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ class PendingRequest
5353
/**
5454
* The factory instance.
5555
*
56-
* @var Factory|null
56+
* @var null|Factory
5757
*/
5858
protected $factory;
5959

6060
/**
6161
* The Guzzle client instance.
6262
*
63-
* @var Client|null
63+
* @var null|Client
6464
*/
6565
protected $client;
6666

@@ -116,7 +116,7 @@ class PendingRequest
116116
/**
117117
* The transfer stats for the request.
118118
*
119-
* @var \GuzzleHttp\TransferStats|null
119+
* @var null|\GuzzleHttp\TransferStats
120120
*/
121121
protected $transferStats;
122122

@@ -130,7 +130,7 @@ class PendingRequest
130130
/**
131131
* A callback to run when throwing if a server or client error occurs.
132132
*
133-
* @var Closure|null
133+
* @var null|Closure
134134
*/
135135
protected $throwCallback;
136136

@@ -149,14 +149,14 @@ class PendingRequest
149149
protected $tries = 1;
150150

151151
/**
152-
* @var int[]|null
152+
* @var null|int[]
153153
*/
154154
protected $backoff;
155155

156156
/**
157157
* The number of milliseconds to wait between retries.
158158
*
159-
* @var Closure|int|null
159+
* @var null|Closure|int
160160
*/
161161
protected $retryDelay = 100;
162162

@@ -170,7 +170,7 @@ class PendingRequest
170170
/**
171171
* The callback that will determine if the request should be retried.
172172
*
173-
* @var callable|null
173+
* @var null|callable
174174
*/
175175
protected $retryWhenCallback;
176176

@@ -184,7 +184,7 @@ class PendingRequest
184184
/**
185185
* The stub callables that will handle requests.
186186
*
187-
* @var Collection|null
187+
* @var null|Collection
188188
*/
189189
protected $stubCallbacks;
190190

@@ -219,7 +219,7 @@ class PendingRequest
219219
/**
220220
* The sent request object, if a request has been made.
221221
*
222-
* @var Request|null
222+
* @var null|Request
223223
*/
224224
protected $request;
225225

@@ -317,7 +317,7 @@ public function asForm()
317317
*
318318
* @param array|string $name
319319
* @param resource|string $contents
320-
* @param string|null $filename
320+
* @param null|string $filename
321321
* @return $this
322322
*/
323323
public function attach($name, $contents = '', $filename = null, array $headers = [])
@@ -758,7 +758,7 @@ public function dd()
758758
/**
759759
* Issue a GET request to the given URL.
760760
*
761-
* @param array|string|null $query
761+
* @param null|array|string $query
762762
* @return Response
763763
*/
764764
public function get(string $url, $query = null)
@@ -771,7 +771,7 @@ public function get(string $url, $query = null)
771771
/**
772772
* Issue a HEAD request to the given URL.
773773
*
774-
* @param array|string|null $query
774+
* @param null|array|string $query
775775
* @return Response
776776
*/
777777
public function head(string $url, $query = null)
@@ -1144,7 +1144,7 @@ public function async(bool $async = true)
11441144
/**
11451145
* Retrieve the pending request promise.
11461146
*
1147-
* @return \GuzzleHttp\Promise\PromiseInterface|null
1147+
* @return null|\GuzzleHttp\Promise\PromiseInterface
11481148
*/
11491149
public function getPromise()
11501150
{

src/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ public function body()
146146
* Determine if the request contains the given file.
147147
*
148148
* @param string $name
149-
* @param string|null $value
150-
* @param string|null $filename
149+
* @param null|string $value
150+
* @param null|string $filename
151151
* @return bool
152152
*/
153153
public function hasFile($name, $value = null, $filename = null)

src/Response.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Response implements ArrayAccess, Stringable
4040
/**
4141
* The transfer stats for the request.
4242
*
43-
* @var \GuzzleHttp\TransferStats|null
43+
* @var null|\GuzzleHttp\TransferStats
4444
*/
4545
public $transferStats;
4646

@@ -105,7 +105,7 @@ public function body()
105105
/**
106106
* Get the JSON decoded body of the response as an array or scalar value.
107107
*
108-
* @param string|null $key
108+
* @param null|string $key
109109
* @param mixed $default
110110
* @return mixed
111111
*/
@@ -125,7 +125,7 @@ public function json($key = null, $default = null)
125125
/**
126126
* Get the JSON decoded body of the response as an object.
127127
*
128-
* @return object|null
128+
* @return null|object
129129
*/
130130
public function object()
131131
{
@@ -135,7 +135,7 @@ public function object()
135135
/**
136136
* Get the JSON decoded body of the response as a collection.
137137
*
138-
* @param string|null $key
138+
* @param null|string $key
139139
* @return Collection
140140
*/
141141
public function collect($key = null)
@@ -146,7 +146,7 @@ public function collect($key = null)
146146
/**
147147
* Get the JSON decoded body of the response as a fluent object.
148148
*
149-
* @param string|null $key
149+
* @param null|string $key
150150
* @return Fluent
151151
*/
152152
public function fluent($key = null)
@@ -197,7 +197,7 @@ public function reason()
197197
/**
198198
* Get the effective URI of the response.
199199
*
200-
* @return \Psr\Http\Message\UriInterface|null
200+
* @return null|\Psr\Http\Message\UriInterface
201201
*/
202202
public function effectiveUri()
203203
{
@@ -313,7 +313,7 @@ public function toPsrResponse()
313313
/**
314314
* Create an exception if a server or client error occurred.
315315
*
316-
* @return RequestException|null
316+
* @return null|RequestException
317317
*/
318318
public function toException()
319319
{

src/ResponseSequence.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __invoke()
7272
/**
7373
* Push a response to the sequence.
7474
*
75-
* @param array|string|null $body
75+
* @param null|array|string $body
7676
* @return $this
7777
*/
7878
public function push($body = null, int $status = 200, array $headers = [])

0 commit comments

Comments
 (0)