[Pkg-owncloud-commits] [php-sabredav] 17/36: PHP 7 is going to change operator precedence.

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 13:35:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit c9f3e7d2be11872eb36873c5410bac476d815871
Author: Evert Pot <me at evertpot.com>
Date:   Sun Jul 19 13:45:57 2015 -0400

    PHP 7 is going to change operator precedence.
---
 lib/CalDAV/CalendarQueryValidator.php | 12 ++++++------
 tests/Sabre/DAV/ClientTest.php        |  8 ++++++++
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/lib/CalDAV/CalendarQueryValidator.php b/lib/CalDAV/CalendarQueryValidator.php
index e78ca68..b1e46fb 100644
--- a/lib/CalDAV/CalendarQueryValidator.php
+++ b/lib/CalDAV/CalendarQueryValidator.php
@@ -59,7 +59,7 @@ class CalendarQueryValidator {
 
         foreach ($filters as $filter) {
 
-            $isDefined = isset($parent->$filter['name']);
+            $isDefined = isset($parent->{$filter['name']});
 
             if ($filter['is-not-defined']) {
 
@@ -75,7 +75,7 @@ class CalendarQueryValidator {
             }
 
             if ($filter['time-range']) {
-                foreach ($parent->$filter['name'] as $subComponent) {
+                foreach ($parent->{$filter['name']} as $subComponent) {
                     if ($this->validateTimeRange($subComponent, $filter['time-range']['start'], $filter['time-range']['end'])) {
                         continue 2;
                     }
@@ -89,7 +89,7 @@ class CalendarQueryValidator {
 
             // If there are sub-filters, we need to find at least one component
             // for which the subfilters hold true.
-            foreach ($parent->$filter['name'] as $subComponent) {
+            foreach ($parent->{$filter['name']} as $subComponent) {
 
                 if (
                     $this->validateCompFilters($subComponent, $filter['comp-filters']) &&
@@ -128,7 +128,7 @@ class CalendarQueryValidator {
 
         foreach ($filters as $filter) {
 
-            $isDefined = isset($parent->$filter['name']);
+            $isDefined = isset($parent->{$filter['name']});
 
             if ($filter['is-not-defined']) {
 
@@ -144,7 +144,7 @@ class CalendarQueryValidator {
             }
 
             if ($filter['time-range']) {
-                foreach ($parent->$filter['name'] as $subComponent) {
+                foreach ($parent->{$filter['name']} as $subComponent) {
                     if ($this->validateTimeRange($subComponent, $filter['time-range']['start'], $filter['time-range']['end'])) {
                         continue 2;
                     }
@@ -158,7 +158,7 @@ class CalendarQueryValidator {
 
             // If there are sub-filters, we need to find at least one property
             // for which the subfilters hold true.
-            foreach ($parent->$filter['name'] as $subComponent) {
+            foreach ($parent->{$filter['name']} as $subComponent) {
 
                 if (
                     $this->validateParamFilters($subComponent, $filter['param-filters']) &&
diff --git a/tests/Sabre/DAV/ClientTest.php b/tests/Sabre/DAV/ClientTest.php
index e5504ae..1184057 100644
--- a/tests/Sabre/DAV/ClientTest.php
+++ b/tests/Sabre/DAV/ClientTest.php
@@ -9,6 +9,14 @@ require_once 'Sabre/DAV/ClientMock.php';
 
 class ClientTest extends \PHPUnit_Framework_TestCase {
 
+    function setUp() {
+
+        if (!function_exists('curl_init')) {
+            $this->markTestSkipped('CURL must be installed to test the client');
+        }
+
+    }
+
     function testConstruct() {
 
         $client = new ClientMock(array(

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list