From a895200282acdb89f22ddee8854f067e8c5dd7b9 Mon Sep 17 00:00:00 2001 From: Richard Tattersall Date: Wed, 22 Jul 2015 22:50:14 +0100 Subject: [PATCH] Fixed up formatting --- src/classes/ExtendedGraph.class.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/classes/ExtendedGraph.class.php b/src/classes/ExtendedGraph.class.php index c71cbcf0..63b1339a 100644 --- a/src/classes/ExtendedGraph.class.php +++ b/src/classes/ExtendedGraph.class.php @@ -174,6 +174,7 @@ public function add_literal_triple($s, $p, $o, $lang = null, $dt = null) { * @param string $s * @param string $p * @param array $o_info + * @throws Exceptions\Exception * @return bool */ private function _add_triple($s, $p, Array $o_info) { @@ -186,19 +187,19 @@ private function _add_triple($s, $p, Array $o_info) { if(!$this->isValidResourceValue($p)){ throw new \Tripod\Exceptions\Exception("The predicate is invalid"); } - if (!isset($this->_index[$s])) { - $this->_index[$s] = array(); - $this->_index[$s][$p] = array($o_info); - return true; - } elseif (!isset($this->_index[$s][$p])) { - $this->_index[$s][$p] = array($o_info); + if (!isset($this->_index[$s])) { + $this->_index[$s] = array(); + $this->_index[$s][$p] = array($o_info); + return true; + } elseif (!isset($this->_index[$s][$p])) { + $this->_index[$s][$p] = array($o_info); + return true; + } else { + if (!in_array($o_info, $this->_index[$s][$p])) { + $this->_index[$s][$p][] = $o_info; return true; - } else { - if (!in_array($o_info, $this->_index[$s][$p])) { - $this->_index[$s][$p][] = $o_info; - return true; - } } + } return false; }