-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ob-ivan/cyclic-deps
Cyclic deps
- Loading branch information
Showing
4 changed files
with
81 additions
and
21 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
namespace tests; | ||
|
||
use SD\DependencyInjection\DeclarerInterface; | ||
use SD\DependencyInjection\ProviderInterface; | ||
|
||
class CurrencyProvider implements DeclarerInterface, ProviderInterface { | ||
private $currencyStore; | ||
|
||
public function declareDependencies() { | ||
return ['currencyStore']; | ||
} | ||
|
||
public function setCurrencyStore($currencyStore) { | ||
$this->currencyStore = $currencyStore; | ||
} | ||
|
||
public function getServiceName(): string { | ||
return 'currency'; | ||
} | ||
|
||
public function provide() { | ||
return new \stdClass; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
namespace tests; | ||
|
||
use SD\DependencyInjection\AutoDeclarerInterface; | ||
use SD\DependencyInjection\AutoDeclarerTrait; | ||
|
||
class CurrencyStore implements AutoDeclarerInterface { | ||
use AutoDeclarerTrait; | ||
|
||
private $autoDeclareCurrency = 'currency'; | ||
private $currency; | ||
|
||
public function setCurrency($currency) { | ||
$this->currency = $currency; | ||
} | ||
} |