Skip to content

Commit 6649d33

Browse files
committedApr 15, 2014
Removing 5.4 syntax
1 parent c19a988 commit 6649d33

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed
 

Diff for: ‎src/JsonMatcher/Matcher/ArrayMatcher.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function match($value, $pattern)
2525
$accessorBuilder->enableExceptionOnInvalidIndex();
2626
$accessor = $accessorBuilder->getPropertyAccessor();
2727

28-
$this->paths = [];
28+
$this->paths = array();
2929
foreach ($value as $key => $element) {
3030
$path = sprintf("[%s]", $key);
3131

Diff for: ‎tests/JsonMatcher/ArrayMatcherTest.php

+24-19
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ class ArrayMatcherTest extends \PHPUnit_Framework_TestCase
1111

1212
public function setUp()
1313
{
14-
$this->simpleArray = [
15-
'users' => [
16-
[
14+
$this->simpleArray = array(
15+
'users' => array(
16+
array(
1717
'firstName' => 'Norbert',
1818
'lastName' => 'Orzechowicz'
19-
],
20-
[
19+
),
20+
array(
2121
'firstName' => 'Michał',
2222
'lastName' => 'Dąbrowski'
23-
]
24-
],
23+
)
24+
),
2525
true,
2626
false,
2727
1,
2828
6.66
29-
];
29+
);
3030
}
3131

3232
public function test_match_arrays()
@@ -36,21 +36,26 @@ public function test_match_arrays()
3636
$matcher = new ArrayMatcher($chain);
3737

3838
$this->assertTrue($matcher->match($this->simpleArray, $this->simpleArray));
39-
$this->assertTrue($matcher->match([], []));
40-
$this->assertFalse($matcher->match($this->simpleArray, []));
39+
$this->assertTrue($matcher->match(array(), array()));
40+
$this->assertFalse($matcher->match($this->simpleArray, array()));
4141
$this->assertFalse($matcher->match(['foo', 1, 3], ['foo', 2, 3]));
42-
$this->assertFalse($matcher->match($this->simpleArray, [6, 6.66, false, false, [1, 2, 'foo'], ['foo' => 'bar2'], null]));
43-
$this->assertFalse($matcher->match($this->simpleArray, [
44-
'users' => [
45-
[
42+
$this->assertFalse($matcher->match($this->simpleArray, array(6, 6.66, false, false, array(1, 2, 'foo'), array('foo' => 'bar2'), null)));
43+
$this->assertFalse($matcher->match($this->simpleArray, array(
44+
'users' => array(
45+
array(
4646
'firstName' => 'Pawel',
4747
'lastName' => 'Orzechowicz'
48-
],
49-
[
48+
),
49+
array(
5050
'firstName' => 'Michał',
5151
'lastName' => 'Dąbrowski'
52-
]
53-
]
54-
]));
52+
)
53+
),
54+
true,
55+
false,
56+
1,
57+
6.66
58+
)));
5559
}
60+
5661
}

0 commit comments

Comments
 (0)