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;
    }