Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #38 from k00ni/fixWarnings

Fix different array related stuff to avoid warnings
  • Loading branch information...
commit 1b09405c134314a0b28bec58fd6127ee1d27852f 2 parents 902f58f + 9eaf526
Philipp Frischmuth pfrischmuth authored
8 library/Erfurt/Cache/Frontend/QueryCache.php
View
@@ -171,8 +171,14 @@ public function invalidateWithStatements( $modelIri, $statements = array() ) {
* @return int $count number of queries which was affected of the invalidation process
*/
public function invalidate( $modelIri, $subject, $predicate, $object ) {
+ // cast subject and predicate to string
+ $subject = (string) $subject;
+ $predicate = (string) $predicate;
+
+ // initialize statements array
$statements = array();
- $statements[$subject][$predicate][] = $object ;
+ $statements[$subject] = array();
+ $statements[$subject][$predicate] = array ($object);
$qids = $this->invalidateWithStatements($modelIri, $statements);
return $qids;
4 library/Erfurt/Store/Adapter/Virtuoso.php
View
@@ -324,8 +324,8 @@ public function deleteMatchingStatements($graphUri, $subject, $predicate, $objec
} else {
$objectSpec = $this->buildLiteralString(
$object['value'],
- array_key_exists('datatype', $object) ? $object['datatype'] : null,
- array_key_exists('lang', $object) ? $object['lang'] : null
+ true == isset ($object['datatype']) ? $object['datatype'] : null,
+ true == isset ($object['lang']) ? $object['lang'] : null
);
}
} else {
15 library/Erfurt/Versioning.php
View
@@ -349,13 +349,14 @@ public function onAddStatement(Erfurt_Event $event)
$this->_checkSetup();
if (is_array($event->statement)) {
- $payload = array (
- $event->statement['subject'] => array (
- $event->statement['predicate'] => array (
- $event->statement['object']
- )
- )
- );
+
+ $s = (string) $event->statement['subject'];
+ $p = (string) $event->statement['predicate'];
+ $o = $event->statement['object'];
+
+ $payload = array ();
+ $payload [$s] = array ();
+ $payload [$s][$p] = array ($o);
$payloadId = $this->_execAddPayload($payload);
$resource = $event->statement['subject'];
Please sign in to comment.
Something went wrong with that request. Please try again.