Skip to content

Commit

Permalink
Rename default validation constant to read better
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Burke committed Jan 29, 2015
1 parent 3739ca1 commit bc6a55a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ORM/Table.php
Expand Up @@ -125,7 +125,7 @@ class Table implements RepositoryInterface, EventListenerInterface
*
* @var string
*/
const VALIDATOR_DEFAULT = 'default';
const DEFAULT_VALIDATOR = 'default';

/**
* Name of the table as it can be found in the database
Expand Down Expand Up @@ -255,7 +255,7 @@ public function __construct(array $config = [])
}
if (!empty($config['validator'])) {
if (!is_array($config['validator'])) {
$this->validator(self::VALIDATOR_DEFAULT, $config['validator']);
$this->validator(self::DEFAULT_VALIDATOR, $config['validator']);
} else {
foreach ($config['validator'] as $name => $validator) {
$this->validator($name, $validator);
Expand Down Expand Up @@ -1149,7 +1149,7 @@ public function updateAll($fields, $conditions)
* use null to get a validator.
* @return \Cake\Validation\Validator
*/
public function validator($name = self::VALIDATOR_DEFAULT, Validator $validator = null)
public function validator($name = self::DEFAULT_VALIDATOR, Validator $validator = null)
{
if ($validator === null && isset($this->_validators[$name])) {
return $this->_validators[$name];
Expand Down

0 comments on commit bc6a55a

Please sign in to comment.