Permalink
Browse files

Typo fixes.

  • Loading branch information...
1 parent 5b62767 commit 753f5a547435aeb4b8d9dff1147f1ef9c4ff281d @jails jails committed Apr 2, 2013
View
@@ -224,10 +224,8 @@ public function set($data = array()) {
* controller, i.e. given a `PostsController` object, if template is set to `'view'`,
* the template path would be `views/posts/view.html.php`. Defaults to the name of the
* action being rendered.
- *
* The options specified here are merged with the values in the `Controller::$_render`
* property. You may refer to it for other options accepted by this method.
- *
* @return object Returns the `Response` object associated with this `Controller` instance.
*/
public function render(array $options = array()) {
@@ -79,10 +79,8 @@ class FirePhp extends \lithium\core\Object {
*/
protected $_headers = array(
'X-Wf-Protocol-1' => 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2',
- 'X-Wf-1-Plugin-1' =>
- 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3',
- 'X-Wf-1-Structure-1' =>
- 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'
+ 'X-Wf-1-Plugin-1' => 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3',
+ 'X-Wf-1-Structure-1' => 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'
);
/**
View
@@ -394,7 +394,7 @@ protected function _response($type, $string, $options) {
if (!is_array($options)) {
if (!$options || is_int($options)) {
$options = array('nl' => $options);
- } else if (is_string($options)) {
+ } elseif (is_string($options)) {
$options = array('style' => $options);
} else {
$options = array();
View
@@ -483,7 +483,7 @@ public function sort($field = 'id', array $options = array()) {
return strcmp($a->$field, $b->$field);
};
- } else if (is_callable($field)) {
+ } elseif (is_callable($field)) {
$sorter = $field;
}
@@ -612,7 +612,6 @@ public function __destruct() {
*
* @see lithium\data\Collection::_populate()
* @see lithium\data\Collection::_offsetSet()
- *
* @param mixed $data An array or an `Entity` object to set.
* @param mixed $offset The offset. If offset is `null` data is simply appended to the set.
* @param array $options Any additional options to pass to the `Entity`'s constructor.
View
@@ -1121,24 +1121,24 @@ public function save($entity, $data = null, array $options = array()) {
* @see lithium\util\Validator::check()
* @see lithium\data\Entity::errors()
* @param string $entity Model entity to validate. Typically either a `Record` or `Document`
- * object. In the following example:
- * {{{
- * $post = Posts::create($data);
- * $success = $post->validates();
- * }}}
- * The `$entity` parameter is equal to the `$post` object instance.
+ * object. In the following example:
+ * {{{
+ * $post = Posts::create($data);
+ * $success = $post->validates();
+ * }}}
+ * The `$entity` parameter is equal to the `$post` object instance.
* @param array $options Available options:
- * - `'rules'` _array_: If specified, this array will _replace_ the default
- * validation rules defined in `$validates`.
- * - `'events'` _mixed_: A string or array defining one or more validation
- * _events_. Events are different contexts in which data events can occur, and
- * correspond to the optional `'on'` key in validation rules. For example, by
- * default, `'events'` is set to either `'create'` or `'update'`, depending on
- * whether `$entity` already exists. Then, individual rules can specify
- * `'on' => 'create'` or `'on' => 'update'` to only be applied at certain times.
- * Using this parameter, you can set up custom events in your rules as well, such
- * as `'on' => 'login'`. Note that when defining validation rules, the `'on'` key
- * can also be an array of multiple events.
+ * - `'rules'` _array_: If specified, this array will _replace_ the default
+ * validation rules defined in `$validates`.
+ * - `'events'` _mixed_: A string or array defining one or more validation
+ * _events_. Events are different contexts in which data events can occur, and
+ * correspond to the optional `'on'` key in validation rules. For example, by
+ * default, `'events'` is set to either `'create'` or `'update'`, depending on
+ * whether `$entity` already exists. Then, individual rules can specify
+ * `'on' => 'create'` or `'on' => 'update'` to only be applied at certain times.
+ * Using this parameter, you can set up custom events in your rules as well, such
+ * as `'on' => 'login'`. Note that when defining validation rules, the `'on'` key
+ * can also be an array of multiple events.
* @return boolean Returns `true` if all validation rules on all fields succeed, otherwise
* `false`. After validation, the messages for any validation failures are assigned to
* the entity, and accessible through the `errors()` method of the entity object.
View
@@ -806,7 +806,6 @@ protected function _entityConditions() {
* @param string $query a query instance
* @return mixed
*/
-
public function childs($relpath = null, $query = null) {
if (!$model = $this->model()) {
throw new ConfigException("No binded model.");
@@ -54,14 +54,13 @@ class Relationship extends \lithium\core\Object {
*
* @param array $config The relationship's configuration, which defines how the two models in
* question are bound. The available options are:
- *
* - `'name'` _string_: The name of the relationship in the context of the
* originating model. For example, a `Posts` model might define a relationship to
* a `Users` model like so:
- * {{{ public $hasMany = array('Author' => array('to' => 'Users')); }}}
- * In this case, the relationship is bound to the `Users` model, but `'Author'` would be the
- * relationship name. This is the name with which the relationship is referenced in the
- * originating model.
+ * {{{ public $hasMany = array('Author' => array('to' => 'Users')); }}}
+ * In this case, the relationship is bound to the `Users` model, but `'Author'` would
+ * be the relationship name. This is the name with which the relationship is
+ * referenced in the originating model.
* - `'key'` _mixed_: An array of fields that define the relationship, where the
* keys are fields in the originating model, and the values are fields in the
* target model. If the relationship is not deined by keys, this array should be
View
@@ -143,7 +143,6 @@ class MongoDb extends \lithium\data\Source {
* or an array containing a read preference and a tag set such as:
* array(Mongo::RP_SECONDARY_PREFERRED, array('dc' => 'east) See the documentation for
* `Mongo::setReadPreference()`. Defaults to null.
- *
* Typically, these parameters are set in `Connections::add()`, when adding the
* adapter to the list of active connections.
*/
@@ -696,6 +695,7 @@ public function conditions($conditions, $context) {
/**
* Protected helper method used to format conditions.
*
+ * @todo Catch Document/Array objects used in conditions and extract their values.
* @param array $conditions The conditions array to be processed.
* @param string $model The name of the model class used in the query.
* @param object $schema The object containing the schema definition.
@@ -721,9 +721,6 @@ protected function _conditions(array $conditions, $model, $schema, $context) {
$conditions[$operator] = $value;
continue;
}
- /**
- * @todo Catch Document/Array objects used in conditions and extract their values.
- */
if (is_object($value)) {
continue;
}
@@ -104,7 +104,6 @@ class MySql extends \lithium\data\source\Database {
* followed by a port number or socket. Defaults to `'localhost:3306'`.
* - `'persistent'`: If a persistent connection (if available) should be made.
* Defaults to true.
- *
* Typically, these parameters are set in `Connections::add()`, when adding the
* adapter to the list of active connections.
*/
@@ -100,7 +100,6 @@ class PostgreSql extends \lithium\data\source\Database {
* - `'persistent'`: If a persistent connection (if available) should be made.
* Defaults to true.
* - `'schema'`: The name of the database schema to use. Defaults to 'public'
- *
* Typically, these parameters are set in `Connections::add()`, when adding the
* adapter to the list of active connections.
*/
@@ -156,7 +155,7 @@ public function connect() {
}
if ($this->_config['schema']) {
- $this->search_path($this->_config['schema']);
+ $this->searchPath($this->_config['schema']);
}
if ($this->_config['timezone']) {
@@ -239,7 +238,7 @@ public function describe($entity, $fields = array(), array $meta = array()) {
$default = $column['default'];
}
$fields[$column['field']] = $match + array(
- 'null' => ($column['null'] == 'YES' ? true : false),
+ 'null' => ($column['null'] == 'YES' ? true : false),
'default' => $default
);
if ($fields[$column['field']]['type'] == 'string') {
@@ -252,18 +251,19 @@ public function describe($entity, $fields = array(), array $meta = array()) {
/**
* Gets or sets the search path for the connection
- * @param $search_path
- * @return mixed If setting the search_path; returns ture on success, else false
- * When getting, returns the search_path
+ *
+ * @param $searchPath
+ * @return mixed If setting the searchPath; returns ture on success, else false
+ * When getting, returns the searchPath
*/
- public function search_path($search_path) {
- if (empty($search_path)) {
+ public function searchPath($searchPath) {
+ if (empty($searchPath)) {
$query = $this->connection->query('SHOW search_path');
- $search_path = $query->fetchColumn(1);
- return explode(",", $search_path);
+ $searchPath = $query->fetchColumn(1);
+ return explode(",", $searchPath);
}
try{
- $this->connection->exec("SET search_path TO ${search_path}");
+ $this->connection->exec("SET search_path TO ${searchPath}");
return true;
} catch (PDOException $e) {
return false;
@@ -272,6 +272,7 @@ public function search_path($search_path) {
/**
* Gets or sets the time zone for the connection
+ *
* @param $timezone
* @return mixed If setting the time zone; returns true on success, else false
* When getting, returns the time zone
@@ -98,7 +98,6 @@ class Sqlite3 extends \lithium\data\source\Database {
* database. By default, open uses SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE.
* - `'key'` _string_: An optional encryption key used when encrypting and decrypting
* an SQLite database.
- *
* Typically, these parameters are set in `Connections::add()`, when adding the
* adapter to the list of active connections.
*/
View
@@ -8,7 +8,6 @@
namespace lithium\g11n;
-
/**
* Globalization data is not just translated messages, it is validation rules, formats and a lot
* more. Generally speaking is the `Catalog` class allowing us to retrieve and store globalized
View
@@ -55,6 +55,16 @@ class Multibyte extends \lithium\core\Adaptable {
* indicating any multibyte encoding. Don't use quick mode for integrity
* validation of UTF-8 encoded strings.
*
+ * Meaning of RegExp:
+ * '[\x09\x0A\x0D\x20-\x7E]'; // ASCII
+ * '|[\xC2-\xDF][\x80-\xBF]'; // non-overlong 2-byte
+ * '|\xE0[\xA0-\xBF][\x80-\xBF]'; // excluding overlongs
+ * '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'; // straight 3-byte
+ * '|\xED[\x80-\x9F][\x80-\xBF]'; // excluding surrogates
+ * '|\xF0[\x90-\xBF][\x80-\xBF]{2}'; // planes 1-3
+ * '|[\xF1-\xF3][\x80-\xBF]{3}'; // planes 4-15
+ * '|\xF4[\x80-\x8F][\x80-\xBF]{2}'; // plane 16
+ *
* @link http://www.w3.org/International/questions/qa-forms-utf-8.en
* @param string $string The string to analyze.
* @param array $options Allows to toggle mode via the `'quick'` option, defaults to `false`.
@@ -68,14 +78,14 @@ public static function is($string, array $options = array()) {
$regex = '/[^\x09\x0A\x0D\x20-\x7E]/m';
} else {
$regex = '/\A(';
- $regex .= '[\x09\x0A\x0D\x20-\x7E]'; // ASCII
- $regex .= '|[\xC2-\xDF][\x80-\xBF]'; // non-overlong 2-byte
- $regex .= '|\xE0[\xA0-\xBF][\x80-\xBF]'; // excluding overlongs
- $regex .= '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'; // straight 3-byte
- $regex .= '|\xED[\x80-\x9F][\x80-\xBF]'; // excluding surrogates
- $regex .= '|\xF0[\x90-\xBF][\x80-\xBF]{2}'; // planes 1-3
- $regex .= '|[\xF1-\xF3][\x80-\xBF]{3}'; // planes 4-15
- $regex .= '|\xF4[\x80-\x8F][\x80-\xBF]{2}'; // plane 16
+ $regex .= '[\x09\x0A\x0D\x20-\x7E]';
+ $regex .= '|[\xC2-\xDF][\x80-\xBF]';
+ $regex .= '|\xE0[\xA0-\xBF][\x80-\xBF]';
+ $regex .= '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}';
+ $regex .= '|\xED[\x80-\x9F][\x80-\xBF]';
+ $regex .= '|\xF0[\x90-\xBF][\x80-\xBF]{2}';
+ $regex .= '|[\xF1-\xF3][\x80-\xBF]{3}';
+ $regex .= '|\xF4[\x80-\x8F][\x80-\xBF]{2}';
$regex .= ')*\z/m';
}
return (boolean) preg_match($regex, $string);
View
@@ -166,7 +166,7 @@ public function type($type = null) {
}
if (is_string($data)) {
$type = $data;
- } else if (!empty($data['content'])) {
+ } elseif (!empty($data['content'])) {
$header = is_array($data['content']) ? reset($data['content']) : $data['content'];
}
$this->headers('Content-Type', $header);
View
@@ -207,9 +207,9 @@ public function to($format, array $options = array()) {
if (is_string($options['query'])) {
$options['query'] = "?" . $options['query'];
- } else if ($options['query']) {
+ } elseif ($options['query']) {
$options['query'] = "?" . http_build_query($options['query']);
- } else if ($options['query'] === null) {
+ } elseif ($options['query'] === null) {
$options['query'] = $this->queryString();
}
@@ -178,8 +178,7 @@ public function clear() {
* Determines if the XCache extension has been installed and
* if the userspace cache is available.
*
- * return boolean True if enabled, false otherwise
- * @return boolean
+ * @return boolean True if enabled, false otherwise.
*/
public static function enabled() {
return extension_loaded('xcache');
@@ -34,12 +34,12 @@
*
* {{{
* Session::config(array('default' => array(
- * 'adapter' => 'Cookie',
- * 'strategies' => array('Encrypt' => array(
- * 'cipher' => MCRYPT_RIJNDAEL_256,
- * 'mode' => MCRYPT_MODE_ECB, // Don't use ECB when you don't have to!
- * 'secret' => 'f00bar$l1thium'
- * ))
+ * 'adapter' => 'Cookie',
+ * 'strategies' => array('Encrypt' => array(
+ * 'cipher' => MCRYPT_RIJNDAEL_256,
+ * 'mode' => MCRYPT_MODE_ECB, // Don't use ECB when you don't have to!
+ * 'secret' => 'f00bar$l1thium'
+ * ))
* )));
* }}}
*
View
@@ -119,10 +119,10 @@ public function tearDown() {}
* For example:
* {{{
* public function skip() {
- * $this->_dbConfig = Connections::get('default', array('config' => true));
- * $hasDb = (isset($this->_dbConfig['adapter']) && $this->_dbConfig['adapter'] == 'MySql');
- * $message = 'Test database is either unavailable, or not using a MySQL adapter';
- * $this->skipIf(!$hasDb, $message);
+ * $this->_dbConfig = Connections::get('default', array('config' => true));
+ * $hasDb = (isset($this->_dbConfig['adapter']) && $this->_dbConfig['adapter'] == 'MySql');
+ * $message = 'Test database is either unavailable, or not using a MySQL adapter';
+ * $this->skipIf(!$hasDb, $message);
* }
* }}}
*/
@@ -429,28 +429,28 @@ public function assertPattern($expected, $result, $message = '{:message}') {
* Checks for an input tag with a name attribute (contains any non-empty value) and an id
* attribute that contains 'my-input':
* {{{
- * array('input' => array('name', 'id' => 'my-input'))
+ * array('input' => array('name', 'id' => 'my-input'))
* }}}
*
* Checks for two p elements with some text in them:
* {{{
- * array(
- * array('p' => true),
- * 'textA',
- * '/p',
- * array('p' => true),
- * 'textB',
- * '/p'
- * )
+ * array(
+ * array('p' => true),
+ * 'textA',
+ * '/p',
+ * array('p' => true),
+ * 'textB',
+ * '/p'
+ * )
* }}}
*
* You can also specify a pattern expression as part of the attribute values, or the tag
* being defined, if you prepend the value with preg: and enclose it with slashes, like so:
* {{{
- * array(
- * array('input' => array('name', 'id' => 'preg:/FieldName\d+/')),
- * 'preg:/My\s+field/'
- * )
+ * array(
+ * array('input' => array('name', 'id' => 'preg:/FieldName\d+/')),
+ * 'preg:/My\s+field/'
+ * )
* }}}
*
* Important: This function is very forgiving about whitespace and also accepts any
@@ -475,7 +475,7 @@ public function assertTags($string, $expected) {
foreach ($normalized as $tags) {
$i++;
- if (is_string($tags) && $tags{0} === '<') {
+ if (is_string($tags) && $tags[0] === '<') {
$tags = array(substr($tags, 1) => array());
} elseif (is_string($tags)) {
$tagsTrimmed = preg_replace('/\s+/m', '', $tags);
@@ -823,7 +823,7 @@ protected function _handleException($exception, $lineFlag = null) {
$ref = $exception->getTrace();
$ref = $ref[0] + array('class' => null);
- if ($ref['class'] == __CLASS__ && $ref['function'] == 'skipIf') {
+ if ($ref['class'] === __CLASS__ && $ref['function'] === 'skipIf') {
return $this->_result('skip', $data);
}
}
Oops, something went wrong.

0 comments on commit 753f5a5

Please sign in to comment.