From 5280127cc27375f665079336712d9e52cd981fbd Mon Sep 17 00:00:00 2001 From: Konrad Abicht Date: Thu, 17 Dec 2020 10:45:02 +0100 Subject: [PATCH] fixed coding style issues (N3Lexer, TriGParser, TriGParserTest) (#31) --- src/N3Lexer.php | 2 +- src/TriGParser.php | 4 ++-- test/TriGParserTest.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/N3Lexer.php b/src/N3Lexer.php index 1bd1960..70fdbc6 100644 --- a/src/N3Lexer.php +++ b/src/N3Lexer.php @@ -471,7 +471,7 @@ private function initTokenize() if (isset($e)) { $error = $e; } - array_push($tokens, $t); + $tokens[] = $t; }, $finalize); if ($error) { throw $error; diff --git a/src/TriGParser.php b/src/TriGParser.php index 6c68f20..012471b 100644 --- a/src/TriGParser.php +++ b/src/TriGParser.php @@ -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, @@ -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 { diff --git a/test/TriGParserTest.php b/test/TriGParserTest.php index 925a2b8..b6abfb9 100644 --- a/test/TriGParserTest.php +++ b/test/TriGParserTest.php @@ -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)); }