Skip to content

Commit

Permalink
Prefix all sprintf() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Jun 20, 2024
1 parent 9fa7f7a commit 8191468
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Debug/TraceableEventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function dispatch(object $event, ?string $eventName = null): object
$currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : '';

if (null !== $this->logger && $event instanceof StoppableEventInterface && $event->isPropagationStopped()) {
$this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
$this->logger->debug(\sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
}

$this->preProcess($eventName);
Expand Down
8 changes: 4 additions & 4 deletions DependencyInjection/RegisterListenersPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function process(ContainerBuilder $container): void

if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method'])) {
if (!$r->hasMethod('__invoke')) {
throw new InvalidArgumentException(sprintf('None of the "%s" or "__invoke" methods exist for the service "%s". Please define the "method" attribute on "kernel.event_listener" tags.', $event['method'], $id));
throw new InvalidArgumentException(\sprintf('None of the "%s" or "__invoke" methods exist for the service "%s". Please define the "method" attribute on "kernel.event_listener" tags.', $event['method'], $id));
}

$event['method'] = '__invoke';
Expand Down Expand Up @@ -123,10 +123,10 @@ public function process(ContainerBuilder $container): void
$class = $def->getClass();

if (!$r = $container->getReflectionClass($class)) {
throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id));
throw new InvalidArgumentException(\sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id));
}
if (!$r->isSubclassOf(EventSubscriberInterface::class)) {
throw new InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, EventSubscriberInterface::class));
throw new InvalidArgumentException(\sprintf('Service "%s" must implement interface "%s".', $id, EventSubscriberInterface::class));
}
$class = $r->name;

Expand Down Expand Up @@ -178,7 +178,7 @@ private function getEventFromTypeDeclaration(ContainerBuilder $container, string
|| $type->isBuiltin()
|| Event::class === ($name = $type->getName())
) {
throw new InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "kernel.event_listener" tags.', $id));
throw new InvalidArgumentException(\sprintf('Service "%s" must define the "event" attribute on "kernel.event_listener" tags.', $id));
}

return $name;
Expand Down
2 changes: 1 addition & 1 deletion GenericEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function getArgument(string $key): mixed
return $this->arguments[$key];
}

throw new \InvalidArgumentException(sprintf('Argument "%s" not found.', $key));
throw new \InvalidArgumentException(\sprintf('Argument "%s" not found.', $key));
}

/**
Expand Down

0 comments on commit 8191468

Please sign in to comment.