/** * Build a collection with only the elements that are properties * * @param CollectionInterface $changeset * @param MapInterface<string, Property> $properties * * @return CollectionInterface */ private function buildProperties(CollectionInterface $changeset, MapInterface $properties) : CollectionInterface { return $changeset->filter(function ($data, string $property) use($properties) { return $properties->contains($property); }); }