Code Duplication    Length = 12-12 lines in 2 locations

PHPDaemon/Network/Connection.php 1 location

@@ 358-369 (lines=12) @@
355
            return;
356
        }
357
        $ctx = Daemon::$config->{'TransportContext:' . $this->ctxname};
358
        foreach ($ctx as $key => $entry) {
359
            $value = ($entry instanceof Config\Entry\Generic) ? $entry->value : $entry;
360
            if (isset($this->{$key}) && is_bool($this->{$key})) {
361
                $this->{$key} = (bool)$value;
362
                continue;
363
            }
364
            if (!property_exists($this, $key)) {
365
                Daemon::log(get_class($this) . ': unrecognized setting in transport context \'' . $this->ctxname . '\': \'' . $key . '\'');
366
                continue;
367
            }
368
            $this->{$key} = $value;
369
        }
370
    }
371
372
    /**

PHPDaemon/BoundSocket/Generic.php 1 location

@@ 236-247 (lines=12) @@
233
            return;
234
        }
235
        $ctx = Daemon::$config->{'TransportContext:' . $this->ctxname};
236
        foreach ($ctx as $key => $entry) {
237
            $value = ($entry instanceof \PHPDaemon\Config\Entry\Generic) ? $entry->value : $entry;
238
            if (isset($this->{$key}) && is_bool($this->{$key})) {
239
                $this->{$key} = (bool)$value;
240
                continue;
241
            }
242
            if (!property_exists($this, $key)) {
243
                Daemon::log(get_class($this) . ': unrecognized setting in transport context \'' . $this->ctxname . '\': \'' . $key . '\'');
244
                continue;
245
            }
246
            $this->{$key} = $value;
247
        }
248
    }
249
250
    /**