forked from hostnet/entity-tracker-bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfiguration.php
More file actions
68 lines (58 loc) · 2.47 KB
/
Copy pathConfiguration.php
File metadata and controls
68 lines (58 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* @copyright 2014-present Hostnet B.V.
*/
declare(strict_types=1);
namespace Hostnet\Bundle\EntityTrackerBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
public const string REVISION_FACTORY_INTERFACE
= 'Hostnet\Component\EntityRevision\Factory\RevisionFactoryInterface';
public const string BLAMABLE_PROVIDER_INTERFACE
= 'Hostnet\Component\EntityBlamable\Provider\BlamableProviderInterface';
public const string BLAMABLE_DEFAULT_PROVIDER
= 'entity_tracker.provider.blamable';
private const string CONFIG_ROOT = 'hostnet_entity_tracker';
public function getConfigTreeBuilder(): TreeBuilder
{
$tree_builder = new TreeBuilder(self::CONFIG_ROOT);
$root_node = $tree_builder->getRootNode();
$component_info = 'Configures and enables the %s listener';
$root_node
->children()
->arrayNode('blamable')
->info(sprintf($component_info, 'blamable'))
->children()
->scalarNode('provider')
->info('Provider implementation of ' . self::BLAMABLE_PROVIDER_INTERFACE)
->cannotBeEmpty()
->isRequired()
->defaultValue(self::BLAMABLE_DEFAULT_PROVIDER)
->end()
->scalarNode('default_username')
->end()
->end()
->end()
->arrayNode('revision')
->info(sprintf($component_info, 'revision'))
->children()
->scalarNode('factory')
->info('Factory implementation of ' . self::REVISION_FACTORY_INTERFACE)
->cannotBeEmpty()
->isRequired()
->end()
->end()
->end()
->arrayNode('mutation')
->info(sprintf($component_info, 'mutation'))
->end()
->scalarNode('cache')
->info('Specifies cacheadapter service to use')
->cannotBeEmpty()
->defaultValue('entity_tracker.cache')
->end();
return $tree_builder;
}
}