@@ -59,7 +59,7 @@ class ApiProblem
59
59
/**
60
60
* HTTP status for the error.
61
61
*/
62
- protected ? int $ status = null ;
62
+ protected int | null $ status = null ;
63
63
64
64
/**
65
65
* Normalized property names for overloading.
@@ -123,7 +123,7 @@ class ApiProblem
123
123
/**
124
124
* Title of the error.
125
125
*/
126
- protected ? string $ title ;
126
+ protected string | null $ title ;
127
127
128
128
/**
129
129
* Create an instance using the provided information. If nothing is
@@ -133,7 +133,7 @@ class ApiProblem
133
133
*
134
134
* @param string[] $additional
135
135
*/
136
- public function __construct (int |string $ status , string |Throwable $ detail , ? string $ type = null , ? string $ title = null , array $ additional = [])
136
+ public function __construct (int |string $ status , string |Throwable $ detail , string | null $ type = null , string | null $ title = null , array $ additional = [])
137
137
{
138
138
if ($ detail instanceof ProblemExceptionInterface) {
139
139
if ($ type === null ) {
@@ -193,7 +193,7 @@ public function __get(string $name): mixed
193
193
194
194
throw new InvalidArgumentException (sprintf (
195
195
'Invalid property name "%s" ' ,
196
- $ name
196
+ $ name,
197
197
));
198
198
}
199
199
@@ -277,7 +277,7 @@ protected function getDetail(): string
277
277
* If an exception was provided, creates the status code from it;
278
278
* otherwise, code as provided is used.
279
279
*/
280
- protected function getStatus (): ? int
280
+ protected function getStatus (): int | null
281
281
{
282
282
if ($ this ->detail instanceof Throwable || $ this ->detail instanceof Exception) {
283
283
$ this ->status = (int ) $ this ->createStatusFromException ();
0 commit comments