Skip to content

Commit 2707992

Browse files
Merge branch '6.4' into 7.0
* 6.4: More short closures + isset instead of null checks + etc.
2 parents 1d62ad6 + f8c4047 commit 2707992

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Matcher/Dumper/CompiledUrlMatcherDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ private function compileDynamicRoutes(RouteCollection $collection, bool $matchHo
346346
$state->markTail = 0;
347347

348348
// if the regex is too large, throw a signaling exception to recompute with smaller chunk size
349-
set_error_handler(function ($type, $message) { throw str_contains($message, $this->signalingException->getMessage()) ? $this->signalingException : new \ErrorException($message); });
349+
set_error_handler(fn ($type, $message) => throw str_contains($message, $this->signalingException->getMessage()) ? $this->signalingException : new \ErrorException($message));
350350
try {
351351
preg_match($state->regex, '');
352352
} finally {

Router.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ public function setContext(RequestContext $context): void
180180
{
181181
$this->context = $context;
182182

183-
if (null !== $this->matcher) {
183+
if (isset($this->matcher)) {
184184
$this->getMatcher()->setContext($context);
185185
}
186-
if (null !== $this->generator) {
186+
if (isset($this->generator)) {
187187
$this->getGenerator()->setContext($context);
188188
}
189189
}
@@ -227,7 +227,7 @@ public function matchRequest(Request $request): array
227227
*/
228228
public function getMatcher(): UrlMatcherInterface|RequestMatcherInterface
229229
{
230-
if (null !== $this->matcher) {
230+
if (isset($this->matcher)) {
231231
return $this->matcher;
232232
}
233233

@@ -268,7 +268,7 @@ function (ConfigCacheInterface $cache) {
268268
*/
269269
public function getGenerator(): UrlGeneratorInterface
270270
{
271-
if (null !== $this->generator) {
271+
if (isset($this->generator)) {
272272
return $this->generator;
273273
}
274274

0 commit comments

Comments
 (0)