Dhii/factory-base

View on GitHub

Showing 5 of 5 total issues

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

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

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $message = '',
        $code = 0,
        RootException $previous = null,
        $factory = null,
        $config = null
Severity: Minor
Found in src/Exception/CouldNotMakeException.php - About 35 mins to fix

    Method _createCouldNotMakeException has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $message = null,
            $code = null,
            RootException $previous = null,
            $factory = null,
            $config = null
    Severity: Minor
    Found in src/Exception/CreateCouldNotMakeExceptionCapableTrait.php - About 35 mins to fix

      Avoid assigning values to variables in if clauses and the like (line '49', column '40').
      Open

          protected function _setSubjectConfig($subjectConfig)
          {
              if ($subjectConfig === null || $subjectConfig = $this->_normalizeContainer($subjectConfig)) {
                  $this->subjectConfig = $subjectConfig;
              }
      Severity: Minor
      Found in src/SubjectConfigAwareTrait.php by phpmd

      IfStatementAssignment

      Since: 2.7.0

      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($foo = 'bar') { // possible typo
                  // ...
              }
              if ($baz = 0) { // always false
                  // ...
              }
          }
      }

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

      The method __ is not named in camelCase.
      Open

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

      Severity
      Category
      Status
      Source
      Language