Sylius/Sylius — pull request #2198 by adamelso (2014-11-30 15:59:37+00:00)
Title: Reusable Set Builders for generating variants with VariantGenerator spec coverage

Q | A
---|---
Bug fix? | no
New feature? | yes
BC breaks? | yes
Deprecations? | no
Fixed tickets | -
License | MIT
Doc PR | https://github.com/Sylius/Sylius-Docs/pull/232

Whilst working on writing specs for the `VariantGenerator`, I could see why there weren't any to being with.
Now the most complicated logic has been extracted out to a new class `CartesianSetBuilder`, which implements `SetBuilderInterface`, so this has the added benefit of allowing developers to define their own strategies for generating variants.

Unfortunately, the disadvantage of this being that the set builder has to be explicitly passed to the constructor of `VariantGenerator`, and only math boffins would be aware of what a _set builder_ and the _Cartesian product_ are.