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

PluginEntityLoaderHelper::getEntityDirectories()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 0
dl 0
loc 11
rs 10
c 0
b 0
f 0
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