Dhii/collections-abstract-base

View on GitHub
src/AbstractIterableCollection.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused local variables such as '$_item'.
Open

            foreach ($list as $_item) {
Severity: Minor
Found in src/AbstractIterableCollection.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

The variable $_item is not named in camelCase.
Open

    public function _arrayCount(&$list)
    {
        if (is_array($list)) {
            return count($list);
        }
Severity: Minor
Found in src/AbstractIterableCollection.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 _current is not named in camelCase.
Open

    protected function _current()
    {
        return $this->_arrayCurrent($this->_getCachedItems());
    }
Severity: Minor
Found in src/AbstractIterableCollection.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 _arrayNext is not named in camelCase.
Open

    protected function _arrayNext(&$array)
    {
        return $array instanceof \Traversable
            ? $this->_getIterator($array)->next()
            : next($array);
Severity: Minor
Found in src/AbstractIterableCollection.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 _arrayCount is not named in camelCase.
Open

    public function _arrayCount(&$list)
    {
        if (is_array($list)) {
            return count($list);
        }
Severity: Minor
Found in src/AbstractIterableCollection.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 _next is not named in camelCase.
Open

    protected function _next()
    {
        $this->_arrayNext($this->_getCachedItems());
    }
Severity: Minor
Found in src/AbstractIterableCollection.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 _arrayCurrent is not named in camelCase.
Open

    protected function _arrayCurrent(&$array)
    {
        return $array instanceof \Traversable
            ? $this->_getIterator($array)->current()
            : current($array);
Severity: Minor
Found in src/AbstractIterableCollection.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 _count is not named in camelCase.
Open

    protected function _count()
    {
        return $this->_arrayCount($this->_getCachedItems());
    }
Severity: Minor
Found in src/AbstractIterableCollection.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 _arrayRewind is not named in camelCase.
Open

    protected function _arrayRewind(&$array)
    {
        return $array instanceof \Traversable
            ? $this->_getIterator($array)->rewind()
            : reset($array);
Severity: Minor
Found in src/AbstractIterableCollection.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 _arrayKey is not named in camelCase.
Open

    protected function _arrayKey(&$array)
    {
        return $array instanceof \Traversable
            ? $this->_getIterator($array)->key()
            : key($array);
Severity: Minor
Found in src/AbstractIterableCollection.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 _getCachedItems is not named in camelCase.
Open

    protected function &_getCachedItems()
    {
        if (is_null($this->cachedItems)) {
            $this->cachedItems = $this->_getItemsForCache();
            $this->_arrayRewind($this->cachedItems);
Severity: Minor
Found in src/AbstractIterableCollection.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 _key is not named in camelCase.
Open

    protected function _key()
    {
        return $this->_arrayKey($this->_getCachedItems());
    }
Severity: Minor
Found in src/AbstractIterableCollection.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 _rewind is not named in camelCase.
Open

    protected function _rewind()
    {
        $this->_clearItemCache();
    }
Severity: Minor
Found in src/AbstractIterableCollection.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 _clearItemCache is not named in camelCase.
Open

    protected function _clearItemCache()
    {
        $this->cachedItems = null;

        return $this;
Severity: Minor
Found in src/AbstractIterableCollection.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 _getIterator is not named in camelCase.
Open

    protected function _getIterator(\Traversable $iterator)
    {
        if ($iterator instanceof \Iterator) {
            return $iterator;
        }
Severity: Minor
Found in src/AbstractIterableCollection.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 _getItemsForCache is not named in camelCase.
Open

    protected function _getItemsForCache()
    {
        $items = $this->getItems();

        return $items;
Severity: Minor
Found in src/AbstractIterableCollection.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