Code Duplication    Length = 9-9 lines in 2 locations

src/Providers/MetadataControllerProvider.php 1 location

@@ 62-70 (lines=9) @@
59
60
        $meta->setMetadata($metamix);
61
62
        if ($isCaching) {
63
            if (!$hasCache) {
64
                $cacheTime = env('APP_METADATA_CACHE_DURATION', null);
65
                $cacheTime = !is_numeric($cacheTime) ? 10 : abs($cacheTime);
66
                Cache::put('metadataControllers', $meta, $cacheTime);
67
            }
68
        } else {
69
            Cache::forget('metadataControllers');
70
        }
71
72
    }
73

src/Providers/MetadataProvider.php 1 location

@@ 56-64 (lines=9) @@
53
            $instance = new $fqModelName();
54
            $instance->hookUpRelationships($EntityTypes, $ResourceSets);
55
        }
56
        if ($isCaching) {
57
            if (!$hasCache) {
58
                $cacheTime = env('APP_METADATA_CACHE_DURATION', null);
59
                $cacheTime = !is_numeric($cacheTime) ? 10 : abs($cacheTime);
60
                Cache::put('metadata', $meta, $cacheTime);
61
            }
62
        } else {
63
            Cache::forget('metadata');
64
        }
65
    }
66
67
    private static function setupRoute()