PHP 8.0.30
Preview: StreamTrait.php Size: 1.56 KB
/home/certprox/template.certproxywizard.com/wp-includes/php-ai-client/third-party/Nyholm/Psr7/StreamTrait.php

<?php

declare (strict_types=1);
namespace WordPress\AiClientDependencies\Nyholm\Psr7;

use WordPress\AiClientDependencies\Psr\Http\Message\StreamInterface;
use WordPress\AiClientDependencies\Symfony\Component\Debug\ErrorHandler as SymfonyLegacyErrorHandler;
use WordPress\AiClientDependencies\Symfony\Component\ErrorHandler\ErrorHandler as SymfonyErrorHandler;
if (\PHP_VERSION_ID >= 70400 || (new \ReflectionMethod(StreamInterface::class, '__toString'))->hasReturnType()) {
    /**
     * @internal
     */
    trait StreamTrait
    {
        public function __toString(): string
        {
            if ($this->isSeekable()) {
                $this->seek(0);
            }
            return $this->getContents();
        }
    }
} else {
    /**
     * @internal
     */
    trait StreamTrait
    {
        /**
         * @return string
         */
        public function __toString()
        {
            try {
                if ($this->isSeekable()) {
                    $this->seek(0);
                }
                return $this->getContents();
            } catch (\Throwable $e) {
                if (\is_array($errorHandler = \set_error_handler('var_dump'))) {
                    $errorHandler = $errorHandler[0] ?? null;
                }
                \restore_error_handler();
                if ($e instanceof \Error || $errorHandler instanceof SymfonyErrorHandler || $errorHandler instanceof SymfonyLegacyErrorHandler) {
                    return \trigger_error((string) $e, \E_USER_ERROR);
                }
                return '';
            }
        }
    }
}

Directory Contents

Dirs: 1 × Files: 10

Name Size Perms Modified Actions
Factory DIR
- drwxr-xr-x 2026-06-15 03:19:30
Edit Download
6.98 KB lrw-r--r-- 2026-07-01 08:20:17
Edit Download
7.29 KB lrw-r--r-- 2026-02-20 06:42:48
Edit Download
1.47 KB lrw-r--r-- 2026-02-20 06:42:48
Edit Download
2.97 KB lrw-r--r-- 2026-02-20 06:42:48
Edit Download
4.23 KB lrw-r--r-- 2026-02-20 06:42:48
Edit Download
4.95 KB lrw-r--r-- 2026-02-20 06:42:48
Edit Download
10.86 KB lrw-r--r-- 2026-02-20 06:42:48
Edit Download
1.56 KB lrw-r--r-- 2026-02-20 06:42:48
Edit Download
5.41 KB lrw-r--r-- 2026-02-20 06:42:48
Edit Download
9.51 KB lrw-r--r-- 2026-02-20 06:42:48
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).