File tree Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 44
55class Change
66{
7+ /**
8+ * @var mixed
9+ */
710 private $ oldValue ;
811
12+ /**
13+ * @var mixed
14+ */
915 private $ newValue ;
1016
1117 /**
12- * @param array|string $oldValue
13- * @param array|string $newValue
18+ * @param mixed $oldValue
19+ * @param mixed $newValue
1420 */
1521 public function __construct ($ oldValue , $ newValue )
1622 {
17- // old value
18- if (!is_array ($ oldValue )) {
19- $ oldValue = (string )$ oldValue ;
20- }
2123 $ this ->oldValue = $ oldValue ;
22-
23- // new value
24- if (!is_array ($ newValue )) {
25- $ newValue = (string )$ newValue ;
26- }
2724 $ this ->newValue = $ newValue ;
2825 }
2926
3027 /**
31- * @return array|string
28+ * @return mixed
3229 */
3330 public function getOldValue ()
3431 {
3532 return $ this ->oldValue ;
3633 }
3734
3835 /**
39- * @return array|string
36+ * @return mixed
4037 */
4138 public function getNewValue ()
4239 {
Original file line number Diff line number Diff line change @@ -107,7 +107,10 @@ public function setFormat($format)
107107 public function render (Change $ change )
108108 {
109109 // get diff
110- $ diff = $ this ->differ ->diffToArray ($ change ->getOldValue (), $ change ->getNewValue ());
110+ $ diff = $ this ->differ ->diffToArray (
111+ (string )$ change ->getOldValue (),
112+ (string )$ change ->getNewValue ()
113+ );
111114
112115 // render diff
113116 foreach ($ diff as &$ line ) {
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ public function renderChangeDataProvider()
8080 * @param $newValue
8181 * @param array|null $renderOptions
8282 */
83- public function testRender_ChanageValueStringType (
83+ public function testRender_ChangeValueHasStringType (
8484 $ expectedDiff ,
8585 $ oldValue ,
8686 $ newValue ,
You can’t perform that action at this time.
0 commit comments