Dhii/wp-events

View on GitHub
src/WordPress/WpHookReplacer.php

Summary

Maintainability
A
0 mins
Test Coverage

The class WpHookReplacer has 12 public methods. Consider refactoring WpHookReplacer to keep number of public methods under 10.
Open

class WpHookReplacer implements Iterator, ArrayAccess
{
    /**
     * The original WP_Hook instance to proxy to.
     *
Severity: Minor
Found in src/WordPress/WpHookReplacer.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

Avoid excessively long variable names like $stoppedPropagationException. Keep variable name length under 20.
Open

        } catch (StoppedPropagationExceptionInterface $stoppedPropagationException) {
Severity: Minor
Found in src/WordPress/WpHookReplacer.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

The method apply_filters is not named in camelCase.
Open

    public function apply_filters($value, $args)
    {
        try {
            $value = $this->wpHook->apply_filters($value, $args);
        } catch (StoppedPropagationExceptionInterface $stoppedPropagationException) {
Severity: Minor
Found in src/WordPress/WpHookReplacer.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