features/upload/lib/webdav.php

Summary

Maintainability
A
0 mins
Test Coverage

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class Uploader_Webdav {

Opening brace of a class must be on the line after the definition
Open

class Uploader_Webdav {

Spaces must be used for alignment; tabs are not allowed
Open

            "status"    => $status

Method name "Uploader_Webdav::process_response" is not in camel caps format
Open

    private function process_response($response) {

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

                $dir_path . "/" . $file_name;            

Spaces must be used for alignment; tabs are not allowed
Open

            "status"    => $status

Spaces must be used for alignment; tabs are not allowed
Open

            $location = $response['headers']['location'];

Spaces must be used for alignment; tabs are not allowed
Open

    private function process_response($response) {

Method name "Uploader_Webdav::make_destination" is not in camel caps format
Open

    private function make_destination($destination_dir) {

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

        } else {

Spaces must be used for alignment; tabs are not allowed
Open

            "location"    => $location,

Method name "Uploader_Webdav::create_client" is not in camel caps format
Open

    private function create_client() {

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

        return array(

Spaces must be used for alignment; tabs are not allowed
Open

        );

Spaces must be used for alignment; tabs are not allowed
Open

        }

Method name "Uploader_Webdav::read_file" is not in camel caps format
Open

    private function read_file($filepath) {

Spaces must be used for alignment; tabs are not allowed
Open

            "location"    => $location,

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    public $username;

Spaces must be used to indent lines; tabs are not allowed
Open

    public $password;

Spaces must be used to indent lines; tabs are not allowed
Open

    public $url;

Spaces must be used to indent lines; tabs are not allowed
Open

            }

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->create_client();

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($options as $key => $value) {

Spaces must be used to indent lines; tabs are not allowed
Open

    private function create_client() {

Spaces must be used to indent lines; tabs are not allowed
Open

    public $proxy;

Spaces must be used to indent lines; tabs are not allowed
Open

    public function __construct($options = []) {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    // Please pass in the appropriate stuff

Spaces must be used to indent lines; tabs are not allowed
Open

            if (property_exists($this, $key)) {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

                $this->$key = $value;

Spaces must be used to indent lines; tabs are not allowed
Open

            'baseUri' => $this->url,

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        $file_name = rawurlencode($file_name);

Spaces must be used to indent lines; tabs are not allowed
Open

            'proxy' => $this->proxy

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($status == 204) {

Spaces must be used to indent lines; tabs are not allowed
Open

            'password' => $this->password,

Spaces must be used to indent lines; tabs are not allowed
Open

    private function read_file($filepath) {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

            'userName' => $this->username,

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->client = new Client(array(

Spaces must be used to indent lines; tabs are not allowed
Open

        $fh = fopen($filepath, 'r');

Spaces must be used to indent lines; tabs are not allowed
Open

            // but only kinda.

Spaces must be used to indent lines; tabs are not allowed
Open

        return $content;

Spaces must be used to indent lines; tabs are not allowed
Open

    // Creates the directory into which we will PUT our file

Spaces must be used to indent lines; tabs are not allowed
Open

        ));

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        return $dir_path;

Spaces must be used to indent lines; tabs are not allowed
Open

        error_log("WebDAV Driver: {$status} on PUT");

Spaces must be used to indent lines; tabs are not allowed
Open

            $location = $this->url . "/" .

Spaces must be used to indent lines; tabs are not allowed
Open

                $dir_path . "/" . $file_name;            

Spaces must be used to indent lines; tabs are not allowed
Open

            // It kinda doesn't like creating a dir that exists

Spaces must be used to indent lines; tabs are not allowed
Open

        fclose($fh);

Spaces must be used to indent lines; tabs are not allowed
Open

        /* A status code of 201 means a new file was created.

Spaces must be used to indent lines; tabs are not allowed
Open

        $dir_path = $this->make_destination($destination_dir);

Spaces must be used to indent lines; tabs are not allowed
Open

        $response = $this->client->request('PUT', "/{$dir_path}/" . $file_name, $content);

Spaces must be used to indent lines; tabs are not allowed
Open

        $mkcol_response = $this->client->request('MKCOL', $dir_path);

Spaces must be used to indent lines; tabs are not allowed
Open

        $content = $this->read_file($filepath);

Spaces must be used to indent lines; tabs are not allowed
Open

        // Which response code when a new file is really 

Spaces must be used to indent lines; tabs are not allowed
Open

    private function make_destination($destination_dir) {

Spaces must be used to indent lines; tabs are not allowed
Open

            error_log("WebDAV Driver: {$mkcol_response['statusCode']} on MKCOL");

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($mkcol_response['statusCode'] >= 400) {

Spaces must be used to indent lines; tabs are not allowed
Open

        $status = $response['statusCode'];

Spaces must be used to indent lines; tabs are not allowed
Open

        $content =  fread($fh, filesize($filepath));

Class name "Uploader_Webdav" is not in camel caps format
Open

class Uploader_Webdav {

Opening brace should be on a new line
Open

    public function __construct($options = []) {

Opening brace should be on a new line
Open

    private function make_destination($destination_dir) {

Opening brace should be on a new line
Open

    private function create_client() {

Opening brace should be on a new line
Open

    private function process_response($response) {

Opening brace should be on a new line
Open

    public function send($filepath, $destination_dir = '') {

Whitespace found at end of line
Open

                $dir_path . "/" . $file_name;            

Opening brace should be on a new line
Open

    private function read_file($filepath) {

Whitespace found at end of line
Open

        // Which response code when a new file is really 

There are no issues that match your filters.

Category
Status