diff --git a/GenericRuntime.php b/GenericRuntime.php index b96468d..b432630 100644 --- a/GenericRuntime.php +++ b/GenericRuntime.php @@ -125,14 +125,14 @@ public function getRunner(?object $application): RunnerInterface } if (!\is_callable($application)) { - throw new \LogicException(sprintf('"%s" doesn\'t know how to handle apps of type "%s".', get_debug_type($this), get_debug_type($application))); + throw new \LogicException(\sprintf('"%s" doesn\'t know how to handle apps of type "%s".', get_debug_type($this), get_debug_type($application))); } $application = $application(...); } if ($_SERVER[$this->options['debug_var_name']] && ($r = new \ReflectionFunction($application)) && $r->getNumberOfRequiredParameters()) { - throw new \ArgumentCountError(sprintf('Zero argument should be required by the runner callable, but at least one is in "%s" on line "%d.', $r->getFileName(), $r->getStartLine())); + throw new \ArgumentCountError(\sprintf('Zero argument should be required by the runner callable, but at least one is in "%s" on line "%d.', $r->getFileName(), $r->getStartLine())); } return new ClosureRunner($application); @@ -171,7 +171,7 @@ protected function getArgument(\ReflectionParameter $parameter, ?string $type): if (!$runtime = $this->getRuntime($type)) { $r = $parameter->getDeclaringFunction(); - throw new \InvalidArgumentException(sprintf('Cannot resolve argument "%s $%s" in "%s" on line "%d": "%s" supports only arguments "array $context", "array $argv" and "array $request", or a runtime named "Symfony\Runtime\%1$sRuntime".', $type, $parameter->name, $r->getFileName(), $r->getStartLine(), get_debug_type($this))); + throw new \InvalidArgumentException(\sprintf('Cannot resolve argument "%s $%s" in "%s" on line "%d": "%s" supports only arguments "array $context", "array $argv" and "array $request", or a runtime named "Symfony\Runtime\%1$sRuntime".', $type, $parameter->name, $r->getFileName(), $r->getStartLine(), get_debug_type($this))); } return $runtime->getArgument($parameter, $type); diff --git a/Internal/ComposerPlugin.php b/Internal/ComposerPlugin.php index 4f49e2b..cad8d85 100644 --- a/Internal/ComposerPlugin.php +++ b/Internal/ComposerPlugin.php @@ -70,7 +70,7 @@ public function updateAutoloadFile(): void } if (!is_file($autoloadTemplate)) { - throw new \InvalidArgumentException(sprintf('File "%s" defined under "extra.runtime.autoload_template" in your composer.json file not found.', $this->composer->getPackage()->getExtra()['runtime']['autoload_template'])); + throw new \InvalidArgumentException(\sprintf('File "%s" defined under "extra.runtime.autoload_template" in your composer.json file not found.', $this->composer->getPackage()->getExtra()['runtime']['autoload_template'])); } } diff --git a/Resolver/DebugClosureResolver.php b/Resolver/DebugClosureResolver.php index 923ae90..026b273 100644 --- a/Resolver/DebugClosureResolver.php +++ b/Resolver/DebugClosureResolver.php @@ -28,7 +28,7 @@ static function (...$arguments) use ($closure) { $r = new \ReflectionFunction($closure); - throw new \TypeError(sprintf('Unexpected value of type "%s" returned, "object" expected from "%s" on line "%d".', get_debug_type($app), $r->getFileName(), $r->getStartLine())); + throw new \TypeError(\sprintf('Unexpected value of type "%s" returned, "object" expected from "%s" on line "%d".', get_debug_type($app), $r->getFileName(), $r->getStartLine())); }, $arguments, ]; diff --git a/Runner/ClosureRunner.php b/Runner/ClosureRunner.php index 4b12ff1..2b54f5a 100644 --- a/Runner/ClosureRunner.php +++ b/Runner/ClosureRunner.php @@ -36,7 +36,7 @@ public function run(): int if (null !== $exitStatus && !\is_int($exitStatus)) { $r = new \ReflectionFunction($this->closure); - throw new \TypeError(sprintf('Unexpected value of type "%s" returned, "string|int|null" expected from "%s" on line "%d".', get_debug_type($exitStatus), $r->getFileName(), $r->getStartLine())); + throw new \TypeError(\sprintf('Unexpected value of type "%s" returned, "string|int|null" expected from "%s" on line "%d".', get_debug_type($exitStatus), $r->getFileName(), $r->getStartLine())); } return $exitStatus ?? 0; diff --git a/SymfonyRuntime.php b/SymfonyRuntime.php index 2891815..ef83936 100644 --- a/SymfonyRuntime.php +++ b/SymfonyRuntime.php @@ -108,7 +108,7 @@ public function __construct(array $options = []) if (isset($this->input) && ($options['dotenv_overload'] ?? false)) { if ($this->input->getParameterOption(['--env', '-e'], $_SERVER[$envKey], true) !== $_SERVER[$envKey]) { - throw new \LogicException(sprintf('Cannot use "--env" or "-e" when the "%s" file defines "%s" and the "dotenv_overload" runtime option is true.', $options['dotenv_path'] ?? '.env', $envKey)); + throw new \LogicException(\sprintf('Cannot use "--env" or "-e" when the "%s" file defines "%s" and the "dotenv_overload" runtime option is true.', $options['dotenv_path'] ?? '.env', $envKey)); } if ($_SERVER[$debugKey] && $this->input->hasParameterOption('--no-debug', true)) { @@ -207,7 +207,7 @@ protected static function register(GenericRuntime $runtime): GenericRuntime private function getInput(): ArgvInput { - if (!empty($_GET) && filter_var(ini_get('register_argc_argv'), \FILTER_VALIDATE_BOOL)) { + if (!empty($_GET) && filter_var(\ini_get('register_argc_argv'), \FILTER_VALIDATE_BOOL)) { throw new \Exception('CLI applications cannot be run safely on non-CLI SAPIs with register_argc_argv=On.'); }