Skip to content

Commit

Permalink
CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Oct 1, 2024
1 parent 4dc1191 commit de73a3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Configurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function unconfigure(Recipe $recipe, Lock $lock)
private function get($key): AbstractConfigurator
{
if (!isset($this->configurators[$key]) && !isset($this->postInstallConfigurators[$key])) {
throw new \InvalidArgumentException(sprintf('Unknown configurator "%s".', $key));
throw new \InvalidArgumentException(\sprintf('Unknown configurator "%s".', $key));
}

if (isset($this->cache[$key])) {
Expand Down
10 changes: 5 additions & 5 deletions src/Configurator/EnvConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ private function unconfigureEnvFiles(Recipe $recipe, $vars)
continue;
}

$contents = preg_replace(sprintf('{%s*###> %s ###.*###< %s ###%s+}s', "\n", $recipe->getName(), $recipe->getName(), "\n"), "\n", file_get_contents($env), -1, $count);
$contents = preg_replace(\sprintf('{%s*###> %s ###.*###< %s ###%s+}s', "\n", $recipe->getName(), $recipe->getName(), "\n"), "\n", file_get_contents($env), -1, $count);
if (!$count) {
continue;
}

$this->write(sprintf('Removing environment variables from %s', $file));
$this->write(\sprintf('Removing environment variables from %s', $file));
file_put_contents($env, $contents);
}
}
Expand All @@ -161,12 +161,12 @@ private function unconfigurePhpUnit(Recipe $recipe, $vars)
continue;
}

$contents = preg_replace(sprintf('{%s*\s+<!-- ###\+ %s ### -->.*<!-- ###- %s ### -->%s+}s', "\n", $recipe->getName(), $recipe->getName(), "\n"), "\n", file_get_contents($phpunit), -1, $count);
$contents = preg_replace(\sprintf('{%s*\s+<!-- ###\+ %s ### -->.*<!-- ###- %s ### -->%s+}s', "\n", $recipe->getName(), $recipe->getName(), "\n"), "\n", file_get_contents($phpunit), -1, $count);
if (!$count) {
continue;
}

$this->write(sprintf('Removing environment variables from %s', $file));
$this->write(\sprintf('Removing environment variables from %s', $file));
file_put_contents($phpunit, $contents);
}
}
Expand Down Expand Up @@ -265,7 +265,7 @@ private function findExistingValue(string $var, string $filename, Recipe $recipe

$lines = explode("\n", $section);
foreach ($lines as $line) {
if (0 !== strpos($line, sprintf('%s=', $var))) {
if (!str_starts_with($line, \sprintf('%s=', $var))) {
continue;
}

Expand Down

0 comments on commit de73a3a

Please sign in to comment.