Skip to content

Commit

Permalink
Merge pull request #73 from zobzn/php7
Browse files Browse the repository at this point in the history
Fix unit tests in PHP 7

This addresses #50
  • Loading branch information
lanthaler authored Aug 25, 2016
2 parents c4af252 + 190ade9 commit 8eaca98
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ matrix:
fast_finish: true
allow_failures:
- php: hhvm
- php: 7.0

before_script:
- composer install
15 changes: 9 additions & 6 deletions Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) &&
(false !== ($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;
}
}
}
}
Expand Down

0 comments on commit 8eaca98

Please sign in to comment.