for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of NodalFlow.
* (c) Fabrice de Stefanis / https://github.com/fab2s/NodalFlow
* This source file is licensed under the MIT license which you will
* find in the LICENSE file or at https://opensource.org/licenses/MIT
*/
namespace fab2s\NodalFlow\Flows;
use fab2s\NodalFlow\NodalFlowException;
/**
* class FlowRegistry
class FlowRegistry
{
* @var array
protected static $registry = [];
* @param string $key
* @param mixed $value
public static function set($key, $value)
if (!isset(static::$registry[$key])) {
throw new NodalFlowException('');
}
static::$registry[$key] = $value;
* @param null|string $key
*
* @return array|mixed|null
public static function &getRef($key = null)
if ($key !== null) {
if (!array_key_exists($key, static::$registry)) {
static::$registry[$key] = null;
return static::$registry[$key];
return static::$registry;