This CollectionBuilder can take factories for the SimpleNumberStringParser,
the Number (usually a SimpleNumberFactory) and the CollectionItemNumberProxy.
For each added number, it will get an instance of each of these from the
factory, to build the CollectionItems that are then added to the
NumberCollection.
This change includes full test coverage.
This should vastly simplify the construction of NumberCollections.
Sample usage:
$numberCollectionBuilder = new NumberCollectionBuilder(
new SimpleNumberStringParserFactory(),
new SimpleNumberFactory(),
new CollectionItemNumberProxyFactory()
);
$numberCollectionBuilder->add('2');
$numberCollectionBuilder->add('3');
$numberCollection = $numberCollectionBuilder->resolve();
This CollectionBuilder can take factories for the SimpleNumberStringParser, the Number (usually a SimpleNumberFactory) and the CollectionItemNumberProxy.
For each added number, it will get an instance of each of these from the factory, to build the CollectionItems that are then added to the NumberCollection.
This change includes full test coverage.
This should vastly simplify the construction of NumberCollections.
Sample usage: