22namespace PHPDataGen \Model ;
33class Data_FieldModel {
44use \PHPDataGen \DataClassTrait;
5- private $ name = null ;
6- private $ editable = null ;
7- private $ direct = null ;
5+ private $ name = '' ;
6+ private $ editable = false ;
7+ private $ direct = false ;
88private $ type = null ;
9- private $ validators = null ;
10- private $ filterDefault = null ;
9+ private $ validators = [] ;
10+ private $ filterDefault = false ;
1111private $ default = null ;
1212public function __construct (array $ init = []) {
1313$ this ->editable = $ this ->validate_editable (false );
@@ -20,37 +20,37 @@ public function __construct(array $init = []) {
2020}
2121public function get_name () { return $ this ->name ; }
2222protected function validate_name ($ value ) {
23- if (!is_null ( $ expr ) && ! is_string ($ value )) { throw new \InvalidArgumentException ('Field name has type string ' ); }
23+ if (!is_string ($ value )) { throw new \InvalidArgumentException ('Field name has type string ' ); }
2424return $ value ;
2525}
2626public function get_editable () { return $ this ->editable ; }
2727protected function validate_editable ($ value ) {
28- if (!is_null ( $ expr ) && ! is_bool ($ value )) { throw new \InvalidArgumentException ('Field editable has type bool ' ); }
28+ if (!is_bool ($ value )) { throw new \InvalidArgumentException ('Field editable has type bool ' ); }
2929return $ value ;
3030}
3131public function get_direct () { return $ this ->direct ; }
3232protected function validate_direct ($ value ) {
33- if (!is_null ( $ expr ) && ! is_bool ($ value )) { throw new \InvalidArgumentException ('Field direct has type bool ' ); }
33+ if (!is_bool ($ value )) { throw new \InvalidArgumentException ('Field direct has type bool ' ); }
3434return $ value ;
3535}
3636public function get_type () { return $ this ->type ; }
3737protected function validate_type ($ value ) {
38- if (!is_null ( $ expr ) && ! is_a ($ value , \PHPDataGen \Type::class)) { throw new \InvalidArgumentException ('Field type has type \PHPDataGen\Type ' ); }
38+ if (!is_a ($ value , \PHPDataGen \Type::class)) { throw new \InvalidArgumentException ('Field type has type \PHPDataGen\Type ' ); }
3939return $ value ;
4040}
4141public function get_validators () { return $ this ->validators ; }
4242protected function validate_validators ($ value ) {
43- if (!is_null ( $ expr ) && ! is_array ($ value )) { throw new \InvalidArgumentException ('Field validators has type array ' ); }
43+ if (!is_array ($ value )) { throw new \InvalidArgumentException ('Field validators has type array ' ); }
4444return $ value ;
4545}
4646public function get_filterDefault () { return $ this ->filterDefault ; }
4747protected function validate_filterDefault ($ value ) {
48- if (!is_null ( $ expr ) && ! is_bool ($ value )) { throw new \InvalidArgumentException ('Field filterDefault has type bool ' ); }
48+ if (!is_bool ($ value )) { throw new \InvalidArgumentException ('Field filterDefault has type bool ' ); }
4949return $ value ;
5050}
5151public function get_default () { return $ this ->default ; }
5252protected function validate_default ($ value ) {
53- if (!is_null ($ expr ) && !is_string ($ value )) { throw new \InvalidArgumentException ('Field default has type string ' ); }
53+ if (!is_null ($ value ) && !is_string ($ value )) { throw new \InvalidArgumentException ('Field default has type string ' ); }
5454return $ value ;
5555}
5656}
0 commit comments