Code Duplication    Length = 7-7 lines in 2 locations

src/Factories/FormatterFactory.php 1 location

@@ 49-55 (lines=7) @@
46
     *
47
     * @throws \InvalidArgumentException
48
     */
49
    private function validateFormatter(string $formatterClass): void
50
    {
51
        $formatterInterface = FormatterInterface::class;
52
        if (! (new \ReflectionClass($formatterClass))->implementsInterface($formatterInterface)) {
53
            throw new \InvalidArgumentException("{$formatterClass} doesn't implement {$formatterInterface}");
54
        }
55
    }
56
}
57

src/Factories/HandlerFactory.php 1 location

@@ 71-77 (lines=7) @@
68
     *
69
     * @throws \InvalidArgumentException
70
     */
71
    private function validateHandler(string $handlerClass): void
72
    {
73
        $handlerInterface = HandlerInterface::class;
74
        if (! (new \ReflectionClass($handlerClass))->implementsInterface($handlerInterface)) {
75
            throw new \InvalidArgumentException("{$handlerClass} doesn't implement {$handlerInterface}");
76
        }
77
    }
78
}
79