Code Duplication    Length = 12-12 lines in 2 locations

src/Factory.php 2 locations

@@ 85-96 (lines=12) @@
82
83
    private function guardThatTheseAreCalendars(array $calendars)
84
    {
85
        foreach ($calendars as $index => $calendar) {
86
            if (!$calendar instanceof Calendar) {
87
                throw new InvalidArgumentException(
88
                    sprintf(
89
                        'Expected an array of "%s" but instead got "%s" at "%s"',
90
                        Calendar::class,
91
                        is_object($calendar) ? get_class($calendar) : gettype($calendar),
92
                        $index
93
                    )
94
                );
95
            }
96
        }
97
    }
98
99
    private function guardThatTheseAreTranslators(array $translators)
@@ 111-122 (lines=12) @@
108
                );
109
            }
110
111
            foreach ($locales as $locale => $translator) {
112
                if (!$translator instanceof Translator) {
113
                    throw new InvalidArgumentException(
114
                        sprintf(
115
                            'Expected an array of "%s" but instead got "%s" at "%s"',
116
                            Calendar::class,
117
                            is_object($translator) ? get_class($translator) : gettype($translator),
118
                            $locale
119
                        )
120
                    );
121
                }
122
            }
123
        }
124
    }
125
}