Skip to content

Commit 8191468

Browse files
committed
Prefix all sprintf() calls
1 parent 9fa7f7a commit 8191468

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Debug/TraceableEventDispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function dispatch(object $event, ?string $eventName = null): object
110110
$currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : '';
111111

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

116116
$this->preProcess($eventName);

DependencyInjection/RegisterListenersPass.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function process(ContainerBuilder $container): void
8888

8989
if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method'])) {
9090
if (!$r->hasMethod('__invoke')) {
91-
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));
91+
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));
9292
}
9393

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

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

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

184184
return $name;

GenericEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function getArgument(string $key): mixed
5656
return $this->arguments[$key];
5757
}
5858

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

6262
/**

0 commit comments

Comments
 (0)