Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle case where groups is not set #296

Merged
merged 3 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/Bridge/Symfony/Bundle/SonataFormBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,12 @@
*/
final class SonataFormBundle extends Bundle
{
/**
* @return string
*/
public function getPath()
public function getPath(): string
{
return __DIR__.'/..';
}

/**
* @return string
*/
protected function getContainerExtensionClass()
protected function getContainerExtensionClass(): string
{
return SonataFormExtension::class;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/Symfony/Resources/config/form_types.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
];
}

return [$message];
return [$message, '', ''];
};

// Use "service" function for creating references to services when dropping support for Symfony 4.4
Expand Down
2 changes: 1 addition & 1 deletion src/Type/BaseDoctrineORMSerializationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
continue;
}

if (!\in_array($this->group, $propertyMetadata->groups, true)) {
if (!isset($propertyMetadata->groups) || !\in_array($this->group, $propertyMetadata->groups, true)) {
continue;
}

Expand Down
3 changes: 3 additions & 0 deletions src/Type/BasePickerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ public function getLocale(): string
return $this->locale;
}

/**
* @param string $locale
*/
public function setLocale($locale): void
{
$this->locale = $locale;
Expand Down
3 changes: 3 additions & 0 deletions src/Validator/InlineValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public function __construct(
$this->constraintValidatorFactory = $constraintValidatorFactory;
}

/**
* @param mixed $value
*/
public function validate($value, Constraint $constraint): void
{
if (!$constraint instanceof InlineConstraint) {
Expand Down