File tree Expand file tree Collapse file tree 4 files changed +4
-8
lines changed Expand file tree Collapse file tree 4 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -1386,7 +1386,7 @@ public function getRequestFormat(?string $default = 'html')
1386
1386
$ this ->format = $ this ->attributes ->get ('_format ' );
1387
1387
}
1388
1388
1389
- return null === $ this ->format ? $ default : $ this -> format ;
1389
+ return $ this ->format ?? $ default ;
1390
1390
}
1391
1391
1392
1392
/**
Original file line number Diff line number Diff line change @@ -109,11 +109,7 @@ public function getParentRequest()
109
109
{
110
110
$ pos = \count ($ this ->requests ) - 2 ;
111
111
112
- if (!isset ($ this ->requests [$ pos ])) {
113
- return null ;
114
- }
115
-
116
- return $ this ->requests [$ pos ];
112
+ return $ this ->requests [$ pos ] ?? null ;
117
113
}
118
114
119
115
/**
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ public function hasCacheControlDirective(string $key)
174
174
*/
175
175
public function getCacheControlDirective (string $ key )
176
176
{
177
- return \array_key_exists ( $ key , $ this ->computedCacheControl ) ? $ this -> computedCacheControl [$ key ] : null ;
177
+ return $ this ->computedCacheControl [$ key ] ?? null ;
178
178
}
179
179
180
180
public function setCookie (Cookie $ cookie )
Original file line number Diff line number Diff line change @@ -161,6 +161,6 @@ private function stampCreated(int $lifetime = null): void
161
161
{
162
162
$ timeStamp = time ();
163
163
$ this ->meta [self ::CREATED ] = $ this ->meta [self ::UPDATED ] = $ this ->lastUsed = $ timeStamp ;
164
- $ this ->meta [self ::LIFETIME ] = ( null === $ lifetime) ? ini_get ('session.cookie_lifetime ' ) : $ lifetime ;
164
+ $ this ->meta [self ::LIFETIME ] = $ lifetime ?? ini_get ('session.cookie_lifetime ' );
165
165
}
166
166
}
You can’t perform that action at this time.
0 commit comments