diff --git a/src/Asset/TemplateAsset.php b/src/Asset/TemplateAsset.php index f7b9543..220d973 100644 --- a/src/Asset/TemplateAsset.php +++ b/src/Asset/TemplateAsset.php @@ -28,16 +28,19 @@ class TemplateAsset * @var string|null */ private $entriesField; - /** - * @var bool - */ - private $initialized = false; + + private bool $initialized = false; /** * @var array */ private $templateData; - public function __construct(private array $bundleConfig, private readonly string $webDir, private readonly Environment $twig, private PageEntrypoints $pageEntrypoints) + public function __construct( + private array $bundleConfig, + private readonly string $webDir, + private readonly Environment $twig, + private PageEntrypoints $pageEntrypoints + ) { } @@ -114,7 +117,7 @@ public function inlineCssLinkTag() preg_match_all('@@i', $styleTags, $matches); - if (isset($matches[1]) && !empty($matches[1])) { + if (!empty($matches[1])) { $inlineCss = implode("\n", array_map(fn($path) => file_get_contents($this->webDir.preg_replace('@@i', '$1', $path)), $matches[1])); return $inlineCss; diff --git a/src/Asset/TemplateAssetGenerator.php b/src/Asset/TemplateAssetGenerator.php index 3dee37c..0cc3c5e 100644 --- a/src/Asset/TemplateAssetGenerator.php +++ b/src/Asset/TemplateAssetGenerator.php @@ -88,7 +88,7 @@ public function inlineCssLinkTag(EntrypointCollection $collection, string $templ preg_match_all('@@i', $styleTags, $matches); - if (isset($matches[1]) && !empty($matches[1])) { + if (!empty($matches[1])) { $inlineCss = implode("\n", array_map(fn($path) => file_get_contents($this->webDir.preg_replace('@@i', '$1', $path)), $matches[1])); return $inlineCss;