File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ function output_tree(\DCarbone\PHPConsulAPI\KV\KVTree $tree)
114114 }
115115 else if ($item instanceof \DCarbone\PHPConsulAPI\KV\KVPair)
116116 {
117- echo '<li >'.$item->getKey() .'</li >';
117+ echo '<li >'.$item->Key.': '.$item->Value .'</li >';
118118 }
119119 }
120120}
@@ -134,7 +134,7 @@ foreach($tree as $v)
134134 }
135135 else if ($v instanceof \DCarbone\PHPConsulAPI\KV\KVPair)
136136 {
137- echo '<li >'.$v->getKey() .'</li >';
137+ echo '<li >'.$v->Key.': '.$v->Value .'</li >';
138138 }
139139}
140140echo '</ul >';
Original file line number Diff line number Diff line change @@ -47,16 +47,10 @@ class Hydrator
4747 */
4848 public static function KVPair (array $ data )
4949 {
50- $ kvp = new KVPair ();
51- foreach ($ data as $ k => $ v )
52- {
53- if ('Value ' === $ k )
54- $ kvp ->Value = base64_decode ($ v );
55- else
56- $ kvp ->{$ k } = $ v ;
57- }
50+ if (isset ($ data ['Value ' ]))
51+ $ data ['Value ' ] = base64_decode ($ data ['Value ' ]);
5852
59- return $ kvp ;
53+ return new KVPair ( $ data ) ;
6054 }
6155
6256 /**
You can’t perform that action at this time.
0 commit comments