![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/vendor/litesaml/lightsaml/src/Context/Profile/Helper/ |
<?php namespace LightSaml\Context\Profile\Helper; use LightSaml\Action\ActionInterface; use LightSaml\Context\ContextInterface; use LightSaml\Context\Profile\ProfileContext; abstract class LogHelper { /** * @param array $extraData * * @return array */ public static function getActionContext(ContextInterface $context, ActionInterface $action, array $extraData = null) { return self::getContext($context, $action, $extraData, false); } /** * @param array $extraData * * @return array */ public static function getActionErrorContext(ContextInterface $context, ActionInterface $action, array $extraData = null) { return self::getContext($context, $action, $extraData, true); } /** * @param ActionInterface $action * @param array $extraData * @param bool $logWholeContext * * @return array */ private static function getContext(ContextInterface $context, ActionInterface $action = null, array $extraData = null, $logWholeContext = false) { $topContext = $context->getTopParent(); $result = []; if ($topContext instanceof ProfileContext) { $result['profile_id'] = $topContext->getProfileId(); $result['own_role'] = $topContext->getOwnRole(); } if ($action) { $result['action'] = get_class($action); } $result['top_context_id'] = spl_object_hash($topContext); if ($logWholeContext) { $result['top_context'] = $topContext; } if ($extraData) { $result = array_merge($result, $extraData); } return $result; } }