Completed
Push — master ( 5ea630...6773cf )
by Maciej
17s queued 10s
created
wfv-validate.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-defined( 'ABSPATH' ) || die();
2
+defined('ABSPATH') || die();
3 3
 /*
4 4
 Plugin Name: WFV - Form Validation
5 5
 Plugin URI:  https://macder.github.io/wfv/
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
 License URI: https://github.com/macder/wp-form-validation/blob/master/LICENSE
12 12
 */
13 13
 
14
-define( 'WFV_VALIDATE_VERSION', '0.11.1' );
15
-define( 'WFV_VALIDATE__MINIMUM_WP_VERSION', '3.7' );
16
-define( 'WFV_VALIDATE__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
14
+define('WFV_VALIDATE_VERSION', '0.11.1');
15
+define('WFV_VALIDATE__MINIMUM_WP_VERSION', '3.7');
16
+define('WFV_VALIDATE__PLUGIN_DIR', plugin_dir_path(__FILE__));
17 17
 
18
-require_once WFV_VALIDATE__PLUGIN_DIR . '/vendor/autoload.php';
18
+require_once WFV_VALIDATE__PLUGIN_DIR.'/vendor/autoload.php';
19 19
 
20 20
 use WFV\FormComposite;
21 21
 use WFV\Agent\InspectionAgent;
@@ -32,19 +32,19 @@  discard block
 block discarded – undo
32 32
  * @param array $form Form arguments
33 33
  * @param bool $trim Trim whitespace from beginning and end of string
34 34
  */
35
-function wfv_create( $action, array &$form, $trim = true ) {
36
-	$guard = new InspectionAgent( $action );
35
+function wfv_create($action, array &$form, $trim = true) {
36
+	$guard = new InspectionAgent($action);
37 37
 
38
-	$builder = new FormArtisan( $form );
39
-	$form = ( new Director( $action ) )
40
-		->with( 'input', $guard )
41
-		->with( 'rules' )
42
-		->with( 'errors' )
43
-		->with( 'validator' )
44
-		->compose( $builder );
38
+	$builder = new FormArtisan($form);
39
+	$form = (new Director($action))
40
+		->with('input', $guard)
41
+		->with('rules')
42
+		->with('errors')
43
+		->with('validator')
44
+		->compose($builder);
45 45
 
46
-	if( $form->input()->is_populated() ) {
47
-		wfv_validate( $form );
46
+	if ($form->input()->is_populated()) {
47
+		wfv_validate($form);
48 48
 	}
49 49
 }
50 50
 
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
  * @param FormComposite $form
57 57
  * @return bool
58 58
  */
59
-function wfv_validate( FormComposite $form ) {
60
-	$factory = ( new ValidatorFactory() )
61
-		->add( $form->rules()->unique() );
62
-	return $form->validate( $factory )->is_valid();
59
+function wfv_validate(FormComposite $form) {
60
+	$factory = (new ValidatorFactory())
61
+		->add($form->rules()->unique());
62
+	return $form->validate($factory)->is_valid();
63 63
 }
Please login to merge, or discard this patch.