Herzult / SimplePHPEasyPlus

A simple, pragmatic numeric operation api written in PHP. It does addition.
MIT License
1.16k stars 46 forks source link

Add a Symfony2 bundle to integrate with the Symfony2 Dependency Injection Container #15

Closed igorw closed 10 years ago

igorw commented 11 years ago

By having the bootstrap managed by the DIC, it becomes a lot easier to use. Also, the XML file is way more maintainable than the annoying manual construction of the object graph.

Sample usage:

$collectionBuilder = $container->get('simple_php_easy_plus.number_collection_builder');
$engine = $container->get('simple_php_easy_plus.engine');
$runner = $container->get('simple_php_easy_plus.runner');

$collectionBuilder->add('1');
$collectionBuilder->add('2');

$calcul = new Calcul($engine, $collectionBuilder->resolve());
$runner->run($calcul);

$value = $calcul->getResult()->getValue();

This PR depends on #13.

felds commented 11 years ago

:+1:

Herzult commented 11 years ago

This PR contains both bundle & number collection builder.

igorw commented 11 years ago

Since the NumberCollectionBuilder PR was merged, this now only contains the bundle.

igorw commented 10 years ago

Bump.