<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\DI;

final class Lifetime
{
    public const SINGLETON = 'singleton';
    public const SCOPED = 'scoped';
    public const PROTOTYPE = 'prototype';
    public const TRANSIENT = 'transient';
    public const INSTANCE = 'instance';
    public const FACTORY = 'factory';

    public static function valid(string $lifetime): bool
    {
        return in_array($lifetime, [
            self::SINGLETON,
            self::SCOPED,
            self::PROTOTYPE,
            self::TRANSIENT,
            self::INSTANCE,
            self::FACTORY,
        ], true);
    }
}
