Permalink
Browse files

QA: Removing trailing comma in arrays, lowercasing some keywords.

  • Loading branch information...
1 parent f004a91 commit 26c2192d26c4e4cee56836d1767b545d757e30a0 @davidpersson davidpersson committed with nateabele Mar 23, 2011
Showing with 260 additions and 260 deletions.
  1. +1 −1 libraries/lithium/action/Controller.php
  2. +3 −3 libraries/lithium/action/Response.php
  3. +1 −1 libraries/lithium/analysis/Debugger.php
  4. +1 −1 libraries/lithium/analysis/Inspector.php
  5. +1 −1 libraries/lithium/analysis/logger/adapter/File.php
  6. +5 −5 libraries/lithium/core/Libraries.php
  7. +1 −1 libraries/lithium/data/Connections.php
  8. +1 −1 libraries/lithium/data/Entity.php
  9. +2 −2 libraries/lithium/data/Model.php
  10. +1 −1 libraries/lithium/data/collection/DocumentArray.php
  11. +1 −1 libraries/lithium/data/model/Query.php
  12. +1 −1 libraries/lithium/data/model/Relationship.php
  13. +2 −2 libraries/lithium/data/source/Database.php
  14. +1 −1 libraries/lithium/data/source/Http.php
  15. +5 −5 libraries/lithium/data/source/MongoDb.php
  16. +2 −2 libraries/lithium/data/source/database/adapter/MySql.php
  17. +1 −1 libraries/lithium/data/source/database/adapter/Sqlite3.php
  18. +3 −3 libraries/lithium/data/source/http/adapter/CouchDb.php
  19. +2 −2 libraries/lithium/data/source/mongo_db/Exporter.php
  20. +1 −1 libraries/lithium/g11n/Message.php
  21. +1 −1 libraries/lithium/g11n/catalog/adapter/Code.php
  22. +1 −1 libraries/lithium/g11n/catalog/adapter/Gettext.php
  23. +1 −1 libraries/lithium/net/Message.php
  24. +6 −6 libraries/lithium/net/http/Media.php
  25. +1 −1 libraries/lithium/net/http/Request.php
  26. +1 −1 libraries/lithium/net/http/Route.php
  27. +2 −2 libraries/lithium/net/http/Service.php
  28. +1 −1 libraries/lithium/storage/cache/adapter/Apc.php
  29. +1 −1 libraries/lithium/storage/cache/adapter/File.php
  30. +1 −1 libraries/lithium/storage/cache/adapter/Memory.php
  31. +1 −1 libraries/lithium/storage/cache/adapter/Redis.php
  32. +1 −1 libraries/lithium/storage/session/adapter/Php.php
  33. +1 −1 libraries/lithium/template/View.php
  34. +1 −1 libraries/lithium/template/helper/Form.php
  35. +1 −1 libraries/lithium/test/Dispatcher.php
  36. +3 −3 libraries/lithium/test/Group.php
  37. +2 −2 libraries/lithium/test/Report.php
  38. +2 −2 libraries/lithium/test/Unit.php
  39. +66 −66 libraries/lithium/tests/cases/action/RequestTest.php
  40. +1 −1 libraries/lithium/tests/cases/core/AdaptableTest.php
  41. +1 −1 libraries/lithium/tests/cases/core/LibrariesTest.php
  42. +3 −3 libraries/lithium/tests/cases/data/ModelTest.php
  43. +2 −2 libraries/lithium/tests/cases/data/collection/RecordSetTest.php
  44. +2 −2 libraries/lithium/tests/cases/data/entity/DocumentTest.php
  45. +3 −3 libraries/lithium/tests/cases/data/model/QueryTest.php
  46. +4 −4 libraries/lithium/tests/cases/data/source/DatabaseTest.php
  47. +1 −1 libraries/lithium/tests/cases/data/source/HttpTest.php
  48. +1 −1 libraries/lithium/tests/cases/data/source/MongoDbTest.php
  49. +2 −2 libraries/lithium/tests/cases/data/source/database/adapter/MySqlTest.php
  50. +1 −1 libraries/lithium/tests/cases/data/source/database/adapter/Sqlite3Test.php
  51. +2 −2 libraries/lithium/tests/cases/data/source/mongo_db/ExporterTest.php
  52. +3 −3 libraries/lithium/tests/cases/g11n/CatalogTest.php
  53. +2 −2 libraries/lithium/tests/cases/g11n/LocaleTest.php
  54. +6 −6 libraries/lithium/tests/cases/g11n/MessageTest.php
  55. +6 −6 libraries/lithium/tests/cases/g11n/catalog/adapter/GettextTest.php
  56. +2 −2 libraries/lithium/tests/cases/net/MessageTest.php
  57. +2 −2 libraries/lithium/tests/cases/net/http/MessageTest.php
  58. +3 −3 libraries/lithium/tests/cases/net/http/RequestTest.php
  59. +2 −2 libraries/lithium/tests/cases/net/http/ResponseTest.php
  60. +10 −10 libraries/lithium/tests/cases/template/helper/FormTest.php
  61. +1 −1 libraries/lithium/tests/cases/template/helper/HtmlTest.php
  62. +3 −3 libraries/lithium/tests/cases/test/GroupTest.php
  63. +1 −1 libraries/lithium/tests/cases/test/UnitTest.php
  64. +14 −14 libraries/lithium/tests/cases/util/SetTest.php
  65. +4 −4 libraries/lithium/tests/cases/util/ValidatorTest.php
  66. +1 −1 libraries/lithium/tests/integration/g11n/CatalogValidatorTest.php
  67. +2 −2 libraries/lithium/tests/integration/storage/CookieTest.php
  68. +1 −1 libraries/lithium/tests/mocks/action/MockCgiRequest.php
  69. +4 −4 libraries/lithium/tests/mocks/console/command/MockLibraryService.php
  70. +1 −1 libraries/lithium/tests/mocks/data/MockPostForValidates.php
  71. +21 −21 libraries/lithium/tests/mocks/data/MockSource.php
  72. +1 −1 libraries/lithium/tests/mocks/data/model/MockDocumentSource.php
  73. +10 −10 libraries/lithium/tests/mocks/data/source/database/adapter/MockMySql.php
  74. +1 −1 libraries/lithium/util/Inflector.php
  75. +4 −4 libraries/lithium/util/Set.php
  76. +2 −2 libraries/lithium/util/String.php
@@ -240,7 +240,7 @@ public function render(array $options = array()) {
'location' => false,
'data' => null,
'head' => false,
- 'controller' => Inflector::underscore($name),
+ 'controller' => Inflector::underscore($name)
);
$options += $this->_render + $defaults;
@@ -80,17 +80,17 @@ public function cache($expires) {
'Cache-Control' => array(
'no-store, no-cache, must-revalidate',
'post-check=0, pre-check=0',
- 'max-age=0',
+ 'max-age=0'
),
- 'Pragma' => 'no-cache',
+ 'Pragma' => 'no-cache'
));
}
$expires = is_int($expires) ? $expires : strtotime($expires);
return $this->headers(array(
'Expires' => gmdate('D, d M Y H:i:s', $expires) . ' GMT',
'Cache-Control' => 'max-age=' . ($expires - time()),
- 'Pragma' => 'cache',
+ 'Pragma' => 'cache'
));
}
@@ -43,7 +43,7 @@ public static function trace(array $options = array()) {
'scope' => array(),
'trace' => array(),
'includeScope' => true,
- 'closures' => true,
+ 'closures' => true
);
$options += $defaults;
@@ -189,7 +189,7 @@ function($str) { return preg_quote($str, '/'); },
$pattern = join('|', array(
"({$pattern})",
"\\$(.+)\($",
- "\s*['\"]\w+['\"]\s*=>\s*.+[\{\(]$",
+ "\s*['\"]\w+['\"]\s*=>\s*.+[\{\(]$"
));
$options['pattern'] = "/^({$pattern})/";
}
@@ -56,7 +56,7 @@ public function __construct(array $config = array()) {
'path' => Libraries::get(true, 'resources') . '/tmp/logs',
'timestamp' => 'Y-m-d H:i:s',
'file' => function($data, $config) { return "{$data['priority']}.log"; },
- 'format' => "{:timestamp} {:message}\n",
+ 'format' => "{:timestamp} {:message}\n"
);
parent::__construct($config + $defaults);
}
@@ -93,7 +93,7 @@ class Libraries {
'{:library}\extensions\command\{:namespace}\{:class}\{:name}',
'{:library}\console\command\{:namespace}\{:class}\{:name}' => array(
'libraries' => 'lithium'
- ),
+ )
),
'controllers' => array(
'{:library}\controllers\{:name}Controller'
@@ -129,10 +129,10 @@ class Libraries {
),
'test' => array(
'{:library}\extensions\test\{:namespace}\{:class}\{:name}',
- '{:library}\test\{:namespace}\{:class}\{:name}' => array('libraries' => 'lithium'),
+ '{:library}\test\{:namespace}\{:class}\{:name}' => array('libraries' => 'lithium')
),
'tests' => array(
- '{:library}\tests\{:namespace}\{:class}\{:name}Test',
+ '{:library}\tests\{:namespace}\{:class}\{:name}Test'
)
);
@@ -274,7 +274,7 @@ public static function add($name, array $config = array()) {
'transform' => null,
'bootstrap' => true,
'defer' => false,
- 'default' => false,
+ 'default' => false
);
if ($name === 'lithium') {
$defaults['defer'] = true;
@@ -417,7 +417,7 @@ public static function find($library, array $options = array()) {
'recursive' => false,
'filter' => '/^(\w+)?(\\\\[a-z0-9_]+)+\\\\[A-Z][a-zA-Z0-9]+$/',
'exclude' => '',
- 'namespaces' => false,
+ 'namespaces' => false
);
$options += $defaults;
$libs = array();
@@ -103,7 +103,7 @@ public static function add($name, array $config = array()) {
'adapter' => null,
'host' => 'localhost',
'login' => '',
- 'password' => '',
+ 'password' => ''
);
return static::$_configurations[$name] = $config + $defaults;
}
@@ -387,7 +387,7 @@ public function export() {
'exists' => $this->_exists,
'data' => $this->_data,
'update' => $this->_updated,
- 'increment' => $this->_increment,
+ 'increment' => $this->_increment
);
}
@@ -741,7 +741,7 @@ public function save($entity, $data = null, array $options = array()) {
'validate' => true,
'whitelist' => null,
'callbacks' => true,
- 'locked' => $self->_meta['locked'],
+ 'locked' => $self->_meta['locked']
);
$options += $defaults;
$params = compact('entity', 'data', 'options');
@@ -820,7 +820,7 @@ public function save($entity, $data = null, array $options = array()) {
public function validates($entity, array $options = array()) {
$defaults = array(
'rules' => $this->validates,
- 'events' => $entity->exists() ? 'update' : 'create',
+ 'events' => $entity->exists() ? 'update' : 'create'
);
$options += $defaults;
$self = static::_object();
@@ -137,7 +137,7 @@ public function export() {
return array(
'exists' => $this->_exists,
'key' => $this->_pathKey,
- 'data' => $this->_data,
+ 'data' => $this->_data
);
}
@@ -98,7 +98,7 @@ public function __construct(array $config = array()) {
'joins' => array(),
'with' => array(),
'map' => array(),
- 'whitelist' => array(),
+ 'whitelist' => array()
);
parent::__construct($config + $defaults);
}
@@ -58,7 +58,7 @@ public function __construct(array $config = array()) {
'link' => self::LINK_KEY,
'fields' => true,
'fieldName' => null,
- 'constraint' => array(),
+ 'constraint' => array()
);
parent::__construct($config + $defaults);
}
@@ -142,7 +142,7 @@ public function __construct(array $config = array()) {
'host' => 'localhost',
'login' => 'root',
'password' => '',
- 'database' => null,
+ 'database' => null
);
$this->_strings += array(
'read' => 'SELECT {:fields} FROM {:source} {:alias} {:joins} {:conditions} {:group} ' .
@@ -280,7 +280,7 @@ public function read($query, array $options = array()) {
return $records;
case 'item':
return $self->item($query->model(), array(), compact('query', 'result') + array(
- 'class' => 'set',
+ 'class' => 'set'
));
}
});
@@ -77,7 +77,7 @@ public function __construct(array $config = array()) {
'password' => '',
'port' => 80,
'timeout' => 30,
- 'encoding' => 'UTF-8',
+ 'encoding' => 'UTF-8'
);
$config = $config + $defaults;
$config['username'] = $config['login'];
@@ -66,7 +66,7 @@ class MongoDb extends \lithium\data\Source {
'set' => 'lithium\data\collection\DocumentSet',
'result' => 'lithium\data\source\mongo_db\Result',
'exporter' => 'lithium\data\source\mongo_db\Exporter',
- 'relationship' => 'lithium\data\model\Relationship',
+ 'relationship' => 'lithium\data\model\Relationship'
);
/**
@@ -84,7 +84,7 @@ class MongoDb extends \lithium\data\Source {
'or' => '$or',
'||' => '$or',
'not' => '$not',
- '!' => '$not',
+ '!' => '$not'
);
/**
@@ -151,7 +151,7 @@ public function __construct(array $config = array()) {
'timeout' => 100,
'replicaSet' => false,
'schema' => null,
- 'gridPrefix' => 'fs',
+ 'gridPrefix' => 'fs'
);
parent::__construct($config + $defaults);
}
@@ -176,7 +176,7 @@ protected function _init() {
'float' => function($v) { return (float) $v; },
'boolean' => function($v) { return (boolean) $v; },
'code' => function($v) { return new MongoCode($v); },
- 'binary' => function($v) { return new MongoBinData($v); },
+ 'binary' => function($v) { return new MongoBinData($v); }
);
}
@@ -209,7 +209,7 @@ public static function enabled($feature = null) {
'arrays' => true,
'transactions' => false,
'booleans' => true,
- 'relationships' => true,
+ 'relationships' => true
);
return isset($features[$feature]) ? $features[$feature] : null;
}
@@ -103,7 +103,7 @@ public static function enabled($feature = null) {
'arrays' => false,
'transactions' => false,
'booleans' => true,
- 'relationships' => true,
+ 'relationships' => true
);
return isset($features[$feature]) ? $features[$feature] : null;
}
@@ -216,7 +216,7 @@ public function describe($entity, array $meta = array()) {
$fields[$column['field']] = $match + array(
'null' => ($column['null'] == 'YES' ? true : false),
- 'default' => $column['default'],
+ 'default' => $column['default']
);
}
return $fields;
@@ -90,7 +90,7 @@ public function __construct(array $config = array()) {
$defaults = array(
'database' => '',
'flags' => SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE,
- 'key' => NULL
+ 'key' => null
);
parent::__construct($config + $defaults);
}
@@ -44,7 +44,7 @@ class CouchDb extends \lithium\data\source\Http {
'service' => 'lithium\net\http\Service',
'entity' => 'lithium\data\entity\Document',
'set' => 'lithium\data\collection\DocumentSet',
- 'array' => 'lithium\data\collection\DocumentArray',
+ 'array' => 'lithium\data\collection\DocumentArray'
);
protected $_handlers = array();
@@ -65,7 +65,7 @@ protected function _init() {
$this->_handlers += array(
'integer' => function($v) { return (integer) $v; },
'float' => function($v) { return (float) $v; },
- 'boolean' => function($v) { return (boolean) $v; },
+ 'boolean' => function($v) { return (boolean) $v; }
);
}
@@ -485,7 +485,7 @@ public static function enabled($feature = null) {
'arrays' => true,
'transactions' => false,
'booleans' => true,
- 'relationships' => false,
+ 'relationships' => false
);
return isset($features[$feature]) ? $features[$feature] : null;
}
@@ -19,7 +19,7 @@ class Exporter extends \lithium\core\StaticObject {
'MongoBinData' => 'binary',
'datetime' => 'date',
'timestamp' => 'date',
- 'int' => 'integer',
+ 'int' => 'integer'
);
public static function get($type, $export, array $options = array()) {
@@ -85,7 +85,7 @@ public static function toCommand($changes) {
'update' => '$set',
'increment' => '$inc',
'remove' => '$unset',
- 'rename' => '$rename',
+ 'rename' => '$rename'
);
$result = array();
@@ -100,7 +100,7 @@ public static function translate($id, array $options = array()) {
'locale' => Environment::get('locale'),
'scope' => null,
'default' => null,
- 'noop' => false,
+ 'noop' => false
);
extract($options + $defaults);
@@ -139,7 +139,7 @@ protected function _parsePhp($file) {
$data = $this->_merge($data, array(
'id' => $ids['singular'],
'ids' => $ids,
- 'occurrences' => array($occurrence),
+ 'occurrences' => array($occurrence)
));
extract($defaults, EXTR_OVERWRITE);
} elseif ($token[0] === T_CONSTANT_ENCAPSED_STRING) {
@@ -285,7 +285,7 @@ protected function _parseMo($stream) {
'offsetId' => null,
'offsetTranslated' => null,
'sizeHashes' => null,
- 'offsetHashes' => null,
+ 'offsetHashes' => null
);
foreach ($header as &$value) {
$value = $this->_readLong($stream, $isBigEndian);
@@ -82,7 +82,7 @@ public function __construct(array $config = array()) {
'username' => null,
'password' => null,
'body' => null,
- 'message' => null,
+ 'message' => null
);
$config += $defaults;
@@ -219,7 +219,7 @@ public static function type($type, $content = null, array $options = array()) {
'encode' => false,
'decode' => false,
'cast' => true,
- 'conditions' => array(),
+ 'conditions' => array()
);
if ($content === false) {
@@ -410,7 +410,7 @@ public static function asset($path, $type, array $options = array()) {
'path' => array(),
'suffix' => null,
'check' => false,
- 'library' => true,
+ 'library' => true
);
if (!$base = static::_assets($type)) {
$type = 'generic';
@@ -506,7 +506,7 @@ public static function path($path, $type, array $options = array()) {
'base' => null,
'path' => array(),
'suffix' => null,
- 'library' => true,
+ 'library' => true
);
if (!$base = static::_assets($type)) {
$type = 'generic';
@@ -753,7 +753,7 @@ protected static function _types($type = null) {
'js' => array('application/javascript', 'text/javascript'),
'text' => 'text/plain',
'txt' => array('alias' => 'text'),
- 'xml' => array('application/xml', 'text/xml'),
+ 'xml' => array('application/xml', 'text/xml')
);
if (!$type) {
@@ -795,15 +795,15 @@ protected static function _handlers($type = null) {
'paths' => array(
'template' => '{:library}/views/{:controller}/{:template}.{:type}.php',
'layout' => '{:library}/views/layouts/{:layout}.{:type}.php',
- 'element' => '{:library}/views/elements/{:template}.{:type}.php',
+ 'element' => '{:library}/views/elements/{:template}.{:type}.php'
)
),
'html' => array(),
'json' => array('cast' => true, 'encode' => 'json_encode', 'decode' => function($data) {
return json_decode($data, true);
}),
'text' => array('cast' => false, 'encode' => function($s) { return $s; }),
- 'form' => array('cast' => true, 'encode' => 'http_build_query'),
+ 'form' => array('cast' => true, 'encode' => 'http_build_query')
);
if ($type) {
Oops, something went wrong.

0 comments on commit 26c2192

Please sign in to comment.