Code Duplication    Length = 6-6 lines in 3 locations

src/SWP/Bundle/CoreBundle/Locator/ApplicationResourceLocator.php 1 location

@@ 48-53 (lines=6) @@
45
     */
46
    public function locate(string $resourceName, ThemeInterface $theme): string
47
    {
48
        if (null !== $this->deviceDetection->getType()) {
49
            $path = sprintf('%s/%s/views/%s', $theme->getPath(), $this->deviceDetection->getType(), $resourceName);
50
            if ($this->filesystem->exists($path)) {
51
                return $path;
52
            }
53
        }
54
55
        $path = sprintf('%s/views/%s', $theme->getPath(), $resourceName);
56
        if (!$this->filesystem->exists($path)) {

src/SWP/Bundle/CoreBundle/Locator/BundleResourceLocator.php 2 locations

@@ 90-95 (lines=6) @@
87
        }
88
89
        foreach ($bundles as $bundle) {
90
            if (null !== $this->deviceDetection->getType()) {
91
                $path = sprintf('%s/%s/%s/%s', $theme->getPath(), $this->deviceDetection->getType(), $bundle->getName(), $resourceName);
92
                if ($this->filesystem->exists($path)) {
93
                    return $path;
94
                }
95
            }
96
97
            $path = sprintf('%s/%s/%s', $theme->getPath(), $bundle->getName(), $resourceName);
98
            if ($this->filesystem->exists($path)) {
@@ 110-115 (lines=6) @@
107
    {
108
        $twigNamespace = substr($resourcePath, 1, strpos($resourcePath, '/') - 1);
109
        $resourceName = substr($resourcePath, strpos($resourcePath, '/') + 1);
110
        if (null !== $this->deviceDetection->getType()) {
111
            $path = sprintf('%s/%s/%s/%s', $theme->getPath(), $this->deviceDetection->getType(), $this->getBundleOrPluginName($twigNamespace), $resourceName);
112
            if ($this->filesystem->exists($path)) {
113
                return $path;
114
            }
115
        }
116
117
        $path = sprintf('%s/%s/views/%s', $theme->getPath(), $this->getBundleOrPluginName($twigNamespace), $resourceName);
118