Closed brendt closed 8 months ago
We probably need to do a little work to get this working. I'm not sure it's a bad idea to add a method caller to the container though.
I did some testing, this implementation is still required as you expected. It's fine for now, we can improve method calling via the container at a later phase, and I'll keep it at is. Moving this logic to anywhere outside of the container (as I originally intended) didn't make any sense.
I'll refactor the current autowire stuff to work with methods soon.
Do you prefer the parameter based approach we have today or something chainable?
Example:
$container
->call($object|"Class")
->method('__invoke')
->with(...$params);
I think it'll be easier to keep it in one method
I think this might be solved with #135 because it adds the ability to autowire built-in types. I'll need to test once that PR is merged.