abrain/einsatzverwaltung

View on GitHub
src/Model/ReportAnnotation.php

Summary

Maintainability
A
45 mins
Test Coverage
F
45%

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

    public function __construct($identifier, $name, $metaKey, $icon, $labelWhenActive, $labelWhenInactive)
Severity: Minor
Found in src/Model/ReportAnnotation.php - About 45 mins to fix

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

        public function getStateForReport(int $postId): bool
        {
            $get_post_meta = get_post_meta($postId, $this->metaKey, true);
            return 1 == $get_post_meta;
        }
    Severity: Minor
    Found in src/Model/ReportAnnotation.php by phpmd

    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