Code Duplication    Length = 6-7 lines in 2 locations

PHPDaemon/Clients/DNS/Pool.php 2 locations

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