Skip to content

Commit 5ad4982

Browse files
author
Martin Brecht-Precht
committed
Removed the decoration from the constructor methods. Added getter and setter methods instead.
1 parent 29177f4 commit 5ad4982

File tree

2 files changed

+42
-10
lines changed

2 files changed

+42
-10
lines changed

src/Handler/JsonHandler.php

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,47 @@ class JsonHandler extends PhpObjectHandler
1515
/**
1616
* @var bool
1717
*/
18-
private $prettyPrint;
18+
private $prettyPrint = false;
1919

2020
/**
2121
* @var bool
2222
*/
23-
private $escapeUnicode;
23+
private $escapeUnicode = false;
24+
25+
/**
26+
* @return bool
27+
*/
28+
public function getPrettyPrint()
29+
{
30+
return $this->prettyPrint;
31+
}
2432

2533
/**
26-
* JsonMarkdomHandler constructor.
27-
*
2834
* @param bool $prettyPrint
29-
* @param bool $escapeUnicode
35+
* @return $this
3036
*/
31-
public function __construct($prettyPrint = false, $escapeUnicode = false)
37+
public function setPrettyPrint($prettyPrint)
3238
{
3339
$this->prettyPrint = $prettyPrint;
40+
return $this;
41+
}
42+
43+
/**
44+
* @return bool
45+
*/
46+
public function getEscapeUnicode()
47+
{
48+
return $this->escapeUnicode;
49+
}
50+
51+
/**
52+
* @param bool $escapeUnicode
53+
* @return $this
54+
*/
55+
public function setEscapeUnicode($escapeUnicode)
56+
{
3457
$this->escapeUnicode = $escapeUnicode;
58+
return $this;
3559
}
3660

3761
/**

src/Handler/XmlHandler.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,24 @@ class XmlHandler implements HandlerInterface
3737
/**
3838
* @var bool
3939
*/
40-
private $prettyPrint;
40+
private $prettyPrint = false;
41+
42+
/**
43+
* @return bool
44+
*/
45+
public function getPrettyPrint()
46+
{
47+
return $this->prettyPrint;
48+
}
4149

4250
/**
43-
* JsonMarkdomHandler constructor.
44-
*
4551
* @param bool $prettyPrint
52+
* @return $this
4653
*/
47-
public function __construct($prettyPrint = false)
54+
public function setPrettyPrint($prettyPrint)
4855
{
4956
$this->prettyPrint = $prettyPrint;
57+
return $this;
5058
}
5159

5260
/**

0 commit comments

Comments
 (0)