Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return a formatted string
sprintf(string $format, mixed ...$values): string
return $this->macroCall($method, $params);
}
throw new BadMethodCallException(sprintf(
'Method %s::%s does not exist.', static::class, $method
));
}
}
}
throw new BadMethodCallException(sprintf(
'Method %s::%s does not exist.', static::class, $method
));
}
}
protected function httpDate($timestamp)
{
return sprintf('%s GMT', gmdate('D, d M Y H:i:s', $timestamp));
}
}
{
return sprintf('%s GMT', gmdate('D, d M Y H:i:s', $timestamp));
}
}
->mapWithKeys(function ($value, $key) {
return ["wire:{$key}" => $this->escapeStringForHtml($value)];
})->map(function ($value, $key) {
return sprintf('%s="%s"', $key, $value);
})->implode(' ');
preg_match('/(?:\n\s*|^\s*)<([a-zA-Z0-9\-]+)/', $dom, $matches, PREG_OFFSET_CAPTURE);
return ["wire:{$key}" => $this->escapeStringForHtml($value)];
})->map(function ($value, $key) {
return sprintf('%s="%s"', $key, $value);
})->implode(' ');
preg_match('/(?:\n\s*|^\s*)<([a-zA-Z0-9\-]+)/', $dom, $matches, PREG_OFFSET_CAPTURE);
$output->startPaging();
}
$output->writeln(sprintf('From <info>%s:%s</info>:', $this->replaceCwd($info['file']), $lineNum));
$output->write(CodeFormatter::formatCode($code, $startLine, $endLine, $lineNum), false);
$output->writeln("\n".$this->e->getMessage());
}
$output->writeln(sprintf('From <info>%s:%s</info>:', $this->replaceCwd($info['file']), $lineNum));
$output->write(CodeFormatter::formatCode($code, $startLine, $endLine, $lineNum), false);
$output->writeln("\n".$this->e->getMessage());
{
return hash_hmac(
'sha256',
sprintf('%s:%s%s', $socketId, $channelName, $userData ? ':'.json_encode($userData) : ''),
$this->getPrivateToken(),
);
}
return hash_hmac(
'sha256',
sprintf('%s:%s%s', $socketId, $channelName, $userData ? ':'.json_encode($userData) : ''),
$this->getPrivateToken(),
);
}
}
} catch (AblyException $e) {
throw new BroadcastException(
sprintf('Ably error: %s', $e->getMessage())
);
}
}
} catch (AblyException $e) {
throw new BroadcastException(
sprintf('Ably error: %s', $e->getMessage())
);
}
}
});
} catch (ApiErrorException $e) {
throw new BroadcastException(
sprintf('Pusher error: %s.', $e->getMessage())
);
}
}
} catch (ApiErrorException $e) {
throw new BroadcastException(
sprintf('Pusher error: %s.', $e->getMessage())
);
}
}
);
} catch (ConnectionException|RedisException $e) {
throw new BroadcastException(
sprintf('Redis error: %s.', $e->getMessage())
);
}
}
} catch (ConnectionException|RedisException $e) {
throw new BroadcastException(
sprintf('Redis error: %s.', $e->getMessage())
);
}
}
$result = call_user_func_array($callback, array_merge($result, [$value, $key]));
if (! is_array($result)) {
throw new UnexpectedValueException(sprintf(
"%s::reduceSpread expects reducer to return an array, but got a '%s' instead.",
class_basename(static::class), gettype($result)
));
}
}
if (! is_array($result)) {
throw new UnexpectedValueException(sprintf(
"%s::reduceSpread expects reducer to return an array, but got a '%s' instead.",
class_basename(static::class), gettype($result)
));
}
}
public static function formatCommandString($string)
{
return sprintf('%s %s %s', static::phpBinary(), static::artisanBinary(), $string);
}
{
return sprintf('%s %s %s', static::phpBinary(), static::artisanBinary(), $string);
}
[$command, $input] = $this->parseCommand($command, $parameters);
if (! $this->has($command)) {
throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $command));
}
return $this->run(
if (! $this->has($command)) {
throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $command));
}
return $this->run(
public function get(string $name): Command
{
if (! $this->has($name)) {
throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name));
}
return $this->container->get($this->commandMap[$name]);
{
if (! $this->has($name)) {
throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name));
}
return $this->container->get($this->commandMap[$name]);
$default = $question->getDefault();
if ($question->isMultiline()) {
$text .= sprintf(' (press %s to continue)', 'Windows' == PHP_OS_FAMILY
? '<comment>Ctrl+Z</comment> then <comment>Enter</comment>'
: '<comment>Ctrl+D</comment>');
}
switch (true) {
if ($question->isMultiline()) {
$text .= sprintf(' (press %s to continue)', 'Windows' == PHP_OS_FAMILY
? '<comment>Ctrl+Z</comment> then <comment>Enter</comment>'
: '<comment>Ctrl+D</comment>');
}
switch (true) {
switch (true) {
case null === $default:
$text = sprintf('<info>%s</info>', $text);
break;
case null === $default:
$text = sprintf('<info>%s</info>', $text);
break;
break;
case $question instanceof ConfirmationQuestion:
$text = sprintf('<info>%s (yes/no)</info> [<comment>%s</comment>]', $text, $default ? 'yes' : 'no');
break;
case $question instanceof ConfirmationQuestion:
$text = sprintf('<info>%s (yes/no)</info> [<comment>%s</comment>]', $text, $default ? 'yes' : 'no');
break;