12
12
namespace Symfony \Component \Config \Definition \Dumper ;
13
13
14
14
use Symfony \Component \Config \Definition \ArrayNode ;
15
+ use Symfony \Component \Config \Definition \BaseNode ;
15
16
use Symfony \Component \Config \Definition \ConfigurationInterface ;
16
17
use Symfony \Component \Config \Definition \EnumNode ;
17
18
use Symfony \Component \Config \Definition \NodeInterface ;
@@ -76,7 +77,10 @@ private function writeNode(NodeInterface $node, NodeInterface $parentNode = null
76
77
$ default = '' ;
77
78
$ defaultArray = null ;
78
79
$ children = null ;
79
- $ example = $ node ->getExample ();
80
+ $ example = null ;
81
+ if ($ node instanceof BaseNode) {
82
+ $ example = $ node ->getExample ();
83
+ }
80
84
81
85
// defaults
82
86
if ($ node instanceof ArrayNode) {
@@ -123,7 +127,7 @@ private function writeNode(NodeInterface $node, NodeInterface $parentNode = null
123
127
}
124
128
125
129
// deprecated?
126
- if ($ node ->isDeprecated ()) {
130
+ if ($ node instanceof BaseNode && $ node ->isDeprecated ()) {
127
131
$ comments [] = sprintf ('Deprecated (%s) ' , $ node ->getDeprecationMessage ($ node ->getName (), $ parentNode ? $ parentNode ->getPath () : $ node ->getPath ()));
128
132
}
129
133
@@ -138,7 +142,7 @@ private function writeNode(NodeInterface $node, NodeInterface $parentNode = null
138
142
$ key = $ prototypedArray ? '- ' : $ node ->getName ().': ' ;
139
143
$ text = rtrim (sprintf ('%-21s%s %s ' , $ key , $ default , $ comments ), ' ' );
140
144
141
- if ($ info = $ node ->getInfo ()) {
145
+ if ($ node instanceof BaseNode && $ info = $ node ->getInfo ()) {
142
146
$ this ->writeLine ('' );
143
147
// indenting multi-line info
144
148
$ info = str_replace ("\n" , sprintf ("\n% " .($ depth * 4 ).'s# ' , ' ' ), $ info );
0 commit comments