Skip to content

Commit

Permalink
Change visibility of collectAttributes() (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Oct 7, 2021
1 parent 4019bc8 commit 1fac60c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/FormModel.php
Expand Up @@ -268,18 +268,6 @@ public function getRules(): array
return [];
}

/**
* @psalm-param array<string, array<array-key, string>> $items
*/
private function addErrors(array $items): void
{
foreach ($items as $attribute => $errors) {
foreach ($errors as $error) {
$this->attributesErrors[$attribute][] = $error;
}
}
}

/**
* Returns the list of attribute types indexed by attribute names.
*
Expand All @@ -289,7 +277,7 @@ private function addErrors(array $items): void
*
* @return array list of attribute types indexed by attribute names.
*/
private function collectAttributes(): array
protected function collectAttributes(): array
{
$class = new ReflectionClass($this);
$attributes = [];
Expand All @@ -315,6 +303,18 @@ private function collectAttributes(): array
return $attributes;
}

/**
* @psalm-param array<string, array<array-key, string>> $items
*/
private function addErrors(array $items): void
{
foreach ($items as $attribute => $errors) {
foreach ($errors as $error) {
$this->attributesErrors[$attribute][] = $error;
}
}
}

private function clearErrors(): void
{
$this->attributesErrors = [];
Expand Down

0 comments on commit 1fac60c

Please sign in to comment.