Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 29... Línea 29...
29
     */
29
     */
30
    public function __get(string $name)
30
    public function __get(string $name)
31
    {
31
    {
32
        if ($name === 'stream') {
32
        if ($name === 'stream') {
33
            $this->stream = $this->createStream();
33
            $this->stream = $this->createStream();
-
 
34
 
34
            return $this->stream;
35
            return $this->stream;
35
        }
36
        }
Línea 36... Línea 37...
36
 
37
 
37
        throw new \UnexpectedValueException("$name not found on class");
38
        throw new \UnexpectedValueException("$name not found on class");
Línea 41... Línea 42...
41
    {
42
    {
42
        try {
43
        try {
43
            if ($this->isSeekable()) {
44
            if ($this->isSeekable()) {
44
                $this->seek(0);
45
                $this->seek(0);
45
            }
46
            }
-
 
47
 
46
            return $this->getContents();
48
            return $this->getContents();
47
        } catch (\Throwable $e) {
49
        } catch (\Throwable $e) {
48
            if (\PHP_VERSION_ID >= 70400) {
50
            if (\PHP_VERSION_ID >= 70400) {
49
                throw $e;
51
                throw $e;
50
            }
52
            }
51
            trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
53
            trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
-
 
54
 
52
            return '';
55
            return '';
53
        }
56
        }
54
    }
57
    }
Línea 55... Línea 58...
55
 
58
 
Línea 65... Línea 68...
65
     */
68
     */
66
    public function __call(string $method, array $args)
69
    public function __call(string $method, array $args)
67
    {
70
    {
68
        /** @var callable $callable */
71
        /** @var callable $callable */
69
        $callable = [$this->stream, $method];
72
        $callable = [$this->stream, $method];
70
        $result = call_user_func_array($callable, $args);
73
        $result = ($callable)(...$args);
Línea 71... Línea 74...
71
 
74
 
72
        // Always return the wrapped object if the result is a return $this
75
        // Always return the wrapped object if the result is a return $this
73
        return $result === $this->stream ? $this : $result;
76
        return $result === $this->stream ? $this : $result;
Línea 77... Línea 80...
77
    {
80
    {
78
        $this->stream->close();
81
        $this->stream->close();
79
    }
82
    }
Línea 80... Línea 83...
80
 
83
 
81
    /**
-
 
82
     * {@inheritdoc}
-
 
83
     *
84
    /**
84
     * @return mixed
85
     * @return mixed
85
     */
86
     */
86
    public function getMetadata($key = null)
87
    public function getMetadata($key = null)
87
    {
88
    {