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

                $path = $this->prefixer->stripPrefix($item->getPrefix() ?? '');

            } else {

                throw new \RuntimeException(sprintf('Argument 2 of "%s" cannot be null when $item is not instance of "%s" or %s', __METHOD__, AwsObject::class, CommonPrefix::class));

            }

        }
<?php             $dateTime = $item->getLastModified();

            $metadata = $this->extractExtraMetadata($item);

        } else {

            throw new \RuntimeException(sprintf('Object of class "%s" is not supported in %s()', \get_class($item), __METHOD__));

        }



        if ($dateTime instanceof \DateTimeInterface) {
<?php         $prefixes = $options = [];



        if ( ! empty($prefixedPath)) {

            $options = ['prefix' => sprintf('%s/', rtrim($prefixedPath, '/'))];

        }



        if ($deep === false) {
<?php                 ->listContents($path, $deep)

                ->map(

                    function (StorageAttributes $attributes) use ($mountIdentifier) {

                        return $attributes->withPath(sprintf('%s://%s', $mountIdentifier, $attributes->path()));

                    }

                );

    }
<?php {

    public static function atLocation(string $location, string $reason = ''): self

    {

        return new self(rtrim(sprintf(

            'Unable to open file at location: %s. %s',

            $location,

            $reason

        )));

    }

}