-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix compilation to blueprints for classes with attributes only, docs
- Loading branch information
1 parent
2610e8f
commit 5fbb45b
Showing
14 changed files
with
220 additions
and
72 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,18 @@ | ||
<?php | ||
declare(strict_types=1); | ||
/** | ||
* | ||
* This file is part of Aura for PHP. | ||
* | ||
* @license http://opensource.org/licenses/MIT MIT | ||
* | ||
*/ | ||
|
||
namespace Aura\Di\Attribute; | ||
|
||
use Attribute; | ||
|
||
#[Attribute(Attribute::TARGET_CLASS)] | ||
class Blueprint | ||
{ | ||
} |
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,26 @@ | ||
<?php | ||
declare(strict_types=1); | ||
/** | ||
* | ||
* This file is part of Aura for PHP. | ||
* | ||
* @license http://opensource.org/licenses/MIT MIT | ||
* | ||
*/ | ||
|
||
namespace Aura\Di\ClassScanner; | ||
|
||
use Aura\Di\Attribute\AnnotatedInjectInterface; | ||
use Aura\Di\Container; | ||
|
||
final class AnnotatedInjectAttributeConfig implements AttributeConfigInterface | ||
{ | ||
public static function define(Container $di, AttributeSpecification $specification): void | ||
{ | ||
/** @var AnnotatedInjectInterface $attribute */ | ||
$attribute = $specification->getAttributeInstance(); | ||
if ($specification->getAttributeTarget() === \Attribute::TARGET_PARAMETER) { | ||
$di->params[$specification->getClassName()][$specification->getTargetConfig()['parameter']] = $attribute->inject(); | ||
} | ||
} | ||
} |
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,21 @@ | ||
<?php | ||
declare(strict_types=1); | ||
/** | ||
* | ||
* This file is part of Aura for PHP. | ||
* | ||
* @license http://opensource.org/licenses/MIT MIT | ||
* | ||
*/ | ||
|
||
namespace Aura\Di\ClassScanner; | ||
|
||
use Aura\Di\Container; | ||
|
||
final class BlueprintAttributeConfig implements AttributeConfigInterface | ||
{ | ||
public static function define(Container $di, AttributeSpecification $specification): void | ||
{ | ||
$di->params[$specification->getClassName()] = $di->params[$specification->getClassName()] ?? []; | ||
} | ||
} |
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
Oops, something went wrong.