diff --git a/src/Form.php b/src/Form.php
index 68a7cb3..2ad6856 100644
--- a/src/Form.php
+++ b/src/Form.php
@@ -288,7 +288,7 @@ public function validate(array $dataSource, array $validationSet)
public function addRule(string $name, $handler, ?string $message = null)
{
$this->rules[strtolower($name)] = $handler;
- $this->messages[strtolower($name)] = $message ?? "%s is invalid!";
+ $this->messages[strtolower($name)] = $message ?? '%s is invalid!';
}
/**
@@ -312,11 +312,11 @@ public function addErrorMessage($field, ?string $message = null)
return $this->addMessage($field, $message);
}
- /**
- * Add validation error message
- * @param string|array $field The field to add the message to
- * @param string|null $message The error message if $field is a string
- */
+ /**
+ * Add validation error message
+ * @param string|array $field The field to add the message to
+ * @param string|null $message The error message if $field is a string
+ */
public function addMessage($field, ?string $message = null)
{
if (is_array($field)) {
@@ -342,7 +342,7 @@ public function submit(string $method, string $action, array $fields)
$form_fields = '';
foreach ($fields as $key => $value) {
- $form_fields = $form_fields . "";
+ $form_fields = $form_fields . "message('number', 'This is a custom message');
diff --git a/tests/validation.test.php b/tests/validation.test.php
index 2983348..7ecb3b2 100644
--- a/tests/validation.test.php
+++ b/tests/validation.test.php
@@ -2,7 +2,6 @@
declare(strict_types=1);
-use Leaf\Form;
test('can perform inline validation', function () {
$value = '';