detain/myadmin-plugin-installer

View on GitHub
src/Plugin.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '168', column '23').
Open

            throw new \Exception('The writable-dirs must be an array.');
Severity: Minor
Found in src/Plugin.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '183', column '23').
Open

            throw new \Exception('The writable-files must be specified in composer arbitrary extra data.');
Severity: Minor
Found in src/Plugin.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '288', column '27').
Open

                throw new \Exception('Path Not Found: '.$path);
Severity: Minor
Found in src/Plugin.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '165', column '23').
Open

            throw new \Exception('The writable-dirs must be specified in composer arbitrary extra data.');
Severity: Minor
Found in src/Plugin.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '186', column '23').
Open

            throw new \Exception('The writable-files must be an array.');
Severity: Minor
Found in src/Plugin.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '309', column '27').
Open

                throw new \Exception('File Not Found: '.$path);
Severity: Minor
Found in src/Plugin.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '332', column '23').
Open

            throw new \Exception('Returned Error Code '.$return);
Severity: Minor
Found in src/Plugin.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

The parameter $http_user is not named in camelCase.
Open

    public static function SetfaclPermissionsSetter(Event $event, $http_user, $path)
    {
        self::EnsureDirExists($event, $path);
        self::runProcess($event, 'setfacl -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path);
        self::runProcess($event, 'setfacl -d -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path);
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $http_user is not named in camelCase.
Open

    public static function ChmodPermissionsSetter(Event $event, $http_user, $path, $type = 'dir')
    {
        if ($type == 'dir') {
            self::EnsureDirExists($event, $path);
        //            self::runProcess($event, 'chmod +a "'.$http_user.' allow delete,write,append,file_inherit,directory_inherit" '.$path);
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The variable $http_user is not named in camelCase.
Open

    public static function setPermissionsSetfacl(Event $event)
    {
        $http_user = self::getHttpdUser($event);
        foreach (self::getWritableDirs($event) as $path) {
            self::SetfaclPermissionsSetter($event, $http_user, $path);
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $http_user is not named in camelCase.
Open

    public static function setPermissionsChmod(Event $event)
    {
        $http_user = self::getHttpdUser($event);
        foreach (self::getWritableDirs($event) as $path) {
            self::ChmodPermissionsSetter($event, $http_user, $path, 'dir');
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $http_user is not named in camelCase.
Open

    public static function setPermissionsChmod(Event $event)
    {
        $http_user = self::getHttpdUser($event);
        foreach (self::getWritableDirs($event) as $path) {
            self::ChmodPermissionsSetter($event, $http_user, $path, 'dir');
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $http_user is not named in camelCase.
Open

    public static function SetfaclPermissionsSetter(Event $event, $http_user, $path)
    {
        self::EnsureDirExists($event, $path);
        self::runProcess($event, 'setfacl -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path);
        self::runProcess($event, 'setfacl -d -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path);
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $http_user is not named in camelCase.
Open

    public static function ChmodPermissionsSetter(Event $event, $http_user, $path, $type = 'dir')
    {
        if ($type == 'dir') {
            self::EnsureDirExists($event, $path);
        //            self::runProcess($event, 'chmod +a "'.$http_user.' allow delete,write,append,file_inherit,directory_inherit" '.$path);
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $http_user is not named in camelCase.
Open

    public static function setPermissionsSetfacl(Event $event)
    {
        $http_user = self::getHttpdUser($event);
        foreach (self::getWritableDirs($event) as $path) {
            self::SetfaclPermissionsSetter($event, $http_user, $path);
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $http_user is not named in camelCase.
Open

    public static function setPermissionsChmod(Event $event)
    {
        $http_user = self::getHttpdUser($event);
        foreach (self::getWritableDirs($event) as $path) {
            self::ChmodPermissionsSetter($event, $http_user, $path, 'dir');
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $http_user is not named in camelCase.
Open

    public static function SetfaclPermissionsSetter(Event $event, $http_user, $path)
    {
        self::EnsureDirExists($event, $path);
        self::runProcess($event, 'setfacl -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path);
        self::runProcess($event, 'setfacl -d -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path);
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $http_user is not named in camelCase.
Open

    public static function setPermissionsSetfacl(Event $event)
    {
        $http_user = self::getHttpdUser($event);
        foreach (self::getWritableDirs($event) as $path) {
            self::SetfaclPermissionsSetter($event, $http_user, $path);
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The method EnsureFileExists is not named in camelCase.
Open

    public static function EnsureFileExists(Event $event, $path)
    {
        if (!is_dir(dirname($path))) {
            mkdir(dirname($path), 0777, true);
            touch($path);
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method ChmodPermissionsSetter is not named in camelCase.
Open

    public static function ChmodPermissionsSetter(Event $event, $http_user, $path, $type = 'dir')
    {
        if ($type == 'dir') {
            self::EnsureDirExists($event, $path);
        //            self::runProcess($event, 'chmod +a "'.$http_user.' allow delete,write,append,file_inherit,directory_inherit" '.$path);
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method SetfaclPermissionsSetter is not named in camelCase.
Open

    public static function SetfaclPermissionsSetter(Event $event, $http_user, $path)
    {
        self::EnsureDirExists($event, $path);
        self::runProcess($event, 'setfacl -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path);
        self::runProcess($event, 'setfacl -d -m u:"'.$http_user.'":rwX -m u:'.$_SERVER['USER'].':rwX '.$path);
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method EnsureDirExists is not named in camelCase.
Open

    public static function EnsureDirExists(Event $event, $path)
    {
        if (!is_dir($path)) {
            mkdir($path, 0777, true);
            if (!is_dir($path)) {
Severity: Minor
Found in src/Plugin.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status