From ae01b362791094d30cac6f8db42e762b298d3cdd Mon Sep 17 00:00:00 2001 From: zema Date: Wed, 3 Aug 2016 11:57:48 +0300 Subject: [PATCH 1/3] fix unit tests in php 7 --- Processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Processor.php b/Processor.php index 05e6e5e..7f097fd 100644 --- a/Processor.php +++ b/Processor.php @@ -1263,7 +1263,7 @@ private function compactIri($iri, $activectx, $inversectx, $value = null, $vocab $termIriLen = strlen($termIri); if (isset($def['term']) && (0 === strncmp($iri, $termIri, $termIriLen)) && - (false !== ($compactIri = substr($iri, $termIriLen)))) { + ('' !== ($compactIri = substr($iri, $termIriLen)))) { $compactIri = $def['term'] . ':' . $compactIri; if (false === isset($activectx[$compactIri]) || From 72e8b8832e77d24f84ba1e7768f36a77b39f260a Mon Sep 17 00:00:00 2001 From: zema Date: Wed, 3 Aug 2016 11:59:07 +0300 Subject: [PATCH 2/3] update travis config - do not ignore failures on php7 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 985a774..492d0d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,6 @@ matrix: fast_finish: true allow_failures: - php: hhvm - - php: 7.0 before_script: - composer install From 190ade9dabf9aaa0cf05bf2055e86dd70d2bdcef Mon Sep 17 00:00:00 2001 From: zema Date: Wed, 3 Aug 2016 12:06:45 +0300 Subject: [PATCH 3/3] fix unit tests in php 7 --- Processor.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Processor.php b/Processor.php index 7f097fd..5748b1a 100644 --- a/Processor.php +++ b/Processor.php @@ -1262,13 +1262,16 @@ private function compactIri($iri, $activectx, $inversectx, $value = null, $vocab foreach ($inversectx as $termIri => $def) { $termIriLen = strlen($termIri); - if (isset($def['term']) && (0 === strncmp($iri, $termIri, $termIriLen)) && - ('' !== ($compactIri = substr($iri, $termIriLen)))) { - $compactIri = $def['term'] . ':' . $compactIri; + if (isset($def['term']) && (0 === strncmp($iri, $termIri, $termIriLen))) { + $compactIri = substr($iri, $termIriLen); - if (false === isset($activectx[$compactIri]) || - ((false === $vocabRelative) && ($iri === $activectx[$compactIri]['@id']))) { - return $compactIri; + if (false !== $compactIri && '' !== $compactIri) { + $compactIri = $def['term'] . ':' . $compactIri; + + if (false === isset($activectx[$compactIri]) || + ((false === $vocabRelative) && ($iri === $activectx[$compactIri]['@id']))) { + return $compactIri; + } } } }