1. Go to this page and download the library: Download mphamid/service-repository 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/ */
mphamid / service-repository example snippets
class TestException extends ServiceException
{
public const NEW_ERROR = 'new_error';
public function configureExceptions()
{
$this->addException(self::NEW_ERROR, Response::HTTP_BAD_REQUEST, 'this is a test exception');
}
}