Avatar
😀

Organizations

Popular posts

  1. NameDescription
    AccumulatorClasses that accumulate or collect data over time, e.g., SumAccumulator, ErrorAccumulator.
    AdapterClasses that adapt or convert interfaces or data between two systems, e.g. DatabaseAdapter, APIAdapter.
    AggregatorClasses that aggregate or collect data from multiple sources, e.g., NewsAggregator, DataAggregator.
    AllocatorClasses that allocate or assign resources, e.g., MemoryAllocator, TaskAllocator.

  2. Environment Variable Processors

    # 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 💥

    Source: https://symfony.com/doc/4.4/configuration/env_var_processors.html

  3. checkdnsrr()

    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.

    Post activity