AcMailer\Controller\Plugin\SendMailPlugin::normalizeMailArgs PHP Method

normalizeMailArgs() protected method

Normalizes the arguments passed when invoking this plugin so that they can be treated in a consistent way
protected normalizeMailArgs ( array $args ) : array
$args array
return array
    protected function normalizeMailArgs(array $args)
    {
        // If the first argument is an array, use it as the mail configuration
        if (is_array($args[0])) {
            return $args[0];
        }
        $result = [];
        $length = count($args);
        // FIXME This is a weak way to handle the arguments, since a change in the order will break it
        for ($i = 0; $i < $length; $i++) {
            $result[$this->argumentsMapping[$i]] = $args[$i];
        }
        return $result;
    }