climbx/Dotenv

View on GitHub
src/DotenvInterface.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php

namespace Climbx\Dotenv;

use Climbx\Dotenv\Bag\DotenvBag;

/**
 * @package Climbx\Dotenv
 */
interface DotenvInterface
{
    /**
     * Reads, parses and write a .env file data in the $_ENV & $_SERVER super-global variables.
     *
     * If a variable already exists, it is ignored.
     *
     * @param string $filePath
     */
    public function load(string $filePath): void;

    /**
     * Reads, parses and write a .env file data in the $_ENV & $_SERVER super-global variables.
     *
     * If a variable already exists, it is overridden.
     *
     * @param string $filePath
     */
    public function overload(string $filePath): void;

    /**
     * Returns a parsed .env data bag.
     *
     * If the .env file is missing, the method returns false.
     *
     * @param string $filePath
     *
     * @return DotenvBag|false
     */
    public function getEnvData(string $filePath): DotenvBag | false;
}