src/Phan/Language/Element/TypedElement.php

Summary

Maintainability
A
3 hrs
Test Coverage

TypedElement has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class TypedElement implements TypedElementInterface
{
    /**
     * @var string
     * The name of the typed structural element
Severity: Minor
Found in src/Phan/Language/Element/TypedElement.php - About 3 hrs to fix

    The 'getFlagsHasState()' method which returns a boolean should be named 'is...()' or 'has...()'
    Open

        public function getFlagsHasState(int $flag): bool
        {
            return ($this->flags & $flag) === $flag;
        }

    BooleanGetMethodName

    Since: 0.2

    Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

    Example

    class Foo {
        /**
         * @return boolean
         */
        public function getFoo() {} // bad
        /**
         * @return bool
         */
        public function isFoo(); // ok
        /**
         * @return boolean
         */
        public function getFoo($bar); // ok, unless checkParameterizedMethods=true
    }

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

    The 'getPhanFlagsHasState()' method which returns a boolean should be named 'is...()' or 'has...()'
    Open

        public function getPhanFlagsHasState(int $flag): bool
        {
            return ($this->phan_flags & $flag) === $flag;
        }

    BooleanGetMethodName

    Since: 0.2

    Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

    Example

    class Foo {
        /**
         * @return boolean
         */
        public function getFoo() {} // bad
        /**
         * @return bool
         */
        public function isFoo(); // ok
        /**
         * @return boolean
         */
        public function getFoo($bar); // ok, unless checkParameterizedMethods=true
    }

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

    There are no issues that match your filters.

    Category
    Status