Code Duplication    Length = 15-15 lines in 2 locations

src/services/ModelById.php 1 location

@@ 73-87 (lines=15) @@
70
    /**
71
     * @inheritdoc
72
     */
73
    public function findCacheByRecord(Record $record)
74
    {
75
76
        if ($model = parent::findCacheByRecord($record)) {
77
            return $model;
78
        }
79
80
        if (!$record instanceof RecordWithId) {
81
            return null;
82
        }
83
84
        // Check if already in cache by id
85
        return $this->findCacheById($record->id);
86
87
    }
88
89
    /**
90
     * @inheritdoc

src/services/ObjectById.php 1 location

@@ 72-86 (lines=15) @@
69
    /**
70
     * @inheritdoc
71
     */
72
    public function findCacheByRecord(Record $record)
73
    {
74
75
        if ($object = parent::findCacheByRecord($record)) {
76
            return $object;
77
        }
78
79
        if (!$record instanceof RecordWithId) {
80
            return null;
81
        }
82
83
        // Check if already in cache by id
84
        return $this->findCacheById($record->id);
85
86
    }
87
88
    /**
89
     * @inheritdoc