Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 991
Zeile 8... Zeile 8...
8
 
8
 
9
/**
9
/**
10
 * Lazily reads or writes to a file that is opened only after an IO operation
10
 * Lazily reads or writes to a file that is opened only after an IO operation
11
 * take place on the stream.
11
 * take place on the stream.
12
 */
-
 
13
#[\AllowDynamicProperties]
12
 */
14
final class LazyOpenStream implements StreamInterface
13
final class LazyOpenStream implements StreamInterface
15
{
14
{
Zeile 16... Zeile 15...
16
    use StreamDecoratorTrait;
15
    use StreamDecoratorTrait;
Zeile 20... Zeile 19...
20
 
19
 
21
    /** @var string */
20
    /** @var string */
Zeile 22... Zeile 21...
22
    private $mode;
21
    private $mode;
-
 
22
 
-
 
23
    /**
-
 
24
     * @var StreamInterface
-
 
25
     */
-
 
26
    private $stream;
23
 
27
 
24
    /**
28
    /**
25
     * @param string $filename File to lazily open
29
     * @param string $filename File to lazily open
26
     * @param string $mode     fopen mode to use when opening the stream
30
     * @param string $mode     fopen mode to use when opening the stream
27
     */
31
     */
28
    public function __construct(string $filename, string $mode)
32
    public function __construct(string $filename, string $mode)
29
    {
33
    {
-
 
34
        $this->filename = $filename;
-
 
35
        $this->mode = $mode;
-
 
36
 
-
 
37
        // unsetting the property forces the first access to go through
30
        $this->filename = $filename;
38
        // __get().
Zeile 31... Zeile 39...
31
        $this->mode = $mode;
39
        unset($this->stream);
32
    }
40
    }
33
 
41