RebelCode/rcmod-eddbk-booking-logic

View on GitHub
src/BookingTransitionManager.php

Summary

Maintainability
A
35 mins
Test Coverage

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

        ValidatorInterface $bookingValidator,
        TransitionerInterface $transitioner,
        EventManagerInterface $eventManager,
        EventFactoryInterface $eventFactory,
        $transitions
Severity: Minor
Found in src/BookingTransitionManager.php - About 35 mins to fix

    The class BookingTransitionManager has a coupling between objects value of 14. Consider to reduce the number of dependencies under 13.
    Open

    class BookingTransitionManager implements InvocableInterface
    {
        /*
         * Provides awareness of a validator.
         *
    Severity: Minor
    Found in src/BookingTransitionManager.php by phpmd

    CouplingBetweenObjects

    Since: 1.1.0

    A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

    Example

    class Foo {
        /**
         * @var \foo\bar\X
         */
        private $x = null;
    
        /**
         * @var \foo\bar\Y
         */
        private $y = null;
    
        /**
         * @var \foo\bar\Z
         */
        private $z = null;
    
        public function setFoo(\Foo $foo) {}
        public function setBar(\Bar $bar) {}
        public function setBaz(\Baz $baz) {}
    
        /**
         * @return \SplObjectStorage
         * @throws \OutOfRangeException
         * @throws \InvalidArgumentException
         * @throws \ErrorException
         */
        public function process(\Iterator $it) {}
    
        // ...
    }

    Source https://phpmd.org/rules/design.html#couplingbetweenobjects

    Avoid excessively long variable names like $validationFailedException. Keep variable name length under 20.
    Open

            } catch (ValidationFailedExceptionInterface $validationFailedException) {
    Severity: Minor
    Found in src/BookingTransitionManager.php by phpmd

    LongVariable

    Since: 0.2

    Detects when a field, formal or local variable is declared with a long name.

    Example

    class Something {
        protected $reallyLongIntName = -3; // VIOLATION - Field
        public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
            $otherReallyLongName = -5; // VIOLATION - Local
            for ($interestingIntIndex = 0; // VIOLATION - For
                 $interestingIntIndex < 10;
                 $interestingIntIndex++ ) {
            }
        }
    }

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

    There are no issues that match your filters.

    Category
    Status