| 1 | <?php |
||
| 17 | final class Inject implements InjectInterface, NamedArgumentConstructorAnnotation |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * If true, and the appropriate binding is not found, the Injector will skip injection of this method or field rather than produce an error. |
||
| 21 | * |
||
| 22 | * @var bool |
||
| 23 | */ |
||
| 24 | public $optional = false; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
| 28 | */ |
||
| 29 | public function __construct(bool $optional = false) |
||
| 30 | { |
||
| 31 | $this->optional = $optional; |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * {@inheritdoc} |
||
| 36 | */ |
||
| 37 | public function isOptional(): bool |
||
| 41 | } |
||
| 42 |