Refactor settings from container#2104
Conversation
|
@akrabat What's your opinion on injecting settings in the constructor? Right now we accept a container instance in the constructor... but that will be unnecessary in 4.x. The container will be optional, so I think we should not ask for it in the constructor, but instead with a setter method We could update the constructor to accept settings though like: |
|
Currently, there are two ways you may use the 3.x constructor: The array argument will be used to populate a default Slim container. Else, you can pass your own container-interop container into the constructor: Both scenarios would need to change to the following signature, where the argument is optional and if present, will be merged with the default settings: |
|
@akrabat I had to merge my latest work from #2102 into this branch. So you can either merge #2102 and then merge this PR, or you can simply merge this PR. Latest changes in this PR make the |
|
Ping @akrabat. Can you review and merge this soon? I just merged in other latest changes from the primary 4.x branch. |
| } | ||
| $this->container = $container; | ||
| $this->addSettings($settings); | ||
| $this->container = new Container(); |
There was a problem hiding this comment.
?? I thought we were going to remove the container ;)
Work in progress. Do not merge yet.