PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.4
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.4
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / vendor_prefixed / guzzlehttp / psr7 / src / LazyOpenStream.php

LazyOpenStream.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.4, at vendor_prefixed/guzzlehttp/psr7/src/LazyOpenStream.php

38 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace YoastSEO_Vendor\GuzzleHttp\Psr7;
4
5 use YoastSEO_Vendor\Psr\Http\Message\StreamInterface;
6 /**
7 * Lazily reads or writes to a file that is opened only after an IO operation
8 * take place on the stream.
9 *
10 * @final
11 */
12 class LazyOpenStream implements \YoastSEO_Vendor\Psr\Http\Message\StreamInterface
13 {
14 use StreamDecoratorTrait;
15 /** @var string File to open */
16 private $filename;
17 /** @var string */
18 private $mode;
19 /**
20 * @param string $filename File to lazily open
21 * @param string $mode fopen mode to use when opening the stream
22 */
23 public function __construct($filename, $mode)
24 {
25 $this->filename = $filename;
26 $this->mode = $mode;
27 }
28 /**
29 * Creates the underlying stream lazily when required.
30 *
31 * @return StreamInterface
32 */
33 protected function createStream()
34 {
35 return \YoastSEO_Vendor\GuzzleHttp\Psr7\Utils::streamFor(\YoastSEO_Vendor\GuzzleHttp\Psr7\Utils::tryFopen($this->filename, $this->mode));
36 }
37 }
38