Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 62... Línea 62...
62
     */
62
     */
63
    public function __construct(
63
    public function __construct(
64
        $streamOrFile,
64
        $streamOrFile,
65
        ?int $size,
65
        ?int $size,
66
        int $errorStatus,
66
        int $errorStatus,
67
        string $clientFilename = null,
67
        ?string $clientFilename = null,
68
        string $clientMediaType = null
68
        ?string $clientMediaType = null
69
    ) {
69
    ) {
70
        $this->setError($errorStatus);
70
        $this->setError($errorStatus);
71
        $this->size = $size;
71
        $this->size = $size;
72
        $this->clientFilename = $clientFilename;
72
        $this->clientFilename = $clientFilename;
73
        $this->clientMediaType = $clientMediaType;
73
        $this->clientMediaType = $clientMediaType;
Línea 111... Línea 111...
111
        }
111
        }
Línea 112... Línea 112...
112
 
112
 
113
        $this->error = $error;
113
        $this->error = $error;
Línea 114... Línea 114...
114
    }
114
    }
115
 
115
 
116
    private function isStringNotEmpty($param): bool
116
    private static function isStringNotEmpty($param): bool
117
    {
117
    {
Línea 118... Línea 118...
118
        return is_string($param) && false === empty($param);
118
        return is_string($param) && false === empty($param);
Línea 161... Línea 161...
161
 
161
 
162
    public function moveTo($targetPath): void
162
    public function moveTo($targetPath): void
163
    {
163
    {
Línea 164... Línea 164...
164
        $this->validateActive();
164
        $this->validateActive();
165
 
165
 
166
        if (false === $this->isStringNotEmpty($targetPath)) {
166
        if (false === self::isStringNotEmpty($targetPath)) {
167
            throw new InvalidArgumentException(
167
            throw new InvalidArgumentException(
168
                'Invalid path provided for move operation; must be a non-empty string'
168
                'Invalid path provided for move operation; must be a non-empty string'