Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return a formatted string
<?php sprintf(string $format, mixed ...$values): string
<?php     {

        return hash_hmac(

            'sha256',

            sprintf('%s:%s%s', $socketId, $channelName, $userData ? ':'.json_encode($userData) : ''),

            $this->getPrivateToken(),

        );

    }
<?php             }

        } catch (AblyException $e) {

            throw new BroadcastException(

                sprintf('Ably error: %s', $e->getMessage())

            );

        }

    }
<?php             });

        } catch (ApiErrorException $e) {

            throw new BroadcastException(

                sprintf('Pusher error: %s.', $e->getMessage())

            );

        }

    }
<?php             );

        } catch (ConnectionException|RedisException $e) {

            throw new BroadcastException(

                sprintf('Redis error: %s.', $e->getMessage())

            );

        }

    }
<?php             }



            throw new UnexpectedValueException(

                sprintf("Collection should only include [%s] items, but '%s' found at position %d.", implode(', ', $allowedTypes), $itemType, $index)

            );

        });

    }
<?php             $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)

                ));

            }

        }
<?php         if (! is_string($value)) {

            throw new InvalidArgumentException(

                sprintf('Configuration value for key [%s] must be a string, %s given.', $key, gettype($value))

            );

        }
<?php         if (! is_int($value)) {

            throw new InvalidArgumentException(

                sprintf('Configuration value for key [%s] must be an integer, %s given.', $key, gettype($value))

            );

        }
<?php         if (! is_float($value)) {

            throw new InvalidArgumentException(

                sprintf('Configuration value for key [%s] must be a float, %s given.', $key, gettype($value))

            );

        }
<?php         if (! is_bool($value)) {

            throw new InvalidArgumentException(

                sprintf('Configuration value for key [%s] must be a boolean, %s given.', $key, gettype($value))

            );

        }
<?php         if (! is_array($value)) {

            throw new InvalidArgumentException(

                sprintf('Configuration value for key [%s] must be an array, %s given.', $key, gettype($value))

            );

        }
<?php     public static function formatCommandString($string)

    {

        return sprintf('%s %s %s', static::phpBinary(), static::artisanBinary(), $string);

    }
<?php         [$command, $input] = $this->parseCommand($command, $parameters);



        if (! $this->has($command)) {

            throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $command));

        }



        return $this->run(
<?php     {

        if ($this instanceof Isolatable && $this->option('isolated') !== false &&

            ! $this->commandIsolationMutex()->create($this)) {

            $this->comment(sprintf(

                'The [%s] command is already running.', $this->getName()

            ));



            return (int) (is_numeric($this->option('isolated'))

                        ? $this->option('isolated')
<?php     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]);