for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
if (!function_exists('context')) {
/**
* Get context.
*
* @param string|null $key
* @param mixed|null $default
* @return \FondBot\Conversation\Context|mixed
*/
function context(string $key = null, $default = null)
{
$context = FondBot\Conversation::instance()->context();
if ($key === null) {
return $context;
}
return optional($context)->getItem($key, $default);