Skip to content

Using a Factory to Create Services: Add working usage example. #13170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Change controller method name for visual compability
  • Loading branch information
Leroid authored and Leroid committed Mar 23, 2021
commit b86ea26027ca52f737f949ff6977c56e9364565c
2 changes: 1 addition & 1 deletion service_container/factories.rst
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ Next, use settings similar to those in the sections above. These settings allow

Now we can use our delivery services as usual (via dependency injection). The only difference is that subclasses instances of services are created in the factory. Let's get those services in controller::

public function getDeliveriesCost(DHL $dhl, UPS $ups)
public function getDeliveriesPrice(DHL $dhl, UPS $ups)
{
// ...

Expand Down