Code Duplication    Length = 14-14 lines in 2 locations

src/CommandBus/Provider/LegacyProvider.php 1 location

@@ 13-26 (lines=14) @@
10
/**
11
 * A handler provider for Legacy versions of concrete5
12
 */
13
class LegacyProvider implements Provider
14
{
15
16
    public function register(HandlerLocator $locator, Site $site)
17
    {
18
        // If we're not in a concrete5 site, or if we're in a modern site, return
19
        if (!$site || version_compare($site->getVersion(), '5.7.0') > -1) {
20
            return;
21
        }
22
23
        // Add a handler for the "Clear" command
24
        $locator->pushHandler(Clear::class, CacheHandler::class);
25
    }
26
}
27

src/CommandBus/Provider/ModernProvider.php 1 location

@@ 13-26 (lines=14) @@
10
/**
11
 * Modern command handler provider
12
 */
13
class ModernProvider implements Provider
14
{
15
16
    public function register(HandlerLocator $locator, Site $site)
17
    {
18
        // If we're not in a concrete5 site, or if we're in a legacy site, return
19
        if (!$site || version_compare($site->getVersion(), '5.7.0') < 0) {
20
            return;
21
        }
22
23
        // Add a handler for the `Clear` command
24
        $locator->pushHandler(Clear::class, CacheHandler::class);
25
    }
26
}
27