Skip to content

Commit

Permalink
[ci] php-cs-fixer it up (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrushlow authored Oct 7, 2024
1 parent 24375de commit dd730d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Listener/PreAssetsCompileEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ public function __invoke(PreAssetsCompileEvent $preAssetsCompileEvent): void
return;
}

throw new \RuntimeException(sprintf('Error compiling sass: "%s"', $process->getErrorOutput()));
throw new \RuntimeException(\sprintf('Error compiling sass: "%s"', $process->getErrorOutput()));
}
}
12 changes: 6 additions & 6 deletions src/SassBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function createProcess(array $args): Process

public function downloadExecutable(): void
{
$url = sprintf('https://github.com/sass/dart-sass/releases/download/%s/%s', self::VERSION, $this->getBinaryName());
$url = \sprintf('https://github.com/sass/dart-sass/releases/download/%s/%s', self::VERSION, $this->getBinaryName());
$isZip = str_ends_with($url, '.zip');

$this->output?->note('Downloading Sass binary from '.$url);
Expand Down Expand Up @@ -108,7 +108,7 @@ public function downloadExecutable(): void

$binaryPath = $this->getDefaultBinaryPath();
if (!is_file($binaryPath)) {
throw new \Exception(sprintf('Could not find downloaded binary in "%s".', $binaryPath));
throw new \Exception(\sprintf('Could not find downloaded binary in "%s".', $binaryPath));
}

chmod($binaryPath, 0777);
Expand All @@ -128,7 +128,7 @@ public function getBinaryName(): string
return $this->buildBinaryFileName('macos-x64');
}

throw new \Exception(sprintf('No matching machine found for Darwin platform (Machine: %s).', $machine));
throw new \Exception(\sprintf('No matching machine found for Darwin platform (Machine: %s).', $machine));
}

if (str_contains($os, 'linux')) {
Expand All @@ -140,18 +140,18 @@ public function getBinaryName(): string
return $this->buildBinaryFileName($baseName.'-x64');
}

throw new \Exception(sprintf('No matching machine found for Linux platform (Machine: %s).', $machine));
throw new \Exception(\sprintf('No matching machine found for Linux platform (Machine: %s).', $machine));
}

if (str_contains($os, 'win')) {
if ('x86_64' === $machine || 'amd64' === $machine || 'i586' === $machine) {
return $this->buildBinaryFileName('windows-x64', true);
}

throw new \Exception(sprintf('No matching machine found for Windows platform (Machine: %s).', $machine));
throw new \Exception(\sprintf('No matching machine found for Windows platform (Machine: %s).', $machine));
}

throw new \Exception(sprintf('Unknown platform or architecture (OS: %s, Machine: %s).', $os, $machine));
throw new \Exception(\sprintf('Unknown platform or architecture (OS: %s, Machine: %s).', $os, $machine));
}

private function buildBinaryFileName(string $os, bool $isWindows = false): string
Expand Down
4 changes: 2 additions & 2 deletions src/SassBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function getScssCssTargets(): array
$targets = [];
foreach ($this->sassPaths as $sassPath) {
if (!is_file($sassPath)) {
throw new \Exception(sprintf('Could not find Sass file: "%s"', $sassPath));
throw new \Exception(\sprintf('Could not find Sass file: "%s"', $sassPath));
}

$targets[] = $sassPath.':'.$this->guessCssNameFromSassFile($sassPath, $this->cssPath);
Expand Down Expand Up @@ -200,7 +200,7 @@ private function setOptions(array $options = []): void
$optionMap = $this->getOptionMap();
foreach ($options as $option => $value) {
if (!isset($optionMap[$option])) {
throw new \InvalidArgumentException(sprintf('Invalid option "%s". Available options are: "%s".', $option, implode('", "', array_keys($optionMap))));
throw new \InvalidArgumentException(\sprintf('Invalid option "%s". Available options are: "%s".', $option, implode('", "', array_keys($optionMap))));
}
$sassOptions[$optionMap[$option]] = $value;
}
Expand Down

0 comments on commit dd730d0

Please sign in to comment.