class Groups
Same name in this branch
- 11.1.x vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Groups.php \PHPUnit\TextUI\XmlConfiguration\Groups
- 11.1.x vendor/phpunit/phpunit/src/Metadata/Api/Groups.php \PHPUnit\Metadata\Api\Groups
@author Kévin Dunglas <dunglas@gmail.com>
Hierarchy
- class \Symfony\Component\Serializer\Attribute\Groups
Expanded class hierarchy of Groups
1 file declares its use of Groups
- AttributeLoader.php in vendor/
symfony/ serializer/ Mapping/ Loader/ AttributeLoader.php
15 string references to 'Groups'
- AttributeMetadata::__sleep in vendor/
symfony/ serializer/ Mapping/ AttributeMetadata.php - Returns the names of the properties that should be serialized.
- Cascade::__construct in vendor/
symfony/ validator/ Constraints/ Cascade.php - Constraint::addImplicitGroupName in vendor/
symfony/ validator/ Constraint.php - Adds the given group if this constraint is in the Default group.
- Constraint::__get in vendor/
symfony/ validator/ Constraint.php - Returns the value of a lazily initialized option.
- Constraint::__isset in vendor/
symfony/ validator/ Constraint.php
File
-
vendor/
symfony/ serializer/ Attribute/ Groups.php, line 19
Namespace
Symfony\Component\Serializer\AttributeView source
class Groups {
/**
* @var string[]
*/
private readonly array $groups;
/**
* @param string|string[] $groups The groups to define on the attribute target
*/
public function __construct(string|array $groups) {
$this->groups = (array) $groups;
if (!$this->groups) {
throw new InvalidArgumentException(\sprintf('Parameter given to "%s" cannot be empty.', static::class));
}
foreach ($this->groups as $group) {
if (!\is_string($group) || '' === $group) {
throw new InvalidArgumentException(\sprintf('Parameter given to "%s" must be a string or an array of non-empty strings.', static::class));
}
}
}
/**
* @return string[]
*/
public function getGroups() : array {
return $this->groups;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
Groups::$groups | private | property | |
Groups::getGroups | public | function | |
Groups::__construct | public | function |