@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace WFV\Artisan; |
| 3 | -defined( 'ABSPATH' ) || die(); |
|
| 3 | +defined('ABSPATH') || die(); |
|
| 4 | 4 | |
| 5 | 5 | use WFV\Contract\ArtisanInterface; |
| 6 | 6 | use WFV\Collection\ErrorCollection; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * |
| 60 | 60 | * @param array $config |
| 61 | 61 | */ |
| 62 | - public function __construct( array $config ) { |
|
| 62 | + public function __construct(array $config) { |
|
| 63 | 63 | $this->config = $config; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | * @param string $action |
| 83 | 83 | * @return WFV\Artisan\FormArtisan |
| 84 | 84 | */ |
| 85 | - public function create( $action ) { |
|
| 86 | - $this->form = new FormComposite( $this, $action ); |
|
| 85 | + public function create($action) { |
|
| 86 | + $this->form = new FormComposite($this, $action); |
|
| 87 | 87 | return $this; |
| 88 | 88 | } |
| 89 | 89 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * @return WFV\Artisan\FormArtisan |
| 97 | 97 | */ |
| 98 | 98 | public function errors() { |
| 99 | - $this->collection['errors'] = new ErrorCollection( $this->labels() ); |
|
| 99 | + $this->collection['errors'] = new ErrorCollection($this->labels()); |
|
| 100 | 100 | return $this; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -109,10 +109,10 @@ discard block |
||
| 109 | 109 | * @param array $data |
| 110 | 110 | * @return WFV\Artisan\FormArtisan |
| 111 | 111 | */ |
| 112 | - public function input( array $data = [] ) { |
|
| 112 | + public function input(array $data = []) { |
|
| 113 | 113 | $input = $data[0]; |
| 114 | 114 | $trim = $data[1]; |
| 115 | - $this->collection['input'] = new InputCollection( $input, $trim ); |
|
| 115 | + $this->collection['input'] = new InputCollection($input, $trim); |
|
| 116 | 116 | return $this; |
| 117 | 117 | } |
| 118 | 118 | |
@@ -126,10 +126,10 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function rules() { |
| 128 | 128 | $rules = array(); |
| 129 | - foreach( $this->config as $field => $options ) { |
|
| 130 | - $rules[ $field ] = $options['rules']; |
|
| 129 | + foreach ($this->config as $field => $options) { |
|
| 130 | + $rules[$field] = $options['rules']; |
|
| 131 | 131 | } |
| 132 | - $this->collection['rules'] = new RuleCollection( $rules ); |
|
| 132 | + $this->collection['rules'] = new RuleCollection($rules); |
|
| 133 | 133 | return $this; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | * @return WFV\Artisan\FormArtisan |
| 143 | 143 | */ |
| 144 | 144 | public function validator() { |
| 145 | - $this->validator = new Validator( new MessageCollection( $this->config ) ); |
|
| 145 | + $this->validator = new Validator(new MessageCollection($this->config)); |
|
| 146 | 146 | return $this; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * @return array |
| 157 | 157 | */ |
| 158 | 158 | protected function labels() { |
| 159 | - return array_map( function( $item ) { |
|
| 159 | + return array_map(function($item) { |
|
| 160 | 160 | return $item['label']; |
| 161 | 161 | }, $this->config); |
| 162 | 162 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace WFV\Collection; |
| 3 | -defined( 'ABSPATH' ) || die(); |
|
| 3 | +defined('ABSPATH') || die(); |
|
| 4 | 4 | use WFV\Abstraction\Collectable; |
| 5 | 5 | /** |
| 6 | 6 | * |
@@ -16,8 +16,8 @@ discard block |
||
| 16 | 16 | * |
| 17 | 17 | * @param array $form Config array |
| 18 | 18 | */ |
| 19 | - public function __construct( array $form ) { |
|
| 20 | - $this->set_messages( $form ); |
|
| 19 | + public function __construct(array $form) { |
|
| 20 | + $this->set_messages($form); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -40,9 +40,9 @@ discard block |
||
| 40 | 40 | * @param string $rule |
| 41 | 41 | * @return array|null |
| 42 | 42 | */ |
| 43 | - public function get_msg( $field, $rule ) { |
|
| 44 | - return ( isset( $this->data[ $field ][ $rule ] ) ) |
|
| 45 | - ? $this->data[ $field ][ $rule ] |
|
| 43 | + public function get_msg($field, $rule) { |
|
| 44 | + return (isset($this->data[$field][$rule])) |
|
| 45 | + ? $this->data[$field][$rule] |
|
| 46 | 46 | : null; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | * @param array $form |
| 57 | 57 | * @return array |
| 58 | 58 | */ |
| 59 | - protected function filter_config( array $form ) { |
|
| 60 | - return array_filter( $form, function( $item ) { |
|
| 61 | - return array_key_exists('messages', $item ); |
|
| 59 | + protected function filter_config(array $form) { |
|
| 60 | + return array_filter($form, function($item) { |
|
| 61 | + return array_key_exists('messages', $item); |
|
| 62 | 62 | }); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @param array |
| 72 | 72 | */ |
| 73 | - protected function make_array( array $filtered ) { |
|
| 73 | + protected function make_array(array $filtered) { |
|
| 74 | 74 | $messages = array(); |
| 75 | - foreach( $filtered as $field => $options ) { |
|
| 76 | - $messages[ $field ] = $options['messages']; |
|
| 75 | + foreach ($filtered as $field => $options) { |
|
| 76 | + $messages[$field] = $options['messages']; |
|
| 77 | 77 | } |
| 78 | 78 | return $messages; |
| 79 | 79 | } |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | * |
| 87 | 87 | * @param array $form |
| 88 | 88 | */ |
| 89 | - protected function set_messages( array $form ) { |
|
| 90 | - $filtered = $this->filter_config( $form ); |
|
| 91 | - $this->data = $this->make_array( $filtered ); |
|
| 89 | + protected function set_messages(array $form) { |
|
| 90 | + $filtered = $this->filter_config($form); |
|
| 91 | + $this->data = $this->make_array($filtered); |
|
| 92 | 92 | } |
| 93 | 93 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace WFV\Collection; |
| 3 | -defined( 'ABSPATH' ) || die(); |
|
| 3 | +defined('ABSPATH') || die(); |
|
| 4 | 4 | |
| 5 | 5 | use WFV\Abstraction\Collectable; |
| 6 | 6 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @param array $labels Human friendly labels for the fields |
| 28 | 28 | */ |
| 29 | - function __construct( array $labels = [] ) { |
|
| 29 | + function __construct(array $labels = []) { |
|
| 30 | 30 | $this->labels = $labels; |
| 31 | 31 | } |
| 32 | 32 | |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | * @param string $field |
| 39 | 39 | * @return string|null |
| 40 | 40 | */ |
| 41 | - public function first( $field ) { |
|
| 42 | - return ( isset( $this->data[ $field ] ) ) |
|
| 43 | - ? array_values( $this->data[ $field ] )[0] |
|
| 41 | + public function first($field) { |
|
| 42 | + return (isset($this->data[$field])) |
|
| 43 | + ? array_values($this->data[$field])[0] |
|
| 44 | 44 | : null; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | * @param string $field |
| 53 | 53 | * @return array|null |
| 54 | 54 | */ |
| 55 | - public function get( $field ) { |
|
| 56 | - return ( isset( $this->data[ $field ] ) ) |
|
| 57 | - ? $this->data[ $field ] |
|
| 55 | + public function get($field) { |
|
| 56 | + return (isset($this->data[$field])) |
|
| 57 | + ? $this->data[$field] |
|
| 58 | 58 | : null; |
| 59 | 59 | } |
| 60 | 60 | |
@@ -66,10 +66,10 @@ discard block |
||
| 66 | 66 | * |
| 67 | 67 | * @param array $errors |
| 68 | 68 | */ |
| 69 | - public function set_errors( array $errors = [] ) { |
|
| 70 | - $this->data = ( $this->is_populated() ) |
|
| 69 | + public function set_errors(array $errors = []) { |
|
| 70 | + $this->data = ($this->is_populated()) |
|
| 71 | 71 | ? $this->data |
| 72 | - : $this->with_labels( $errors ); |
|
| 72 | + : $this->with_labels($errors); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | * @param string $field |
| 83 | 83 | * @return string |
| 84 | 84 | */ |
| 85 | - protected function label( $field ) { |
|
| 86 | - return ( isset( $this->labels[ $field ] ) ) |
|
| 87 | - ? $this->labels[ $field ] |
|
| 85 | + protected function label($field) { |
|
| 86 | + return (isset($this->labels[$field])) |
|
| 87 | + ? $this->labels[$field] |
|
| 88 | 88 | : $field; |
| 89 | 89 | } |
| 90 | 90 | |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | * @param array $errors |
| 98 | 98 | * @return array |
| 99 | 99 | */ |
| 100 | - protected function with_labels( $errors ) { |
|
| 100 | + protected function with_labels($errors) { |
|
| 101 | 101 | $labeled = array(); |
| 102 | - foreach( $errors as $field => $messages ) { |
|
| 103 | - $label = $this->label( $field ); |
|
| 104 | - $labeled[ $field ] = str_replace( '{label}', $label, $errors[ $field ] ); |
|
| 102 | + foreach ($errors as $field => $messages) { |
|
| 103 | + $label = $this->label($field); |
|
| 104 | + $labeled[$field] = str_replace('{label}', $label, $errors[$field]); |
|
| 105 | 105 | } |
| 106 | 106 | return $labeled; |
| 107 | 107 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace WFV\Validators; |
| 3 | -defined( 'ABSPATH' ) || die(); |
|
| 3 | +defined('ABSPATH') || die(); |
|
| 4 | 4 | |
| 5 | 5 | use WFV\Validators\AbstractValidator; |
| 6 | 6 | |
@@ -32,14 +32,14 @@ discard block |
||
| 32 | 32 | * @param bool (optional) $optional |
| 33 | 33 | * @return bool |
| 34 | 34 | */ |
| 35 | - public function validate( $input = null, $optional = false ) { |
|
| 35 | + public function validate($input = null, $optional = false) { |
|
| 36 | 36 | $args = func_get_args(); |
| 37 | 37 | $params = $args[2]; |
| 38 | 38 | $max_value = $params[0]; |
| 39 | 39 | |
| 40 | 40 | $v = $this->validator->create(); |
| 41 | - return ( $optional ) |
|
| 42 | - ? $v->optional( $v->create()->length( null, $max_value ) )->validate( $input ) |
|
| 43 | - : $v->length( null, $max_value )->validate( $input ); |
|
| 41 | + return ($optional) |
|
| 42 | + ? $v->optional($v->create()->length(null, $max_value))->validate($input) |
|
| 43 | + : $v->length(null, $max_value)->validate($input); |
|
| 44 | 44 | } |
| 45 | 45 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace WFV\Validators; |
| 3 | -defined( 'ABSPATH' ) or die(); |
|
| 3 | +defined('ABSPATH') or die(); |
|
| 4 | 4 | |
| 5 | 5 | use WFV\Validators\AbstractValidator; |
| 6 | 6 | |
@@ -32,18 +32,18 @@ discard block |
||
| 32 | 32 | * @param bool (optional) $optional |
| 33 | 33 | * @return bool |
| 34 | 34 | */ |
| 35 | - public function validate( $input = null, $optional = false ){ |
|
| 35 | + public function validate($input = null, $optional = false) { |
|
| 36 | 36 | $args = func_get_args(); |
| 37 | 37 | $params = $args[2]; |
| 38 | 38 | $other_field = $params[0]; |
| 39 | 39 | |
| 40 | 40 | $v = $this->validator->create(); |
| 41 | 41 | |
| 42 | - if( $optional ) { |
|
| 42 | + if ($optional) { |
|
| 43 | 43 | return $v->optional( |
| 44 | - $v->create()->not( $v->create()->equals( $_POST[ $other_field ] )) ) |
|
| 45 | - ->validate( $input ); |
|
| 44 | + $v->create()->not($v->create()->equals($_POST[$other_field])) ) |
|
| 45 | + ->validate($input); |
|
| 46 | 46 | } |
| 47 | - return $v->not( $v->create()->equals( $_POST[ $other_field ] ))->validate( $input ); |
|
| 47 | + return $v->not($v->create()->equals($_POST[$other_field]))->validate($input); |
|
| 48 | 48 | } |
| 49 | 49 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace WFV\Validators; |
| 3 | -defined( 'ABSPATH' ) || die(); |
|
| 3 | +defined('ABSPATH') || die(); |
|
| 4 | 4 | |
| 5 | 5 | use WFV\Validators\AbstractValidator; |
| 6 | 6 | |
@@ -32,14 +32,14 @@ discard block |
||
| 32 | 32 | * @param bool (optional) $optional |
| 33 | 33 | * @return bool |
| 34 | 34 | */ |
| 35 | - public function validate( $input = null, $optional = false ) { |
|
| 35 | + public function validate($input = null, $optional = false) { |
|
| 36 | 36 | $args = func_get_args(); |
| 37 | 37 | $params = $args[2]; |
| 38 | 38 | $min_value = $params[0]; |
| 39 | 39 | |
| 40 | 40 | $v = $this->validator->create(); |
| 41 | - return ( $optional ) |
|
| 42 | - ? $v->optional( $v->create()->length( $min_value, null ) )->validate( $input ) |
|
| 43 | - : $v->length( $min_value, null )->validate( $input ); |
|
| 41 | + return ($optional) |
|
| 42 | + ? $v->optional($v->create()->length($min_value, null))->validate($input) |
|
| 43 | + : $v->length($min_value, null)->validate($input); |
|
| 44 | 44 | } |
| 45 | 45 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace WFV\Validators; |
| 3 | -defined( 'ABSPATH' ) || die(); |
|
| 3 | +defined('ABSPATH') || die(); |
|
| 4 | 4 | |
| 5 | 5 | use WFV\Validators\AbstractValidator; |
| 6 | 6 | |
@@ -32,10 +32,10 @@ discard block |
||
| 32 | 32 | * @param bool (optional) $optional |
| 33 | 33 | * @return bool |
| 34 | 34 | */ |
| 35 | - public function validate( $input = null, $optional = false ) { |
|
| 35 | + public function validate($input = null, $optional = false) { |
|
| 36 | 36 | $v = $this->validator->create(); |
| 37 | - return ( $optional ) |
|
| 38 | - ? $v->optional( $v->create()->url() )->validate( $input ) |
|
| 39 | - : $v->url()->validate( $input ); |
|
| 37 | + return ($optional) |
|
| 38 | + ? $v->optional($v->create()->url())->validate($input) |
|
| 39 | + : $v->url()->validate($input); |
|
| 40 | 40 | } |
| 41 | 41 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace WFV\Validators; |
| 3 | -defined( 'ABSPATH' ) || die(); |
|
| 3 | +defined('ABSPATH') || die(); |
|
| 4 | 4 | |
| 5 | 5 | use WFV\Validators\AbstractValidator; |
| 6 | 6 | |
@@ -32,10 +32,10 @@ discard block |
||
| 32 | 32 | * @param bool (optional) $optional |
| 33 | 33 | * @return bool |
| 34 | 34 | */ |
| 35 | - public function validate( $input = null, $optional = false ) { |
|
| 35 | + public function validate($input = null, $optional = false) { |
|
| 36 | 36 | $v = $this->validator->create(); |
| 37 | - return ( $optional ) |
|
| 38 | - ? $v->optional( $v->create()->phone() )->validate( $input ) |
|
| 39 | - : $v->phone()->validate( $input ); |
|
| 37 | + return ($optional) |
|
| 38 | + ? $v->optional($v->create()->phone())->validate($input) |
|
| 39 | + : $v->phone()->validate($input); |
|
| 40 | 40 | } |
| 41 | 41 | } |
@@ -3,8 +3,6 @@ |
||
| 3 | 3 | defined( 'ABSPATH' ) || die(); |
| 4 | 4 | |
| 5 | 5 | use WFV\Artisan\FormArtisan; |
| 6 | -use WFV\Contract\FormInterface; |
|
| 7 | -use WFV\Contract\ValidateInterface; |
|
| 8 | 6 | use WFV\Factory\ValidatorFactory; |
| 9 | 7 | |
| 10 | 8 | /** |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace WFV; |
| 3 | -defined( 'ABSPATH' ) || die(); |
|
| 3 | +defined('ABSPATH') || die(); |
|
| 4 | 4 | |
| 5 | 5 | use WFV\Artisan\FormArtisan; |
| 6 | 6 | use WFV\Contract\FormInterface; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * @param ArtisanInterface $builder |
| 50 | 50 | * @param string $action |
| 51 | 51 | */ |
| 52 | - public function __construct( FormArtisan $builder, $action ) { |
|
| 52 | + public function __construct(FormArtisan $builder, $action) { |
|
| 53 | 53 | $this->alias = $action; |
| 54 | 54 | $this->collection = $builder->collection; |
| 55 | 55 | $this->validator = $builder->validator; |
@@ -66,10 +66,10 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | protected function valid() { |
| 68 | 68 | $is_valid = $this->validator->is_valid(); |
| 69 | - if( false === $is_valid ) { |
|
| 70 | - $this->utilize('errors')->set_errors( $this->validator->errors() ); |
|
| 69 | + if (false === $is_valid) { |
|
| 70 | + $this->utilize('errors')->set_errors($this->validator->errors()); |
|
| 71 | 71 | } |
| 72 | - $this->trigger_post_validate_action( $is_valid ); |
|
| 72 | + $this->trigger_post_validate_action($is_valid); |
|
| 73 | 73 | return $is_valid; |
| 74 | 74 | } |
| 75 | 75 | |
@@ -81,17 +81,17 @@ discard block |
||
| 81 | 81 | * @param ValidatorFactory $factory |
| 82 | 82 | * @return self |
| 83 | 83 | */ |
| 84 | - protected function validate( ValidatorFactory $factory ) { |
|
| 84 | + protected function validate(ValidatorFactory $factory) { |
|
| 85 | 85 | $rule_collection = $this->utilize('rules'); |
| 86 | - $rules = $rule_collection->get_array( true ); |
|
| 86 | + $rules = $rule_collection->get_array(true); |
|
| 87 | 87 | |
| 88 | - foreach( $rules as $field => $ruleset ) { |
|
| 89 | - $input = $this->field_value( $field ); |
|
| 90 | - $optional = $rule_collection->is_optional( $field ); |
|
| 88 | + foreach ($rules as $field => $ruleset) { |
|
| 89 | + $input = $this->field_value($field); |
|
| 90 | + $optional = $rule_collection->is_optional($field); |
|
| 91 | 91 | |
| 92 | - foreach( $ruleset as $index => $rule ) { |
|
| 93 | - $params = $rule_collection->get_params( $field, $index ); |
|
| 94 | - $this->validator->validate( $factory->get( $rule ), $field, $input, $optional, $params ); |
|
| 92 | + foreach ($ruleset as $index => $rule) { |
|
| 93 | + $params = $rule_collection->get_params($field, $index); |
|
| 94 | + $this->validator->validate($factory->get($rule), $field, $input, $optional, $params); |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | return $this->valid(); |
@@ -106,11 +106,11 @@ discard block |
||
| 106 | 106 | * |
| 107 | 107 | * @param string $field |
| 108 | 108 | */ |
| 109 | - protected function field_value( $field ) { |
|
| 109 | + protected function field_value($field) { |
|
| 110 | 110 | $input = $this->utilize('input'); |
| 111 | - if( $input->has( $field ) ) { |
|
| 112 | - $input = $input->get_array( false ); |
|
| 113 | - return $input[ $field ]; |
|
| 111 | + if ($input->has($field)) { |
|
| 112 | + $input = $input->get_array(false); |
|
| 113 | + return $input[$field]; |
|
| 114 | 114 | } |
| 115 | 115 | return null; |
| 116 | 116 | } |
@@ -126,8 +126,8 @@ discard block |
||
| 126 | 126 | * @param string (optional) $value |
| 127 | 127 | * @return string|null |
| 128 | 128 | */ |
| 129 | - protected function string_or_null( $response, $field = null, $value = null ) { |
|
| 130 | - return ( $this->utilize('input')->contains( $field, $value ) ) ? $response : null; |
|
| 129 | + protected function string_or_null($response, $field = null, $value = null) { |
|
| 130 | + return ($this->utilize('input')->contains($field, $value)) ? $response : null; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -138,9 +138,9 @@ discard block |
||
| 138 | 138 | * |
| 139 | 139 | * @param bool $is_valid |
| 140 | 140 | */ |
| 141 | - protected function trigger_post_validate_action( $is_valid = false ) { |
|
| 142 | - $action = ( true === $is_valid ) ? $this->alias : $this->alias .'_fail'; |
|
| 143 | - do_action( $action, $this ); |
|
| 141 | + protected function trigger_post_validate_action($is_valid = false) { |
|
| 142 | + $action = (true === $is_valid) ? $this->alias : $this->alias.'_fail'; |
|
| 143 | + do_action($action, $this); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @param string $component Key indentifier. |
| 153 | 153 | */ |
| 154 | - protected function utilize( $component ) { |
|
| 155 | - return $this->collection[ $component ]; |
|
| 154 | + protected function utilize($component) { |
|
| 155 | + return $this->collection[$component]; |
|
| 156 | 156 | } |
| 157 | 157 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @since 0.10.0 |
| 48 | 48 | * |
| 49 | - * @param ArtisanInterface $builder |
|
| 49 | + * @param FormArtisan $builder |
|
| 50 | 50 | * @param string $action |
| 51 | 51 | */ |
| 52 | 52 | public function __construct( FormArtisan $builder, $action ) { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * @since 0.11.0 |
| 80 | 80 | * |
| 81 | 81 | * @param ValidatorFactory $factory |
| 82 | - * @return self |
|
| 82 | + * @return boolean |
|
| 83 | 83 | */ |
| 84 | 84 | protected function validate( ValidatorFactory $factory ) { |
| 85 | 85 | $rule_collection = $this->utilize('rules'); |
@@ -124,6 +124,8 @@ discard block |
||
| 124 | 124 | * @param string $response |
| 125 | 125 | * @param string (optional) $field |
| 126 | 126 | * @param string (optional) $value |
| 127 | + * @param string $field |
|
| 128 | + * @param string $value |
|
| 127 | 129 | * @return string|null |
| 128 | 130 | */ |
| 129 | 131 | protected function string_or_null( $response, $field = null, $value = null ) { |