Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php defined('SYSPATH') OR die('No direct access allowed.'); |
||
11 | public function initialize(Jam_Meta $meta, $name) |
||
12 | { |
||
13 | parent::initialize($meta, $name); |
||
14 | |||
15 | $meta |
||
|
|||
16 | ->unique_key(array($this, 'username_key')) |
||
17 | |||
18 | ->name_key('username') |
||
19 | |||
20 | ->fields([ |
||
21 | 'username' => Jam::field('string'), |
||
22 | ]) |
||
23 | |||
24 | ->validator('username', array( |
||
25 | 'length' => array('minimum' => 3, 'maximum' => 32), |
||
26 | 'present' => TRUE, |
||
27 | 'format' => array('regex' => '/^[a-zA-Z0-9\_\-]+$/') |
||
28 | )); |
||
29 | } |
||
30 | |||
37 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.