Code Duplication    Length = 8-8 lines in 2 locations

Features/Components/Component.php 2 locations

@@ 28-35 (lines=8) @@
25
26
        // Enqueue Component Scripts if they exist
27
        $scriptAbsPath = Asset::requirePath("Components/{$componentName}/script.js");
28
        if (is_file($scriptAbsPath)) {
29
            Asset::enqueue([
30
                'type' => 'script',
31
                'name' => "Flynt/Components/{$componentName}",
32
                'path' => "Components/{$componentName}/script.js",
33
                'dependencies' => $scriptDeps
34
            ]);
35
        }
36
37
        // collect style dependencies
38
        $styleDeps = array_reduce($dependencies, function ($list, $dependency) {
@@ 47-54 (lines=8) @@
44
45
        // Enqueue Component Styles if they exist
46
        $styleAbsPath = Asset::requirePath("Components/{$componentName}/style.css");
47
        if (is_file($styleAbsPath)) {
48
            Asset::enqueue([
49
                'type' => 'style',
50
                'name' => "Flynt/Components/{$componentName}",
51
                'path' => "Components/{$componentName}/style.css",
52
                'dependencies' => $styleDeps
53
            ]);
54
        }
55
    }
56
}
57