Created
December 25, 2018 12:07
-
-
Save r8or0pz/66fd0c0d025af64176c59632725e28d2 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
<?php | |
namespace Controller; | |
use Symfony\Component\HttpFoundation\Request; | |
class FooController | |
{ | |
public function doSomething(Request $request, AwesomeService $service) | |
{ | |
return $service->foo(); | |
} | |
} | |
class AwesomeService | |
{ | |
private $barService; | |
public function __construct(BarService $barService) | |
{ | |
// args are available here | |
$args = $something->getData(); | |
$this->barService = $barService; | |
} | |
public function foo() | |
{ | |
// doSomething is dependant on args | |
$args = $this->barService->doSomething(); | |
} | |
} | |
class BarService | |
{ | |
/** | |
* This is where the problem is | |
* @param BarService $barService [description] | |
*/ | |
public function __construct(array $args) | |
{ | |
// ../ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment