Code Duplication    Length = 5-5 lines in 5 locations

cloudcontrol/library/storage/Document.php 1 location

@@ 88-92 (lines=5) @@
85
                       AND path != ' . $this->dbHandle->quote($this->path) . '
86
                    ';
87
        $stmt = $this->dbHandle->query($sql);
88
        if ($stmt === false) {
89
            $errorInfo = $this->dbHandle->errorInfo();
90
            $errorMsg = $errorInfo[2];
91
            throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
92
        }
93
        $contents = $stmt->fetchAll(\PDO::FETCH_CLASS, '\library\storage\Document');
94
        foreach ($contents as $key => $document) {
95
            if ($document->type === 'folder') {

cloudcontrol/library/search/indexer/InverseDocumentFrequency.php 1 location

@@ 54-58 (lines=5) @@
51
		}
52
		$stmt->bindValue(':documentCount', $this->documentCount);
53
		$result = $stmt->execute();
54
		if ($result === false) {
55
			$errorInfo = $db->errorInfo();
56
			$errorMsg = $errorInfo[2];
57
			throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
58
		}
59
	}
60
}

cloudcontrol/library/search/indexer/TermFieldLengthNorm.php 1 location

@@ 45-49 (lines=5) @@
42
	  GROUP BY documentPath, field
43
		';
44
		$stmt = $db->prepare($sql);
45
		if ($stmt === false) {
46
			$errorInfo = $db->errorInfo();
47
			$errorMsg = $errorInfo[2];
48
			throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
49
		}
50
		if (($stmt->execute()) === false) {
51
			$errorInfo = $db->errorInfo();
52
			$errorMsg = $errorInfo[2];

cloudcontrol/library/search/Search.php 1 location

@@ 85-89 (lines=5) @@
82
			throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
83
		}
84
		$result = $stmt->fetch(\PDO::FETCH_COLUMN);
85
		if (false === $result) {
86
			$errorInfo = $db->errorInfo();
87
			$errorMsg = $errorInfo[2];
88
			throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
89
		}
90
		return intval($result);
91
	}
92

cloudcontrol/library/storage/Repository.php 1 location

@@ 351-355 (lines=5) @@
348
    {
349
        $db = $this->getContentDbHandle();
350
        $stmt = $db->query($sql);
351
        if ($stmt === false) {
352
            $errorInfo = $db->errorInfo();
353
            $errorMsg = $errorInfo[2];
354
            throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
355
        }
356
        return $stmt;
357
    }
358