Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
shama authored and lorenzo committed Oct 14, 2012
1 parent cc6f27e commit 3e19f69
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 47 deletions.
24 changes: 12 additions & 12 deletions lib/Cake/Model/Datasource/Database/Connection.php
Expand Up @@ -8,7 +8,7 @@
Cake\Model\Datasource\Database\Exception\MissingConnectionException;

/**
* Represents a conection with a database server
* Represents a connection with a database server
*
**/
class Connection {
Expand All @@ -22,7 +22,7 @@ class Connection {

/**
* Driver object, responsible for creating the real connection
* and provide specific SQL dialact
* and provide specific SQL dialect
*
* @var Cake\Model\Datasource\Database\Driver
**/
Expand Down Expand Up @@ -60,7 +60,7 @@ class Connection {
/**
* Constructor
*
* @param array $config configuration for conencting to database
* @param array $config configuration for connecting to database
* @throws \Cake\Model\Datasource\Database\Exception\MissingDriverException if driver class can not be found
* @throws \Cake\Model\Datasource\Database\Exception\MissingExtensionException if driver cannot be used
* @return void
Expand All @@ -78,7 +78,7 @@ public function __construct($config) {
}

/**
* Connects to the configured databatase
* Connects to the configured database
*
* @throws \Cake\Model\Datasource\Database\Exception\MissingConnectionException if credentials are invalid
* @return boolean true on success or false if already connected
Expand All @@ -105,7 +105,7 @@ public function disconnect() {
}

/**
* Returns wheter connection to database server was already stablished
* Returns whether connection to database server was already stablished
*
* @return boolean
**/
Expand All @@ -131,7 +131,7 @@ public function prepare($sql) {
* @param string $query SQL to be executed and interpolated with $params
* @param array $params list or associative array of params to be interpolated in $query as values
* @param array $types list or associative array of types to be used for casting values in query
* @return Cake\Model\Datasource\Database\Statement executed statament
* @return Cake\Model\Datasource\Database\Statement executed statement
**/
public function execute($query, array $params = array(), array $types = array()) {
$this->connect();
Expand All @@ -146,7 +146,7 @@ public function execute($query, array $params = array(), array $types = array())
}

/**
* Executes a SQL statament and returns the Statement object as result
* Executes a SQL statement and returns the Statement object as result
*
* @return Cake\Model\Datasource\Database\Statement
**/
Expand Down Expand Up @@ -274,7 +274,7 @@ public function commit() {
}

/**
* Rollsback current transaction
* Rollback current transaction
*
* @return void
**/
Expand Down Expand Up @@ -360,7 +360,7 @@ public function rollbackSavepoint($name) {
*
* @param mixed $value
* @param Type to be used for determining kind of quoting to perform
* @return mixed queted value
* @return mixed quoted value
**/
public function quote($value, $type = null) {

Expand All @@ -380,7 +380,7 @@ public function quoteIdentifier($identifier) {
/**
* Returns last id generated for a table or sequence in database
*
* @param strin $table table name or sequence to get last insert value from
* @param string $table table name or sequence to get last insert value from
* @return string|integer
**/
public function lastInsertId($table) {
Expand All @@ -401,7 +401,7 @@ public function charset($collation) {
*
* @param \Cake\Model\Datasource\Database\Statement The statement objet to bind values to
* @param array $params list of values to be bound
* @param array $types list of types to be used, kesy should match those in $params
* @param array $types list of types to be used, keys should match those in $params
* @return void
**/
protected function _bindValues($statement, $params, $types) {
Expand Down Expand Up @@ -443,7 +443,7 @@ protected function _mapTypes($columns, $types) {
}

/**
* Simple condtions parser joind by AND
* Simple conditions parser joined by AND
*
* @param array conditions key value array or list of conditions to be joined
* to construct a WHERE clause
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/Model/Datasource/Database/Driver.php
Expand Up @@ -10,9 +10,9 @@
abstract class Driver {

/**
* Establishes a conenction to the databse server
* Establishes a connection to the database server
*
* @param array $config configuretion to be used for creating connection
* @param array $config configuration to be used for creating connection
* @return boolean true con success
**/
public abstract function connect(array $config);
Expand All @@ -25,7 +25,7 @@ public abstract function connect(array $config);
public abstract function disconnect();

/**
* Returns wheter php is able to use this driver for connecting to database
* Returns whether php is able to use this driver for connecting to database
*
* @return boolean true if it is valid to use this driver
**/
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Model/Datasource/Database/Driver/Mysql.php
Expand Up @@ -26,7 +26,7 @@ class Mysql extends \Cake\Model\Datasource\Database\Driver {
/**
* Establishes a connection to the databse server
*
* @param array $config configuretion to be used for creating connection
* @param array $config configuration to be used for creating connection
* @return boolean true on success
**/
public function connect(array $config) {
Expand Down Expand Up @@ -64,7 +64,7 @@ public function disconnect() {
}

/**
* Returns wheter php is able to use this driver for connecting to database
* Returns whether php is able to use this driver for connecting to database
*
* @return boolean true if it is valid to use this driver
**/
Expand Down
32 changes: 16 additions & 16 deletions lib/Cake/Model/Datasource/Database/Statement.php
Expand Up @@ -109,11 +109,11 @@ public function closeCursor() {
*
* {{{
* $statement = $connection->prepare('SELECT id, title from articles');
* $stamement->execute();
* echo $stamement->columnCount(); // outputs 2
* $statement->execute();
* echo $statement->columnCount(); // outputs 2
* }}}
*
* @return int
* @return integer
**/
public function columnCount() {
return $this->_statement->columnCount();
Expand All @@ -122,14 +122,14 @@ public function columnCount() {
/**
* Returns the error code for the last error that occurred when executing this statement
*
* @return int|string
* @return integer|string
**/
public function errorCode() {
return $this->_statement->errorCode();
}

/**
* Returens the error information for the last error that occurred when executing
* Returns the error information for the last error that occurred when executing
* this statement
*
* @return array
Expand All @@ -144,7 +144,7 @@ public function errorInfo() {
* that binding parameters from this method will not perform any custom type conversion
* as it would normally happen when calling `bindValue`
*
* $param array $params lsit of values to be bound to query
* $param array $params list of values to be bound to query
* @return boolean true on success, false otherwise
**/
public function execute($params = null) {
Expand All @@ -160,11 +160,11 @@ public function execute($params = null) {
*
* {{{
* $statement = $connection->prepare('SELECT id, title from articles');
* $stamement->execute();
* print_r($stamement->fetch('assoc')); // will show array('id' => 1, 'title' => 'a title')
* $statement->execute();
* print_r($statement->fetch('assoc')); // will show array('id' => 1, 'title' => 'a title')
* }}}
*
* @param string $type 'num' for positional columns, assoc for named calumns
* @param string $type 'num' for positional columns, assoc for named columns
* @return mixed|boolean result array containing columns and values or false if no results
* are left
**/
Expand All @@ -184,8 +184,8 @@ public function fetch($type = 'num') {
*
* {{{
* $statement = $connection->prepare('SELECT id, title from articles');
* $stamement->execute();
* print_r($stamement->fetchAll('assoc')); // will show array(0 => array('id' => 1, 'title' => 'a title'))
* $statement->execute();
* print_r($statement->fetchAll('assoc')); // will show array(0 => array('id' => 1, 'title' => 'a title'))
* }}}
*
* @param string $type num for fetching columns as positional keys or assoc for column names as keys
Expand All @@ -207,11 +207,11 @@ public function fetchAll($type = 'num') {
*
* {{{
* $statement = $connection->prepare('SELECT id, title from articles');
* $stamement->execute();
* print_r($stamement->rowCout()); // will show 1
* $statement->execute();
* print_r($statement->rowCount()); // will show 1
* }}}
*
* @return int
* @return integer
**/
public function rowCount() {
return $this->_statement->rowCount();
Expand All @@ -225,7 +225,7 @@ public function rowCount() {
*
* {{{
* $statement = $connection->prepare('SELECT id, title from articles');
* $stamement->execute();
* $statement->execute();
* foreach ($statement as $row) {
* //do stuff
* }
Expand All @@ -241,7 +241,7 @@ public function getIterator() {
* Statements can be passed as argument for count()
* to return the number for affected rows from last execution
*
* @return int
* @return integer
**/
public function count() {
return $this->rowCount();
Expand Down
12 changes: 6 additions & 6 deletions lib/Cake/Model/Datasource/Database/Type.php
Expand Up @@ -7,13 +7,13 @@
Cake\Model\Datasource\Database\Driver;

/**
* Encapsultes all conversion functions for values coming from database into PHP and
* Encapsulates all conversion functions for values coming from database into PHP and
* going from PHP into database.
**/
class Type {

/**
* List of supported database types . A humand readable
* List of supported database types. A human readable
* identifier is used as key and a complete namespaced class name as value
* representing the class that will do actual type conversions.
*
Expand All @@ -28,7 +28,7 @@ class Type {
);

/**
* List of mbasic type mappings, used to avoid having to instantiate a class
* List of basic type mappings, used to avoid having to instantiate a class
* for doing conversion on these
*
* @var array
Expand Down Expand Up @@ -65,7 +65,7 @@ public function __construct($name = null) {
}

/**
* Returns a Type object capable of converting a type identifyed by $name
* Returns a Type object capable of converting a type identified by $name
*
* @param string $name type identifier
* @return Type
Expand All @@ -86,7 +86,7 @@ public static function build($name) {
/**
* Registers a new type identifier and maps it to a fully namespaced classname,
* If called with no arguments it will return current types map array
* If $className is ommited it will return mapped class for $type
* 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
Expand All @@ -108,7 +108,7 @@ public static function map($type = null, $className = null) {
}

/**
* Clears out all created intences and mapped types classes, useful for testing
* Clears out all created instances and mapped types classes, useful for testing
*
* @return void
**/
Expand Down
Expand Up @@ -158,7 +158,7 @@ public function testExecuteWithMissingType() {
}

/**
* Tests executing a qury with no params also works
* Tests executing a query with no params also works
*
* @return void
**/
Expand Down Expand Up @@ -213,7 +213,7 @@ public function testInsertWithPositionalTypes() {
}

/**
* Auxiliary function to insert a couple rows in a newly creted table
* Auxiliary function to insert a couple rows in a newly created table
*
* @return void
**/
Expand Down Expand Up @@ -256,7 +256,7 @@ public function testStatementReusing() {
}

/**
* Tests rows can be updated without specifying any coditions nor types
* Tests rows can be updated without specifying any conditions nor types
*
* @return void
**/
Expand Down Expand Up @@ -284,7 +284,7 @@ public function testUpdateWithConditionsNoTypes() {
}

/**
* Tests it is possible to use key => value and stirng conditions for update
* Tests it is possible to use key => value and string conditions for update
*
* @return void
**/
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/Test/TestCase/Model/Datasource/Database/TypeTest.php
Expand Up @@ -42,7 +42,7 @@ class TypeTest extends \Cake\TestSuite\TestCase {
protected $_originalMap = array();

/**
* Backsup original Type class state
* Backup original Type class state
*
* @return void
**/
Expand Down Expand Up @@ -73,7 +73,7 @@ public function testBuildBasicTypes($name) {
}

/**
* provides a basics type list to be used as data proviced for a test
* provides a basics type list to be used as data provided for a test
*
* @return void
**/
Expand All @@ -87,7 +87,7 @@ public function basicTypesProvider() {
}

/**
* Tests trying to build an uknown type throws exception
* Tests trying to build an unknown type throws exception
*
* @expectedException InvalidArgumentException
* @return void
Expand Down Expand Up @@ -129,7 +129,7 @@ public function testMapAndBuild() {
}

/**
* Tests clear function in conjuntion with map
* Tests clear function in conjunction with map
*
* @return void
**/
Expand Down

0 comments on commit 3e19f69

Please sign in to comment.