Code Duplication    Length = 14-14 lines in 2 locations

src/services/traits/ModelByString.php 1 location

@@ 224-237 (lines=14) @@
221
     * @param Record $record
222
     * @return BaseModel|null
223
     */
224
    protected function findCacheByRecordByString(Record $record)
225
    {
226
227
        $property = $this->recordStringProperty();
228
229
        $stringValue = $record->{$property};
230
231
        if ($stringValue === null) {
232
            return null;
233
        }
234
235
        return $this->findCacheByString($stringValue);
236
237
    }
238
239
    /*******************************************
240
     * RECORD BY STRING

src/services/traits/ObjectByString.php 1 location

@@ 215-228 (lines=14) @@
212
     * @param Record $record
213
     * @return BaseObject|null
214
     */
215
    protected function findCacheByRecordByString(Record $record)
216
    {
217
218
        $property = $this->recordStringProperty();
219
220
        $stringValue = $record->{$property};
221
222
        if ($stringValue === null) {
223
            return null;
224
        }
225
226
        return $this->findCacheByString($stringValue);
227
228
    }
229
230
    /*******************************************
231
     * RECORD BY STRING