Class Dotenv\Validator
Inheritance | Dotenv\Validator |
---|
Validator.
Validations to be applied against a number of variables.
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$loader | Dotenv\Loader | Dotenv\Validator | |
$variables | array | Dotenv\Validator |
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Create a new validator instance. | Dotenv\Validator |
allowedValues() | Assert that each variable is amongst the given choices. | Dotenv\Validator |
notEmpty() | Assert that each variable is not empty. | Dotenv\Validator |
Protected Methods
Method | Description | Defined By |
---|---|---|
assertCallback() | Assert that the callback returns true for each variable. | Dotenv\Validator |
Property Details
Method Details
Create a new validator instance.
public void __construct ( array $variables, Dotenv\Loader $loader ) | ||
$variables | array | |
$loader | Dotenv\Loader |
Assert that each variable is amongst the given choices.
public Dotenv\Validator allowedValues ( array $choices ) | ||
$choices | string[] |
Assert that the callback returns true for each variable.
protected Dotenv\Validator assertCallback ( $callback, $message = 'failed callback assertion' ) | ||
$callback | callable | |
$message | string |
Assert that each variable is not empty.
public Dotenv\Validator notEmpty ( ) |