Skip to content

Commit

Permalink
Merge pull request #174 from phpcr/php-72
Browse files Browse the repository at this point in the history
build with php 7.2
  • Loading branch information
dbu authored Nov 12, 2017
2 parents 4a920bf + 411e31c commit 39e2639
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ php:
- 5.6
- 7.0
- 7.1
- 7.2

env:
- PACKAGE_VERSION=high
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
],
"require": {
"php": "^5.6|7.0.x|7.1.x",
"php": "^5.6|^7.0",
"phpcr/phpcr": "~2.1.0",
"symfony/console": "~2.3|~3.0"
},
Expand Down
4 changes: 3 additions & 1 deletion src/PHPCR/Util/Console/Helper/PhpcrHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ public function processNode(OutputInterface $output, NodeInterface $node, array
);
} else {
$closureString = $closure;
$closure = create_function('$session, $node', $closure);
$closure = function (SessionInterface $session, NodeInterface $node) use ($closureString) {
eval($closureString);
};
$output->writeln(sprintf(
'<comment> > Applying closure: %s</comment>',
strlen($closureString) > 75 ? substr($closureString, 0, 72).'...' : $closureString
Expand Down
4 changes: 3 additions & 1 deletion src/PHPCR/Util/QOM/Sql1Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ public function evalFullTextSearch($selectorName, $searchExpression, $propertyNa
*/
public function evalColumns($columns)
{
if (count($columns) === 0) {
if ((!is_array($columns) && !$columns instanceof \Countable)
|| count($columns) === 0
) {
return 's';
}

Expand Down
4 changes: 3 additions & 1 deletion src/PHPCR/Util/QOM/Sql2Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ public function evalPropertyValue($propertyName, $selectorName = null)
*/
public function evalColumns($columns)
{
if (count($columns) === 0) {
if ((!is_array($columns) && !$columns instanceof \Countable)
|| count($columns) === 0
) {
return '*';
}

Expand Down

0 comments on commit 39e2639

Please sign in to comment.