@@ -40,7 +40,7 @@ |
||
40 | 40 | */ |
41 | 41 | public function add( $name, $type = Type::TEXT, $rules = [] ) { |
42 | 42 | $this->fields[$name] = new Field($name, $type, $rules); |
43 | - $this->types = []; // clear this so it will be refreshed when we've finished adding fields |
|
43 | + $this->types = []; // clear this so it will be refreshed when we've finished adding fields |
|
44 | 44 | return $this; |
45 | 45 | } |
46 | 46 |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $method = $validators[$type]; |
212 | 212 | $clean = Validator::$method($v); |
213 | 213 | } |
214 | - elseif( in_array($type, [Type::OBJECT, Type::ENTITY]) ){ |
|
214 | + elseif( in_array($type, [Type::OBJECT, Type::ENTITY]) ) { |
|
215 | 215 | $clean = Validator::validateObject($v, $this->rules['class'], $this->nullable); |
216 | 216 | } |
217 | 217 | elseif( $type == Type::BINARY ) { |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $this->required = $rules['required']; |
292 | 292 | $this->nullable = $rules['nullable']; |
293 | 293 | $this->default = $rules['default']; |
294 | - $this->label = $rules['label']; |
|
294 | + $this->label = $rules['label']; |
|
295 | 295 | |
296 | 296 | unset( |
297 | 297 | $rules['required'], |
@@ -42,7 +42,7 @@ |
||
42 | 42 | if( !isset($config) || !is_array($config) ) |
43 | 43 | throw new \LogicException('Invalid Configuration'); |
44 | 44 | |
45 | - if( empty($key) ) |
|
45 | + if( empty($key) ) |
|
46 | 46 | $this->merge($config); |
47 | 47 | else |
48 | 48 | $this->set($key, $config); |
@@ -225,7 +225,7 @@ |
||
225 | 225 | * @param integer $limit |
226 | 226 | * @return self |
227 | 227 | */ |
228 | - public function limit( $limit ) { |
|
228 | + public function limit( $limit ) { |
|
229 | 229 | $this->limit = max(1, (int) $limit); |
230 | 230 | return $this; |
231 | 231 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public static function __callStatic( $name, $args ) { |
28 | 28 | |
29 | - $name = 'validate'. substr($name, 2); |
|
29 | + $name = 'validate'.substr($name, 2); |
|
30 | 30 | |
31 | 31 | if( !method_exists(__CLASS__, $name) ) |
32 | 32 | throw new \BadMethodCallException(sprintf("%s::%s()", get_called_class(), $name)); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | new \Twig_SimpleFilter('sha1', 'sha1'), |
48 | 48 | new \Twig_SimpleFilter('truncate', function( $str, $length, $replace = '...' ) { |
49 | 49 | if( isset($str) ) |
50 | - return strlen($str) <= $length ? $str : substr($str, 0, $length - strip_tags($replace)) . $replace; |
|
50 | + return strlen($str) <= $length ? $str : substr($str, 0, $length - strip_tags($replace)).$replace; |
|
51 | 51 | return null; |
52 | 52 | }), |
53 | 53 | new \Twig_SimpleFilter('sum', 'array_sum'), |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | ]; |
56 | 56 | |
57 | 57 | // include some helpful shit from yolk-core/StringHelper if we have it available |
58 | - if( class_exists ('\\yolk\\helpers\\StringHelper') ) { |
|
58 | + if( class_exists('\\yolk\\helpers\\StringHelper') ) { |
|
59 | 59 | $filters = array_merge( |
60 | 60 | $filters, |
61 | 61 | [ |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | // more helpful shit from yolk-core/Inflector if we have it available |
74 | - if( class_exists ('\\yolk\\helpers\\Inflector') ) { |
|
74 | + if( class_exists('\\yolk\\helpers\\Inflector') ) { |
|
75 | 75 | $filters = array_merge( |
76 | 76 | $filters, |
77 | 77 | [ |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | ]; |
94 | 94 | |
95 | 95 | // include some helpful shit from yolk-core/StringHelper if we have it available |
96 | - if( class_exists ('\\yolk\\helpers\\StringHelper') ) { |
|
96 | + if( class_exists('\\yolk\\helpers\\StringHelper') ) { |
|
97 | 97 | $functions = array_merge( |
98 | 98 | $functions, |
99 | 99 | [ |