Created
April 7, 2021 01:15
-
-
Save markrandall/e9521e15bc3b68b70192c0d29ebe6ff6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomeClassThatIsntAServiceButNeedsLotsOfThem { | |
public function __construct(ServiceA, $a, ServiceB $b, ServiceC $c, ServiceD $d, SomeCustomData $data) { | |
} | |
} | |
class SomeService { | |
public function __construct(private ServiceA, $a, private ServiceB $b, private ServiceC $c, private ServiceD $d) { | |
} | |
public function doSomething() { | |
$foo = new SomeClassThatIsntAServiceButNeedsLotsOfThem( | |
$this->serviceA, | |
$this->serviceB, | |
$this->serviceC, | |
$this->serviceD, | |
new SomeCustomData(...) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment