File tree Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,10 @@ class RenderInJson extends Decorator
10
10
/**
11
11
* render data as JSON.
12
12
*
13
- * @return mixed| string
13
+ * @return string
14
14
*/
15
15
public function renderData ()
16
16
{
17
- $ output = $ this ->wrapped ->renderData ();
18
-
19
- return json_encode ($ output );
17
+ return json_encode ($ this ->wrapped ->renderData ());
20
18
}
21
19
}
Original file line number Diff line number Diff line change @@ -10,17 +10,15 @@ class RenderInXml extends Decorator
10
10
/**
11
11
* render data as XML.
12
12
*
13
- * @return mixed| string
13
+ * @return string
14
14
*/
15
15
public function renderData ()
16
16
{
17
- $ output = $ this ->wrapped ->renderData ();
18
-
19
17
// do some fancy conversion to xml from array ...
20
18
21
19
$ doc = new \DOMDocument ();
22
20
23
- foreach ($ output as $ key => $ val ) {
21
+ foreach ($ this -> wrapped -> renderData () as $ key => $ val ) {
24
22
$ doc ->appendChild ($ doc ->createElement ($ key , $ val ));
25
23
}
26
24
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ interface RendererInterface
10
10
/**
11
11
* render data.
12
12
*
13
- * @return mixed
13
+ * @return string
14
14
*/
15
15
public function renderData ();
16
16
}
You can’t perform that action at this time.
0 commit comments