src/Tus/Server.php
protected function handleDelete() : HttpResponse
    {
        $key      = $this->request->key();
        $fileMeta = $this->cache->get($key);
        $resource = $fileMeta['file_path'] ?? null;

        if ( ! $resource) {
            return $this->response->send(null, HttpResponse::HTTP_NOT_FOUND);
        }

        $isDeleted = $this->cache->delete($key);

        if ( ! $isDeleted || ! file_exists($resource)) {
            return $this->response->send(null, HttpResponse::HTTP_GONE);
        }

        unlink($resource);

        return $this->response->send(null, HttpResponse::HTTP_NO_CONTENT, [
            'Tus-Extension' => self::TUS_EXTENSION_TERMINATION,
        ]);
    }
protected function handleDelete() : HttpResponse
    {
        $key      = $this->request->key();
        $fileMeta = $this->cache->get($key);
        $resource = $fileMeta['file_path'] ?? null;

        if ( ! $resource) {
            return $this->response->send(null, HttpResponse::HTTP_NOT_FOUND);
        }

        $isDeleted = $this->cache->delete($key);

        if ( ! $isDeleted || ! file_exists($resource)) {
            return $this->response->send(null, HttpResponse::HTTP_GONE);
        }

        unlink($resource);

        return $this->response->send(null, HttpResponse::HTTP_NO_CONTENT, [
            'Tus-Extension' => self::TUS_EXTENSION_TERMINATION,
        ]);
    }
protected function handleDelete ( ) : HttpResponse { $ key = $ this -> request -> key ( ) ; $ fileMeta = $ this -> cache -> get ( $ key ) ; $ resource = $ fileMeta [ 'file_path' ] ?? null ; if ( ! $ resource ) { return $ this -> response -> send ( null , HttpResponse :: HTTP_NOT_FOUND ) ; } $ isDeleted = $ this -> cache -> delete ( $ key ) ; if ( ! $ isDeleted || ! file_exists ( $ resource ) ) { return $ this -> response -> send ( null , HttpResponse :: HTTP_GONE ) ; } unlink ( $ resource ) ; return $ this -> response -> send ( null , HttpResponse :: HTTP_NO_CONTENT , [ 'Tus-Extension' => self :: TUS_EXTENSION_TERMINATION , ] ) ; }
Handle DELETE request.

@return HttpResponse
Handle DELETE request .