mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-10 05:54:41 +02:00
lib: Add API documentation
This commit is contained in:
parent
b29ba5b973
commit
c4550be812
15 changed files with 1212 additions and 91 deletions
|
@ -1,12 +1,43 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of RSS-Bridge, a PHP project capable of generating RSS and
|
||||
* Atom feeds for websites that don't have one.
|
||||
*
|
||||
* For the full license information, please view the UNLICENSE file distributed
|
||||
* with this source code.
|
||||
*
|
||||
* @package Core
|
||||
* @license http://unlicense.org/ UNLICENSE
|
||||
* @link https://github.com/rss-bridge/rss-bridge
|
||||
*/
|
||||
|
||||
/**
|
||||
* Throws an exception when called.
|
||||
*
|
||||
* @throws \HttpException when called
|
||||
* @param string $message The error message
|
||||
* @param int $code The HTTP error code
|
||||
* @link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes List of HTTP
|
||||
* status codes
|
||||
*/
|
||||
function returnError($message, $code){
|
||||
throw new \HttpException($message, $code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns HTTP Error 400 (Bad Request) when called.
|
||||
*
|
||||
* @param string $message The error message
|
||||
*/
|
||||
function returnClientError($message){
|
||||
returnError($message, 400);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns HTTP Error 500 (Internal Server Error) when called.
|
||||
*
|
||||
* @param string $message The error message
|
||||
*/
|
||||
function returnServerError($message){
|
||||
returnError($message, 500);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue