Code Duplication    Length = 3-5 lines in 2 locations

src/Core/Injector/Injector.php 2 locations

@@ 655-659 (lines=5) @@
652
                }
653
654
                // Format validation
655
                if (!is_array($method) || !isset($method[0]) || isset($method[2])) {
656
                    throw new \InvalidArgumentException(
657
                        "'calls' entries in service definition should be 1 or 2 element arrays."
658
                    );
659
                }
660
                if (!is_string($method[0])) {
661
                    throw new \InvalidArgumentException("1st element of a 'calls' entry should be a string");
662
                }
@@ 663-665 (lines=3) @@
660
                if (!is_string($method[0])) {
661
                    throw new \InvalidArgumentException("1st element of a 'calls' entry should be a string");
662
                }
663
                if (isset($method[1]) && !is_array($method[1])) {
664
                    throw new \InvalidArgumentException("2nd element of a 'calls' entry should an arguments array");
665
                }
666
667
                // Check that the method exists and is callable
668
                $objectMethod = array($object, $method[0]);