Browse Source

Correct doc blocks and default values.

euromark 11 years ago
parent
commit
0efad4f6ee

+ 3 - 3
src/Database/Connection.php

@@ -145,13 +145,13 @@ class Connection {
  *
  * If no params are passed it will return the current driver instance.
  *
- * @param string|\Cake\Database\Driver $driver The driver instance to use.
+ * @param \Cake\Database\Driver|string|null $driver The driver instance to use.
  * @param array|null $config Either config for a new driver or null.
  * @throws \Cake\Database\Exception\MissingDriverException When a driver class is missing.
  * @throws \Cake\Database\Exception\MissingExtensionException When a driver's PHP extension is missing.
  * @return \Cake\Database\Driver
  */
-	public function driver($driver = null, $config = null) {
+	public function driver($driver = null, $config = []) {
 		if ($driver === null) {
 			return $this->_driver;
 		}
@@ -288,7 +288,7 @@ class Connection {
 /**
  * Gets or sets a Schema\Collection object for this connection.
  *
- * @param \Cake\Database\Schema\Collection $collection The schema collection object
+ * @param \Cake\Database\Schema\Collection|null $collection The schema collection object
  * @return \Cake\Database\Schema\Collection
  */
 	public function schemaCollection(SchemaCollection $collection = null) {

+ 2 - 2
src/Database/Driver/PDODriverTrait.php

@@ -136,8 +136,8 @@ trait PDODriverTrait {
 /**
  * Returns last id generated for a table or sequence in database
  *
- * @param string $table table name or sequence to get last insert value from
- * @param string $column the name of the column representing the primary key
+ * @param string|null $table table name or sequence to get last insert value from
+ * @param string|null $column the name of the column representing the primary key
  * @return string|int
  */
 	public function lastInsertId($table = null, $column = null) {

+ 2 - 2
src/Database/Expression/CaseExpression.php

@@ -138,7 +138,7 @@ class CaseExpression implements ExpressionInterface {
 /**
  * Sets the default value
  *
- * @param string|ExpressionInterface|array $value Value to set
+ * @param \Cake\Database\ExpressionInterface|string|array|null $value Value to set
  * @param string $type Type of value
  *
  * @return void
@@ -157,7 +157,7 @@ class CaseExpression implements ExpressionInterface {
 /**
  * Compiles the relevant parts into sql
  *
- * @param array|string|ExpressionInterface $part The part to compile
+ * @param array|string|\Cake\Database\ExpressionInterface $part The part to compile
  * @param ValueBinder $generator Sql generator
  *
  * @return string

+ 2 - 2
src/Database/Query.php

@@ -467,7 +467,7 @@ class Query implements ExpressionInterface, IteratorAggregate {
  *	$query->join(['something' => 'different_table'], [], true); // resets joins list
  * }}}
  *
- * @param array|string $tables list of tables to be joined in the query
+ * @param array|string|null $tables list of tables to be joined in the query
  * @param array $types associative array of type names used to bind values to query
  * @param bool $overwrite whether to reset joins with passed list or not
  * @see \Cake\Database\Type
@@ -724,7 +724,7 @@ class Query implements ExpressionInterface, IteratorAggregate {
  * If you use string conditions make sure that your values are correctly quoted.
  * The safest thing you can do is to never use string conditions.
  *
- * @param string|array|ExpressionInterface|callback $conditions The conditions to filter on.
+ * @param string|array|\Cake\Database\ExpressionInterface|callback|null $conditions The conditions to filter on.
  * @param array $types associative array of type names used to bind values to query
  * @param bool $overwrite whether to reset conditions with passed list or not
  * @see \Cake\Database\Type

+ 3 - 3
src/Database/Schema/SqlserverSchema.php

@@ -63,9 +63,9 @@ class SqlserverSchema extends BaseSchema {
  * Cake\Database\Type can handle.
  *
  * @param string $col The column type
- * @param int $length the column length
- * @param int $precision The column precision
- * @param int $scale The column scale
+ * @param int|null $length the column length
+ * @param int|null $precision The column precision
+ * @param int|null $scale The column scale
  * @return array Array of column information.
  * @link http://technet.microsoft.com/en-us/library/ms187752.aspx
  */

+ 3 - 3
src/Database/Statement/BufferedStatement.php

@@ -52,8 +52,8 @@ class BufferedStatement extends StatementDecorator {
 /**
  * Constructor
  *
- * @param \Cake\Database\StatementInterface $statement Statement implementation such as PDOStatement
- * @param \Cake\Database\Driver $driver Driver instance
+ * @param \Cake\Database\StatementInterface|null $statement Statement implementation such as PDOStatement
+ * @param \Cake\Database\Driver|null $driver Driver instance
  */
 	public function __construct($statement = null, $driver = null) {
 		parent::__construct($statement, $driver);
@@ -63,7 +63,7 @@ class BufferedStatement extends StatementDecorator {
 /**
  * Execute the statement and return the results.
  *
- * @param array $params list of values to be bound to query
+ * @param array|null $params list of values to be bound to query
  * @return bool true on success, false otherwise
  */
 	public function execute($params = null) {

+ 2 - 2
src/Database/Statement/PDOStatement.php

@@ -26,8 +26,8 @@ class PDOStatement extends StatementDecorator {
 /**
  * Constructor
  *
- * @param \PDOStatement $statement Original statement to be decorated.
- * @param \Cake\Database\Driver $driver Driver instance.
+ * @param \PDOStatement|null $statement Original statement to be decorated.
+ * @param \Cake\Database\Driver|null $driver Driver instance.
  */
 	public function __construct(Statement $statement = null, $driver = null) {
 		$this->_statement = $statement;

+ 5 - 5
src/Database/Statement/StatementDecorator.php

@@ -48,8 +48,8 @@ class StatementDecorator implements StatementInterface, \Countable, \IteratorAgg
 /**
  * Constructor
  *
- * @param \Cake\Database\StatementInterface $statement Statement implementation such as PDOStatement
- * @param \Cake\Database\Driver $driver Driver instance
+ * @param \Cake\Database\StatementInterface|null $statement Statement implementation such as PDOStatement
+ * @param \Cake\Database\Driver|null $driver Driver instance
  */
 	public function __construct($statement = null, $driver = null) {
 		$this->_statement = $statement;
@@ -145,7 +145,7 @@ class StatementDecorator implements StatementInterface, \Countable, \IteratorAgg
  * that binding parameters from this method will not perform any custom type conversion
  * as it would normally happen when calling `bindValue`.
  *
- * @param array $params list of values to be bound to query
+ * @param array|null $params list of values to be bound to query
  * @return bool true on success, false otherwise
  */
 	public function execute($params = null) {
@@ -267,8 +267,8 @@ class StatementDecorator implements StatementInterface, \Countable, \IteratorAgg
 /**
  * Returns the latest primary inserted using this statement.
  *
- * @param string $table table name or sequence to get last insert value from
- * @param string $column the name of the column representing the primary key
+ * @param string|null $table table name or sequence to get last insert value from
+ * @param string|null $column the name of the column representing the primary key
  * @return string
  */
 	public function lastInsertId($table = null, $column = null) {

+ 2 - 2
src/Database/StatementInterface.php

@@ -160,8 +160,8 @@ interface StatementInterface {
 /**
  * Returns the latest primary inserted using this statement
  *
- * @param string $table table name or sequence to get last insert value from
- * @param string $column the name of the column representing the primary key
+ * @param string|null $table table name or sequence to get last insert value from
+ * @param string|null $column the name of the column representing the primary key
  * @return string
  */
 	public function lastInsertId($table = null, $column = null);

+ 2 - 2
src/Database/Type.php

@@ -106,8 +106,8 @@ class Type {
  * If called with no arguments it will return current types map array
  * If $className is omitted it will return mapped class for $type
  *
- * @param string|array $type if string name of type to map, if array list of arrays to be mapped
- * @param string $className The classname to register.
+ * @param string|array|null $type if string name of type to map, if array list of arrays to be mapped
+ * @param string|null $className The classname to register.
  * @return array|string|null if $type is null then array with current map, if $className is null string
  * configured class name for give $type, null otherwise
  */