Nelmio\Alice\Definition\PropertyBag::with PHP Метод

with() публичный Метод

public with ( Property $property ) : self
$property Property
Результат self
    public function with(Property $property) : self
    {
        $clone = clone $this;
        $clone->properties[$property->getName()] = $property;
        return $clone;
    }

Usage Example

 private function denormalizeProperty(PropertyDenormalizerInterface $propertyDenormalizer, FlagParserInterface $flagParser, string $unparsedPropertyName, $value, PropertyBag $properties, FixtureInterface $scope) : PropertyBag
 {
     $flags = $flagParser->parse($unparsedPropertyName);
     $propertyName = $flags->getKey();
     $property = $propertyDenormalizer->denormalize($scope, $propertyName, $value, $flags);
     return $properties->with($property);
 }