upgraded dependencies

This commit is contained in:
RafficMohammed
2023-01-08 01:59:16 +05:30
parent 51056e3aad
commit f9ae387337
6895 changed files with 133617 additions and 178680 deletions

View File

@@ -4,14 +4,17 @@ namespace Dotenv;
use Dotenv\Exception\ValidationException;
use Dotenv\Regex\Regex;
use Dotenv\Repository\RepositoryInterface;
/**
* This is the validator class.
*
* It's responsible for applying validations against a number of variables.
*/
class Validator
{
/**
* The environment repository instance.
*
* @var \Dotenv\Repository\RepositoryInterface
*/
protected $repository;
/**
* The variables to validate.
*
@@ -19,28 +22,21 @@ class Validator
*/
protected $variables;
/**
* The loader instance.
*
* @var \Dotenv\Loader
*/
protected $loader;
/**
* Create a new validator instance.
*
* @param string[] $variables
* @param \Dotenv\Loader $loader
* @param bool $required
* @param \Dotenv\Repository\RepositoryInterface $repository
* @param string[] $variables
* @param bool $required
*
* @throws \Dotenv\Exception\ValidationException
*
* @return void
*/
public function __construct(array $variables, Loader $loader, $required = true)
public function __construct(RepositoryInterface $repository, array $variables, $required = true)
{
$this->repository = $repository;
$this->variables = $variables;
$this->loader = $loader;
if ($required) {
$this->assertCallback(
@@ -180,7 +176,7 @@ class Validator
$failing = [];
foreach ($this->variables as $variable) {
if ($callback($this->loader->getEnvironmentVariable($variable)) === false) {
if ($callback($this->repository->get($variable)) === false) {
$failing[] = sprintf('%s %s', $variable, $message);
}
}