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

SettingsFieldsGroupsListFactory::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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