File tree 3 files changed +15
-15
lines changed
3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 4
4
5
5
class Change
6
6
{
7
+ /**
8
+ * @var mixed
9
+ */
7
10
private $ oldValue ;
8
11
12
+ /**
13
+ * @var mixed
14
+ */
9
15
private $ newValue ;
10
16
11
17
/**
12
- * @param array|string $oldValue
13
- * @param array|string $newValue
18
+ * @param mixed $oldValue
19
+ * @param mixed $newValue
14
20
*/
15
21
public function __construct ($ oldValue , $ newValue )
16
22
{
17
- // old value
18
- if (!is_array ($ oldValue )) {
19
- $ oldValue = (string )$ oldValue ;
20
- }
21
23
$ this ->oldValue = $ oldValue ;
22
-
23
- // new value
24
- if (!is_array ($ newValue )) {
25
- $ newValue = (string )$ newValue ;
26
- }
27
24
$ this ->newValue = $ newValue ;
28
25
}
29
26
30
27
/**
31
- * @return array|string
28
+ * @return mixed
32
29
*/
33
30
public function getOldValue ()
34
31
{
35
32
return $ this ->oldValue ;
36
33
}
37
34
38
35
/**
39
- * @return array|string
36
+ * @return mixed
40
37
*/
41
38
public function getNewValue ()
42
39
{
Original file line number Diff line number Diff line change @@ -107,7 +107,10 @@ public function setFormat($format)
107
107
public function render (Change $ change )
108
108
{
109
109
// 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
+ );
111
114
112
115
// render diff
113
116
foreach ($ diff as &$ line ) {
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ public function renderChangeDataProvider()
80
80
* @param $newValue
81
81
* @param array|null $renderOptions
82
82
*/
83
- public function testRender_ChanageValueStringType (
83
+ public function testRender_ChangeValueHasStringType (
84
84
$ expectedDiff ,
85
85
$ oldValue ,
86
86
$ newValue ,
You can’t perform that action at this time.
0 commit comments