Skip to content

Commit c2c1e4a

Browse files
authored
Merge pull request #163 from phpcr/php71_fix
fix php 7 support
2 parents 9f51c3e + 1b0751f commit c2c1e4a

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ php:
44
- 5.4
55
- 5.5
66
- 5.6
7+
- 7.0
8+
- 7.1
79
- hhvm
810

911
env:
@@ -15,6 +17,9 @@ matrix:
1517
include:
1618
- php: 5.3
1719
env: PACKAGE_VERSION=low
20+
allow_failures:
21+
- php: 7.0
22+
- php: 7.1
1823

1924
before_script:
2025
- composer selfupdate

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
}
2828
],
2929
"require": {
30-
"php": ">=5.3.3",
30+
"php": "^5.3.3|7.0.x|7.1.x",
3131
"phpcr/phpcr": "~2.1.0",
3232
"symfony/console": "~2.3|~3.0"
3333
},

src/PHPCR/Util/QOM/Sql2Scanner.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@ protected function scan($sql2)
159159
$token = strtok(" \n\t");
160160
}
161161

162-
$regexp = '';
162+
$regexpTokens = array();
163163
foreach ($tokens as $token) {
164-
$regexp[] = preg_quote($token, '/');
164+
$regexpTokens[] = preg_quote($token, '/');
165165
}
166166

167-
$regexp = '/^'.implode('([ \t\n]+)', $regexp).'$/';
167+
$regexp = '/^'.implode('([ \t\n]+)', $regexpTokens).'$/';
168168
preg_match($regexp, $sql2, $this->delimiters);
169169
$this->delimiters[0] = '';
170170

tests/PHPCR/Tests/Util/ValueConverterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function dataConversionMatrix()
5252
;
5353
$nodemock
5454
->expects($this->any())
55-
->method('isNodetype')
55+
->method('isNodeType')
5656
->with('mix:referenceable')
5757
->will($this->returnValue(true))
5858
;
@@ -406,7 +406,7 @@ public function testConvertNonrefNode()
406406
;
407407
$nodemock
408408
->expects($this->once())
409-
->method('isNodetype')
409+
->method('isNodeType')
410410
->with('mix:referenceable')
411411
->will($this->returnValue(false))
412412
;

0 commit comments

Comments
 (0)