Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
przemyslaw-przylucki committed May 30, 2024
1 parent bfc8c48 commit 428c85f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace Tempest\Support;

final class StringHelper
final class LanguageHelper
{

public static function naturalLangJoin(array $strings): string
public static function join(array $strings): string
{
$last = array_pop($strings);

Expand Down
4 changes: 2 additions & 2 deletions src/Validation/Exceptions/ValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Exception;
use Tempest\Validation\Rule;
use Tempest\Support\ArrayHelper;
use Tempest\Support\StringHelper;
use Tempest\Support\LanguageHelper;

final class ValidationException extends Exception
{
Expand All @@ -22,7 +22,7 @@ public function __construct(object $object, array $failingRules)
foreach ($failingRules as $field => $failingRulesForField) {
/** @var Rule $failingRuleForField */
foreach ($failingRulesForField as $failingRuleForField) {
$messages[$field][] = StringHelper::naturalLangJoin(ArrayHelper::wrap($failingRuleForField->message()));
$messages[$field][] = LanguageHelper::join(ArrayHelper::wrap($failingRuleForField->message()));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Validation/Rules/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Attribute;
use Tempest\Validation\Rule;
use Tempest\Support\StringHelper;
use Tempest\Support\LanguageHelper;

#[Attribute]
final readonly class Password implements Rule
Expand Down

0 comments on commit 428c85f

Please sign in to comment.