protected function setRequest($request): void
    {
        if (is_null($this->path)) {
            throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('path');
        }
        if (! is_null($request)) {
            if (! is_string($request)) {
                throw \AWonderPHP\FileWrapper\TypeErrorException::requestWrongType($request);
            }
            $request = trim(basename($request));
            if (strlen($request) === 0) {
                $request = null;
            }
        }
        if (is_null($request)) {
            $request = trim(basename($this->path));
        }
        $this->request = $request;
    }
protected function setRequest($request): void
    {
        if (is_null($this->path)) {
            throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('path');
        }
        if (! is_null($request)) {
            if (! is_string($request)) {
                throw \AWonderPHP\FileWrapper\TypeErrorException::requestWrongType($request);
            }
            $request = trim(basename($request));
            if (strlen($request) === 0) {
                $request = null;
            }
        }
        if (is_null($request)) {
            $request = trim(basename($this->path));
        }
        $this->request = $request;
    }
protected function setRequest ( $ request ) : void { if ( is_null ( $ this -> path ) ) { throw \ AWonderPHP \ FileWrapper \ NullPropertyException :: propertyIsNull ( 'path' ) ; } if ( ! is_null ( $ request ) ) { if ( ! is_string ( $ request ) ) { throw \ AWonderPHP \ FileWrapper \ TypeErrorException :: requestWrongType ( $ request ) ; } $ request = trim ( basename ( $ request ) ) ; if ( strlen ( $ request ) === 0 ) { $ request = null ; } } if ( is_null ( $ request ) ) { $ request = trim ( basename ( $ this -> path ) ) ; } $ this -> request = $ request ; }
Set the request property

@param string|null $request The name of file as user sees it, only matter for file
download.

@psalm-suppress RedundantConditionGivenDocblockType

@return void
Set the request property