@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | */ |
358 | 358 | public function completed($name = null) |
359 | 359 | { |
360 | - if($this->submitted($name) && $this->valid()) { |
|
360 | + if ($this->submitted($name) && $this->valid()) { |
|
361 | 361 | $this->broadcast('completed'); |
362 | 362 | return true; |
363 | 363 | } |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | $errors = []; |
498 | 498 | |
499 | 499 | foreach ($this->fields as $field) { |
500 | - foreach($field->errors() as $error) { |
|
500 | + foreach ($field->errors() as $error) { |
|
501 | 501 | $errors[] = $error; |
502 | 502 | } |
503 | 503 | } |
@@ -619,8 +619,8 @@ discard block |
||
619 | 619 | { |
620 | 620 | $config = $this->templateConfig($template); |
621 | 621 | |
622 | - if ( isset($config['plugins']) && is_array($config['plugins'])) { |
|
623 | - foreach($config['plugins'] as $plugin) { |
|
622 | + if (isset($config['plugins']) && is_array($config['plugins'])) { |
|
623 | + foreach ($config['plugins'] as $plugin) { |
|
624 | 624 | $this->addPlugin($plugin); |
625 | 625 | } |
626 | 626 | } |
@@ -636,8 +636,8 @@ discard block |
||
636 | 636 | { |
637 | 637 | $config = $this->templateConfig($template); |
638 | 638 | |
639 | - if ( isset($config['plugins']) && is_array($config['plugins'])) { |
|
640 | - foreach($config['plugins'] as $plugin) { |
|
639 | + if (isset($config['plugins']) && is_array($config['plugins'])) { |
|
640 | + foreach ($config['plugins'] as $plugin) { |
|
641 | 641 | $this->removePlugin($plugin); |
642 | 642 | } |
643 | 643 | } |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | foreach ($field->errors() as $error => $parameters) { |
675 | 675 | |
676 | 676 | if ($error == 'userDefined') { |
677 | - foreach($parameters as $message) { |
|
677 | + foreach ($parameters as $message) { |
|
678 | 678 | $properties['errors'][] = ['error' => $message]; |
679 | 679 | } |
680 | 680 | } else { |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | |
684 | 684 | $message = $this->translate($error, $field); |
685 | 685 | |
686 | - foreach($parameters as $key => $value) { |
|
686 | + foreach ($parameters as $key => $value) { |
|
687 | 687 | if (is_object($value) && method_exists($value, '__toString')) $value = (string) $value; |
688 | 688 | if (is_array($value)) $value = implode(', ', $value); |
689 | 689 | $message = str_replace('['.$key.']', $value, $message); |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | */ |
931 | 931 | private function broadcast($event, $params = []) |
932 | 932 | { |
933 | - foreach($this->plugins as $plugin) { |
|
933 | + foreach ($this->plugins as $plugin) { |
|
934 | 934 | $plugin->event($this, $event, $params); |
935 | 935 | } |
936 | 936 | } |
@@ -1078,7 +1078,7 @@ discard block |
||
1078 | 1078 | { |
1079 | 1079 | if ( ! method_exists($this, $method)) |
1080 | 1080 | { |
1081 | - if ( $this->typeExists($method)) { |
|
1081 | + if ($this->typeExists($method)) { |
|
1082 | 1082 | return $this->addField($method, array_shift($parameters)); |
1083 | 1083 | } |
1084 | 1084 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | |
54 | 54 | $method = new ReflectionMethod($class, $method); |
55 | 55 | |
56 | - foreach($method->getParameters() as $param) { |
|
56 | + foreach ($method->getParameters() as $param) { |
|
57 | 57 | $params[] = $param->getName(); |
58 | 58 | } |
59 | 59 |
@@ -28,13 +28,13 @@ |
||
28 | 28 | |
29 | 29 | public static function alphaNum($var) |
30 | 30 | { |
31 | - if (! is_string($var) && ! is_numeric($var)) return false; |
|
31 | + if ( ! is_string($var) && ! is_numeric($var)) return false; |
|
32 | 32 | return preg_match('/^[\pL\pM\pN]+$/u', $var); |
33 | 33 | } |
34 | 34 | |
35 | 35 | public static function alphaDash($var) |
36 | 36 | { |
37 | - if (! is_string($var) && ! is_numeric($var)) return false; |
|
37 | + if ( ! is_string($var) && ! is_numeric($var)) return false; |
|
38 | 38 | return preg_match('/^[\pL\pM\pN_-]+$/u', $var); |
39 | 39 | } |
40 | 40 |