| Name | Description |
|---|---|
| Accumulator | Classes that accumulate or collect data over time, e.g., SumAccumulator, ErrorAccumulator. |
| Adapter | Classes that adapt or convert interfaces or data between two systems, e.g. DatabaseAdapter, APIAdapter. |
| Aggregator | Classes that aggregate or collect data from multiple sources, e.g., NewsAggregator, DataAggregator. |
| Allocator | Classes that allocate or assign resources, e.g., MemoryAllocator, TaskAllocator. |
# config/packages/framework.yaml
parameters:
env(TRUSTED_HOSTS): "10.0.0.1,10.0.0.2"
framework:
trusted_hosts: '%env(csv:TRUSTED_HOSTS)%'
From now, you don’t need to use explode 💥
With this function you can check the DNS records for an IP or hostname that you can pass to the function as a param. A really good use case is to check if the domain of a given email address exists.
<?php
function validateMail(string $email): bool
{
$parts = explode("@", $email);
$host = end($parts);
return checkdnsrr($host, 'MX');
}
$email = '[email protected]';
validateMail($email);
This helps you to avoid bounce emails trying to create an account on your website or platform.