Skip to content

Commit

Permalink
Make $names in attribute public
Browse files Browse the repository at this point in the history
There were some problems with Symfony var-exporter when using
forms. Actual cause is unclear, but setting $names to public
fixes the issue and has no other ramifications.
  • Loading branch information
iquito committed Dec 20, 2020
1 parent de14528 commit 3a75369
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion src/Annotation/StringFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class StringFilter
/**
* @var string[] Filter names which should be executed
*/
private array $names = [];
public array $names = [];

/**
* @param mixed $names
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/StringFilterProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public function process(object $class): void
}
}

// @codeCoverageIgnoreStart
private function getFromAttribute(\ReflectionProperty $property): ?StringFilter
{
$attributes = $property->getAttributes(StringFilter::class);
Expand All @@ -72,7 +71,6 @@ private function getFromAttribute(\ReflectionProperty $property): ?StringFilter

return $attributes[0]->newInstance();
}
// @codeCoverageIgnoreEnd

private function getFromAnnotation(\ReflectionProperty $property): ?StringFilter
{
Expand Down
1 change: 0 additions & 1 deletion tests/TestClasses/ClassWithPrivateProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class ClassWithPrivateProperties
/**
* @StringFilter({"Lowercase","Trim"})
*/
#[StringFilter("Lowercase", "Trim")]
private $title;

/**
Expand Down

0 comments on commit 3a75369

Please sign in to comment.