Просмотр файла vendor/php-di/php-di/src/Attribute/Injectable.php

Размер файла: 566B
<?php

declare(strict_types=1);

namespace DI\Attribute;

use Attribute;

/**
 * "Injectable" attribute.
 *
 * Marks a class as injectable
 *
 * @api
 *
 * @author Domenic Muskulus <[email protected]>
 * @author Matthieu Napoli <[email protected]>
 */
#[Attribute(Attribute::TARGET_CLASS)]
final class Injectable
{
    /**
     * @param bool|null $lazy Should the object be lazy-loaded.
     */
    public function __construct(
        private ?bool $lazy = null,
    ) {
    }

    public function isLazy() : bool|null
    {
        return $this->lazy;
    }
}