Passed
Push — master ( 9afe80...f5220c )
by Gabriel
03:51
created

HasEntrypointLookup::getWebpackCssFiles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ByTIC\Assets\AssetsManager;
4
5
use Symfony\WebpackEncoreBundle\Asset\EntrypointLookupInterface;
6
7
/**
8
 * Trait HasEntrypointLookup
9
 * @package ByTIC\Assets\AssetsManager
10
 */
11
trait HasEntrypointLookup
12
{
13
    protected function getEntrypointLookup(string $entrypointName): EntrypointLookupInterface
0 ignored issues
show
Unused Code introduced by
The parameter $entrypointName is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

13
    protected function getEntrypointLookup(/** @scrutinizer ignore-unused */ string $entrypointName): EntrypointLookupInterface

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
14
    {
15
        return $this->getContainer()->get('assets.entrypoint_lookup');
0 ignored issues
show
Bug introduced by
It seems like getContainer() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
        return $this->/** @scrutinizer ignore-call */ getContainer()->get('assets.entrypoint_lookup');
Loading history...
16
    }
17
18
    public function getWebpackJsFiles(string $entryName, string $entrypointName = '_default'): array
19
    {
20
        return $this->getEntrypointLookup($entrypointName)
21
            ->getJavaScriptFiles($entryName);
22
    }
23
24
    public function getWebpackCssFiles(string $entryName, string $entrypointName = '_default'): array
25
    {
26
        return $this->getEntrypointLookup($entrypointName)
27
            ->getCssFiles($entryName);
28
    }
29
}
30