File "Entry.php"

Full Path: /home/romayxjt/public_html/wp-content/plugins/kadence-starter-templates/vendor/vendor-prefixed/vlucas/phpdotenv/src/Parser/Entry.php
File size: 1.29 KB
MIME-type: text/x-php
Charset: utf-8

<?php
/**
 * @license BSD-3-Clause
 *
 * Modified using {@see https://github.com/BrianHenryIE/strauss}.
 */

declare(strict_types=1);

namespace KadenceWP\KadenceStarterTemplates\Dotenv\Parser;

use KadenceWP\KadenceStarterTemplates\PhpOption\Option;

final class Entry
{
    /**
     * The entry name.
     *
     * @var string
     */
    private $name;

    /**
     * The entry value.
     *
     * @var \KadenceWP\KadenceStarterTemplates\Dotenv\Parser\Value|null
     */
    private $value;

    /**
     * Create a new entry instance.
     *
     * @param string                    $name
     * @param \KadenceWP\KadenceStarterTemplates\Dotenv\Parser\Value|null $value
     *
     * @return void
     */
    public function __construct(string $name, ?Value $value = null)
    {
        $this->name = $name;
        $this->value = $value;
    }

    /**
     * Get the entry name.
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Get the entry value.
     *
     * @return \KadenceWP\KadenceStarterTemplates\PhpOption\Option<\Dotenv\Parser\Value>
     */
    public function getValue()
    {
        /** @var \KadenceWP\KadenceStarterTemplates\PhpOption\Option<\Dotenv\Parser\Value> */
        return Option::fromValue($this->value);
    }
}