1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-13 17:44:11 +02:00

improved coding style

This commit is contained in:
David Grudl
2015-06-19 03:11:36 +02:00
parent 462ef6934b
commit ca99b0b822
55 changed files with 297 additions and 306 deletions

View File

@@ -29,14 +29,14 @@ class dibi
AFFECTED_ROWS = 'a';
/** @deprecated */
const FIELD_TEXT = dibi::TEXT,
FIELD_BINARY = dibi::BINARY,
FIELD_BOOL = dibi::BOOL,
FIELD_INTEGER = dibi::INTEGER,
FIELD_FLOAT = dibi::FLOAT,
FIELD_DATE = dibi::DATE,
FIELD_DATETIME = dibi::DATETIME,
FIELD_TIME = dibi::TIME;
const FIELD_TEXT = self::TEXT,
FIELD_BINARY = self::BINARY,
FIELD_BOOL = self::BOOL,
FIELD_INTEGER = self::INTEGER,
FIELD_FLOAT = self::FLOAT,
FIELD_DATE = self::DATE,
FIELD_DATETIME = self::DATETIME,
FIELD_TIME = self::TIME;
/** version */
const VERSION = '2.3.2',
@@ -76,7 +76,7 @@ class dibi
*/
final public function __construct()
{
throw new LogicException("Cannot instantiate static class " . get_class($this));
throw new LogicException('Cannot instantiate static class ' . get_class($this));
}
@@ -294,7 +294,7 @@ class dibi
* @return int
* @throws DibiException
*/
public static function getInsertId($sequence=NULL)
public static function getInsertId($sequence = NULL)
{
return self::getConnection()->getInsertId($sequence);
}
@@ -306,7 +306,7 @@ class dibi
* @return int
* @throws DibiException
*/
public static function insertId($sequence=NULL)
public static function insertId($sequence = NULL)
{
return self::getConnection()->getInsertId($sequence);
}
@@ -477,7 +477,7 @@ class dibi
$sql = preg_replace("#(?<=[\\s,(])($keywords1)(?=[\\s,)])#i", "\n\$1", $sql);
// reduce spaces
$sql = preg_replace('#[ \t]{2,}#', " ", $sql);
$sql = preg_replace('#[ \t]{2,}#', ' ', $sql);
$sql = wordwrap($sql, 100);
$sql = preg_replace("#([ \t]*\r?\n){2,}#", "\n", $sql);