Passed
Push — master ( 4c7952...221fe6 )
by Angel Fernando Quiroz
08:53
created

PluginEntityLoaderHelper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEntityDirectories() 0 11 2
A __construct() 0 3 1
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
declare(strict_types=1);
6
7
namespace Chamilo\CoreBundle\Helpers;
8
9
use Symfony\Component\Finder\Finder;
10
11
readonly class PluginEntityLoaderHelper
12
{
13
    public function __construct(
14
        private string $pluginDir,
15
    ) {}
16
17
    public function getEntityDirectories(): array
18
    {
19
        $finder = new Finder();
20
        $finder->directories()->in($this->pluginDir)->name('Entity')->depth('== 1');
21
22
        $directories = [];
23
        foreach ($finder as $dir) {
24
            $directories[] = $dir->getRealPath();
25
        }
26
27
        return $directories;
28
    }
29
}
30