mirror of
https://github.com/flextype/flextype.git
synced 2025-08-08 06:06:45 +02:00
feat(actions): update Actions API and add AcationsHelper #549
This commit is contained in:
@@ -22,9 +22,9 @@ class Actions extends Arrays
|
||||
private static ?Actions $instance = null;
|
||||
|
||||
/**
|
||||
* Actions storage
|
||||
* Actions registry
|
||||
*/
|
||||
private static ?Arrays $storage = null;
|
||||
private static ?Arrays $registry = null;
|
||||
|
||||
/**
|
||||
* Gets the instance via lazy initialization (created on first usage)
|
||||
@@ -35,8 +35,8 @@ class Actions extends Arrays
|
||||
static::$instance = new self();
|
||||
}
|
||||
|
||||
if (static::$storage === null) {
|
||||
static::$storage = new Arrays();
|
||||
if (static::$registry === null) {
|
||||
static::$registry = new Arrays();
|
||||
}
|
||||
|
||||
return static::$instance;
|
||||
|
20
src/flextype/Foundation/Helpers/ActionsHelper.php
Normal file
20
src/flextype/Foundation/Helpers/ActionsHelper.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Flextype (https://flextype.org)
|
||||
* Founded by Sergey Romanenko and maintained by Flextype Community.
|
||||
*/
|
||||
|
||||
use Flextype\Foundation\Actions;
|
||||
|
||||
if (! function_exists('actions')) {
|
||||
/**
|
||||
* Get the available Flextype instance.
|
||||
*/
|
||||
function actions()
|
||||
{
|
||||
return Actions::getInstance();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user