Skip to content

Conversation

AhmedAlaa4611
Copy link
Contributor

Description

This PR refactors several validation message replacer methods that shared the same logic:

  • replaceIn()
  • replaceInArrayKeys()
  • replaceRequiredArrayKeys()
  • replaceEndsWith()
  • replaceDoesntEndWith()
  • replaceStartsWith()
  • replaceDoesntStartWith()
  • replaceDoesntContain()

Instead of duplicating the same code, these methods now delegate to the existing replaceIn() implementation.

This follows the same approach already used in replaceNotIn(), where the logic is centralized in one method and other similar methods simply call it.

protected function replaceNotIn($message, $attribute, $rule, $parameters)
{
return $this->replaceIn($message, $attribute, $rule, $parameters);
}

This change reduces code duplication and makes the code easier to maintain.

@AhmedAlaa4611 AhmedAlaa4611 deleted the defactor-ReplacesAttributes-1 branch August 27, 2025 12:29
@AhmedAlaa4611 AhmedAlaa4611 restored the defactor-ReplacesAttributes-1 branch August 27, 2025 12:30
@AhmedAlaa4611 AhmedAlaa4611 reopened this Aug 27, 2025
@AhmedAlaa4611
Copy link
Contributor Author

AhmedAlaa4611 commented Aug 27, 2025

Closed by mistake and then reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants