Code Duplication    Length = 8-8 lines in 2 locations

src/eXpansion/Core/Services/Application.php 1 location

@@ 51-58 (lines=8) @@
48
        $this->dispatcher->dispatch(self::EVENT_PRE_LOOP, []);
49
50
        $calls = $this->connection->executeCallbacks();
51
        if (!empty($calls)) {
52
            foreach ($calls as $call) {
53
                $method = preg_replace('/^[[:alpha:]]+\./', '', $call[0]); // remove trailing "Whatever."
54
                $params = (array) $call[1];
55
56
                $this->dispatcher->dispatch($method, $params);
57
            }
58
        }
59
60
        $this->connection->executeMulticall();
61
        $this->dispatcher->dispatch(self::EVENT_POST_LOOP, []);

src/eXpansion/Core/Services/ApplicationDebug.php 1 location

@@ 20-27 (lines=8) @@
17
    {
18
19
        $calls = $this->connection->executeCallbacks();
20
        if (!empty($calls)) {
21
            foreach ($calls as $call) {
22
                $method = preg_replace('/^[[:alpha:]]+\./', '', $call[0]); // remove trailing "Whatever."
23
                $params = (array) $call[1];
24
25
                $this->dispatcher->dispatch($method, $params);
26
            }
27
        }
28
        $this->connection->executeMulticall();
29
    }
30
}