File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -152,9 +152,9 @@ class Request
152
152
protected string $ defaultLocale = 'en ' ;
153
153
154
154
/**
155
- * @var array<string, string[]>
155
+ * @var array<string, string[]>|null
156
156
*/
157
- protected static array $ formats ;
157
+ protected static ? array $ formats = null ;
158
158
159
159
protected static ?\Closure $ requestFactory = null ;
160
160
@@ -1499,7 +1499,11 @@ public function isNoCache(): bool
1499
1499
*/
1500
1500
public function getPreferredFormat (?string $ default = 'html ' ): ?string
1501
1501
{
1502
- if ($ this ->preferredFormat ??= $ this ->getRequestFormat (null )) {
1502
+ if (!isset ($ this ->preferredFormat ) && null !== $ preferredFormat = $ this ->getRequestFormat (null )) {
1503
+ $ this ->preferredFormat = $ preferredFormat ;
1504
+ }
1505
+
1506
+ if ($ this ->preferredFormat ?? null ) {
1503
1507
return $ this ->preferredFormat ;
1504
1508
}
1505
1509
You can’t perform that action at this time.
0 commit comments