Skip to content

Commit 9c19bfe

Browse files
committed
replace CPP with non-nullable property
Using constructor property promotion for the $metaFile property does not make much sense for two reasons: * We need to declare it nullable just for the sake of the constructor accepting null while the property itself will always receive a string. * The initially set value is immediately overwritten in the constructor.
1 parent b9a04fe commit 9c19bfe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/Config/ResourceCheckerConfigCache.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*/
2424
class ResourceCheckerConfigCache implements ConfigCacheInterface
2525
{
26+
private string $metaFile;
27+
2628
/**
2729
* @param string $file The absolute cache path
2830
* @param iterable<mixed, ResourceCheckerInterface> $resourceCheckers The ResourceCheckers to use for the freshness check
@@ -31,7 +33,7 @@ class ResourceCheckerConfigCache implements ConfigCacheInterface
3133
public function __construct(
3234
private string $file,
3335
private iterable $resourceCheckers = [],
34-
private ?string $metaFile = null,
36+
?string $metaFile = null,
3537
) {
3638
$this->metaFile = $metaFile ?? $file.'.meta';
3739
}

0 commit comments

Comments
 (0)