Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 18
rs 9.8333
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Azine\JsCryptoStoreBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * Define the possible configuration settings for the config.yml/.xml.
10
 */
11
class Configuration implements ConfigurationInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function getConfigTreeBuilder()
17
    {
18
        $treeBuilder = new TreeBuilder();
19
        $rootNode = $treeBuilder->root('azine_js_crypto_store');
20
21
        $rootNode->children()
22
            ->scalarNode('ownerProvider')->defaultValue('Azine\JsCryptoStoreBundle\Service\DefaultOwnerProvider')->info('Service used to get the ownerId (e.g. the current user id) to associate uploaded files with the current user.')->end()
23
24
            ->scalarNode('encryptionCipher')->defaultValue('aes')->info('Encryption Ciper Algorythm. Default: aes')->end()
25
            ->scalarNode('encryptionMode')->defaultValue('gcm')->info("Encryption Mode. Default: 'gcm' (Galois/Counter mode)")->end()
26
            ->integerNode('encryptionIterations')->defaultValue(1000)->info('Encryption Key Hash-Iterations. Default: 1000')->end()
27
            ->integerNode('encryptionKs')->defaultValue(256)->info('KS. Default: 256')->end()
28
            ->integerNode('encryptionTs')->defaultValue(128)->info('TS. Default: 128')->end()
29
            ->scalarNode('defaultLifeTime')->defaultValue('14 days')->info("Default expiry time/date for documents. Format: input for DateTime(). Default: '14 days'")->end()
30
            ->integerNode('maxFileSize')->defaultValue(50000000)->info("Maximum file size in bytes for the encryption. Default: 50'000'000 = 50mb")->end()
31
        ->end();
32
33
        return $treeBuilder;
34
    }
35
}
36