Skip to content

Commit 89c7d5b

Browse files
committed
minor phpstan fixes
1 parent 4d39e87 commit 89c7d5b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/quickRdfIo/NQuadsParser.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -343,27 +343,27 @@ private function parseStar(int $line): iQuad {
343343
if (0 === (int) $ret) {
344344
throw new RdfIoException("Failed parsing predicate on line $line with error '" . preg_last_error_msg() . "': " . substr($this->line, $this->offset));
345345
}
346-
$this->offset += strlen($matches[0]);
347-
$pred = $this->dataFactory::namedNode($matches[1]);
346+
$this->offset += strlen((string) $matches[0]);
347+
$pred = $this->dataFactory::namedNode((string) $matches[1]);
348348
} else {
349349
$ret = preg_match($this->regexpSbjPred, $this->line, $matches, PREG_UNMATCHED_AS_NULL, $this->offset);
350350
if (0 === (int) $ret) {
351351
throw new RdfIoException("Failed parsing subject and predicate on line $line with error '" . preg_last_error_msg() . "': " . substr($this->line, $this->offset));
352352
}
353-
$this->offset += strlen($matches[0]);
353+
$this->offset += strlen((string) $matches[0]);
354354
if ($matches[1] !== null) {
355355
$sbj = $this->dataFactory::namedNode($this->unescape($matches[1]));
356356
} else {
357357
$sbj = $this->dataFactory::blankNode($matches[2]);
358358
}
359-
$pred = $this->dataFactory::namedNode($matches[3]);
359+
$pred = $this->dataFactory::namedNode((string) $matches[3]);
360360
}
361361
if (preg_match(self::STAR_START, $this->line, $matches, 0, $this->offset)) {
362362
$this->offset += strlen($matches[0]);
363363
$this->level++;
364364
$obj = $this->parseStar($line);
365365
$ret = preg_match($this->regexpGraph, $this->line, $matches, PREG_UNMATCHED_AS_NULL, $this->offset);
366-
$this->offset += strlen($matches[0]);
366+
$this->offset += strlen((string) $matches[0]);
367367
if (($matches[1] ?? null) !== null) {
368368
$graph = $this->dataFactory::namedNode($matches[1]);
369369
} else if (($matches[2] ?? null) !== null) {
@@ -374,7 +374,7 @@ private function parseStar(int $line): iQuad {
374374
if (0 === $ret) {
375375
throw new RdfIoException("Can't parse object on line $line with error '" . preg_last_error_msg() . "': " . substr($this->line, $this->offset));
376376
}
377-
$this->offset += strlen($matches[0]);
377+
$this->offset += strlen((string) $matches[0]);
378378
if ($matches[1] !== null) {
379379
$obj = $this->dataFactory::namedNode($matches[1]);
380380
} elseif ($matches[2] !== null) {

0 commit comments

Comments
 (0)