Skip to content

Commit

Permalink
Simplify method name
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioribeiro committed Jul 27, 2024
1 parent ac6a31c commit f0e1359
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Repositories/Behaviors/HandleBlocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private function validate(array $formData, int $id, array $basicRules, array $tr
foreach ($validator->messages()->getMessages() as $key => $errors) {
foreach ($errors as $error) {
if ($this->errorMessageIsOnNestedBlock($key)) {
$blockInfo = $this->makeBlocksValidationArrayInfoForNestedBlocks($id, $key, $formData, true);
$blockInfo = $this->makeValidationInfoForNestedBlocks($id, $key, $formData, true);

$id = $blockInfo['nestedBlockId'];
$key = $blockInfo['nestedField'];
Expand All @@ -202,7 +202,7 @@ private function validate(array $formData, int $id, array $basicRules, array $tr
foreach ($validator->messages()->getMessages() as $key => $errors) {
foreach ($errors as $error) {
if ($this->errorMessageIsOnNestedBlock($key)) {
$blockInfo = $this->makeBlocksValidationArrayInfoForNestedBlocks($id, $key, $formData, true);
$blockInfo = $this->makeValidationInfoForNestedBlocks($id, $key, $formData, true);

$id = $blockInfo['nestedBlockId'];
$key = $blockInfo['nestedField'];
Expand Down Expand Up @@ -555,7 +555,7 @@ public function errorMessageIsOnNestedBlock($failedKey)
return strpos($failedKey, '.content.') !== false;
}

public function makeBlocksValidationArrayInfoForNestedBlocks($rootBlockId, $failedKey, $formData, $translated = false)
public function makeValidationInfoForNestedBlocks($rootBlockId, $failedKey, $formData, $translated = false)
{
$blockFilter = Str::beforeLast($failedKey, '.content.');

Expand Down

0 comments on commit f0e1359

Please sign in to comment.