From 5e90e5823cb16348a4ede9dbccf573b8fabd11f7 Mon Sep 17 00:00:00 2001 From: aB0t Date: Tue, 26 Mar 2024 19:06:14 +0200 Subject: [PATCH] update 2024-03-26 19:05:48 --- README.md | 53 ++++++++- .../README.md | 99 +++++++++++++++- .../code.php | 106 +++++++++++++++++- .../code.power | 80 ++++++++++++- .../settings.json | 19 +++- super-powers.json | 14 ++- 6 files changed, 365 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 433b69e..b1a008a 100644 --- a/README.md +++ b/README.md @@ -1 +1,52 @@ -###POWERREADME### \ No newline at end of file +``` +███████╗██╗ ██╗██████╗ ███████╗██████╗ +██╔════╝██║ ██║██╔══██╗██╔════╝██╔══██╗ +███████╗██║ ██║██████╔╝█████╗ ██████╔╝ +╚════██║██║ ██║██╔═══╝ ██╔══╝ ██╔══██╗ +███████║╚██████╔╝██║ ███████╗██║ ██║ +╚══════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ ███████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗██╔════╝ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝███████╗ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗╚════██║ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║███████║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝╚══════╝ +``` + +### 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\Psr\Cache](#vdm-psr-cache) + + - **interface CacheItemInterface** | [Details](src/171fcb39-ae27-4c2b-b091-2f70b824288b) | [Code](src/171fcb39-ae27-4c2b-b091-2f70b824288b/code.php) | [Settings](src/171fcb39-ae27-4c2b-b091-2f70b824288b/settings.json) | Super__171fcb39_ae27_4c2b_b091_2f70b824288b__Power + +--- +``` + ██╗ ██████╗ ██████╗ ███╗ ███╗██╗ █████╗ + ██║██╔═══██╗██╔═══██╗████╗ ████║██║ ██╔══██╗ + ██║██║ ██║██║ ██║██╔████╔██║██║ ███████║ +██ ██║██║ ██║██║ ██║██║╚██╔╝██║██║ ██╔══██║ +╚█████╔╝╚██████╔╝╚██████╔╝██║ ╚═╝ ██║███████╗██║ ██║ + ╚════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ + ██████╗ ██████╗ ███╗ ███╗██████╗ ██████╗ ███╗ ██╗███████╗███╗ ██╗████████╗ +██╔════╝██╔═══██╗████╗ ████║██╔══██╗██╔═══██╗████╗ ██║██╔════╝████╗ ██║╚══██╔══╝ +██║ ██║ ██║██╔████╔██║██████╔╝██║ ██║██╔██╗ ██║█████╗ ██╔██╗ ██║ ██║ +██║ ██║ ██║██║╚██╔╝██║██╔═══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║╚██╗██║ ██║ +╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚██████╔╝██║ ╚████║███████╗██║ ╚████║ ██║ + ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═══╝ ╚═╝ +██████╗ ██╗ ██╗██╗██╗ ██████╗ ███████╗██████╗ +██╔══██╗██║ ██║██║██║ ██╔══██╗██╔════╝██╔══██╗ +██████╔╝██║ ██║██║██║ ██║ ██║█████╗ ██████╔╝ +██╔══██╗██║ ██║██║██║ ██║ ██║██╔══╝ ██╔══██╗ +██████╔╝╚██████╔╝██║███████╗██████╔╝███████╗██║ ██║ +╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝ ╚══════╝╚═╝ ╚═╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/171fcb39-ae27-4c2b-b091-2f70b824288b/README.md b/src/171fcb39-ae27-4c2b-b091-2f70b824288b/README.md index 433b69e..f3ef7da 100644 --- a/src/171fcb39-ae27-4c2b-b091-2f70b824288b/README.md +++ b/src/171fcb39-ae27-4c2b-b091-2f70b824288b/README.md @@ -1 +1,98 @@ -###POWERREADME### \ No newline at end of file +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface CacheItemInterface (Details) +> namespace: **VDM\Psr\Cache** +```uml +@startuml +interface CacheItemInterface #Lavender { + + getKey() : string + + get() : mixed + + isHit() : bool + + set(mixed $value) : static + + expiresAt(?\DateTimeInterface $expiration) : static + + expiresAfter(int|\DateInterval|null $time) : static +} + +note right of CacheItemInterface::getKey + Returns the key for the current cache item. +The key is loaded by the Implementing Library, but should be available to +the higher level callers when needed. +The key string for this cache item. + + return: string +end note + +note right of CacheItemInterface::get + Retrieves the value of the item from the cache associated with this object's key. +The value returned must be identical to the value originally stored by set(). +If isHit() returns false, this method MUST return null. Note that null +is a legitimate cached value, so the isHit() method SHOULD be used to +differentiate between "null value was found" and "no value was found." +The value corresponding to this cache item's key, or null if not found. + + return: mixed +end note + +note right of CacheItemInterface::isHit + Confirms if the cache item lookup resulted in a cache hit. +Note: This method MUST NOT have a race condition between calling isHit() +and calling get(). +True if the request resulted in a cache hit. False otherwise. + + return: bool +end note + +note right of CacheItemInterface::set + Sets the value represented by this cache item. +The $value argument may be any item that can be serialized by PHP, +although the method of serialization is left up to the Implementing +Library. +The serializable value to be stored. +The invoked object. + + return: static +end note + +note right of CacheItemInterface::expiresAt + Sets the expiration time for this cache item. +The point in time after which the item MUST be considered expired. +If null is passed explicitly, a default value MAY be used. If none is set, +the value should be stored permanently or for as long as the +implementation allows. +The called object. + + return: static +end note + +note right of CacheItemInterface::expiresAfter + Sets the expiration time for this cache item. +The period of time from the present after which the item MUST be considered +expired. An integer parameter is understood to be the time in seconds until +expiration. If null is passed explicitly, a default value MAY be used. +If none is set, the value should be stored permanently or for as long as the +implementation allows. +The called object. + + return: static +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/171fcb39-ae27-4c2b-b091-2f70b824288b/code.php b/src/171fcb39-ae27-4c2b-b091-2f70b824288b/code.php index 8aad235..458e1db 100644 --- a/src/171fcb39-ae27-4c2b-b091-2f70b824288b/code.php +++ b/src/171fcb39-ae27-4c2b-b091-2f70b824288b/code.php @@ -7,4 +7,108 @@ * @git Caching Interface * @license MIT */ -###POWERCODE### +namespace VDM\Psr\Cache; + + +/** + * CacheItemInterface defines an interface for interacting with objects inside a cache. + * + * Each Item object MUST be associated with a specific key, which can be set + * according to the implementing system and is typically passed by the + * Cache\CacheItemPoolInterface object. + * + * The Cache\CacheItemInterface object encapsulates the storage and retrieval of + * cache items. Each Cache\CacheItemInterface is generated by a + * Cache\CacheItemPoolInterface object, which is responsible for any required + * setup as well as associating the object with a unique Key. + * Cache\CacheItemInterface objects MUST be able to store and retrieve any type + * of PHP value defined in the Data section of the specification. + * + * Calling Libraries MUST NOT instantiate Item objects themselves. They may only + * be requested from a Pool object via the getItem() method. Calling Libraries + * SHOULD NOT assume that an Item created by one Implementing Library is + * compatible with a Pool from another Implementing Library. + */ +interface CacheItemInterface +{ + /** + * Returns the key for the current cache item. + * + * The key is loaded by the Implementing Library, but should be available to + * the higher level callers when needed. + * + * @return string + * The key string for this cache item. + */ + public function getKey(): string; + + /** + * Retrieves the value of the item from the cache associated with this object's key. + * + * The value returned must be identical to the value originally stored by set(). + * + * If isHit() returns false, this method MUST return null. Note that null + * is a legitimate cached value, so the isHit() method SHOULD be used to + * differentiate between "null value was found" and "no value was found." + * + * @return mixed + * The value corresponding to this cache item's key, or null if not found. + */ + public function get(): mixed; + + /** + * Confirms if the cache item lookup resulted in a cache hit. + * + * Note: This method MUST NOT have a race condition between calling isHit() + * and calling get(). + * + * @return bool + * True if the request resulted in a cache hit. False otherwise. + */ + public function isHit(): bool; + + /** + * Sets the value represented by this cache item. + * + * The $value argument may be any item that can be serialized by PHP, + * although the method of serialization is left up to the Implementing + * Library. + * + * @param mixed $value + * The serializable value to be stored. + * + * @return static + * The invoked object. + */ + public function set(mixed $value): static; + + /** + * Sets the expiration time for this cache item. + * + * @param ?\DateTimeInterface $expiration + * The point in time after which the item MUST be considered expired. + * If null is passed explicitly, a default value MAY be used. If none is set, + * the value should be stored permanently or for as long as the + * implementation allows. + * + * @return static + * The called object. + */ + public function expiresAt(?\DateTimeInterface $expiration): static; + + /** + * Sets the expiration time for this cache item. + * + * @param int|\DateInterval|null $time + * The period of time from the present after which the item MUST be considered + * expired. An integer parameter is understood to be the time in seconds until + * expiration. If null is passed explicitly, a default value MAY be used. + * If none is set, the value should be stored permanently or for as long as the + * implementation allows. + * + * @return static + * The called object. + */ + public function expiresAfter(int|\DateInterval|null $time): static; +} + diff --git a/src/171fcb39-ae27-4c2b-b091-2f70b824288b/code.power b/src/171fcb39-ae27-4c2b-b091-2f70b824288b/code.power index 69309b0..f3097c9 100644 --- a/src/171fcb39-ae27-4c2b-b091-2f70b824288b/code.power +++ b/src/171fcb39-ae27-4c2b-b091-2f70b824288b/code.power @@ -1 +1,79 @@ -###CODEPOWER### \ No newline at end of file + /** + * Returns the key for the current cache item. + * + * The key is loaded by the Implementing Library, but should be available to + * the higher level callers when needed. + * + * @return string + * The key string for this cache item. + */ + public function getKey(): string; + + /** + * Retrieves the value of the item from the cache associated with this object's key. + * + * The value returned must be identical to the value originally stored by set(). + * + * If isHit() returns false, this method MUST return null. Note that null + * is a legitimate cached value, so the isHit() method SHOULD be used to + * differentiate between "null value was found" and "no value was found." + * + * @return mixed + * The value corresponding to this cache item's key, or null if not found. + */ + public function get(): mixed; + + /** + * Confirms if the cache item lookup resulted in a cache hit. + * + * Note: This method MUST NOT have a race condition between calling isHit() + * and calling get(). + * + * @return bool + * True if the request resulted in a cache hit. False otherwise. + */ + public function isHit(): bool; + + /** + * Sets the value represented by this cache item. + * + * The $value argument may be any item that can be serialized by PHP, + * although the method of serialization is left up to the Implementing + * Library. + * + * @param mixed $value + * The serializable value to be stored. + * + * @return static + * The invoked object. + */ + public function set(mixed $value): static; + + /** + * Sets the expiration time for this cache item. + * + * @param ?\DateTimeInterface $expiration + * The point in time after which the item MUST be considered expired. + * If null is passed explicitly, a default value MAY be used. If none is set, + * the value should be stored permanently or for as long as the + * implementation allows. + * + * @return static + * The called object. + */ + public function expiresAt(?\DateTimeInterface $expiration): static; + + /** + * Sets the expiration time for this cache item. + * + * @param int|\DateInterval|null $time + * The period of time from the present after which the item MUST be considered + * expired. An integer parameter is understood to be the time in seconds until + * expiration. If null is passed explicitly, a default value MAY be used. + * If none is set, the value should be stored permanently or for as long as the + * implementation allows. + * + * @return static + * The called object. + */ + public function expiresAfter(int|\DateInterval|null $time): static; \ No newline at end of file diff --git a/src/171fcb39-ae27-4c2b-b091-2f70b824288b/settings.json b/src/171fcb39-ae27-4c2b-b091-2f70b824288b/settings.json index 6b3b222..8b54ea2 100644 --- a/src/171fcb39-ae27-4c2b-b091-2f70b824288b/settings.json +++ b/src/171fcb39-ae27-4c2b-b091-2f70b824288b/settings.json @@ -1 +1,18 @@ -###POWERLINKER### \ No newline at end of file +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "171fcb39-ae27-4c2b-b091-2f70b824288b", + "implements": null, + "load_selection": null, + "name": "CacheItemInterface", + "power_version": "3.0.0", + "system_name": "Psr.Cache.CacheItemInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Psr\\Cache.CacheItemInterface", + "description": "\/**\r\n * CacheItemInterface defines an interface for interacting with objects inside a cache.\r\n *\r\n * Each Item object MUST be associated with a specific key, which can be set\r\n * according to the implementing system and is typically passed by the\r\n * Cache\\CacheItemPoolInterface object.\r\n *\r\n * The Cache\\CacheItemInterface object encapsulates the storage and retrieval of\r\n * cache items. Each Cache\\CacheItemInterface is generated by a\r\n * Cache\\CacheItemPoolInterface object, which is responsible for any required\r\n * setup as well as associating the object with a unique Key.\r\n * Cache\\CacheItemInterface objects MUST be able to store and retrieve any type\r\n * of PHP value defined in the Data section of the specification.\r\n *\r\n * Calling Libraries MUST NOT instantiate Item objects themselves. They may only\r\n * be requested from a Pool object via the getItem() method. Calling Libraries\r\n * SHOULD NOT assume that an Item created by one Implementing Library is\r\n * compatible with a Pool from another Implementing Library.\r\n *\/", + "licensing_template": "\/**\r\n * @package Common interface for caching libraries\r\n *\r\n * @created Feb 9, 2021\r\n * @author PHP-FIG \r\n * @git Caching Interface \r\n * @license MIT\r\n *\/", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/super-powers.json b/super-powers.json index 18f683b..30bd5b0 100644 --- a/super-powers.json +++ b/super-powers.json @@ -1 +1,13 @@ -###POWERINDEX### \ No newline at end of file +{ + "171fcb39-ae27-4c2b-b091-2f70b824288b": { + "name": "CacheItemInterface", + "type": "interface", + "namespace": "VDM\\Psr\\Cache", + "code": "src\/171fcb39-ae27-4c2b-b091-2f70b824288b\/code.php", + "power": "src\/171fcb39-ae27-4c2b-b091-2f70b824288b\/code.power", + "settings": "src\/171fcb39-ae27-4c2b-b091-2f70b824288b\/settings.json", + "path": "src\/171fcb39-ae27-4c2b-b091-2f70b824288b", + "spk": "Super__171fcb39_ae27_4c2b_b091_2f70b824288b__Power", + "guid": "171fcb39-ae27-4c2b-b091-2f70b824288b" + } +} \ No newline at end of file