Uname: Linux p3plzcpnl499967.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
Software: Apache
PHP version: 8.2.30 [ PHP INFO ] PHP os: Linux
Server Ip: 208.109.40.231
Your Ip: 216.73.216.26
User: nayff91c5tsx (10005085) | Group: nayff91c5tsx (10005085)
Safe Mode: OFF
Disable Function:
NONE

name : Cleaner.php
<?php

namespace FluentMail\Includes\Request;

trait Cleaner
{
    /**
     * Clean up the request data.
     *
     * @param  array $data
     * @return array
     */
    public function clean($data)
    {
        return $this->cleanArray($data);
    }

    /**
     * Clean the data in the given array.
     *
     * @param  array $data
     * @return array
     */
    protected function cleanArray(array $data)
    {
        return array_map(function ($value) {
            return $this->cleanValue($value);
        }, $data);
    }

    /**
     * Clean the given value.
     *
     * @param  mixed $value
     * @return mixed
     */
    protected function cleanValue($value)
    {
        if (is_array($value)) {
            return $this->cleanArray($value);
        }

        return $this->transform($value);
    }

    /**
     * Transform the given value.
     *
     * @param  mixed $value
     * @return mixed
     */
    protected function transform($value)
    {
        if (is_string($value)) {
            $value = trim($value);

            if ($value === '') {
                $value = null;
            }
        }

        return $value;
    }
}
© 2026 GrazzMean