Completed
Push — ezp25376-fields_groups ( c5e8d5...eb21fd )
by
unknown
21:45
created

SettingsFieldsGroupsListFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A build() 0 10 1
1
<?php
2
/**
3
 * This file is part of the ezpublish-kernel package.
4
 * @license For full copyright and license information view LICENSE file distributed with this source code.
5
 */
6
namespace eZ\Publish\Core\Helper\FieldsGroups;
7
8
use eZ\Bundle\EzPublishCoreBundle\ApiLoader\RepositoryConfigurationProvider;
9
use Symfony\Component\Translation\TranslatorInterface;
10
11
/**
12
 * Builds a SettingsFieldGroupsList
13
 */
14
final class SettingsFieldsGroupsListFactory
15
{
16
    /**
17
     * @var \eZ\Bundle\EzPublishCoreBundle\ApiLoader\RepositoryConfigurationProvider
18
     */
19
    private $configProvider;
20
21
    public function __construct(RepositoryConfigurationProvider $configProvider)
22
    {
23
        $this->configProvider = $configProvider;
24
    }
25
26
    public function build(TranslatorInterface $translator)
27
    {
28
        $repositoryConfig = $this->configProvider->getRepositoryConfig();
29
30
        return new SettingsFieldsGroupsList(
31
            $translator,
32
            $repositoryConfig['fields_groups']['default'],
33
            $repositoryConfig['fields_groups']['list']
34
        );
35
    }
36
}
37