|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Knp\Bundle\SnappyBundle\DependencyInjection; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
|
6
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Configuration for the emailing bundle. |
|
10
|
|
|
*/ |
|
11
|
|
|
class Configuration implements ConfigurationInterface |
|
12
|
|
|
{ |
|
13
|
|
|
/** |
|
14
|
|
|
* {@inheritdoc} |
|
15
|
|
|
*/ |
|
16
|
|
|
public function getConfigTreeBuilder() |
|
17
|
|
|
{ |
|
18
|
|
|
$fixOptionKeys = function ($options) { |
|
19
|
|
|
$fixedOptions = []; |
|
20
|
|
|
foreach ($options as $key => $value) { |
|
21
|
|
|
$fixedOptions[str_replace('_', '-', $key)] = $value; |
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
return $fixedOptions; |
|
25
|
|
|
}; |
|
26
|
|
|
|
|
27
|
|
|
$treeBuilder = new TreeBuilder('knp_snappy'); |
|
28
|
|
|
if (method_exists($treeBuilder, 'getRootNode')) { |
|
29
|
|
|
$rootNode = $treeBuilder->getRootNode(); |
|
30
|
|
|
} else { |
|
31
|
|
|
// BC for symfony/config < 4.2 |
|
32
|
|
|
$rootNode = $treeBuilder->root('knp_snappy'); |
|
|
|
|
|
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
$rootNode |
|
36
|
|
|
->children() |
|
37
|
|
|
->scalarNode('temporary_folder')->end() |
|
38
|
|
|
->integerNode('process_timeout') |
|
39
|
|
|
->min(1) |
|
40
|
|
|
->info('Generator process timeout in seconds.') |
|
41
|
|
|
->end() |
|
42
|
|
|
->arrayNode('pdf') |
|
43
|
|
|
->addDefaultsIfNotSet() |
|
44
|
|
|
->children() |
|
45
|
|
|
->booleanNode('enabled')->defaultTrue()->end() |
|
46
|
|
|
->scalarNode('binary')->defaultValue('wkhtmltopdf')->end() |
|
47
|
|
|
->arrayNode('options') |
|
48
|
|
|
->performNoDeepMerging() |
|
49
|
|
|
->useAttributeAsKey('name') |
|
50
|
|
|
->beforeNormalization() |
|
51
|
|
|
->always($fixOptionKeys) |
|
52
|
|
|
->end() |
|
53
|
|
|
->prototype('scalar')->end() |
|
54
|
|
|
->end() |
|
55
|
|
|
->arrayNode('env') |
|
56
|
|
|
->prototype('scalar')->end() |
|
57
|
|
|
->end() |
|
58
|
|
|
->end() |
|
59
|
|
|
->end() |
|
60
|
|
|
->arrayNode('image') |
|
61
|
|
|
->addDefaultsIfNotSet() |
|
62
|
|
|
->children() |
|
63
|
|
|
->booleanNode('enabled')->defaultTrue()->end() |
|
64
|
|
|
->scalarNode('binary')->defaultValue('wkhtmltoimage')->end() |
|
65
|
|
|
->arrayNode('options') |
|
66
|
|
|
->performNoDeepMerging() |
|
67
|
|
|
->useAttributeAsKey('name') |
|
68
|
|
|
->beforeNormalization() |
|
69
|
|
|
->always($fixOptionKeys) |
|
70
|
|
|
->end() |
|
71
|
|
|
->prototype('scalar')->end() |
|
72
|
|
|
->end() |
|
73
|
|
|
->arrayNode('env') |
|
74
|
|
|
->prototype('scalar')->end() |
|
75
|
|
|
->end() |
|
76
|
|
|
->end() |
|
77
|
|
|
->end() |
|
78
|
|
|
->end() |
|
79
|
|
|
; |
|
80
|
|
|
|
|
81
|
|
|
return $treeBuilder; |
|
82
|
|
|
} |
|
83
|
|
|
} |
|
84
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.