From d25987f6935b1f79b45d70e23968ccb62abc232e Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Thu, 1 Jun 2023 02:47:38 +0200 Subject: [PATCH] first commit --- README.md | 72 +++++++++ .../README.md | 54 +++++++ .../code.php | 80 ++++++++++ .../code.power | 50 ++++++ .../settings.json | 33 ++++ .../README.md | 53 +++++++ .../code.php | 76 +++++++++ .../code.power | 50 ++++++ .../settings.json | 18 +++ .../README.md | 45 ++++++ .../code.php | 54 +++++++ .../code.power | 26 ++++ .../settings.json | 26 ++++ .../README.md | 61 ++++++++ .../code.php | 69 +++++++++ .../code.power | 43 ++++++ .../settings.json | 18 +++ .../README.md | 44 ++++++ .../code.php | 68 ++++++++ .../code.power | 39 +++++ .../settings.json | 31 ++++ .../README.md | 53 +++++++ .../code.php | 79 ++++++++++ .../code.power | 53 +++++++ .../settings.json | 18 +++ .../README.md | 42 +++++ .../code.php | 44 ++++++ .../code.power | 18 +++ .../settings.json | 18 +++ .../README.md | 69 +++++++++ .../code.php | 121 +++++++++++++++ .../code.power | 90 +++++++++++ .../settings.json | 38 +++++ .../README.md | 61 ++++++++ .../code.php | 90 +++++++++++ .../code.power | 60 ++++++++ .../settings.json | 34 ++++ .../README.md | 36 +++++ .../code.php | 48 ++++++ .../code.power | 21 +++ .../settings.json | 19 +++ .../README.md | 45 ++++++ .../code.php | 55 +++++++ .../code.power | 29 ++++ .../settings.json | 18 +++ .../README.md | 58 +++++++ .../code.php | 123 +++++++++++++++ .../code.power | 95 ++++++++++++ .../settings.json | 27 ++++ .../README.md | 45 ++++++ .../code.php | 63 ++++++++ .../code.power | 36 +++++ .../settings.json | 23 +++ super-powers.json | 145 ++++++++++++++++++ 54 files changed, 2784 insertions(+) create mode 100644 README.md create mode 100644 src/11892cfa-374e-4e3f-b0bc-531871c822d9/README.md create mode 100644 src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.php create mode 100644 src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.power create mode 100644 src/11892cfa-374e-4e3f-b0bc-531871c822d9/settings.json create mode 100644 src/491c91ce-6355-40d3-bbbd-622473c6c026/README.md create mode 100644 src/491c91ce-6355-40d3-bbbd-622473c6c026/code.php create mode 100644 src/491c91ce-6355-40d3-bbbd-622473c6c026/code.power create mode 100644 src/491c91ce-6355-40d3-bbbd-622473c6c026/settings.json create mode 100644 src/56465044-94ed-4e00-b6db-160c67163df8/README.md create mode 100644 src/56465044-94ed-4e00-b6db-160c67163df8/code.php create mode 100644 src/56465044-94ed-4e00-b6db-160c67163df8/code.power create mode 100644 src/56465044-94ed-4e00-b6db-160c67163df8/settings.json create mode 100644 src/71075f03-4e77-4fc0-840a-ef55fd9260b2/README.md create mode 100644 src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.php create mode 100644 src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.power create mode 100644 src/71075f03-4e77-4fc0-840a-ef55fd9260b2/settings.json create mode 100644 src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/README.md create mode 100644 src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.php create mode 100644 src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.power create mode 100644 src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/settings.json create mode 100644 src/a752e4b2-9b5e-4188-8d33-3799c46d5119/README.md create mode 100644 src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.php create mode 100644 src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.power create mode 100644 src/a752e4b2-9b5e-4188-8d33-3799c46d5119/settings.json create mode 100644 src/afa508bf-78f8-4616-97cc-f2809584c086/README.md create mode 100644 src/afa508bf-78f8-4616-97cc-f2809584c086/code.php create mode 100644 src/afa508bf-78f8-4616-97cc-f2809584c086/code.power create mode 100644 src/afa508bf-78f8-4616-97cc-f2809584c086/settings.json create mode 100644 src/b32eea04-6b9c-469d-94db-35d610686cf1/README.md create mode 100644 src/b32eea04-6b9c-469d-94db-35d610686cf1/code.php create mode 100644 src/b32eea04-6b9c-469d-94db-35d610686cf1/code.power create mode 100644 src/b32eea04-6b9c-469d-94db-35d610686cf1/settings.json create mode 100644 src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/README.md create mode 100644 src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/code.php create mode 100644 src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/code.power create mode 100644 src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/settings.json create mode 100644 src/b8c66089-735e-4081-825c-8fe36b28e4a6/README.md create mode 100644 src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.php create mode 100644 src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.power create mode 100644 src/b8c66089-735e-4081-825c-8fe36b28e4a6/settings.json create mode 100644 src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/README.md create mode 100644 src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.php create mode 100644 src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.power create mode 100644 src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/settings.json create mode 100644 src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/README.md create mode 100644 src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.php create mode 100644 src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.power create mode 100644 src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/settings.json create mode 100644 src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/README.md create mode 100644 src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.php create mode 100644 src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.power create mode 100644 src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/settings.json create mode 100644 super-powers.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..2c97dec --- /dev/null +++ b/README.md @@ -0,0 +1,72 @@ +``` +███████╗██╗ ██╗██████╗ ███████╗██████╗ +██╔════╝██║ ██║██╔══██╗██╔════╝██╔══██╗ +███████╗██║ ██║██████╔╝█████╗ ██████╔╝ +╚════██║██║ ██║██╔═══╝ ██╔══╝ ██╔══██╗ +███████║╚██████╔╝██║ ███████╗██║ ██║ +╚══════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ ███████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗██╔════╝ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝███████╗ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗╚════██║ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║███████║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝╚══════╝ +``` + +### What is JCB Super Powers? +The Joomla Component Builder (JCB) Super Power features are designed to enhance JCB's functionality and streamline the development process. These Super Powers enable developers to efficiently manage and share their custom powers across multiple JCB instances through repositories hosted on [https://git.vdm.dev/[username]/[repository-name]](https://git.vdm.dev). JCB Super Powers are managed using a combination of layers, events, tasks, methods, switches, and algorithms, which work together to provide powerful customization and extensibility options. More details on JCB Super Powers can be found in the [Super Powers Documentation](https://git.vdm.dev/joomla/super-powers/wiki). + +In summary, JCB Super Powers offer a flexible and efficient way to manage and share functionalities between JCB instances. By utilizing a sophisticated system of layers, events, tasks, methods, switches, and algorithms, developers can seamlessly integrate JCB core powers and their custom powers. For more information on how to work with JCB Super Powers, refer to the [Super Powers User Guide](https://git.vdm.dev/joomla/super-powers/wiki). + +### What can I find here? +This repository contains an index (see below) of all the approved powers within the JCB GUI. During the compilation of a component, these powers are automatically added to the repository, ensuring a well-organized and accessible collection of functionalities. + +# Index of powers + +- **Namespace**: [VDM\Joomla\GetBible](#vdm-joomla-getbible) + + - **abstract class Factory** | [Details](src/11892cfa-374e-4e3f-b0bc-531871c822d9) | [Code](src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.php) | [Settings](src/11892cfa-374e-4e3f-b0bc-531871c822d9/settings.json) | Super__11892cfa_374e_4e3f_b0bc_531871c822d9__Power + - **class Config** | [Details](src/71075f03-4e77-4fc0-840a-ef55fd9260b2) | [Code](src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.php) | [Settings](src/71075f03-4e77-4fc0-840a-ef55fd9260b2/settings.json) | Super__71075f03_4e77_4fc0_840a_ef55fd9260b2__Power +- **Namespace**: [VDM\Joomla\GetBible\Abstraction](#vdm-joomla-getbible-abstraction) + + - **abstract class Api** | [Details](src/7b490e63-8d1f-46de-a0c4-154272fd5d7f) | [Code](src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.php) | [Settings](src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/settings.json) | Super__7b490e63_8d1f_46de_a0c4_154272fd5d7f__Power +- **Namespace**: [VDM\Joomla\GetBible\Api](#vdm-joomla-getbible-api) + + - **final class Books** | [Details](src/491c91ce-6355-40d3-bbbd-622473c6c026) | [Code](src/491c91ce-6355-40d3-bbbd-622473c6c026/code.php) | [Settings](src/491c91ce-6355-40d3-bbbd-622473c6c026/settings.json) | Super__491c91ce_6355_40d3_bbbd_622473c6c026__Power + - **final class Chapters** | [Details](src/a752e4b2-9b5e-4188-8d33-3799c46d5119) | [Code](src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.php) | [Settings](src/a752e4b2-9b5e-4188-8d33-3799c46d5119/settings.json) | Super__a752e4b2_9b5e_4188_8d33_3799c46d5119__Power + - **final class Translations** | [Details](src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0) | [Code](src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.php) | [Settings](src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/settings.json) | Super__be0cae8b_4b78_4f59_b97b_9e31ee6f52e0__Power + - **final class Verses** | [Details](src/afa508bf-78f8-4616-97cc-f2809584c086) | [Code](src/afa508bf-78f8-4616-97cc-f2809584c086/code.php) | [Settings](src/afa508bf-78f8-4616-97cc-f2809584c086/settings.json) | Super__afa508bf_78f8_4616_97cc_f2809584c086__Power +- **Namespace**: [VDM\Joomla\GetBible\Service](#vdm-joomla-getbible-service) + + - **class Api** | [Details](src/b32eea04-6b9c-469d-94db-35d610686cf1) | [Code](src/b32eea04-6b9c-469d-94db-35d610686cf1/code.php) | [Settings](src/b32eea04-6b9c-469d-94db-35d610686cf1/settings.json) | Super__b32eea04_6b9c_469d_94db_35d610686cf1__Power + - **class App** | [Details](src/56465044-94ed-4e00-b6db-160c67163df8) | [Code](src/56465044-94ed-4e00-b6db-160c67163df8/code.php) | [Settings](src/56465044-94ed-4e00-b6db-160c67163df8/settings.json) | Super__56465044_94ed_4e00_b6db_160c67163df8__Power + - **class Utilities** | [Details](src/b89d74ef-c71c-4a58-8455-5dbdfe94027a) | [Code](src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/code.php) | [Settings](src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/settings.json) | Super__b89d74ef_c71c_4a58_8455_5dbdfe94027a__Power +- **Namespace**: [VDM\Joomla\GetBible\Utilities](#vdm-joomla-getbible-utilities) + + - **final class Http** | [Details](src/b8c66089-735e-4081-825c-8fe36b28e4a6) | [Code](src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.php) | [Settings](src/b8c66089-735e-4081-825c-8fe36b28e4a6/settings.json) | Super__b8c66089_735e_4081_825c_8fe36b28e4a6__Power + - **final class Response** | [Details](src/c99e85a0-d120-4f25-bcbf-0940dd7b773b) | [Code](src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.php) | [Settings](src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/settings.json) | Super__c99e85a0_d120_4f25_bcbf_0940dd7b773b__Power + - **final class Uri** | [Details](src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb) | [Code](src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.php) | [Settings](src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/settings.json) | Super__fc9ab6f0_c31b_4077_bb1c_2dcddd36f6bb__Power + +--- +``` + ██╗ ██████╗ ██████╗ ███╗ ███╗██╗ █████╗ + ██║██╔═══██╗██╔═══██╗████╗ ████║██║ ██╔══██╗ + ██║██║ ██║██║ ██║██╔████╔██║██║ ███████║ +██ ██║██║ ██║██║ ██║██║╚██╔╝██║██║ ██╔══██║ +╚█████╔╝╚██████╔╝╚██████╔╝██║ ╚═╝ ██║███████╗██║ ██║ + ╚════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ + ██████╗ ██████╗ ███╗ ███╗██████╗ ██████╗ ███╗ ██╗███████╗███╗ ██╗████████╗ +██╔════╝██╔═══██╗████╗ ████║██╔══██╗██╔═══██╗████╗ ██║██╔════╝████╗ ██║╚══██╔══╝ +██║ ██║ ██║██╔████╔██║██████╔╝██║ ██║██╔██╗ ██║█████╗ ██╔██╗ ██║ ██║ +██║ ██║ ██║██║╚██╔╝██║██╔═══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║╚██╗██║ ██║ +╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚██████╔╝██║ ╚████║███████╗██║ ╚████║ ██║ + ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═══╝ ╚═╝ +██████╗ ██╗ ██╗██╗██╗ ██████╗ ███████╗██████╗ +██╔══██╗██║ ██║██║██║ ██╔══██╗██╔════╝██╔══██╗ +██████╔╝██║ ██║██║██║ ██║ ██║█████╗ ██████╔╝ +██╔══██╗██║ ██║██║██║ ██║ ██║██╔══╝ ██╔══██╗ +██████╔╝╚██████╔╝██║███████╗██████╔╝███████╗██║ ██║ +╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝ ╚══════╝╚═╝ ╚═╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/11892cfa-374e-4e3f-b0bc-531871c822d9/README.md b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/README.md new file mode 100644 index 0000000..722fed3 --- /dev/null +++ b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class Factory (Details) +> namespace: **VDM\Joomla\GetBible** +```uml +@startuml +abstract Factory #Orange { + # static $container + + {static} _(string $key) : Mixed + + {static} getContainer() : Container + # {static} createContainer() : Container +} + +note right of Factory::_ + Get any class from the package container + + since: 3.2.0 + return: Mixed +end note + +note right of Factory::getContainer + Get the global package container + + since: 3.2.0 + return: Container +end note + +note right of Factory::createContainer + Create a container object + + since: 3.2.0 + return: Container +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.php b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.php new file mode 100644 index 0000000..00c4be9 --- /dev/null +++ b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.php @@ -0,0 +1,80 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible; + + +use Joomla\DI\Container; +use VDM\Joomla\GetBible\Service\Api; +use VDM\Joomla\GetBible\Service\Utilities; +use VDM\Joomla\GetBible\Service\App; +use VDM\Joomla\Componentbuilder\Interfaces\FactoryInterface; + + +/** + * GetBible Factory + * + * @since 3.2.0 + */ +abstract class Factory implements FactoryInterface +{ + /** + * Global Package Container + * + * @var Container + * @since 3.2.0 + **/ + protected static $container = null; + + /** + * Get any class from the package container + * + * @param string $key The container class key + * + * @return Mixed + * @since 3.2.0 + */ + public static function _($key) + { + return self::getContainer()->get($key); + } + + /** + * Get the global package container + * + * @return Container + * @since 3.2.0 + */ + public static function getContainer(): Container + { + if (!self::$container) + { + self::$container = self::createContainer(); + } + + return self::$container; + } + + /** + * Create a container object + * + * @return Container + * @since 3.2.0 + */ + protected static function createContainer(): Container + { + return (new Container()) + ->registerServiceProvider(new Utilities()) + ->registerServiceProvider(new Api()) + ->registerServiceProvider(new App()); + } +} + diff --git a/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.power b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.power new file mode 100644 index 0000000..75be52c --- /dev/null +++ b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.power @@ -0,0 +1,50 @@ + /** + * Global Package Container + * + * @var Container + * @since 3.2.0 + **/ + protected static $container = null; + + /** + * Get any class from the package container + * + * @param string $key The container class key + * + * @return Mixed + * @since 3.2.0 + */ + public static function _($key) + { + return self::getContainer()->get($key); + } + + /** + * Get the global package container + * + * @return Container + * @since 3.2.0 + */ + public static function getContainer(): Container + { + if (!self::$container) + { + self::$container = self::createContainer(); + } + + return self::$container; + } + + /** + * Create a container object + * + * @return Container + * @since 3.2.0 + */ + protected static function createContainer(): Container + { + return (new Container()) + ->registerServiceProvider(new Utilities()) + ->registerServiceProvider(new Api()) + ->registerServiceProvider(new App()); + } \ No newline at end of file diff --git a/src/11892cfa-374e-4e3f-b0bc-531871c822d9/settings.json b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/settings.json new file mode 100644 index 0000000..16ee53a --- /dev/null +++ b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/settings.json @@ -0,0 +1,33 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "11892cfa-374e-4e3f-b0bc-531871c822d9", + "implements": [ + "caf33c5d-858c-4f9a-894f-ab302ec5445a" + ], + "load_selection": null, + "name": "Factory", + "power_version": "1.0.0", + "system_name": "GetBible.Factory", + "type": "abstract class", + "use_selection": { + "use_selection0": { + "use": "b32eea04-6b9c-469d-94db-35d610686cf1", + "as": "default" + }, + "use_selection1": { + "use": "b89d74ef-c71c-4a58-8455-5dbdfe94027a", + "as": "default" + }, + "use_selection2": { + "use": "56465044-94ed-4e00-b6db-160c67163df8", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Factory", + "description": "GetBible Factory\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;", + "composer": "" +} \ No newline at end of file diff --git a/src/491c91ce-6355-40d3-bbbd-622473c6c026/README.md b/src/491c91ce-6355-40d3-bbbd-622473c6c026/README.md new file mode 100644 index 0000000..547338a --- /dev/null +++ b/src/491c91ce-6355-40d3-bbbd-622473c6c026/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Books (Details) +> namespace: **VDM\Joomla\GetBible\Api** +```uml +@startuml +class Books << (F,LightGreen) >> #Green { + + get(string $translation = 'kjv') : ?object + + list(string $translation = 'kjv') : ?object + + checksum(string $translation = 'kjv') : ?object +} + +note right of Books::get + Get the books in a translation + + since: 3.2.0 + return: ?object +end note + +note right of Books::list + List the books in a translation + + since: 3.2.0 + return: ?object +end note + +note right of Books::checksum + List the books checksums in a translation + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.php b/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.php new file mode 100644 index 0000000..10dae9a --- /dev/null +++ b/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.php @@ -0,0 +1,76 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Api; + + +use VDM\Joomla\GetBible\Abstraction\Api; + + +/** + * The GetBible Books + * + * @since 3.2.0 + */ +final class Books extends Api +{ + /** + * Get the books in a translation + * + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function get(string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '.json') + ) + ); + } + + /** + * List the books in a translation + * + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function list(string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/books.json') + ) + ); + } + + /** + * List the books checksums in a translation + * + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function checksum(string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/checksum.json') + ) + ); + } +} + diff --git a/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.power b/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.power new file mode 100644 index 0000000..e65cb9f --- /dev/null +++ b/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.power @@ -0,0 +1,50 @@ + /** + * Get the books in a translation + * + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function get(string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '.json') + ) + ); + } + + /** + * List the books in a translation + * + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function list(string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/books.json') + ) + ); + } + + /** + * List the books checksums in a translation + * + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function checksum(string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/checksum.json') + ) + ); + } \ No newline at end of file diff --git a/src/491c91ce-6355-40d3-bbbd-622473c6c026/settings.json b/src/491c91ce-6355-40d3-bbbd-622473c6c026/settings.json new file mode 100644 index 0000000..bf1cf08 --- /dev/null +++ b/src/491c91ce-6355-40d3-bbbd-622473c6c026/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7b490e63-8d1f-46de-a0c4-154272fd5d7f", + "guid": "491c91ce-6355-40d3-bbbd-622473c6c026", + "implements": null, + "load_selection": null, + "name": "Books", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Api.Books", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\GetBible\\Api.Books", + "description": "The GetBible Books\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/56465044-94ed-4e00-b6db-160c67163df8/README.md b/src/56465044-94ed-4e00-b6db-160c67163df8/README.md new file mode 100644 index 0000000..05813cd --- /dev/null +++ b/src/56465044-94ed-4e00-b6db-160c67163df8/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class App (Details) +> namespace: **VDM\Joomla\GetBible\Service** +```uml +@startuml +class App #Gold { + + register(Container $container) : void + + getConfig(Container $container) : Config +} + +note right of App::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of App::getConfig + Get the Config class + + since: 3.2.0 + return: Config +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/56465044-94ed-4e00-b6db-160c67163df8/code.php b/src/56465044-94ed-4e00-b6db-160c67163df8/code.php new file mode 100644 index 0000000..4c6d996 --- /dev/null +++ b/src/56465044-94ed-4e00-b6db-160c67163df8/code.php @@ -0,0 +1,54 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\GetBible\Config; + + +/** + * The GetBible App Service + * + * @since 3.2.0 + */ +class App implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Config::class, 'GetBible.Config') + ->share('GetBible.Config', [$this, 'getConfig'], true); + } + + /** + * Get the Config class + * + * @param Container $container The DI container. + * + * @return Config + * @since 3.2.0 + */ + public function getConfig(Container $container): Config + { + return new Config(); + } +} + diff --git a/src/56465044-94ed-4e00-b6db-160c67163df8/code.power b/src/56465044-94ed-4e00-b6db-160c67163df8/code.power new file mode 100644 index 0000000..2f78a07 --- /dev/null +++ b/src/56465044-94ed-4e00-b6db-160c67163df8/code.power @@ -0,0 +1,26 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Config::class, 'GetBible.Config') + ->share('GetBible.Config', [$this, 'getConfig'], true); + } + + /** + * Get the Config class + * + * @param Container $container The DI container. + * + * @return Config + * @since 3.2.0 + */ + public function getConfig(Container $container): Config + { + return new Config(); + } \ No newline at end of file diff --git a/src/56465044-94ed-4e00-b6db-160c67163df8/settings.json b/src/56465044-94ed-4e00-b6db-160c67163df8/settings.json new file mode 100644 index 0000000..36cb597 --- /dev/null +++ b/src/56465044-94ed-4e00-b6db-160c67163df8/settings.json @@ -0,0 +1,26 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "56465044-94ed-4e00-b6db-160c67163df8", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "App", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Service.App", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "71075f03-4e77-4fc0-840a-ef55fd9260b2", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Service.App", + "description": "The GetBible App Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/README.md b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/README.md new file mode 100644 index 0000000..88d2bb6 --- /dev/null +++ b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/README.md @@ -0,0 +1,61 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Config (Details) +> namespace: **VDM\Joomla\GetBible** +```uml +@startuml +class Config #Gold { + # getEndpoint() : ?string + # getSchema() : ?string + # getDomain() : ?string + # getVersion() : ?string +} + +note right of Config::getEndpoint + get Bible API url + + since: 3.2.0 + return: ?string +end note + +note right of Config::getSchema + get Bible API Schema + + since: 3.2.0 + return: ?string +end note + +note right of Config::getDomain + get Bible API domain + + since: 3.2.0 + return: ?string +end note + +note right of Config::getVersion + get Bible version + + since: 3.2.0 + return: ?string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.php b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.php new file mode 100644 index 0000000..56533dc --- /dev/null +++ b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.php @@ -0,0 +1,69 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible; + + +use VDM\Joomla\Abstraction\BaseConfig; + + +/** + * GetBible Configurations + * + * @since 3.2.0 + */ +class Config extends BaseConfig +{ + /** + * get Bible API url + * + * @return string The API Endpoint + * @since 3.2.0 + */ + protected function getEndpoint(): ?string + { + return $this->schema . '://' . $this->domain . '/' . $this->version . '/'; + } + + /** + * get Bible API Schema + * + * @return string The Get Bible Schema + * @since 3.2.0 + */ + protected function getSchema(): ?string + { + return 'https'; + } + + /** + * get Bible API domain + * + * @return string The Get Bible Domain + * @since 3.2.0 + */ + protected function getDomain(): ?string + { + return 'api.getbible.net'; + } + + /** + * get Bible version + * + * @return string The Get Bible Version + * @since 3.2.0 + */ + protected function getVersion(): ?string + { + return 'v2'; + } +} + diff --git a/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.power b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.power new file mode 100644 index 0000000..59d20c0 --- /dev/null +++ b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.power @@ -0,0 +1,43 @@ + /** + * get Bible API url + * + * @return string The API Endpoint + * @since 3.2.0 + */ + protected function getEndpoint(): ?string + { + return $this->schema . '://' . $this->domain . '/' . $this->version . '/'; + } + + /** + * get Bible API Schema + * + * @return string The Get Bible Schema + * @since 3.2.0 + */ + protected function getSchema(): ?string + { + return 'https'; + } + + /** + * get Bible API domain + * + * @return string The Get Bible Domain + * @since 3.2.0 + */ + protected function getDomain(): ?string + { + return 'api.getbible.net'; + } + + /** + * get Bible version + * + * @return string The Get Bible Version + * @since 3.2.0 + */ + protected function getVersion(): ?string + { + return 'v2'; + } \ No newline at end of file diff --git a/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/settings.json b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/settings.json new file mode 100644 index 0000000..2f7eca7 --- /dev/null +++ b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "ffbd4e1f-a342-4080-ab7d-1de3741bf319", + "guid": "71075f03-4e77-4fc0-840a-ef55fd9260b2", + "implements": null, + "load_selection": null, + "name": "Config", + "power_version": "1.0.0", + "system_name": "JCB.GetBible.Config", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\GetBible\\Config", + "description": "GetBible Configurations\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/README.md b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/README.md new file mode 100644 index 0000000..9278de8 --- /dev/null +++ b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/README.md @@ -0,0 +1,44 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class Api (Details) +> namespace: **VDM\Joomla\GetBible\Abstraction** +```uml +@startuml +abstract Api #Orange { + # Http $http + # Uri $uri + # Response $response + + __construct(Http $http, Uri $uri, ...) +} + +note right of Api::__construct + Constructor. + + since: 3.2.0 + + arguments: + Http $http + Uri $uri + Response $response +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.php b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.php new file mode 100644 index 0000000..2254458 --- /dev/null +++ b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.php @@ -0,0 +1,68 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Abstraction; + + +use Joomla\Uri\Uri as JoomlaUri; +use VDM\Joomla\GetBible\Utilities\Http; +use VDM\Joomla\GetBible\Utilities\Uri; +use VDM\Joomla\GetBible\Utilities\Response; + + +/** + * The GetBible Api + * + * @since 3.2.0 + */ +abstract class Api +{ + /** + * The Http class + * + * @var Http + * @since 3.2.0 + */ + protected Http $http; + + /** + * The Uri class + * + * @var Uri + * @since 3.2.0 + */ + protected Uri $uri; + + /** + * The Response class + * + * @var Response + * @since 3.2.0 + */ + protected Response $response; + + /** + * Constructor. + * + * @param Http $http The http class. + * @param Uri $uri The uri class. + * @param Response $response The response class. + * + * @since 3.2.0 + **/ + public function __construct(Http $http, Uri $uri, Response $response) + { + $this->http = $http; + $this->uri = $uri; + $this->response = $response; + } +} + diff --git a/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.power b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.power new file mode 100644 index 0000000..7f1d19e --- /dev/null +++ b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.power @@ -0,0 +1,39 @@ + /** + * The Http class + * + * @var Http + * @since 3.2.0 + */ + protected Http $http; + + /** + * The Uri class + * + * @var Uri + * @since 3.2.0 + */ + protected Uri $uri; + + /** + * The Response class + * + * @var Response + * @since 3.2.0 + */ + protected Response $response; + + /** + * Constructor. + * + * @param Http $http The http class. + * @param Uri $uri The uri class. + * @param Response $response The response class. + * + * @since 3.2.0 + **/ + public function __construct(Http $http, Uri $uri, Response $response) + { + $this->http = $http; + $this->uri = $uri; + $this->response = $response; + } \ No newline at end of file diff --git a/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/settings.json b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/settings.json new file mode 100644 index 0000000..2b214e5 --- /dev/null +++ b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/settings.json @@ -0,0 +1,31 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "7b490e63-8d1f-46de-a0c4-154272fd5d7f", + "implements": null, + "load_selection": null, + "name": "Api", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Abstraction.Api", + "type": "abstract class", + "use_selection": { + "use_selection0": { + "use": "b8c66089-735e-4081-825c-8fe36b28e4a6", + "as": "default" + }, + "use_selection1": { + "use": "fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb", + "as": "default" + }, + "use_selection2": { + "use": "c99e85a0-d120-4f25-bcbf-0940dd7b773b", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Abstraction.Api", + "description": "The GetBible Api\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\Uri\\Uri as JoomlaUri;", + "composer": "" +} \ No newline at end of file diff --git a/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/README.md b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/README.md new file mode 100644 index 0000000..51dcdf3 --- /dev/null +++ b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Chapters (Details) +> namespace: **VDM\Joomla\GetBible\Api** +```uml +@startuml +class Chapters << (F,LightGreen) >> #Green { + + get(int $book, string $translation = 'kjv') : ?object + + list(int $book, string $translation = 'kjv') : ?object + + checksum(int $book, string $translation = 'kjv') : ?object +} + +note right of Chapters::get + Get the chapters in a book in a translation + + since: 3.2.0 + return: ?object +end note + +note right of Chapters::list + List the chapters of a book in a translation + + since: 3.2.0 + return: ?object +end note + +note right of Chapters::checksum + List the chapters checksums of a book in a translation + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.php b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.php new file mode 100644 index 0000000..d5a9593 --- /dev/null +++ b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.php @@ -0,0 +1,79 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Api; + + +use VDM\Joomla\GetBible\Abstraction\Api; + + +/** + * The GetBible Book Chapters + * + * @since 3.2.0 + */ +final class Chapters extends Api +{ + /** + * Get the chapters in a book in a translation + * + * @param int $book The book number. + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function get(int $book, string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '.json') + ) + ); + } + + /** + * List the chapters of a book in a translation + * + * @param int $book The book number. + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function list(int $book, string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '/chapters.json') + ) + ); + } + + /** + * List the chapters checksums of a book in a translation + * + * @param int $book The book number. + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function checksum(int $book, string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '/checksum.json') + ) + ); + } +} + diff --git a/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.power b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.power new file mode 100644 index 0000000..5dde518 --- /dev/null +++ b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.power @@ -0,0 +1,53 @@ + /** + * Get the chapters in a book in a translation + * + * @param int $book The book number. + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function get(int $book, string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '.json') + ) + ); + } + + /** + * List the chapters of a book in a translation + * + * @param int $book The book number. + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function list(int $book, string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '/chapters.json') + ) + ); + } + + /** + * List the chapters checksums of a book in a translation + * + * @param int $book The book number. + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function checksum(int $book, string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '/checksum.json') + ) + ); + } \ No newline at end of file diff --git a/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/settings.json b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/settings.json new file mode 100644 index 0000000..8317e85 --- /dev/null +++ b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7b490e63-8d1f-46de-a0c4-154272fd5d7f", + "guid": "a752e4b2-9b5e-4188-8d33-3799c46d5119", + "implements": null, + "load_selection": null, + "name": "Chapters", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Api.Chapters", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\GetBible\\Api.Chapters", + "description": "The GetBible Book Chapters\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/afa508bf-78f8-4616-97cc-f2809584c086/README.md b/src/afa508bf-78f8-4616-97cc-f2809584c086/README.md new file mode 100644 index 0000000..8cbe0ce --- /dev/null +++ b/src/afa508bf-78f8-4616-97cc-f2809584c086/README.md @@ -0,0 +1,42 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Verses (Details) +> namespace: **VDM\Joomla\GetBible\Api** +```uml +@startuml +class Verses << (F,LightGreen) >> #Green { + + get(int $chapter, int $book, ...) : ?object +} + +note right of Verses::get + Get the verses of chapter in a book in a translation + + since: 3.2.0 + return: ?object + + arguments: + int $chapter + int $book + string $translation = 'kjv' +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/afa508bf-78f8-4616-97cc-f2809584c086/code.php b/src/afa508bf-78f8-4616-97cc-f2809584c086/code.php new file mode 100644 index 0000000..9aea223 --- /dev/null +++ b/src/afa508bf-78f8-4616-97cc-f2809584c086/code.php @@ -0,0 +1,44 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Api; + + +use VDM\Joomla\GetBible\Abstraction\Api; + + +/** + * The GetBible Book Chapter Verses + * + * @since 3.2.0 + */ +final class Verses extends Api +{ + /** + * Get the verses of chapter in a book in a translation + * + * @param int $chapter The chapter number. + * @param int $book The book number. + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function get(int $chapter, int $book, string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '/' . $chapter . '.json') + ) + ); + } +} + diff --git a/src/afa508bf-78f8-4616-97cc-f2809584c086/code.power b/src/afa508bf-78f8-4616-97cc-f2809584c086/code.power new file mode 100644 index 0000000..0fe8f65 --- /dev/null +++ b/src/afa508bf-78f8-4616-97cc-f2809584c086/code.power @@ -0,0 +1,18 @@ + /** + * Get the verses of chapter in a book in a translation + * + * @param int $chapter The chapter number. + * @param int $book The book number. + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function get(int $chapter, int $book, string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '/' . $chapter . '.json') + ) + ); + } \ No newline at end of file diff --git a/src/afa508bf-78f8-4616-97cc-f2809584c086/settings.json b/src/afa508bf-78f8-4616-97cc-f2809584c086/settings.json new file mode 100644 index 0000000..0265eb1 --- /dev/null +++ b/src/afa508bf-78f8-4616-97cc-f2809584c086/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7b490e63-8d1f-46de-a0c4-154272fd5d7f", + "guid": "afa508bf-78f8-4616-97cc-f2809584c086", + "implements": null, + "load_selection": null, + "name": "Verses", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Api.Verses", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\GetBible\\Api.Verses", + "description": "The GetBible Book Chapter Verses\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/b32eea04-6b9c-469d-94db-35d610686cf1/README.md b/src/b32eea04-6b9c-469d-94db-35d610686cf1/README.md new file mode 100644 index 0000000..b1d65e2 --- /dev/null +++ b/src/b32eea04-6b9c-469d-94db-35d610686cf1/README.md @@ -0,0 +1,69 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Api (Details) +> namespace: **VDM\Joomla\GetBible\Service** +```uml +@startuml +class Api #Gold { + + register(Container $container) : void + + getTranslations(Container $container) : Translations + + getBooks(Container $container) : Books + + getChapters(Container $container) : Chapters + + getVerses(Container $container) : Verses +} + +note right of Api::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Api::getTranslations + Get the Translations class + + since: 3.2.0 + return: Translations +end note + +note right of Api::getBooks + Get the Books class + + since: 3.2.0 + return: Books +end note + +note right of Api::getChapters + Get the Chapters class + + since: 3.2.0 + return: Chapters +end note + +note right of Api::getVerses + Get the Verses class + + since: 3.2.0 + return: Verses +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.php b/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.php new file mode 100644 index 0000000..7df8fe2 --- /dev/null +++ b/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.php @@ -0,0 +1,121 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\GetBible\Api\Translations; +use VDM\Joomla\GetBible\Api\Books; +use VDM\Joomla\GetBible\Api\Chapters; +use VDM\Joomla\GetBible\Api\Verses; + + +/** + * The GetBible Api Service + * + * @since 3.2.0 + */ +class Api implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Translations::class, 'GetBible.Api.Translations') + ->share('GetBible.Api.Translations', [$this, 'getTranslations'], true); + + $container->alias(Books::class, 'GetBible.Api.Books') + ->share('GetBible.Api.Books', [$this, 'getBooks'], true); + + $container->alias(Chapters::class, 'GetBible.Api.Chapters') + ->share('GetBible.Api.Chapters', [$this, 'getChapters'], true); + + $container->alias(Verses::class, 'GetBible.Api.Verses') + ->share('GetBible.Api.Verses', [$this, 'getVerses'], true); + } + + /** + * Get the Translations class + * + * @param Container $container The DI container. + * + * @return Translations + * @since 3.2.0 + */ + public function getTranslations(Container $container): Translations + { + return new Translations( + $container->get('GetBible.Utilities.Http'), + $container->get('GetBible.Utilities.Uri'), + $container->get('GetBible.Utilities.Response') + ); + } + + /** + * Get the Books class + * + * @param Container $container The DI container. + * + * @return Books + * @since 3.2.0 + */ + public function getBooks(Container $container): Books + { + return new Books( + $container->get('GetBible.Utilities.Http'), + $container->get('GetBible.Utilities.Uri'), + $container->get('GetBible.Utilities.Response') + ); + } + + /** + * Get the Chapters class + * + * @param Container $container The DI container. + * + * @return Chapters + * @since 3.2.0 + */ + public function getChapters(Container $container): Chapters + { + return new Chapters( + $container->get('GetBible.Utilities.Http'), + $container->get('GetBible.Utilities.Uri'), + $container->get('GetBible.Utilities.Response') + ); + } + + /** + * Get the Verses class + * + * @param Container $container The DI container. + * + * @return Verses + * @since 3.2.0 + */ + public function getVerses(Container $container): Verses + { + return new Verses( + $container->get('GetBible.Utilities.Http'), + $container->get('GetBible.Utilities.Uri'), + $container->get('GetBible.Utilities.Response') + ); + } +} + diff --git a/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.power b/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.power new file mode 100644 index 0000000..3ee348c --- /dev/null +++ b/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.power @@ -0,0 +1,90 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Translations::class, 'GetBible.Api.Translations') + ->share('GetBible.Api.Translations', [$this, 'getTranslations'], true); + + $container->alias(Books::class, 'GetBible.Api.Books') + ->share('GetBible.Api.Books', [$this, 'getBooks'], true); + + $container->alias(Chapters::class, 'GetBible.Api.Chapters') + ->share('GetBible.Api.Chapters', [$this, 'getChapters'], true); + + $container->alias(Verses::class, 'GetBible.Api.Verses') + ->share('GetBible.Api.Verses', [$this, 'getVerses'], true); + } + + /** + * Get the Translations class + * + * @param Container $container The DI container. + * + * @return Translations + * @since 3.2.0 + */ + public function getTranslations(Container $container): Translations + { + return new Translations( + $container->get('GetBible.Utilities.Http'), + $container->get('GetBible.Utilities.Uri'), + $container->get('GetBible.Utilities.Response') + ); + } + + /** + * Get the Books class + * + * @param Container $container The DI container. + * + * @return Books + * @since 3.2.0 + */ + public function getBooks(Container $container): Books + { + return new Books( + $container->get('GetBible.Utilities.Http'), + $container->get('GetBible.Utilities.Uri'), + $container->get('GetBible.Utilities.Response') + ); + } + + /** + * Get the Chapters class + * + * @param Container $container The DI container. + * + * @return Chapters + * @since 3.2.0 + */ + public function getChapters(Container $container): Chapters + { + return new Chapters( + $container->get('GetBible.Utilities.Http'), + $container->get('GetBible.Utilities.Uri'), + $container->get('GetBible.Utilities.Response') + ); + } + + /** + * Get the Verses class + * + * @param Container $container The DI container. + * + * @return Verses + * @since 3.2.0 + */ + public function getVerses(Container $container): Verses + { + return new Verses( + $container->get('GetBible.Utilities.Http'), + $container->get('GetBible.Utilities.Uri'), + $container->get('GetBible.Utilities.Response') + ); + } \ No newline at end of file diff --git a/src/b32eea04-6b9c-469d-94db-35d610686cf1/settings.json b/src/b32eea04-6b9c-469d-94db-35d610686cf1/settings.json new file mode 100644 index 0000000..4d50170 --- /dev/null +++ b/src/b32eea04-6b9c-469d-94db-35d610686cf1/settings.json @@ -0,0 +1,38 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "b32eea04-6b9c-469d-94db-35d610686cf1", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Api", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Service.Api", + "type": "class", + "use_selection": { + "use_selection1": { + "use": "be0cae8b-4b78-4f59-b97b-9e31ee6f52e0", + "as": "default" + }, + "use_selection2": { + "use": "491c91ce-6355-40d3-bbbd-622473c6c026", + "as": "default" + }, + "use_selection3": { + "use": "a752e4b2-9b5e-4188-8d33-3799c46d5119", + "as": "default" + }, + "use_selection4": { + "use": "afa508bf-78f8-4616-97cc-f2809584c086", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Service.Api", + "description": "The GetBible Api Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/README.md b/src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/README.md new file mode 100644 index 0000000..058ac5d --- /dev/null +++ b/src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/README.md @@ -0,0 +1,61 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Utilities (Details) +> namespace: **VDM\Joomla\GetBible\Service** +```uml +@startuml +class Utilities #Gold { + + register(Container $container) : void + + getUri(Container $container) : Uri + + getResponse(Container $container) : Response + + getHttp(Container $container) : Http +} + +note right of Utilities::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Utilities::getUri + Get the Uri class + + since: 3.2.0 + return: Uri +end note + +note right of Utilities::getResponse + Get the Response class + + since: 3.2.0 + return: Response +end note + +note right of Utilities::getHttp + Get the Http class + + since: 3.2.0 + return: Http +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/code.php b/src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/code.php new file mode 100644 index 0000000..36e54ad --- /dev/null +++ b/src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/code.php @@ -0,0 +1,90 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\GetBible\Utilities\Uri; +use VDM\Joomla\GetBible\Utilities\Response; +use VDM\Joomla\GetBible\Utilities\Http; + + +/** + * The GetBible Utilities Service + * + * @since 3.2.0 + */ +class Utilities implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Uri::class, 'GetBible.Utilities.Uri') + ->share('GetBible.Utilities.Uri', [$this, 'getUri'], true); + + $container->alias(Response::class, 'GetBible.Utilities.Response') + ->share('GetBible.Utilities.Response', [$this, 'getResponse'], true); + + $container->alias(Http::class, 'GetBible.Utilities.Http') + ->share('GetBible.Utilities.Http', [$this, 'getHttp'], true); + } + + /** + * Get the Uri class + * + * @param Container $container The DI container. + * + * @return Uri + * @since 3.2.0 + */ + public function getUri(Container $container): Uri + { + return new Uri( + $container->get('GetBible.Config') + ); + } + + /** + * Get the Response class + * + * @param Container $container The DI container. + * + * @return Response + * @since 3.2.0 + */ + public function getResponse(Container $container): Response + { + return new Response(); + } + + /** + * Get the Http class + * + * @param Container $container The DI container. + * + * @return Http + * @since 3.2.0 + */ + public function getHttp(Container $container): Http + { + return new Http(); + } +} + diff --git a/src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/code.power b/src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/code.power new file mode 100644 index 0000000..65e4382 --- /dev/null +++ b/src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/code.power @@ -0,0 +1,60 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Uri::class, 'GetBible.Utilities.Uri') + ->share('GetBible.Utilities.Uri', [$this, 'getUri'], true); + + $container->alias(Response::class, 'GetBible.Utilities.Response') + ->share('GetBible.Utilities.Response', [$this, 'getResponse'], true); + + $container->alias(Http::class, 'GetBible.Utilities.Http') + ->share('GetBible.Utilities.Http', [$this, 'getHttp'], true); + } + + /** + * Get the Uri class + * + * @param Container $container The DI container. + * + * @return Uri + * @since 3.2.0 + */ + public function getUri(Container $container): Uri + { + return new Uri( + $container->get('GetBible.Config') + ); + } + + /** + * Get the Response class + * + * @param Container $container The DI container. + * + * @return Response + * @since 3.2.0 + */ + public function getResponse(Container $container): Response + { + return new Response(); + } + + /** + * Get the Http class + * + * @param Container $container The DI container. + * + * @return Http + * @since 3.2.0 + */ + public function getHttp(Container $container): Http + { + return new Http(); + } \ No newline at end of file diff --git a/src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/settings.json b/src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/settings.json new file mode 100644 index 0000000..b3873c0 --- /dev/null +++ b/src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/settings.json @@ -0,0 +1,34 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "b89d74ef-c71c-4a58-8455-5dbdfe94027a", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Utilities", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Service.Utilities", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb", + "as": "default" + }, + "use_selection1": { + "use": "c99e85a0-d120-4f25-bcbf-0940dd7b773b", + "as": "default" + }, + "use_selection2": { + "use": "b8c66089-735e-4081-825c-8fe36b28e4a6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Service.Utilities", + "description": "The GetBible Utilities Service\r\n\r\n@since 3.2.0", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/b8c66089-735e-4081-825c-8fe36b28e4a6/README.md b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/README.md new file mode 100644 index 0000000..9c24b3f --- /dev/null +++ b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/README.md @@ -0,0 +1,36 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Http (Details) +> namespace: **VDM\Joomla\GetBible\Utilities** +```uml +@startuml +class Http << (F,LightGreen) >> #Green { + + __construct() +} + +note right of Http::__construct + Constructor. + + since: 3.2.0 +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.php b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.php new file mode 100644 index 0000000..ec581fb --- /dev/null +++ b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.php @@ -0,0 +1,48 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Utilities; + + +use Joomla\CMS\Http\Http as JoomlaHttp; +use Joomla\Registry\Registry; + + +/** + * The GetBible Http + * + * @since 3.2.0 + */ +final class Http extends JoomlaHttp +{ + /** + * Constructor. + * + * @since 3.2.0 + * @throws \InvalidArgumentException + **/ + public function __construct() + { + // setup config + $config = [ + 'userAgent' => 'JoomlaGetBible/2.0', + 'headers' => [ + 'Content-Type' => 'application/json' + ] + ]; + + $options = new Registry($config); + + // run parent constructor + parent::__construct($options); + } +} + diff --git a/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.power b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.power new file mode 100644 index 0000000..0e3f76f --- /dev/null +++ b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.power @@ -0,0 +1,21 @@ + /** + * Constructor. + * + * @since 3.2.0 + * @throws \InvalidArgumentException + **/ + public function __construct() + { + // setup config + $config = [ + 'userAgent' => 'JoomlaGetBible/2.0', + 'headers' => [ + 'Content-Type' => 'application/json' + ] + ]; + + $options = new Registry($config); + + // run parent constructor + parent::__construct($options); + } \ No newline at end of file diff --git a/src/b8c66089-735e-4081-825c-8fe36b28e4a6/settings.json b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/settings.json new file mode 100644 index 0000000..71808ca --- /dev/null +++ b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/settings.json @@ -0,0 +1,19 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "-1", + "guid": "b8c66089-735e-4081-825c-8fe36b28e4a6", + "implements": null, + "load_selection": null, + "name": "Http", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Utilities.Http", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\GetBible\\Utilities.Http", + "description": "The GetBible Http\r\n\r\n@since 3.2.0", + "extends_custom": "JoomlaHttp", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\CMS\\Http\\Http as JoomlaHttp;\r\nuse Joomla\\Registry\\Registry;", + "composer": "" +} \ No newline at end of file diff --git a/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/README.md b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/README.md new file mode 100644 index 0000000..f5e8471 --- /dev/null +++ b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Translations (Details) +> namespace: **VDM\Joomla\GetBible\Api** +```uml +@startuml +class Translations << (F,LightGreen) >> #Green { + + list() : ?object + + checksum() : ?object +} + +note right of Translations::list + List the translations + + since: 3.2.0 + return: ?object +end note + +note right of Translations::checksum + List the translations checksums + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.php b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.php new file mode 100644 index 0000000..02bb5da --- /dev/null +++ b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.php @@ -0,0 +1,55 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Api; + + +use VDM\Joomla\GetBible\Abstraction\Api; + + +/** + * The GetBible Translations + * + * @since 3.2.0 + */ +final class Translations extends Api +{ + /** + * List the translations + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function list(): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get('translations.json') + ) + ); + } + + /** + * List the translations checksums + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function checksum(): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get('checksum.json') + ) + ); + } +} + diff --git a/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.power b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.power new file mode 100644 index 0000000..1f28144 --- /dev/null +++ b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.power @@ -0,0 +1,29 @@ + /** + * List the translations + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function list(): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get('translations.json') + ) + ); + } + + /** + * List the translations checksums + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function checksum(): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get('checksum.json') + ) + ); + } \ No newline at end of file diff --git a/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/settings.json b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/settings.json new file mode 100644 index 0000000..f41b4d3 --- /dev/null +++ b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7b490e63-8d1f-46de-a0c4-154272fd5d7f", + "guid": "be0cae8b-4b78-4f59-b97b-9e31ee6f52e0", + "implements": null, + "load_selection": null, + "name": "Translations", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Api.Translations", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\GetBible\\Api.Translations", + "description": "The GetBible Translations\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/README.md b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/README.md new file mode 100644 index 0000000..63f83e0 --- /dev/null +++ b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/README.md @@ -0,0 +1,58 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Response (Details) +> namespace: **VDM\Joomla\GetBible\Utilities** +```uml +@startuml +class Response << (F,LightGreen) >> #Green { + + get(JoomlaResponse $response, int $expectedCode = 200, ...) : mixed + # getBody(JoomlaResponse $response, mixed $default = null) : mixed + # error(JoomlaResponse $response) : string +} + +note right of Response::get + Process the response and decode it. + + since: 3.2.0 + return: mixed + + arguments: + JoomlaResponse $response + int $expectedCode = 200 + mixed $default = null +end note + +note right of Response::getBody + Return the body from the response + + since: 3.2.0 + return: mixed +end note + +note right of Response::error + Get the error message from the GetBible API response + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.php b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.php new file mode 100644 index 0000000..69a0e87 --- /dev/null +++ b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.php @@ -0,0 +1,123 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Utilities; + + +use Joomla\CMS\Http\Response as JoomlaResponse; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * The GetBible Response + * + * @since 3.2.0 + */ +final class Response +{ + /** + * Process the response and decode it. + * + * @param JoomlaResponse $response The response. + * @param integer $expectedCode The expected "good" code. + * @param mixed $default The default if body not have length + * + * @return mixed + * + * @since 3.2.0 + * @throws \DomainException + **/ + public function get(JoomlaResponse $response, int $expectedCode = 200, $default = null) + { + // Validate the response code. + if ($response->code != $expectedCode) + { + // Decode the error response and throw an exception. + $message = $this->error($response); + + // Throw an exception with the GetBible error message and code. + throw new \DomainException($message, $response->code); + } + + return $this->getBody($response, $default); + } + + /** + * Return the body from the response + * + * @param JoomlaResponse $response The response. + * @param mixed $default The default if body not have length + * + * @return mixed + * @since 3.2.0 + **/ + protected function getBody(JoomlaResponse $response, $default = null) + { + // check that we have a body + if (isset($response->body) && StringHelper::check($response->body)) + { + // if it's JSON, decode it + if (JsonHelper::check($response->body)) + { + return json_decode((string) $response->body); + } + + // if it's XML, convert it to an object + libxml_use_internal_errors(true); + $xml = simplexml_load_string($response->body); + if ($xml !== false) + { + return $xml; + } + + // if it's neither JSON nor XML, return as is + return $response->body; + } + + return $default; + } + + /** + * Get the error message from the GetBible API response + * + * @param JoomlaResponse $response The response. + * + * @return string + * @since 3.2.0 + **/ + protected function error(JoomlaResponse $response): string + { + // do we have a json string + if (isset($response->body) && JsonHelper::check($response->body)) + { + $error = json_decode($response->body); + } + else + { + return 'Invalid or empty response body.'; + } + + // check if GetBible returned an error object + if (isset($error->Error)) + { + // error object found, extract message and code + $errorMessage = isset($error->Error->Message) ? $error->Error->Message : 'Unknown error.'; + $errorCode = isset($error->Error->Code) ? $error->Error->Code : 'Unknown error code.'; + + // return formatted error message + return 'Wasabi Error: ' . $errorMessage . ' Code: ' . $errorCode; + } + + return 'No error information found in response.'; + } +} + diff --git a/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.power b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.power new file mode 100644 index 0000000..f6513ab --- /dev/null +++ b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.power @@ -0,0 +1,95 @@ + /** + * Process the response and decode it. + * + * @param JoomlaResponse $response The response. + * @param integer $expectedCode The expected "good" code. + * @param mixed $default The default if body not have length + * + * @return mixed + * + * @since 3.2.0 + * @throws \DomainException + **/ + public function get(JoomlaResponse $response, int $expectedCode = 200, $default = null) + { + // Validate the response code. + if ($response->code != $expectedCode) + { + // Decode the error response and throw an exception. + $message = $this->error($response); + + // Throw an exception with the GetBible error message and code. + throw new \DomainException($message, $response->code); + } + + return $this->getBody($response, $default); + } + + /** + * Return the body from the response + * + * @param JoomlaResponse $response The response. + * @param mixed $default The default if body not have length + * + * @return mixed + * @since 3.2.0 + **/ + protected function getBody(JoomlaResponse $response, $default = null) + { + // check that we have a body + if (isset($response->body) && StringHelper::check($response->body)) + { + // if it's JSON, decode it + if (JsonHelper::check($response->body)) + { + return json_decode((string) $response->body); + } + + // if it's XML, convert it to an object + libxml_use_internal_errors(true); + $xml = simplexml_load_string($response->body); + if ($xml !== false) + { + return $xml; + } + + // if it's neither JSON nor XML, return as is + return $response->body; + } + + return $default; + } + + /** + * Get the error message from the GetBible API response + * + * @param JoomlaResponse $response The response. + * + * @return string + * @since 3.2.0 + **/ + protected function error(JoomlaResponse $response): string + { + // do we have a json string + if (isset($response->body) && JsonHelper::check($response->body)) + { + $error = json_decode($response->body); + } + else + { + return 'Invalid or empty response body.'; + } + + // check if GetBible returned an error object + if (isset($error->Error)) + { + // error object found, extract message and code + $errorMessage = isset($error->Error->Message) ? $error->Error->Message : 'Unknown error.'; + $errorCode = isset($error->Error->Code) ? $error->Error->Code : 'Unknown error code.'; + + // return formatted error message + return 'Wasabi Error: ' . $errorMessage . ' Code: ' . $errorCode; + } + + return 'No error information found in response.'; + } \ No newline at end of file diff --git a/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/settings.json b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/settings.json new file mode 100644 index 0000000..8af5228 --- /dev/null +++ b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "c99e85a0-d120-4f25-bcbf-0940dd7b773b", + "implements": null, + "load_selection": null, + "name": "Response", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Utilities.Response", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Utilities.Response", + "description": "The GetBible Response\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\CMS\\Http\\Response as JoomlaResponse;", + "composer": "" +} \ No newline at end of file diff --git a/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/README.md b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/README.md new file mode 100644 index 0000000..65f4979 --- /dev/null +++ b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Uri (Details) +> namespace: **VDM\Joomla\GetBible\Utilities** +```uml +@startuml +class Uri << (F,LightGreen) >> #Green { + # Config $config + + __construct(Config $config) + + get(string $path) : JoomlaUri +} + +note right of Uri::__construct + Constructor + + since: 3.2.0 +end note + +note right of Uri::get + Method to build and return a full request URL for the request. + + since: 3.2.0 + return: JoomlaUri +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.php b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.php new file mode 100644 index 0000000..848bf47 --- /dev/null +++ b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.php @@ -0,0 +1,63 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Utilities; + + +use Joomla\Uri\Uri as JoomlaUri; +use VDM\Joomla\GetBible\Config; + + +/** + * The GetBible Uri + * + * @since 3.2.0 + */ +final class Uri +{ + /** + * The Config class + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Constructor + * + * @param Config $config The config class. + * + * @since 3.2.0 + **/ + public function __construct(Config $config) + { + // set the API config + $this->config = $config; + } + + /** + * Method to build and return a full request URL for the request. + * + * @param string $path URL to inflect + * + * @return JoomlaUri + * @since 3.2.0 + **/ + public function get(string $path): JoomlaUri + { + // Get a new Uri object focusing the api url and given path. + $uri = new JoomlaUri($this->config->endpoint . $path); + + return $uri; + } +} + diff --git a/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.power b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.power new file mode 100644 index 0000000..1eb5f02 --- /dev/null +++ b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.power @@ -0,0 +1,36 @@ + /** + * The Config class + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Constructor + * + * @param Config $config The config class. + * + * @since 3.2.0 + **/ + public function __construct(Config $config) + { + // set the API config + $this->config = $config; + } + + /** + * Method to build and return a full request URL for the request. + * + * @param string $path URL to inflect + * + * @return JoomlaUri + * @since 3.2.0 + **/ + public function get(string $path): JoomlaUri + { + // Get a new Uri object focusing the api url and given path. + $uri = new JoomlaUri($this->config->endpoint . $path); + + return $uri; + } \ No newline at end of file diff --git a/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/settings.json b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/settings.json new file mode 100644 index 0000000..c988ff7 --- /dev/null +++ b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/settings.json @@ -0,0 +1,23 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb", + "implements": null, + "load_selection": null, + "name": "Uri", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Utilities.Uri", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "71075f03-4e77-4fc0-840a-ef55fd9260b2", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Utilities.Uri", + "description": "The GetBible Uri\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\Uri\\Uri as JoomlaUri;", + "composer": "" +} \ No newline at end of file diff --git a/super-powers.json b/super-powers.json new file mode 100644 index 0000000..fc7d66a --- /dev/null +++ b/super-powers.json @@ -0,0 +1,145 @@ +{ + "11892cfa-374e-4e3f-b0bc-531871c822d9": { + "name": "Factory", + "type": "abstract class", + "namespace": "VDM\\Joomla\\GetBible", + "code": "src\/11892cfa-374e-4e3f-b0bc-531871c822d9\/code.php", + "power": "src\/11892cfa-374e-4e3f-b0bc-531871c822d9\/code.power", + "settings": "src\/11892cfa-374e-4e3f-b0bc-531871c822d9\/settings.json", + "path": "src\/11892cfa-374e-4e3f-b0bc-531871c822d9", + "spk": "Super__11892cfa_374e_4e3f_b0bc_531871c822d9__Power", + "guid": "11892cfa-374e-4e3f-b0bc-531871c822d9" + }, + "491c91ce-6355-40d3-bbbd-622473c6c026": { + "name": "Books", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible\\Api", + "code": "src\/491c91ce-6355-40d3-bbbd-622473c6c026\/code.php", + "power": "src\/491c91ce-6355-40d3-bbbd-622473c6c026\/code.power", + "settings": "src\/491c91ce-6355-40d3-bbbd-622473c6c026\/settings.json", + "path": "src\/491c91ce-6355-40d3-bbbd-622473c6c026", + "spk": "Super__491c91ce_6355_40d3_bbbd_622473c6c026__Power", + "guid": "491c91ce-6355-40d3-bbbd-622473c6c026" + }, + "56465044-94ed-4e00-b6db-160c67163df8": { + "name": "App", + "type": "class", + "namespace": "VDM\\Joomla\\GetBible\\Service", + "code": "src\/56465044-94ed-4e00-b6db-160c67163df8\/code.php", + "power": "src\/56465044-94ed-4e00-b6db-160c67163df8\/code.power", + "settings": "src\/56465044-94ed-4e00-b6db-160c67163df8\/settings.json", + "path": "src\/56465044-94ed-4e00-b6db-160c67163df8", + "spk": "Super__56465044_94ed_4e00_b6db_160c67163df8__Power", + "guid": "56465044-94ed-4e00-b6db-160c67163df8" + }, + "71075f03-4e77-4fc0-840a-ef55fd9260b2": { + "name": "Config", + "type": "class", + "namespace": "VDM\\Joomla\\GetBible", + "code": "src\/71075f03-4e77-4fc0-840a-ef55fd9260b2\/code.php", + "power": "src\/71075f03-4e77-4fc0-840a-ef55fd9260b2\/code.power", + "settings": "src\/71075f03-4e77-4fc0-840a-ef55fd9260b2\/settings.json", + "path": "src\/71075f03-4e77-4fc0-840a-ef55fd9260b2", + "spk": "Super__71075f03_4e77_4fc0_840a_ef55fd9260b2__Power", + "guid": "71075f03-4e77-4fc0-840a-ef55fd9260b2" + }, + "7b490e63-8d1f-46de-a0c4-154272fd5d7f": { + "name": "Api", + "type": "abstract class", + "namespace": "VDM\\Joomla\\GetBible\\Abstraction", + "code": "src\/7b490e63-8d1f-46de-a0c4-154272fd5d7f\/code.php", + "power": "src\/7b490e63-8d1f-46de-a0c4-154272fd5d7f\/code.power", + "settings": "src\/7b490e63-8d1f-46de-a0c4-154272fd5d7f\/settings.json", + "path": "src\/7b490e63-8d1f-46de-a0c4-154272fd5d7f", + "spk": "Super__7b490e63_8d1f_46de_a0c4_154272fd5d7f__Power", + "guid": "7b490e63-8d1f-46de-a0c4-154272fd5d7f" + }, + "a752e4b2-9b5e-4188-8d33-3799c46d5119": { + "name": "Chapters", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible\\Api", + "code": "src\/a752e4b2-9b5e-4188-8d33-3799c46d5119\/code.php", + "power": "src\/a752e4b2-9b5e-4188-8d33-3799c46d5119\/code.power", + "settings": "src\/a752e4b2-9b5e-4188-8d33-3799c46d5119\/settings.json", + "path": "src\/a752e4b2-9b5e-4188-8d33-3799c46d5119", + "spk": "Super__a752e4b2_9b5e_4188_8d33_3799c46d5119__Power", + "guid": "a752e4b2-9b5e-4188-8d33-3799c46d5119" + }, + "afa508bf-78f8-4616-97cc-f2809584c086": { + "name": "Verses", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible\\Api", + "code": "src\/afa508bf-78f8-4616-97cc-f2809584c086\/code.php", + "power": "src\/afa508bf-78f8-4616-97cc-f2809584c086\/code.power", + "settings": "src\/afa508bf-78f8-4616-97cc-f2809584c086\/settings.json", + "path": "src\/afa508bf-78f8-4616-97cc-f2809584c086", + "spk": "Super__afa508bf_78f8_4616_97cc_f2809584c086__Power", + "guid": "afa508bf-78f8-4616-97cc-f2809584c086" + }, + "b32eea04-6b9c-469d-94db-35d610686cf1": { + "name": "Api", + "type": "class", + "namespace": "VDM\\Joomla\\GetBible\\Service", + "code": "src\/b32eea04-6b9c-469d-94db-35d610686cf1\/code.php", + "power": "src\/b32eea04-6b9c-469d-94db-35d610686cf1\/code.power", + "settings": "src\/b32eea04-6b9c-469d-94db-35d610686cf1\/settings.json", + "path": "src\/b32eea04-6b9c-469d-94db-35d610686cf1", + "spk": "Super__b32eea04_6b9c_469d_94db_35d610686cf1__Power", + "guid": "b32eea04-6b9c-469d-94db-35d610686cf1" + }, + "b89d74ef-c71c-4a58-8455-5dbdfe94027a": { + "name": "Utilities", + "type": "class", + "namespace": "VDM\\Joomla\\GetBible\\Service", + "code": "src\/b89d74ef-c71c-4a58-8455-5dbdfe94027a\/code.php", + "power": "src\/b89d74ef-c71c-4a58-8455-5dbdfe94027a\/code.power", + "settings": "src\/b89d74ef-c71c-4a58-8455-5dbdfe94027a\/settings.json", + "path": "src\/b89d74ef-c71c-4a58-8455-5dbdfe94027a", + "spk": "Super__b89d74ef_c71c_4a58_8455_5dbdfe94027a__Power", + "guid": "b89d74ef-c71c-4a58-8455-5dbdfe94027a" + }, + "b8c66089-735e-4081-825c-8fe36b28e4a6": { + "name": "Http", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible\\Utilities", + "code": "src\/b8c66089-735e-4081-825c-8fe36b28e4a6\/code.php", + "power": "src\/b8c66089-735e-4081-825c-8fe36b28e4a6\/code.power", + "settings": "src\/b8c66089-735e-4081-825c-8fe36b28e4a6\/settings.json", + "path": "src\/b8c66089-735e-4081-825c-8fe36b28e4a6", + "spk": "Super__b8c66089_735e_4081_825c_8fe36b28e4a6__Power", + "guid": "b8c66089-735e-4081-825c-8fe36b28e4a6" + }, + "be0cae8b-4b78-4f59-b97b-9e31ee6f52e0": { + "name": "Translations", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible\\Api", + "code": "src\/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0\/code.php", + "power": "src\/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0\/code.power", + "settings": "src\/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0\/settings.json", + "path": "src\/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0", + "spk": "Super__be0cae8b_4b78_4f59_b97b_9e31ee6f52e0__Power", + "guid": "be0cae8b-4b78-4f59-b97b-9e31ee6f52e0" + }, + "c99e85a0-d120-4f25-bcbf-0940dd7b773b": { + "name": "Response", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible\\Utilities", + "code": "src\/c99e85a0-d120-4f25-bcbf-0940dd7b773b\/code.php", + "power": "src\/c99e85a0-d120-4f25-bcbf-0940dd7b773b\/code.power", + "settings": "src\/c99e85a0-d120-4f25-bcbf-0940dd7b773b\/settings.json", + "path": "src\/c99e85a0-d120-4f25-bcbf-0940dd7b773b", + "spk": "Super__c99e85a0_d120_4f25_bcbf_0940dd7b773b__Power", + "guid": "c99e85a0-d120-4f25-bcbf-0940dd7b773b" + }, + "fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb": { + "name": "Uri", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible\\Utilities", + "code": "src\/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb\/code.php", + "power": "src\/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb\/code.power", + "settings": "src\/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb\/settings.json", + "path": "src\/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb", + "spk": "Super__fc9ab6f0_c31b_4077_bb1c_2dcddd36f6bb__Power", + "guid": "fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb" + } +} \ No newline at end of file