Skip to content

Commit ed55b43

Browse files
Fixes for PHP 7
1 parent 32d5678 commit ed55b43

13 files changed

+24
-15
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818

1919
"require-dev": {
20-
"phpunit/phpunit": "~4.0"
20+
"phpunit/phpunit": "^4.8.36|^7.5.15"
2121
},
2222

2323
"autoload": {

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
colors="true">
44

55
<testsuites>
6-
<testsuite>
6+
<testsuite name="Unit Tests">
77
<directory>tests</directory>
88
</testsuite>
99
</testsuites>

src/TreeCompiler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function visit(array $ast, $fnName, $expr)
2323
$this->source = $this->indentation = '';
2424
$this->write("<?php\n")
2525
->write('use JmesPath\\TreeInterpreter as Ti;')
26-
->write('use JmesPath\\FnDispatcher as Fn;')
26+
->write('use JmesPath\\FnDispatcher as Fd;')
2727
->write('use JmesPath\\Utils;')
2828
->write('')
2929
->write('function %s(Ti $interpreter, $value) {', $fnName)
@@ -257,7 +257,7 @@ private function visit_function(array $node)
257257
}
258258

259259
return $this->write(
260-
'$value = Fn::getInstance()->__invoke("%s", %s);',
260+
'$value = Fd::getInstance()->__invoke("%s", %s);',
261261
$node['value'], $args
262262
);
263263
}

src/Utils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,6 @@ private static function sliceIndices($subject, $start, $stop, $step)
224224
}
225225
}
226226

227-
return $type == 'string' ? implode($result, '') : $result;
227+
return $type == 'string' ? implode('', $result) : $result;
228228
}
229229
}

tests/ComplianceTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
use JmesPath\AstRuntime;
55
use JmesPath\CompilerRuntime;
66
use JmesPath\SyntaxErrorException;
7+
use PHPUnit\Framework\TestCase;
78

8-
class ComplianceTest extends \PHPUnit_Framework_TestCase
9+
class ComplianceTest extends TestCase
910
{
1011
private static $path;
1112

tests/EnvTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
use JmesPath\Env;
55
use JmesPath\CompilerRuntime;
6+
use PHPUnit\Framework\TestCase;
67

7-
class EnvTest extends \PHPUnit_Framework_TestCase
8+
class EnvTest extends TestCase
89
{
910
public function testSearchesInput()
1011
{

tests/FnDispatcherTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php
22
namespace JmesPath\Tests;
33

4-
use JmesPath\FnDispatcher;
4+
use JmesPath\fnDispatcher;
5+
use PHPUnit\Framework\TestCase;
56

6-
class FnDispatcherTest extends \PHPUnit_Framework_TestCase
7+
class fnDispatcherTest extends TestCase
78
{
89
public function testConvertsToString()
910
{

tests/LexerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
use JmesPath\Lexer;
55
use JmesPath\SyntaxErrorException;
6+
use PHPUnit\Framework\TestCase;
67

78
/**
89
* @covers JmesPath\Lexer
910
*/
10-
class LexerTest extends \PHPUnit_Framework_TestCase
11+
class LexerTest extends TestCase
1112
{
1213
public function inputProvider()
1314
{

tests/ParserTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
use JmesPath\Lexer;
55
use JmesPath\Parser;
6+
use PHPUnit\Framework\TestCase;
67

78
/**
89
* @covers JmesPath\Parser
910
*/
10-
class ParserTest extends \PHPUnit_Framework_TestCase
11+
class ParserTest extends TestCase
1112
{
1213
/**
1314
* @expectedException \JmesPath\SyntaxErrorException

tests/SyntaxErrorExceptionTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
namespace JmesPath\Tests;
33

44
use JmesPath\SyntaxErrorException;
5+
use PHPUnit\Framework\TestCase;
56

67
/**
78
* @covers JmesPath\SyntaxErrorException
89
*/
9-
class SyntaxErrorExceptionTest extends \PHPUnit_Framework_TestCase
10+
class SyntaxErrorExceptionTest extends TestCase
1011
{
1112
public function testCreatesWithNoArray()
1213
{

0 commit comments

Comments
 (0)