Download xirelogy / magpie-core / CommonPdoExceptionMessage.php - Solve class 'CommonPdoExceptionMessage' not found
This file is part of the package xirelogy/magpie-core.
Please go to our download page to download this composer package and to solve the problem class 'CommonPdoExceptionMessage' not found.
Download xirelogy/magpie-core
Class is not correct?
Search class
<?php
namespace Magpie\Models\Providers\Pdo\Traits;
use Magpie\Models\Providers\Pdo\PdoError;
trait CommonPdoExceptionMessage
{
/**
* Format message
* @param PdoError $error
* @param string $reasonMessage
* @param string $defaultMessage
* @return string
*/
protected static function formatMessageUsing(PdoError $error, string $reasonMessage, string $defaultMessage) : string
{
$reason = $error->getSimpleMessage();
if (!empty($reason)) {
return _format_safe($reasonMessage, $reason) ?? $defaultMessage;
}
return $defaultMessage;
}
}