Skip to content

Commit 10b28d0

Browse files
Copilotdermatz
andcommitted
Replace dirname() with explicit path manipulation to address static analysis warning
Co-authored-by: dermatz <[email protected]>
1 parent 51ae8f7 commit 10b28d0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Service/HyvaTokens/CssGenerator.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ public function generate(array $tokens, string $cssSelector): string
4747
*/
4848
public function write(string $content, string $outputPath): bool
4949
{
50-
// Ensure the directory exists
51-
$directory = dirname($outputPath);
50+
// Ensure the directory exists by extracting parent directory path
51+
$pathParts = explode('/', $outputPath);
52+
array_pop($pathParts); // Remove filename
53+
$directory = implode('/', $pathParts);
54+
5255
if (!$this->fileDriver->isDirectory($directory)) {
5356
$this->fileDriver->createDirectory($directory, 0750);
5457
}

0 commit comments

Comments
 (0)