1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 14:16:39 +02:00

typos & whitespace

This commit is contained in:
David Grudl
2013-07-02 18:42:55 +02:00
parent 9e23730cb0
commit e87c112d71
55 changed files with 612 additions and 1299 deletions

View File

@@ -10,7 +10,6 @@
*/
/**
* dibi connection.
*
@@ -45,7 +44,6 @@ class DibiConnection extends DibiObject
private $substitutes;
/**
* Connection options: (see driver-specific options too)
* - lazy (bool) => if TRUE, connection will be established only when required
@@ -139,7 +137,6 @@ class DibiConnection extends DibiObject
}
/**
* Automatically frees the resources allocated for this result set.
* @return void
@@ -151,7 +148,6 @@ class DibiConnection extends DibiObject
}
/**
* Connects to a database.
* @return void
@@ -171,7 +167,6 @@ class DibiConnection extends DibiObject
}
/**
* Disconnects from a database.
* @return void
@@ -183,7 +178,6 @@ class DibiConnection extends DibiObject
}
/**
* Returns TRUE when connection was established.
* @return bool
@@ -194,7 +188,6 @@ class DibiConnection extends DibiObject
}
/**
* Returns configuration variable. If no $key is passed, returns the entire array.
* @see self::__construct
@@ -216,7 +209,6 @@ class DibiConnection extends DibiObject
}
/**
* Apply configuration alias or default values.
* @param array connect configuration
@@ -224,10 +216,12 @@ class DibiConnection extends DibiObject
* @param string alias key
* @return void
*/
public static function alias(&$config, $key, $alias)
public static function alias(& $config, $key, $alias)
{
$foo = & $config;
foreach (explode('|', $key) as $key) $foo = & $foo[$key];
foreach (explode('|', $key) as $key) {
$foo = & $foo[$key];
}
if (!isset($foo) && isset($config[$alias])) {
$foo = $config[$alias];
@@ -236,7 +230,6 @@ class DibiConnection extends DibiObject
}
/**
* Returns the driver and connects to a database in lazy mode.
* @return IDibiDriver
@@ -248,7 +241,6 @@ class DibiConnection extends DibiObject
}
/**
* Generates (translates) and executes SQL query.
* @param array|mixed one or more arguments
@@ -262,7 +254,6 @@ class DibiConnection extends DibiObject
}
/**
* Generates SQL query.
* @param array|mixed one or more arguments
@@ -276,7 +267,6 @@ class DibiConnection extends DibiObject
}
/**
* Generates and prints SQL query.
* @param array|mixed one or more arguments
@@ -300,7 +290,6 @@ class DibiConnection extends DibiObject
}
/**
* Generates (translates) and returns SQL query as DibiDataSource.
* @param array|mixed one or more arguments
@@ -314,7 +303,6 @@ class DibiConnection extends DibiObject
}
/**
* Generates SQL query.
* @param array
@@ -327,7 +315,6 @@ class DibiConnection extends DibiObject
}
/**
* Executes the SQL query.
* @param string SQL statement.
@@ -359,7 +346,6 @@ class DibiConnection extends DibiObject
}
/**
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
* @return int number of rows
@@ -369,12 +355,13 @@ class DibiConnection extends DibiObject
{
$this->connected || $this->connect();
$rows = $this->driver->getAffectedRows();
if (!is_int($rows) || $rows < 0) throw new DibiException('Cannot retrieve number of affected rows.');
if (!is_int($rows) || $rows < 0) {
throw new DibiException('Cannot retrieve number of affected rows.');
}
return $rows;
}
/**
* Gets the number of affected rows. Alias for getAffectedRows().
* @return int number of rows
@@ -386,7 +373,6 @@ class DibiConnection extends DibiObject
}
/**
* Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
* @param string optional sequence name
@@ -397,12 +383,13 @@ class DibiConnection extends DibiObject
{
$this->connected || $this->connect();
$id = $this->driver->getInsertId($sequence);
if ($id < 1) throw new DibiException('Cannot retrieve last generated ID.');
if ($id < 1) {
throw new DibiException('Cannot retrieve last generated ID.');
}
return (int) $id;
}
/**
* Retrieves the ID generated for an AUTO_INCREMENT column. Alias for getInsertId().
* @param string optional sequence name
@@ -415,7 +402,6 @@ class DibiConnection extends DibiObject
}
/**
* Begins a transaction (if supported).
* @param string optional savepoint name
@@ -436,7 +422,6 @@ class DibiConnection extends DibiObject
}
/**
* Commits statements in a transaction.
* @param string optional savepoint name
@@ -457,7 +442,6 @@ class DibiConnection extends DibiObject
}
/**
* Rollback changes in a transaction.
* @param string optional savepoint name
@@ -478,7 +462,6 @@ class DibiConnection extends DibiObject
}
/**
* Result set factory.
* @param IDibiResultDriver
@@ -492,11 +475,9 @@ class DibiConnection extends DibiObject
}
/********************* fluent SQL builders ****************d*g**/
/**
* @return DibiFluent
*/
@@ -506,7 +487,6 @@ class DibiConnection extends DibiObject
}
/**
* @param string column name
* @return DibiFluent
@@ -518,7 +498,6 @@ class DibiConnection extends DibiObject
}
/**
* @param string table
* @param array
@@ -533,7 +512,6 @@ class DibiConnection extends DibiObject
}
/**
* @param string table
* @param array
@@ -551,7 +529,6 @@ class DibiConnection extends DibiObject
}
/**
* @param string table
* @return DibiFluent
@@ -562,11 +539,9 @@ class DibiConnection extends DibiObject
}
/********************* substitutions ****************d*g**/
/**
* Returns substitution hashmap.
* @return DibiHashMap
@@ -577,7 +552,6 @@ class DibiConnection extends DibiObject
}
/**
* Provides substitution.
* @return string
@@ -588,7 +562,6 @@ class DibiConnection extends DibiObject
}
/**
* Substitution callback.
*/
@@ -598,11 +571,9 @@ class DibiConnection extends DibiObject
}
/********************* shortcuts ****************d*g**/
/**
* Executes SQL query and fetch result - shortcut for query() & fetch().
* @param array|mixed one or more arguments
@@ -616,7 +587,6 @@ class DibiConnection extends DibiObject
}
/**
* Executes SQL query and fetch results - shortcut for query() & fetchAll().
* @param array|mixed one or more arguments
@@ -630,7 +600,6 @@ class DibiConnection extends DibiObject
}
/**
* Executes SQL query and fetch first column - shortcut for query() & fetchSingle().
* @param array|mixed one or more arguments
@@ -644,7 +613,6 @@ class DibiConnection extends DibiObject
}
/**
* Executes SQL query and fetch pairs - shortcut for query() & fetchPairs().
* @param array|mixed one or more arguments
@@ -658,11 +626,9 @@ class DibiConnection extends DibiObject
}
/********************* misc ****************d*g**/
/**
* Import SQL dump from file - extreme fast!
* @param string filename
@@ -698,7 +664,6 @@ class DibiConnection extends DibiObject
}
/**
* Gets a information about the current database.
* @return DibiDatabaseInfo
@@ -710,7 +675,6 @@ class DibiConnection extends DibiObject
}
/**
* Prevents unserialization.
*/
@@ -720,7 +684,6 @@ class DibiConnection extends DibiObject
}
/**
* Prevents serialization.
*/