Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix overriding annotations with config + refactoring
- Loading branch information
Showing
13 changed files
with
216 additions
and
209 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
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
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
9 changes: 9 additions & 0 deletions
9
tests/IntegrationTest/Definitions/AutowireDefinition/Class1.php
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,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DI\Test\IntegrationTest\Definitions\AutowireDefinition; | ||
|
||
class Class1 | ||
{ | ||
} |
30 changes: 30 additions & 0 deletions
30
tests/IntegrationTest/Definitions/AutowireDefinition/ConstructorInjection.php
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,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DI\Test\IntegrationTest\Definitions\AutowireDefinition; | ||
|
||
use DI\Annotation\Inject; | ||
|
||
class ConstructorInjection | ||
{ | ||
/** | ||
* @var \stdClass | ||
*/ | ||
public $autowiredParameter; | ||
|
||
/** | ||
* @var Class1 | ||
*/ | ||
public $overloadedParameter; | ||
|
||
/** | ||
* Force the injection of a specific value for the first parameter. (when using annotations) | ||
* @Inject({"autowiredParameter"="anotherStdClass"}) | ||
*/ | ||
public function __construct(\stdClass $autowiredParameter, Class1 $overloadedParameter) | ||
{ | ||
$this->autowiredParameter = $autowiredParameter; | ||
$this->overloadedParameter = $overloadedParameter; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
tests/IntegrationTest/Definitions/AutowireDefinition/MethodInjection.php
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,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DI\Test\IntegrationTest\Definitions\AutowireDefinition; | ||
|
||
use DI\Annotation\Inject; | ||
|
||
class MethodInjection | ||
{ | ||
/** | ||
* @var \stdClass | ||
*/ | ||
public $autowiredParameter; | ||
|
||
/** | ||
* @var Class1 | ||
*/ | ||
public $overloadedParameter; | ||
|
||
/** | ||
* Force the injection of a specific value for the first parameter. (when using annotations) | ||
* @Inject({"autowiredParameter"="anotherStdClass"}) | ||
*/ | ||
public function setFoo(\stdClass $autowiredParameter, Class1 $overloadedParameter) | ||
{ | ||
$this->autowiredParameter = $autowiredParameter; | ||
$this->overloadedParameter = $overloadedParameter; | ||
} | ||
} |
Oops, something went wrong.