Respect / Config

A powerful, small, deadly simple configurator and dependency injection container DSL made to be easy
http://respect.github.io/Config
Other
98 stars 7 forks source link

Prevent InvalidArgumentException to optional arguments #29

Closed augustohp closed 12 years ago

augustohp commented 12 years ago

Given the relational.ini below:

[connection Pdo]
dsn = sqlite::memory:

[mapper Respect\Relational\Db]
connection = [connection]

Suppose $connection is an optional parameter for the Respect\Relational\Db::__construct(), currently if we do not define the $connection instance Config throws a Exception. Even if the instance is not needed. We should prevent that behaviour so we can better reuse INIs.

alganet commented 12 years ago

We may easily change every "Item foo not found" exception into a silent null value. The user then becomes responsible for loading and assigning INI files. What do you think?

augustohp commented 12 years ago

+1 for null values.

henriquemoody commented 12 years ago

+1

alganet commented 12 years ago

Already implemented!

nickl- commented 12 years ago

Weeeeeee!

Happy Panda