Code Duplication    Length = 12-12 lines in 2 locations

src/DB/DbService.php 2 locations

@@ 140-151 (lines=12) @@
137
	 * @param int $fetchmode
138
	 * @return array|mixed
139
	 */
140
	public function row( $query, $params = null, $fetchmode = \PDO::FETCH_ASSOC )
141
	{
142
		$this->queryInit( $query, $params );
143
144
		if ( $this->lastStatement === self::QUERY_TYPE_EXPLAIN )
145
			return $this->sQuery->fetchAll( \PDO::FETCH_ASSOC );
146
147
		$result = $this->sQuery->fetch( $fetchmode );
148
		$this->sQuery->closeCursor(); // Frees up the connection to the server so that other SQL statements may be issued,
149
150
		return $result;
151
	}
152
153
	/**
154
	 * @param string $query
@@ 158-169 (lines=12) @@
155
	 * @param array $params
156
	 * @return mixed|array
157
	 */
158
	public function single( $query, $params = null )
159
	{
160
		$this->queryInit( $query, $params );
161
162
		if ( $this->lastStatement === self::QUERY_TYPE_EXPLAIN )
163
			return $this->sQuery->fetchAll( \PDO::FETCH_ASSOC );
164
165
		$result = $this->sQuery->fetchColumn();
166
		$this->sQuery->closeCursor(); // Frees up the connection to the server so that other SQL statements may be issued
167
168
		return $result;
169
	}
170
171
172
	/**