Code Duplication    Length = 6-7 lines in 2 locations

PHPDaemon/Clients/DNS/Pool.php 2 locations

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