Code Duplication    Length = 6-7 lines in 2 locations

PHPDaemon/Clients/DNS/Pool.php 2 locations

@@ 214-220 (lines=7) @@
211
     */
212
    public function resolve($hostname, $cb, $noncache = false, $nameServers = [])
213
    {
214
        if (!$this->preloading->hasCompleted()) {
215
            $pool = $this;
216
            $this->preloading->addListener(function ($job) use ($hostname, $cb, $noncache, $pool, $nameServers) {
217
                $pool->resolve($hostname, $cb, $noncache, $nameServers);
218
            });
219
            return;
220
        }
221
        $hostname = rtrim($hostname, '.') . '.';
222
        if (isset($this->hosts[$hostname])) {
223
            $cb($this->hosts[$hostname]);
@@ 293-298 (lines=6) @@
290
        if (!$nameServers) {
291
            $nameServers = $this->nameServers;
292
        }
293
        if (!$this->preloading->hasCompleted()) {
294
            $this->preloading->addListener(function ($job) use (
295
                $hostname,
296
                $cb,
297
                $noncache,
298
                $pool,
299
                $nameServers,
300
                $proto
301
            ) {