Skip to content

Commit

Permalink
fixed coding style issues (N3Lexer, TriGParser, TriGParserTest) (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
k00ni authored Dec 17, 2020
1 parent feb6fa8 commit 5280127
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/N3Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ private function initTokenize()
if (isset($e)) {
$error = $e;
}
array_push($tokens, $t);
$tokens[] = $t;
}, $finalize);
if ($error) {
throw $error;
Expand Down
4 changes: 2 additions & 2 deletions src/TriGParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private function setBase($baseIRI = null)
// when entering a new scope (list, blank node, formula)
private function saveContext($type, $graph, $subject, $predicate, $object)
{
$n3Mode = $this->n3Mode ? $this->n3Mode : null;
$n3Mode = $this->n3Mode ?: null;
array_push($this->contextStack, [
'subject' => $subject, 'predicate' => $predicate, 'object' => $object,
'graph' => $graph, 'type' => $type,
Expand Down Expand Up @@ -1158,7 +1158,7 @@ public function parseChunk($input, $finalize = false)
$error = null;
$this->callback = function ($e, $t = null) use (&$triples, &$error) {
if (!$e && $t) {
array_push($triples, $t);
$triples[] = $t;
} elseif (!$e) {
//DONE
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/TriGParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private function shouldParse($createParser, $input = ''): void
$parser->parse($input, function ($error, $triple = null) use (&$results, &$items) {
//expect($error).not.to.exist;
if ($triple) {
array_push($results, $triple);
$results[] = $triple;
} else {
$this->assertEquals(self::toSortedJSON($items), self::toSortedJSON($results));
}
Expand Down

0 comments on commit 5280127

Please sign in to comment.