Dhii/iterator-abstract

View on GitHub
src/RecursiveIteratorTrait.php

Summary

Maintainability
A
30 mins
Test Coverage

Avoid too many return statements within this method.
Open

        return $this->_loop();
Severity: Major
Found in src/RecursiveIteratorTrait.php - About 30 mins to fix

    Call to method getKey from undeclared class \Dhii\Iterator\IterationInterface
    Open

            if ($current->getKey() === null) {
    Severity: Critical
    Found in src/RecursiveIteratorTrait.php by phan

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

        protected function _createIteration($key, $value, $pathSegments = [])
    Severity: Minor
    Found in src/RecursiveIteratorTrait.php by phan

    Call to method getValue from undeclared class \Dhii\Iterator\IterationInterface
    Open

            $children = $current->getValue();
    Severity: Critical
    Found in src/RecursiveIteratorTrait.php by phan

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

        protected function _createIteration($key, $value, $pathSegments = [])
    Severity: Minor
    Found in src/RecursiveIteratorTrait.php by phan

    Reference to constant MODE_CHILD_FIRST from undeclared class \Dhii\Iterator\RecursiveIteratorInterface
    Open

            if ($this->_isMode(R::MODE_CHILD_FIRST)) {
    Severity: Critical
    Found in src/RecursiveIteratorTrait.php by phan

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

        abstract protected function _createRecursiveIteration($key, $value, $pathSegments = []);
    Severity: Minor
    Found in src/RecursiveIteratorTrait.php by phan

    Parameter $pathSegments has undeclared type \Dhii\Util\String\StringableInterface[]
    Open

        protected function _createIteration($key, $value, $pathSegments = [])
    Severity: Minor
    Found in src/RecursiveIteratorTrait.php by phan

    Reference to constant MODE_SELF_FIRST from undeclared class \Dhii\Iterator\RecursiveIteratorInterface
    Open

            if ($this->_isMode(R::MODE_SELF_FIRST)) {
    Severity: Critical
    Found in src/RecursiveIteratorTrait.php by phan

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

        protected function _reset()
    Severity: Minor
    Found in src/RecursiveIteratorTrait.php by phan

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

        protected function _loop()
    Severity: Minor
    Found in src/RecursiveIteratorTrait.php by phan

    Call to method getValue from undeclared class \Dhii\Iterator\IterationInterface
    Open

            if (!$this->_isElementHasChildren($current->getValue())) {
    Severity: Critical
    Found in src/RecursiveIteratorTrait.php by phan

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

        protected function _backtrackLoop()
    Severity: Minor
    Found in src/RecursiveIteratorTrait.php by phan

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

        protected function _createCurrentIteration(&$iterable)
    Severity: Minor
    Found in src/RecursiveIteratorTrait.php by phan

    The method _loop is not named in camelCase.
    Open

        protected function _loop()
        {
            // Ensure that there are items on the stack
            if (!$this->_hasParents()) {
                return $this->_createIteration(null, null);
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _valid is not named in camelCase.
    Open

        protected function _valid()
        {
            return $this->_hasParents();
        }
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _getCurrentIterable is not named in camelCase.
    Open

        protected function &_getCurrentIterable()
        {
            $iterable = &$this->_getTopmostParent();
    
            return $iterable;
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _backtrackLoop is not named in camelCase.
    Open

        protected function _backtrackLoop()
        {
            $this->_popParent();
    
            if (!$this->_hasParents()) {
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _pushParent is not named in camelCase.
    Open

        protected function _pushParent(&$parent)
        {
            $children    = &$this->_getElementChildren($parent);
            $pathSegment = $this->_getElementPathSegment(null, $parent);
    
    
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _getTopmostParent is not named in camelCase.
    Open

        protected function &_getTopmostParent()
        {
            if (isset($this->parents[0])) {
                return $this->parents[0];
            }
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _getCurrentIterableKey is not named in camelCase.
    Open

        abstract protected function _getCurrentIterableKey(&$iterable);
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _popParent is not named in camelCase.
    Open

        protected function _popParent()
        {
            $this->_popPathSegment();
    
            array_shift($this->parents);
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _resetParents is not named in camelCase.
    Open

        protected function _resetParents()
        {
            $this->parents      = [];
            $this->pathSegments = [];
    
    
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _pushPathSegment is not named in camelCase.
    Open

        protected function _pushPathSegment($segment)
        {
            array_push($this->pathSegments, $segment);
        }
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _getCurrentPath is not named in camelCase.
    Open

        protected function _getCurrentPath($key, $value)
        {
            $path   = $this->_getPathSegments();
            $path[] = $this->_getElementPathSegment($key, $value);
    
    
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _createCurrentIteration is not named in camelCase.
    Open

        protected function _createCurrentIteration(&$iterable)
        {
            $key  = $this->_getCurrentIterableKey($iterable);
            $val  = $this->_getCurrentIterableValue($iterable);
            $path = $this->_getCurrentPath($key, $val);
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _hasParents is not named in camelCase.
    Open

        protected function _hasParents()
        {
            return count($this->parents) > 0;
        }
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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

        protected function _createIteration($key, $value, $pathSegments = [])
        {
            return $this->_createRecursiveIteration($key, $value, $pathSegments);
        }
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _createRecursiveIteration is not named in camelCase.
    Open

        abstract protected function _createRecursiveIteration($key, $value, $pathSegments = []);
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _getElementChildren is not named in camelCase.
    Open

        abstract protected function &_getElementChildren($value);
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _isMode is not named in camelCase.
    Open

        abstract protected function _isMode($mode);
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _reset is not named in camelCase.
    Open

        protected function _reset()
        {
            $this->_resetParents();
            $this->_pushParent($this->_getInitialParentIterable());
    
    
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _getInitialParentIterable is not named in camelCase.
    Open

        abstract protected function &_getInitialParentIterable();
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _popPathSegment is not named in camelCase.
    Open

        protected function _popPathSegment()
        {
            array_pop($this->pathSegments);
        }
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _getCurrentIterableValue is not named in camelCase.
    Open

        abstract protected function _getCurrentIterableValue(&$iterable);
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _isElementHasChildren is not named in camelCase.
    Open

        abstract protected function _isElementHasChildren($value);
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _getPathSegments is not named in camelCase.
    Open

        protected function _getPathSegments()
        {
            return $this->pathSegments;
        }
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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 _getElementPathSegment is not named in camelCase.
    Open

        abstract protected function _getElementPathSegment($key, $value);
    Severity: Minor
    Found in src/RecursiveIteratorTrait.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