1
0
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:
Awilum
2021-07-26 22:02:00 +03:00
parent 11e09d33b7
commit 1870111fba
2 changed files with 24 additions and 4 deletions

View File

@@ -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;

View 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();
}
}