Dhii/iterator-abstract

View on GitHub
src/IteratorIteratorTrait.php

Summary

Maintainability
A
0 mins
Test Coverage

Parameter $key has undeclared type \Dhii\Util\String\StringableInterface
Open

    abstract protected function _createIteration($key, $value);
Severity: Minor
Found in src/IteratorIteratorTrait.php by phan

Parameter $code has undeclared type \Dhii\Util\String\StringableInterface
Open

    abstract protected function _createInvalidArgumentException(
Severity: Minor
Found in src/IteratorIteratorTrait.php by phan

Return type of _createIterationFromTracker() is undeclared type \Dhii\Iterator\IterationInterface
Open

    protected function _createIterationFromTracker($tracker)
Severity: Minor
Found in src/IteratorIteratorTrait.php by phan

Parameter $message has undeclared type \Dhii\Util\String\StringableInterface
Open

    abstract protected function _createInvalidArgumentException(
Severity: Minor
Found in src/IteratorIteratorTrait.php by phan

Return type of _createIteration() is undeclared type \Dhii\Iterator\IterationInterface
Open

    abstract protected function _createIteration($key, $value);
Severity: Minor
Found in src/IteratorIteratorTrait.php by phan

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

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

    protected function _advanceTracker($tracker)
    {
        if (!($tracker instanceof Iterator)) {
            throw $this->_createInvalidArgumentException($this->__('Can only advance an Iterator tracker'), null, null, $tracker);
        }
Severity: Minor
Found in src/IteratorIteratorTrait.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 _resetTracker is not named in camelCase.
Open

    protected function _resetTracker($tracker)
    {
        if (!($tracker instanceof Iterator)) {
            throw $this->_createInvalidArgumentException($this->__('Can only reset an Iterator tracker'), null, null, $tracker);
        }
Severity: Minor
Found in src/IteratorIteratorTrait.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 _calculateKey is not named in camelCase.
Open

    protected function _calculateKey(Iterator $iterator)
    {
        return $iterator->valid()
            ? $iterator->key()
            : null;
Severity: Minor
Found in src/IteratorIteratorTrait.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 _calculateValue is not named in camelCase.
Open

    protected function _calculateValue(Iterator $iterator)
    {
        return $iterator->valid()
            ? $iterator->current()
            : null;
Severity: Minor
Found in src/IteratorIteratorTrait.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 __ is not named in camelCase.
Open

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

    abstract protected function _createIteration($key, $value);
Severity: Minor
Found in src/IteratorIteratorTrait.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 _createIterationFromTracker is not named in camelCase.
Open

    protected function _createIterationFromTracker($tracker)
    {
        if (!($tracker instanceof Iterator)) {
            throw $this->_createInvalidArgumentException($this->__('Can only create an iteration from an Iterator tracker'), null, null, $tracker);
        }
Severity: Minor
Found in src/IteratorIteratorTrait.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 _createInvalidArgumentException is not named in camelCase.
Open

    abstract protected function _createInvalidArgumentException(
        $message = null,
        $code = null,
        RootException $previous = null,
        $argument = null
Severity: Minor
Found in src/IteratorIteratorTrait.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