PHP code example of pagamastarde / module-utils
1. Go to this page and download the library: Download pagamastarde/module-utils 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/ */
pagamastarde / module-utils example snippets
composer
//Amount mismatch Example
try {
if ($price1 != $price2) {
throw new AmountMismatchException($price1, $price2);
}
} catch(AmountMismatchException $e) {
$jsonResponse = new JsonExceptionResponse();
$jsonResponse->setException($e);
$jsonResponse->toJson();
}