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

        $updatedStaticLoader = str_replace(

            "__DIR__ . '/../..'",

            sprintf("'%s'", rtrim(getenv('LAMBDA_TASK_ROOT'), '/')),

            file_get_contents(self::AUTOLOAD_STATIC_PATH)

        );
<?php     {

        $updatedStaticLoader = str_replace(

            "__DIR__ . '/../..'",

            sprintf("'%s'", rtrim(getenv('LAMBDA_TASK_ROOT'), '/')),

            file_get_contents(self::AUTOLOAD_STATIC_PATH)

        );
<?php     {

        $updatedStaticLoader = str_replace(

            "__DIR__ . '/../..'",

            sprintf("'%s'", rtrim(getenv('LAMBDA_TASK_ROOT'), '/')),

            file_get_contents(self::AUTOLOAD_STATIC_PATH)

        );
<?php     foreach (LAYER_NAMES as $layerName) {

        $results[$layerName] = $lambda->listLayerVersions([

            'LayerName' => sprintf('arn:aws:lambda:%s:209497400698:layer:%s', $selectedRegion, $layerName),

            'MaxItems' => 1,

        ]);

    }
<?php     {

        $jsonData = json_encode($data);

        if ($jsonData === false) {

            throw new Exception(sprintf(

                "The Lambda response cannot be encoded to JSON.\nThis error usually happens when you try to return binary content. If you are writing an HTTP application and you want to return a binary HTTP response (like an image, a PDF, etc.), please read this guide: https://bref.sh/docs/runtimes/http.html#binary-requests-and-responses\nHere is the original JSON error: '%s'",

                json_last_error_msg()

            ));

        }



        if ($this->curlHandleResult === null) {
<?php         $this->client = new WebsocketClient(

            [

                'region' => $region,

                'endpoint' => sprintf('https://%s.execute-api.%s.amazonaws.com', $apiId, $region),

            ],

            $credentialProvider,

            $httpClient
<?php     public function disconnect(string $connectionId): void

    {

        $this->client->request('DELETE', sprintf('/%s/@connections/%s', $this->stage, $connectionId));

    }



    public function message(string $connectionId, string $body): void
<?php     public function message(string $connectionId, string $body): void

    {

        $this->client->request('POST', sprintf('/%s/@connections/%s', $this->stage, $connectionId), $body);

    }



    public function status(string $connectionId): WebsocketClientStatus
<?php     public function status(string $connectionId): WebsocketClientStatus

    {

        return new WebsocketClientStatus(

            $this->client->request('GET', sprintf('/%s/@connections/%s', $this->stage, $connectionId))

                ->toArray()

        );

    }