Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php declare(strict_types=1); namespace App\Mailer\Transport; /** * Smtp Transport cla..
Decoded Output download
<?php
declare(strict_types=1);
namespace App\Mailer\Transport;
/**
* Smtp Transport class based on the CakePHP one, with tracing capabilities to help with debugging.
*/
class DebugSmtpTransport extends SmtpTransport
{
/**
* Client / server communication trace.
*
* @var array
*/
protected $trace = [];
/**
* Extends _smtpSend by storing the communication trace.
*
* @param null|string $data data to be sent
* @param string|false $checkCode check code
* @return null|string
*/
protected function _smtpSend(?string $data, $checkCode = '250'): ?string
{
$code = parent::_smtpSend($data, $checkCode);
$this->_bufferTrace($data, $this->getLastResponse());
return $code;
}
/**
* Add trace in buffer.
*
* @param ?string $data data sent
* @param array $response response received
* @return array
*/
protected function _bufferTrace(?string $data, array $response): array
{
$entry = [
'cmd' => $data,
'response' => $response,
];
$this->trace[] = $entry;
return $entry;
}
/**
* Get trace.
*
* @return array
*/
public function getTrace(): array
{
return $this->trace;
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare(strict_types=1);
namespace App\Mailer\Transport;
/**
* Smtp Transport class based on the CakePHP one, with tracing capabilities to help with debugging.
*/
class DebugSmtpTransport extends SmtpTransport
{
/**
* Client / server communication trace.
*
* @var array
*/
protected $trace = [];
/**
* Extends _smtpSend by storing the communication trace.
*
* @param null|string $data data to be sent
* @param string|false $checkCode check code
* @return null|string
*/
protected function _smtpSend(?string $data, $checkCode = '250'): ?string
{
$code = parent::_smtpSend($data, $checkCode);
$this->_bufferTrace($data, $this->getLastResponse());
return $code;
}
/**
* Add trace in buffer.
*
* @param ?string $data data sent
* @param array $response response received
* @return array
*/
protected function _bufferTrace(?string $data, array $response): array
{
$entry = [
'cmd' => $data,
'response' => $response,
];
$this->trace[] = $entry;
return $entry;
}
/**
* Get trace.
*
* @return array
*/
public function getTrace(): array
{
return $this->trace;
}
}
Function Calls
None |
Stats
MD5 | 4d151d5f7230b507efaa4365ef8ff89b |
Eval Count | 0 |
Decode Time | 84 ms |