chore: add line highlights to more DI examples

Signed-off-by: Josh <josh.t.richards@gmail.com>
This commit is contained in:
Josh
2025-11-06 12:09:09 -05:00
committed by GitHub
parent a73bb1dbe8
commit a57318c550

View File

@@ -56,6 +56,7 @@ centralizes object creation logic.
For example, consider the following pattern:
.. code-block:: php
:emphasize-lines: 10, 14
/**
* Without dependency injection:
@@ -77,6 +78,7 @@ For example, consider the following pattern:
With dependency injection, you would instead pass the dependency into the constructor:
.. code-block:: php
:emphasize-lines: 10, 13, 15
/**
* Using dependency injection:
@@ -99,6 +101,7 @@ With dependency injection, you would instead pass the dependency into the constr
Or, more succinctly, by using constructor property promotion (since PHP 7.4):
.. code-block:: php
:emphasize-lines: 18
/**
* Using dependency injection with constructor property promotion: