RebelCode/expression-wp-query-builder-abstract

View on GitHub
src/BuildWpQueryArgsCapableTrait.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using empty try-catch blocks in _attemptBuildWpQueryArgsTerm.
Open

        } catch (OutOfRangeException $exception) {
        }
Severity: Minor
Found in src/BuildWpQueryArgsCapableTrait.php by phpmd

EmptyCatchBlock

Since: 2.7.0

Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.

Example

class Foo {

  public function bar()
  {
      try {
          // ...
      } catch (Exception $e) {} // empty catch block
  }
}

Source https://phpmd.org/rules/design.html#emptycatchblock

Avoid using empty try-catch blocks in _attemptBuildWpQueryArgsTerm.
Open

        } catch (OutOfRangeException $exception) {
        }
Severity: Minor
Found in src/BuildWpQueryArgsCapableTrait.php by phpmd

EmptyCatchBlock

Since: 2.7.0

Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.

Example

class Foo {

  public function bar()
  {
      try {
          // ...
      } catch (Exception $e) {} // empty catch block
  }
}

Source https://phpmd.org/rules/design.html#emptycatchblock

Avoid using empty try-catch blocks in _attemptBuildWpQueryArgsTerm.
Open

        } catch (OutOfRangeException $exception) {
        }
Severity: Minor
Found in src/BuildWpQueryArgsCapableTrait.php by phpmd

EmptyCatchBlock

Since: 2.7.0

Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.

Example

class Foo {

  public function bar()
  {
      try {
          // ...
      } catch (Exception $e) {} // empty catch block
  }
}

Source https://phpmd.org/rules/design.html#emptycatchblock

Avoid using short method names like BuildWpQueryArgsCapableTrait::__(). The configured minimum method name length is 3.
Open

    abstract protected function __($string, $args = [], $context = null);
Severity: Minor
Found in src/BuildWpQueryArgsCapableTrait.php by phpmd

ShortMethodName

Since: 0.2

Detects when very short method names are used.

Example

class ShortMethod {
    public function a( $index ) { // Violation
    }
}

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

The method __ is not named in camelCase.
Open

    abstract protected function __($string, $args = [], $context = null);
Severity: Minor
Found in src/BuildWpQueryArgsCapableTrait.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