Deploy website via FTP / Deploy (push) Skipped
- Updated .gitignore to exclude new directories and files. - Enhanced config.php with detailed PHPDoc comments for better clarity. - Refactored functions.php to include PHPDoc comments and improve code readability. - Added custom exceptions in exceptions.php with detailed documentation. - Improved utilities.php with better documentation and error handling. - Updated index.php with structured comments and improved readability. - Refined style.css for better visual consistency. - Introduced phpcs.xml for coding style checks and standards enforcement.
101 lines
2.9 KiB
PHP
101 lines
2.9 KiB
PHP
<?php
|
|
/**
|
|
* Custom exceptions for API interactions.
|
|
*
|
|
* PHP version 8.1+
|
|
*
|
|
* @category Exception
|
|
* @package TornVaultTracker
|
|
* @author Keith Solomon <ksolomon@gmail.com>
|
|
* @license Unlicense https://unlicense.org/
|
|
* @link https://github.com/ksolomon/Torn-Vault-Tracker
|
|
*/
|
|
|
|
/**
|
|
* Exception thrown when API key is missing.
|
|
*
|
|
* @category Exception
|
|
* @package TornVaultTracker
|
|
* @author Keith Solomon <ksolomon@gmail.com>
|
|
* @license Unlicense https://unlicense.org/
|
|
* @link https://github.com/ksolomon/Torn-Vault-Tracker
|
|
*/
|
|
class ApiKeyMissingException extends Exception {
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @param string $message The exception message.
|
|
* @param int $code The exception code.
|
|
* @param Throwable $previous The previous throwable.
|
|
*/
|
|
public function __construct($message, $code = 0, Throwable $previous = null) {
|
|
parent::__construct($message, $code, $previous);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Exception thrown on CURL errors.
|
|
*
|
|
* @category Exception
|
|
* @package TornVaultTracker
|
|
* @author Keith Solomon <ksolomon@gmail.com>
|
|
* @license Unlicense https://unlicense.org/
|
|
* @link https://github.com/ksolomon/Torn-Vault-Tracker
|
|
*/
|
|
class CurlErrorException extends Exception {
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @param string $message The exception message.
|
|
* @param int $code The exception code.
|
|
* @param Throwable $previous The previous throwable.
|
|
*/
|
|
public function __construct($message, $code = 0, Throwable $previous = null) {
|
|
parent::__construct($message, $code, $previous);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Exception thrown on JSON data errors.
|
|
*
|
|
* @category Exception
|
|
* @package TornVaultTracker
|
|
* @author Keith Solomon <ksolomon@gmail.com>
|
|
* @license Unlicense https://unlicense.org/
|
|
* @link https://github.com/ksolomon/Torn-Vault-Tracker
|
|
*/
|
|
class JsonDataException extends Exception {
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @param string $message The exception message.
|
|
* @param int $code The exception code.
|
|
* @param Throwable $previous The previous throwable.
|
|
*/
|
|
public function __construct($message, $code = 0, Throwable $previous = null) {
|
|
parent::__construct($message, $code, $previous);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Exception thrown on API validation errors.
|
|
*
|
|
* @category Exception
|
|
* @package TornVaultTracker
|
|
* @author Keith Solomon <ksolomon@gmail.com>
|
|
* @license Unlicense https://unlicense.org/
|
|
* @link https://github.com/ksolomon/Torn-Vault-Tracker
|
|
*/
|
|
class ApiValidationException extends Exception {
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @param string $message The exception message.
|
|
* @param int $code The exception code.
|
|
* @param Throwable $previous The previous throwable.
|
|
*/
|
|
public function __construct($message, $code = 0, Throwable $previous = null) {
|
|
parent::__construct($message, $code, $previous);
|
|
}
|
|
}
|