Code Duplication    Length = 14-14 lines in 5 locations

src/cli/Database/Base/Channel.php 1 location

@@ 325-338 (lines=14) @@
322
     * Clean up internal collections prior to serializing
323
     * Avoids recursive loops that turn into segmentation faults when serializing
324
     */
325
    public function __sleep()
326
    {
327
        $this->clearAllReferences();
328
329
        $cls = new \ReflectionClass($this);
330
        $propertyNames = [];
331
        $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\ReflectionProperty::IS_STATIC));
332
333
        foreach($serializableProperties as $property) {
334
            $propertyNames[] = $property->getName();
335
        }
336
337
        return $propertyNames;
338
    }
339
340
    /**
341
     * Get the [id] column value.

src/cli/Database/Base/Connection.php 1 location

@@ 338-351 (lines=14) @@
335
     * Clean up internal collections prior to serializing
336
     * Avoids recursive loops that turn into segmentation faults when serializing
337
     */
338
    public function __sleep()
339
    {
340
        $this->clearAllReferences();
341
342
        $cls = new \ReflectionClass($this);
343
        $propertyNames = [];
344
        $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\ReflectionProperty::IS_STATIC));
345
346
        foreach($serializableProperties as $property) {
347
            $propertyNames[] = $property->getName();
348
        }
349
350
        return $propertyNames;
351
    }
352
353
    /**
354
     * Get the [id] column value.

src/cli/Database/Base/Instance.php 1 location

@@ 349-362 (lines=14) @@
346
     * Clean up internal collections prior to serializing
347
     * Avoids recursive loops that turn into segmentation faults when serializing
348
     */
349
    public function __sleep()
350
    {
351
        $this->clearAllReferences();
352
353
        $cls = new \ReflectionClass($this);
354
        $propertyNames = [];
355
        $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\ReflectionProperty::IS_STATIC));
356
357
        foreach($serializableProperties as $property) {
358
            $propertyNames[] = $property->getName();
359
        }
360
361
        return $propertyNames;
362
    }
363
364
    /**
365
     * Get the [name] column value.

src/cli/Database/Base/Subscription.php 1 location

@@ 366-379 (lines=14) @@
363
     * Clean up internal collections prior to serializing
364
     * Avoids recursive loops that turn into segmentation faults when serializing
365
     */
366
    public function __sleep()
367
    {
368
        $this->clearAllReferences();
369
370
        $cls = new \ReflectionClass($this);
371
        $propertyNames = [];
372
        $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\ReflectionProperty::IS_STATIC));
373
374
        foreach($serializableProperties as $property) {
375
            $propertyNames[] = $property->getName();
376
        }
377
378
        return $propertyNames;
379
    }
380
381
    /**
382
     * Get the [id] column value.

src/cli/Database/Base/User.php 1 location

@@ 340-353 (lines=14) @@
337
     * Clean up internal collections prior to serializing
338
     * Avoids recursive loops that turn into segmentation faults when serializing
339
     */
340
    public function __sleep()
341
    {
342
        $this->clearAllReferences();
343
344
        $cls = new \ReflectionClass($this);
345
        $propertyNames = [];
346
        $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\ReflectionProperty::IS_STATIC));
347
348
        foreach($serializableProperties as $property) {
349
            $propertyNames[] = $property->getName();
350
        }
351
352
        return $propertyNames;
353
    }
354
355
    /**
356
     * Get the [id] column value.