for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace AppUtils;
class ConvertHelper_ThrowableInfo_MessageRenderer
{
/**
* @var ConvertHelper_ThrowableInfo
*/
private $info;
* @var bool
private $developerInfo;
public function __construct(ConvertHelper_ThrowableInfo $info, bool $developerInfo)
$this->info = $info;
$this->developerInfo = $developerInfo;
}
* @return string
* @throws ConvertHelper_Exception
public function render() : string
$finalCall = $this->info->getFinalCall();
$message = sb()
->t('A %1$s exception occurred.', $this->info->getClass())
->eol()
->t('Code:')
->add($this->info->getCode())
->t('Message:')
->add($this->info->getMessage());
if($this->developerInfo)
$message
->t('Final call:')
->add($finalCall->toString());
if($this->developerInfo && $this->info->hasDetails())
->t('Developer details:')
->add($this->info->getDetails());
if($this->info->hasPrevious())
->t('Previous exception:')
->add($this->info->getPrevious()->renderErrorMessage($this->developerInfo));
return (string)$message;