| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /inetpub/wwwroot/finman.es.ihu.gr/wp-content/plugins/fluent-smtp/includes/Request/ |
Upload File : |
<?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;
}
}