Skip to content

Commit 3336281

Browse files
committed
fix string to array conversion issue - it breaks on php 7.1
1 parent 9f51c3e commit 3336281

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.travis.yml

Lines changed: 2 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:

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

0 commit comments

Comments
 (0)