diff --git a/src/Lunr/Gravity/Database/DMLQueryBuilderInterface.php b/src/Lunr/Gravity/Database/DMLQueryBuilderInterface.php
index e1045b328a17614419e097f996455a2062848ac0..7463dbb8c84ffb0b2cffe0a70bfe080913b38511 100644
--- a/src/Lunr/Gravity/Database/DMLQueryBuilderInterface.php
+++ b/src/Lunr/Gravity/Database/DMLQueryBuilderInterface.php
@@ -186,7 +186,7 @@ interface DMLQueryBuilderInterface
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return DMLQueryBuilderInterface $self Self reference
      */
@@ -197,7 +197,7 @@ interface DMLQueryBuilderInterface
     *
     * @param string $left   Left expression
     * @param string $right  Right expression
-    * @param string $negate Whether to negate the comparison or not
+    * @param bool   $negate Whether to negate the comparison or not
     *
     * @return DMLQueryBuilderInterface $self Self reference
     */
@@ -209,7 +209,7 @@ interface DMLQueryBuilderInterface
      * @param string $left   Left expression
      * @param string $lower  The lower bound of the between condition
      * @param string $upper  The upper bound of the between condition
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return DMLQueryBuilderInterface $self Self reference
      */
@@ -220,7 +220,7 @@ interface DMLQueryBuilderInterface
     *
     * @param string $left   Left expression
     * @param string $right  Right expression
-    * @param string $negate Whether to negate the comparison or not
+    * @param bool   $negate Whether to negate the comparison or not
     *
     * @return DMLQueryBuilderInterface $self Self reference
     */
@@ -230,7 +230,7 @@ interface DMLQueryBuilderInterface
      * Define ON part of a JOIN clause with the NULL condition.
      *
      * @param string $left   Left expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return DMLQueryBuilderInterface $self Self reference
      */
@@ -280,7 +280,7 @@ interface DMLQueryBuilderInterface
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return DMLQueryBuilderInterface $self Self reference
      */
@@ -291,7 +291,7 @@ interface DMLQueryBuilderInterface
     *
     * @param string $left   Left expression
     * @param string $right  Right expression
-    * @param string $negate Whether to negate the condition or not
+    * @param bool   $negate Whether to negate the condition or not
     *
     * @return DMLQueryBuilderInterface $self Self reference
     */
@@ -303,7 +303,7 @@ interface DMLQueryBuilderInterface
      * @param string $left   Left expression
      * @param string $lower  The lower bound of the between condition
      * @param string $upper  The upper bound of the between condition
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return DMLQueryBuilderInterface $self Self reference
      */
@@ -314,7 +314,7 @@ interface DMLQueryBuilderInterface
     *
     * @param string $left   Left expression
     * @param string $right  Right expression
-    * @param string $negate Whether to negate the condition or not
+    * @param bool   $negate Whether to negate the condition or not
     *
     * @return DMLQueryBuilderInterface $self Self reference
     */
@@ -324,7 +324,7 @@ interface DMLQueryBuilderInterface
      * Define WHERE clause with the NULL condition.
      *
      * @param string $left   Left expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return DMLQueryBuilderInterface $self Self reference
      */
@@ -355,7 +355,7 @@ interface DMLQueryBuilderInterface
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return DMLQueryBuilderInterface $self Self reference
      */
@@ -366,7 +366,7 @@ interface DMLQueryBuilderInterface
     *
     * @param string $left   Left expression
     * @param string $right  Right expression
-    * @param string $negate Whether to negate the comparison or not
+    * @param bool   $negate Whether to negate the comparison or not
     *
     * @return DMLQueryBuilderInterface $self Self reference
     */
@@ -378,7 +378,7 @@ interface DMLQueryBuilderInterface
      * @param string $left   Left expression
      * @param string $lower  The lower bound of the between condition
      * @param string $upper  The upper bound of the between condition
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return DMLQueryBuilderInterface $self Self reference
      */
@@ -389,7 +389,7 @@ interface DMLQueryBuilderInterface
     *
     * @param string $left   Left expression
     * @param string $right  Right expression
-    * @param string $negate Whether to negate the comparison or not
+    * @param bool   $negate Whether to negate the comparison or not
     *
     * @return DMLQueryBuilderInterface $self Self reference
     */
@@ -399,7 +399,7 @@ interface DMLQueryBuilderInterface
      * Define HAVING clause with the NULL condition.
      *
      * @param string $left   Left expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return DMLQueryBuilderInterface $self Self reference
      */
diff --git a/src/Lunr/Gravity/Database/DatabaseAccessObject.php b/src/Lunr/Gravity/Database/DatabaseAccessObject.php
index aa82128a72e222b0f93bf51829fb4724ddc794b2..a6e4874c15eb3ebfcda3dbf9abeba2edfc6537a8 100644
--- a/src/Lunr/Gravity/Database/DatabaseAccessObject.php
+++ b/src/Lunr/Gravity/Database/DatabaseAccessObject.php
@@ -165,7 +165,7 @@ abstract class DatabaseAccessObject implements DataAccessObjectInterface
 
         $result = [];
 
-        foreach ($query->result_array() as $row)
+        foreach ($query->result_array(TRUE) as $row)
         {
             $result[$row[$column]] = $row;
         }
diff --git a/src/Lunr/Gravity/Database/DatabaseConnection.php b/src/Lunr/Gravity/Database/DatabaseConnection.php
index 08340690662e70a79acda7c5bcb48dcd86c80e53..1236f006b1d3731756abb1e341b048102e129fbc 100644
--- a/src/Lunr/Gravity/Database/DatabaseConnection.php
+++ b/src/Lunr/Gravity/Database/DatabaseConnection.php
@@ -31,13 +31,13 @@ abstract class DatabaseConnection
 
     /**
      * Shared instance of the Configuration class
-     * @var Configuration
+     * @var \Lunr\Core\Configuration
      */
     protected $configuration;
 
     /**
      * Shared instance of a Logger class
-     * @var LoggerInterface
+     * @var \Psr\Log\LoggerInterface
      */
     protected $logger;
 
@@ -50,8 +50,8 @@ abstract class DatabaseConnection
     /**
      * Constructor.
      *
-     * @param Configuration   $configuration Shared instance of the configuration class
-     * @param LoggerInterface $logger        Shared instance of a logger class
+     * @param \Lunr\Core\Configuration $configuration Shared instance of the configuration class
+     * @param \Psr\Log\LoggerInterface $logger        Shared instance of a logger class
      */
     public function __construct($configuration, $logger)
     {
diff --git a/src/Lunr/Gravity/Database/DatabaseConnectionPool.php b/src/Lunr/Gravity/Database/DatabaseConnectionPool.php
index a7cafb4c100a74644405c24f5f2e9814eb949384..57776870d54e28bbf7f29eabeca98fadc0e97181 100644
--- a/src/Lunr/Gravity/Database/DatabaseConnectionPool.php
+++ b/src/Lunr/Gravity/Database/DatabaseConnectionPool.php
@@ -21,13 +21,13 @@ class DatabaseConnectionPool
 
     /**
      * Shared instance of the Configuration class
-     * @var Configuration
+     * @var \Lunr\Core\Configuration
      */
     protected $configuration;
 
     /**
      * Shared instance of a Logger class
-     * @var LoggerInterface
+     * @var \Psr\Log\LoggerInterface
      */
     protected $logger;
 
@@ -46,8 +46,8 @@ class DatabaseConnectionPool
     /**
      * Constructor.
      *
-     * @param Configuration   $configuration Shared instance of the configuration class
-     * @param LoggerInterface $logger        Shared instance of a logger class
+     * @param \Lunr\Core\Configuration $configuration Shared instance of the configuration class
+     * @param \Psr\Log\LoggerInterface $logger        Shared instance of a logger class
      */
     public function __construct($configuration, $logger)
     {
diff --git a/src/Lunr/Gravity/Database/DatabaseDMLQueryBuilder.php b/src/Lunr/Gravity/Database/DatabaseDMLQueryBuilder.php
index 156ce2c0e44e50abd1d5245df7b97e54ffa765d0..a3f019c2948bb9f6ccf78c68f728ff595fc6da81 100644
--- a/src/Lunr/Gravity/Database/DatabaseDMLQueryBuilder.php
+++ b/src/Lunr/Gravity/Database/DatabaseDMLQueryBuilder.php
@@ -819,9 +819,10 @@ abstract class DatabaseDMLQueryBuilder implements DMLQueryBuilderInterface
         {
             $this->compound .= ' ';
         }
-        if($operator === 'ALL' || $operator === 'DISTINCT')
+
+        if ($operator === 'ALL' || $operator === 'DISTINCT')
         {
-            $base = $type . " " . $operator;
+            $base = $type . ' ' . $operator;
         }
         else
         {
diff --git a/src/Lunr/Gravity/Database/DatabaseQueryEscaper.php b/src/Lunr/Gravity/Database/DatabaseQueryEscaper.php
index d2aa1d945a67510e07a881cd31deaa1308bba10e..78220ab646ca7c97620dbefd3971ef4b70049add 100644
--- a/src/Lunr/Gravity/Database/DatabaseQueryEscaper.php
+++ b/src/Lunr/Gravity/Database/DatabaseQueryEscaper.php
@@ -27,13 +27,13 @@ abstract class DatabaseQueryEscaper implements QueryEscaperInterface
      * The left identifier delimiter.
      * @var String
      */
-    const IDENTIFIER_DELIMITER_L = '`';
+    protected const IDENTIFIER_DELIMITER_L = '`';
 
     /**
      * The right identifier delimiter.
      * @var String
      */
-    const IDENTIFIER_DELIMITER_R = '`';
+    protected const IDENTIFIER_DELIMITER_R = '`';
 
     /**
      * Constructor.
diff --git a/src/Lunr/Gravity/Database/Exceptions/Tests/QueryExceptionBaseTest.php b/src/Lunr/Gravity/Database/Exceptions/Tests/QueryExceptionBaseTest.php
index 9d5f49b9aa6634fdad6438b655e529b05dedb49f..a6d4870d61b4cf04d50429b7a2a2360a0989b67c 100644
--- a/src/Lunr/Gravity/Database/Exceptions/Tests/QueryExceptionBaseTest.php
+++ b/src/Lunr/Gravity/Database/Exceptions/Tests/QueryExceptionBaseTest.php
@@ -5,6 +5,8 @@
  *
  * @package Lunr\Gravity\Database\Exceptions
  * @author  Heinz Wiesinger <heinz@m2mobi.com>
+ * @copyright  2012-2018, M2Mobi BV, Amsterdam, The Netherlands
+ * @license    http://lunr.nl/LICENSE MIT License
  */
 
 namespace Lunr\Gravity\Database\Exceptions\Tests;
diff --git a/src/Lunr/Gravity/Database/Exceptions/Tests/QueryExceptionTest.php b/src/Lunr/Gravity/Database/Exceptions/Tests/QueryExceptionTest.php
index 855b2557ea4248f689da1806b1669137ac19e658..76ee52e7b6b9bf8ec18be5738a16a949c97f537c 100644
--- a/src/Lunr/Gravity/Database/Exceptions/Tests/QueryExceptionTest.php
+++ b/src/Lunr/Gravity/Database/Exceptions/Tests/QueryExceptionTest.php
@@ -3,8 +3,10 @@
 /**
  * This file contains the QueryExceptionTest class.
  *
- * @package Lunr\Gravity\Database\Exceptions
- * @author  Heinz Wiesinger <heinz@m2mobi.com>
+ * @package   Lunr\Gravity\Database\Exceptions
+ * @author    Heinz Wiesinger <heinz@m2mobi.com>
+ * @copyright 2012-2018, M2Mobi BV, Amsterdam, The Netherlands
+ * @license   http://lunr.nl/LICENSE MIT License
  */
 
 namespace Lunr\Gravity\Database\Exceptions\Tests;
@@ -17,6 +19,7 @@ use ReflectionClass;
 /**
  * This class contains common setup routines, providers
  * and shared attributes for testing the QueryException class.
+ *
  */
 abstract class QueryExceptionTest extends LunrBaseTest
 {
diff --git a/src/Lunr/Gravity/Database/MariaDB/MariaDBConnection.php b/src/Lunr/Gravity/Database/MariaDB/MariaDBConnection.php
index 2de363f81b95f87f420ee319ff89c8f64f1283f8..22ad2bc79d074441af22779e9983eb57ca99164d 100644
--- a/src/Lunr/Gravity/Database/MariaDB/MariaDBConnection.php
+++ b/src/Lunr/Gravity/Database/MariaDB/MariaDBConnection.php
@@ -25,9 +25,9 @@ class MariaDBConnection extends MySQLConnection
     /**
      * Constructor.
      *
-     * @param Configuration   $configuration Shared instance of the configuration class
-     * @param LoggerInterface $logger        Shared instance of a logger class
-     * @param mysqli          $mysqli        Instance of the mysqli class
+     * @param \Lunr\Core\Configuration $configuration Shared instance of the configuration class
+     * @param \Psr\Log\LoggerInterface $logger        Shared instance of a logger class
+     * @param mysqli                   $mysqli        Instance of the mysqli class
      */
     public function __construct($configuration, $logger, $mysqli)
     {
diff --git a/src/Lunr/Gravity/Database/MariaDB/MariaDBSimpleDMLQueryBuilder.php b/src/Lunr/Gravity/Database/MariaDB/MariaDBSimpleDMLQueryBuilder.php
index 347cdc9c542cf12457d0ec659bb21214905db98f..9279df4fe27b2db4f347049ed18e574b34bf7535 100644
--- a/src/Lunr/Gravity/Database/MariaDB/MariaDBSimpleDMLQueryBuilder.php
+++ b/src/Lunr/Gravity/Database/MariaDB/MariaDBSimpleDMLQueryBuilder.php
@@ -80,7 +80,6 @@ class MariaDBSimpleDMLQueryBuilder extends MySQLSimpleDMLQueryBuilder
         return $this;
     }
 
-
     /**
      * Define a EXCEPT, EXCEPT DISTINCT or EXCEPT ALL clause of the SQL statement.
      *
diff --git a/src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBDMLQueryBuilderSelectTest.php b/src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBDMLQueryBuilderSelectTest.php
index 585c03c058fae96127aa772d910a9e3e76cc5f14..75164d96c0ed4ca526c036b37ca434b47cb51013 100644
--- a/src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBDMLQueryBuilderSelectTest.php
+++ b/src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBDMLQueryBuilderSelectTest.php
@@ -12,6 +12,7 @@
 namespace Lunr\Gravity\Database\MariaDB\Tests;
 
 use Lunr\Gravity\Database\MariaDB\Tests\MariaDBDMLQueryBuilderTest;
+
 /**
  * This class contains select tests for the MariaDBDMLQueryBuilder class.
  *
diff --git a/src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBSimpleDMLQueryBuilderSelectTest.php b/src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBSimpleDMLQueryBuilderSelectTest.php
index a789dc04023077b69e38a216d2af8b9fe5d051e6..aadb99437d700c8009df641ab9fa2cf7bce55bb3 100644
--- a/src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBSimpleDMLQueryBuilderSelectTest.php
+++ b/src/Lunr/Gravity/Database/MariaDB/Tests/MariaDBSimpleDMLQueryBuilderSelectTest.php
@@ -22,6 +22,8 @@ class MariaDBSimpleDMLQueryBuilderSelectTest extends MariaDBSimpleDMLQueryBuilde
     /**
      * Test intersect().
      *
+     * @param string $operators Operators to test
+     *
      * @dataProvider compoundOperatorProvider
      * @covers Lunr\Gravity\Database\MariaDB\MariaDBSimpleDMLQueryBuilder::intersect
      */
@@ -43,6 +45,8 @@ class MariaDBSimpleDMLQueryBuilderSelectTest extends MariaDBSimpleDMLQueryBuilde
     /**
      * Test except().
      *
+     * @param string $operators Operators to test
+     *
      * @dataProvider compoundOperatorProvider
      * @covers Lunr\Gravity\Database\MariaDB\MariaDBSimpleDMLQueryBuilder::except
      */
diff --git a/src/Lunr/Gravity/Database/MySQL/MySQLAsyncQueryResult.php b/src/Lunr/Gravity/Database/MySQL/MySQLAsyncQueryResult.php
index 5f3344e2a7f4d5ab2f6dbf1124cd1be19a734c2e..d6f19c4d44d39b881424bcbbb4b0de793bea3640 100644
--- a/src/Lunr/Gravity/Database/MySQL/MySQLAsyncQueryResult.php
+++ b/src/Lunr/Gravity/Database/MySQL/MySQLAsyncQueryResult.php
@@ -21,7 +21,7 @@ class MySQLAsyncQueryResult extends MySQLQueryResult
 
     /**
      * Flag whether the result was fetched or not.
-     * @var Boolean
+     * @var bool
      */
     protected $fetched;
 
diff --git a/src/Lunr/Gravity/Database/MySQL/MySQLDMLQueryBuilder.php b/src/Lunr/Gravity/Database/MySQL/MySQLDMLQueryBuilder.php
index c3025f47a2e9bdcb97e7e29df6d24c591915cb68..cb28e8b6d951e355dcb302968bd822f88260d1a8 100644
--- a/src/Lunr/Gravity/Database/MySQL/MySQLDMLQueryBuilder.php
+++ b/src/Lunr/Gravity/Database/MySQL/MySQLDMLQueryBuilder.php
@@ -165,7 +165,7 @@ class MySQLDMLQueryBuilder extends SQLDMLQueryBuilder
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return MySQLDMLQueryBuilder $self Self reference
      */
@@ -181,7 +181,7 @@ class MySQLDMLQueryBuilder extends SQLDMLQueryBuilder
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return MySQLDMLQueryBuilder $self Self reference
      */
@@ -218,7 +218,7 @@ class MySQLDMLQueryBuilder extends SQLDMLQueryBuilder
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return MySQLDMLQueryBuilder $self Self reference
      */
@@ -266,6 +266,8 @@ class MySQLDMLQueryBuilder extends SQLDMLQueryBuilder
     /**
      * Set ON DUPLICATE KEY UPDATE clause.
      *
+     * @param string $set Action to perform on conflict
+     *
      * @return MySQLDMLQueryBuilder $self Self reference
      */
     public function on_duplicate_key_update($set)
diff --git a/src/Lunr/Gravity/Database/MySQL/MySQLQueryResult.php b/src/Lunr/Gravity/Database/MySQL/MySQLQueryResult.php
index f32f45eda8cdea5895ff0df828614927e898893f..87b8a03d1e71839dffe8119c17a121cf461a34f5 100644
--- a/src/Lunr/Gravity/Database/MySQL/MySQLQueryResult.php
+++ b/src/Lunr/Gravity/Database/MySQL/MySQLQueryResult.php
@@ -24,13 +24,13 @@ class MySQLQueryResult implements DatabaseQueryResultInterface
      * The MySQL error code for transaction deadlock.
      * @var Integer
      */
-    const DEADLOCK_ERR_CODE = 1213;
+    private const DEADLOCK_ERR_CODE = 1213;
 
     /**
      * The MySQL error code for transaction lock timeout.
      * @var Integer
      */
-    const LOCK_TIMEOUT_ERR_CODE = 1205;
+    private const LOCK_TIMEOUT_ERR_CODE = 1205;
 
     /**
      * The query string that was executed.
diff --git a/src/Lunr/Gravity/Database/MySQL/MySQLSimpleDMLQueryBuilder.php b/src/Lunr/Gravity/Database/MySQL/MySQLSimpleDMLQueryBuilder.php
index c9f1f1ce41f1bcb8e783a6d3da758ec9e42d4520..952e4f479f2d27d5994bd069692d9be75a1435b5 100644
--- a/src/Lunr/Gravity/Database/MySQL/MySQLSimpleDMLQueryBuilder.php
+++ b/src/Lunr/Gravity/Database/MySQL/MySQLSimpleDMLQueryBuilder.php
@@ -380,7 +380,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -395,7 +395,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      *
      * @param string $left   Left expression
      * @param array  $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -413,7 +413,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      * @param string $left   Left expression
      * @param string $lower  The lower bound of the between condition
      * @param string $upper  The upper bound of the between condition
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -432,7 +432,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -446,7 +446,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      * Define ON part of a JOIN clause with the NULL condition.
      *
      * @param string $left   Left expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -520,7 +520,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -535,7 +535,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      *
      * @param string $left   Left expression
      * @param array  $right  Right expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -553,7 +553,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      * @param string $left   Left expression
      * @param string $lower  The lower bound of the between condition
      * @param string $upper  The upper bound of the between condition
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -572,7 +572,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -586,7 +586,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      * Define WHERE clause with the NULL condition.
      *
      * @param string $left   Left expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -652,7 +652,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -667,7 +667,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      *
      * @param string $left   Left expression
      * @param array  $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -685,7 +685,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      * @param string $left   Left expression
      * @param string $lower  The lower bound of the between condition
      * @param string $upper  The upper bound of the between condition
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -704,7 +704,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -718,7 +718,7 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
      * Define HAVING clause with the NULL condition.
      *
      * @param string $left   Left expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return MySQLSimpleDMLQueryBuilder $self Self reference
      */
@@ -827,6 +827,8 @@ class MySQLSimpleDMLQueryBuilder implements DMLQueryBuilderInterface
     /**
      * Set ON DUPLICATE KEY UPDATE clause.
      *
+     * @param string $set Action to perform on conflict
+     *
      * @return MySQLDMLQueryBuilder $self Self reference
      */
     public function on_duplicate_key_update($set)
diff --git a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLSimpleDMLQueryBuilderSelectTest.php b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLSimpleDMLQueryBuilderSelectTest.php
index ba03aae8198f7f5e30b6b266942d6fbe3dc96a76..937ff351683976c010f78e3db1b3222a4901e70c 100644
--- a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLSimpleDMLQueryBuilderSelectTest.php
+++ b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLSimpleDMLQueryBuilderSelectTest.php
@@ -193,6 +193,9 @@ class MySQLSimpleDMLQueryBuilderSelectTest extends MySQLSimpleDMLQueryBuilderTes
 
     /**
      * Test union().
+     *
+     * @param string $operators Operators to test
+     *
      * @dataProvider unionOperatorProvider
      * @covers Lunr\Gravity\Database\MySQL\MySQLSimpleDMLQueryBuilder::union
      */
diff --git a/src/Lunr/Gravity/Database/SQLDMLQueryBuilder.php b/src/Lunr/Gravity/Database/SQLDMLQueryBuilder.php
index df6913a85513764c9431aa2de3ceec5e9f89918d..bf1c31188601137265aeb137cf0bd8828bf52514 100644
--- a/src/Lunr/Gravity/Database/SQLDMLQueryBuilder.php
+++ b/src/Lunr/Gravity/Database/SQLDMLQueryBuilder.php
@@ -39,7 +39,7 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
     /**
      * Define a DELETE clause.
      *
-     * @param string $table_reference The tables to delete from
+     * @param string $table_references The tables to delete from
      *
      * @return SQLDMLQueryBuilder $self Self reference
      */
@@ -202,7 +202,7 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return SQLDMLQueryBuilder $self Self reference
      */
@@ -218,7 +218,7 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return SQLDMLQueryBuilder $self Self reference
      */
@@ -235,7 +235,7 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
      * @param string $left   Left expression
      * @param string $lower  The lower bound of the between condition
      * @param string $upper  The upper bound of the between condition
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return SQLDMLQueryBuilder $self Self reference
      */
@@ -251,7 +251,7 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
      * Define ON part of a JOIN clause with the NULL condition.
      *
      * @param string $left   Left expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return SQLDMLQueryBuilder $self Self reference
      */
@@ -304,7 +304,7 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return SQLDMLQueryBuilder $self Self reference
      */
@@ -320,7 +320,7 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return SQLDMLQueryBuilder $self Self reference
      */
@@ -337,7 +337,7 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
      * @param string $left   Left expression
      * @param string $lower  The lower bound of the between condition
      * @param string $upper  The upper bound of the between condition
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return SQLDMLQueryBuilder $self Self reference
      */
@@ -353,7 +353,7 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
      * Define WHERE clause with the NULL condition.
      *
      * @param string $left   Left expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return SQLDMLQueryBuilder $self Self reference
      */
@@ -406,7 +406,7 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return SQLDMLQueryBuilder $self Self reference
      */
@@ -422,7 +422,7 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return SQLDMLQueryBuilder $self Self reference
      */
@@ -439,7 +439,7 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
      * @param string $left   Left expression
      * @param string $lower  The lower bound of the between condition
      * @param string $upper  The upper bound of the between condition
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return SQLDMLQueryBuilder $self Self reference
      */
@@ -455,7 +455,7 @@ abstract class SQLDMLQueryBuilder extends DatabaseDMLQueryBuilder
      * Define HAVING clause with the NULL condition.
      *
      * @param string $left   Left expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return SQLDMLQueryBuilder $self Self reference
      */
diff --git a/src/Lunr/Gravity/Database/SQLite3/SQLite3DMLQueryBuilder.php b/src/Lunr/Gravity/Database/SQLite3/SQLite3DMLQueryBuilder.php
index aa561128f4897cb14c0f2bcc24805ffa8726b7fb..bf010877c14b4adcc1287b11ef0862de5c372b39 100644
--- a/src/Lunr/Gravity/Database/SQLite3/SQLite3DMLQueryBuilder.php
+++ b/src/Lunr/Gravity/Database/SQLite3/SQLite3DMLQueryBuilder.php
@@ -198,7 +198,7 @@ class SQLite3DMLQueryBuilder extends SQLDMLQueryBuilder
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return SQLite3DMLQueryBuilder $self Self reference
      */
@@ -214,7 +214,7 @@ class SQLite3DMLQueryBuilder extends SQLDMLQueryBuilder
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the condition or not
+     * @param bool   $negate Whether to negate the condition or not
      *
      * @return SQLite3DMLQueryBuilder $self Self reference
      */
@@ -244,7 +244,7 @@ class SQLite3DMLQueryBuilder extends SQLDMLQueryBuilder
      *
      * @param string $left   Left expression
      * @param string $right  Right expression
-     * @param string $negate Whether to negate the comparison or not
+     * @param bool   $negate Whether to negate the comparison or not
      *
      * @return SQLite3DMLQueryBuilder $self Self reference
      */
diff --git a/src/Lunr/Gravity/Database/SQLite3/SQLite3QueryEscaper.php b/src/Lunr/Gravity/Database/SQLite3/SQLite3QueryEscaper.php
index 150c9b03ca7196ebae6b783110ff3fd208e5464a..b07d54ae2bbb50b21b38f3149594b7cad489b1a2 100644
--- a/src/Lunr/Gravity/Database/SQLite3/SQLite3QueryEscaper.php
+++ b/src/Lunr/Gravity/Database/SQLite3/SQLite3QueryEscaper.php
@@ -23,13 +23,13 @@ class SQLite3QueryEscaper extends DatabaseQueryEscaper
      * The left identifier delimiter.
      * @var String
      */
-    const IDENTIFIER_DELIMITER_L = '"';
+    protected const IDENTIFIER_DELIMITER_L = '"';
 
     /**
      * The right identifier delimiter.
      * @var String
      */
-    const IDENTIFIER_DELIMITER_R = '"';
+    protected const IDENTIFIER_DELIMITER_R = '"';
 
     /**
      * Constructor.
diff --git a/src/Lunr/Gravity/Database/SQLite3/SQLite3QueryResult.php b/src/Lunr/Gravity/Database/SQLite3/SQLite3QueryResult.php
index f28deb292856d296ff9079fc1faf3bf8d1c54b48..ca9c671c14c49e1e4aa87451adbc82ebe05c80ea 100644
--- a/src/Lunr/Gravity/Database/SQLite3/SQLite3QueryResult.php
+++ b/src/Lunr/Gravity/Database/SQLite3/SQLite3QueryResult.php
@@ -25,13 +25,13 @@ class SQLite3QueryResult implements DatabaseQueryResultInterface
      * The Sqlite3 error code for transaction deadlock.
      * @var Integer
      */
-    const LOCK_TIMEOUT_ERR_CODE = 5;
+    private const LOCK_TIMEOUT_ERR_CODE = 5;
 
     /**
      * The Sqlite3 error code for transaction deadlock.
      * @var Integer
      */
-    const DEADLOCK_ERR_CODE = 6;
+    private const DEADLOCK_ERR_CODE = 6;
 
     /**
      * The query string that was executed.
diff --git a/src/Lunr/Gravity/Database/Tests/DatabaseDMLQueryBuilderQueryPartsTest.php b/src/Lunr/Gravity/Database/Tests/DatabaseDMLQueryBuilderQueryPartsTest.php
index f92b738276e96a72c8ef22772da235c4a005d39a..9c84d531ac449a7376e687059654a83f1dba8e4e 100644
--- a/src/Lunr/Gravity/Database/Tests/DatabaseDMLQueryBuilderQueryPartsTest.php
+++ b/src/Lunr/Gravity/Database/Tests/DatabaseDMLQueryBuilderQueryPartsTest.php
@@ -25,7 +25,8 @@ class DatabaseDMLQueryBuilderQueryPartsTest extends DatabaseDMLQueryBuilderTest
     /**
      * Test specifying the UNION part of a query.
      *
-     * @param string $types     Compound query operator
+     * @param string $types    Whether to construct UNION, EXCEPT or INTERSECT
+     * @param string $operator Compound query operator
      *
      * @dataProvider compoundQueryTypeAndOperatorProvider
      * @covers       Lunr\Gravity\Database\DatabaseDMLQueryBuilder::sql_compound
@@ -36,13 +37,13 @@ class DatabaseDMLQueryBuilderQueryPartsTest extends DatabaseDMLQueryBuilderTest
 
         $method->invokeArgs($this->class, [ '(sql query)', $types, $operator ]);
 
-        if($operator === NULL)
+        if ($operator === NULL)
         {
             $string = $types . ' (sql query)';
         }
         else
         {
-            $string = $types . " " . $operator . ' (sql query)';
+            $string = $types . ' ' . $operator . ' (sql query)';
         }
 
         $this->assertPropertyEquals('compound', $string);
@@ -51,7 +52,8 @@ class DatabaseDMLQueryBuilderQueryPartsTest extends DatabaseDMLQueryBuilderTest
     /**
      * Test specifying the UNION part of a query with invalid parameters.
      *
-     * @param string $types     Compound query operator
+     * @param string $types    Whether to construct UNION, EXCEPT or INTERSECT
+     * @param string $operator Compound query operator
      *
      * @dataProvider compoundQueryInvalidTypeAndOperatorProvider
      * @covers       Lunr\Gravity\Database\DatabaseDMLQueryBuilder::sql_compound
diff --git a/src/Lunr/Gravity/Database/TransactionalDatabaseAccessObject.php b/src/Lunr/Gravity/Database/TransactionalDatabaseAccessObject.php
index de926983a25c790262c963e86152c9a00ca4459a..e703d72df0dc075187540b07ba807e11f5a86ee3 100644
--- a/src/Lunr/Gravity/Database/TransactionalDatabaseAccessObject.php
+++ b/src/Lunr/Gravity/Database/TransactionalDatabaseAccessObject.php
@@ -2,8 +2,10 @@
 /**
  * This file contains the DatabaseAccessObject for transactional access.
  *
- * @package Skysail\Gravity\Database
- * @author  Sean Molenaar <s.molenaar@m2mobi.com>
+ * @package   Skysail\Gravity\Database
+ * @author    Sean Molenaar <s.molenaar@m2mobi.com>
+ * @copyright 2012-2018, M2Mobi BV, Amsterdam, The Netherlands
+ * @license   http://lunr.nl/LICENSE MIT License
  */
 
 namespace Lunr\Gravity\Database;
