private function setError(int $error): void
    {
        if (! \in_array($error, self::ERRORS, true)) {
            throw new InvalidArgumentException('Invalid error status for UploadedFile.');
        }

        $this->error = $error;
    }