PHP code example of brenno-duarte / modern-php-exception
1. Go to this page and download the library: Download brenno-duarte/modern-php-exception library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
brenno-duarte / modern-php-exception example snippets
use ModernPHPException\ModernPHPException;
$exc = new ModernPHPException();
$exc->start();
$config = __DIR__ . '/config.example.yaml';
$exc = new ModernPHPException($config);
$exc->start();
$config = __DIR__ . '/config.example.yaml';
$exc = new ModernPHPException($config);
$exc->enableOccurrences(); // <- Before `start` method
$exc->start();
namespace Test;
use ModernPHPException\Solution;
use ModernPHPException\Interface\SolutionInterface;
class CustomException extends \Exception implements SolutionInterface
{
public function getSolution(): Solution
{
return Solution::createSolution('My Solution')
->setDescription('description')
->setDocs('https://google.com');
}
#...
public static function staticCall()
{
throw new CustomException("Error Processing Request");
}