10b3fd2d3SAndreas Gohr<?php 2*dad993c5SAndreas Gohr 30b3fd2d3SAndreas Gohr/** 40b3fd2d3SAndreas Gohr * This file is part of the FreeDSx LDAP package. 50b3fd2d3SAndreas Gohr * 60b3fd2d3SAndreas Gohr * (c) Chad Sikorra <Chad.Sikorra@gmail.com> 70b3fd2d3SAndreas Gohr * 80b3fd2d3SAndreas Gohr * For the full copyright and license information, please view the LICENSE 90b3fd2d3SAndreas Gohr * file that was distributed with this source code. 100b3fd2d3SAndreas Gohr */ 110b3fd2d3SAndreas Gohr 120b3fd2d3SAndreas Gohrnamespace FreeDSx\Ldap\Server; 130b3fd2d3SAndreas Gohr 140b3fd2d3SAndreas Gohruse FreeDSx\Ldap\Control\ControlBag; 150b3fd2d3SAndreas Gohruse FreeDSx\Ldap\Server\Token\TokenInterface; 160b3fd2d3SAndreas Gohr 170b3fd2d3SAndreas Gohr/** 180b3fd2d3SAndreas Gohr * Represents the context of a server request. This includes any controls associated with the request and the token for 190b3fd2d3SAndreas Gohr * authentication details. 200b3fd2d3SAndreas Gohr * 210b3fd2d3SAndreas Gohr * @author Chad Sikorra <Chad.Sikorra@gmail.com> 220b3fd2d3SAndreas Gohr */ 230b3fd2d3SAndreas Gohrclass RequestContext 240b3fd2d3SAndreas Gohr{ 250b3fd2d3SAndreas Gohr /** 260b3fd2d3SAndreas Gohr * @var ControlBag 270b3fd2d3SAndreas Gohr */ 280b3fd2d3SAndreas Gohr protected $controls; 290b3fd2d3SAndreas Gohr 300b3fd2d3SAndreas Gohr /** 310b3fd2d3SAndreas Gohr * @var TokenInterface 320b3fd2d3SAndreas Gohr */ 330b3fd2d3SAndreas Gohr protected $token; 340b3fd2d3SAndreas Gohr 350b3fd2d3SAndreas Gohr /** 360b3fd2d3SAndreas Gohr * @param ControlBag $controls 370b3fd2d3SAndreas Gohr * @param TokenInterface $token 380b3fd2d3SAndreas Gohr */ 390b3fd2d3SAndreas Gohr public function __construct(ControlBag $controls, TokenInterface $token) 400b3fd2d3SAndreas Gohr { 410b3fd2d3SAndreas Gohr $this->controls = $controls; 420b3fd2d3SAndreas Gohr $this->token = $token; 430b3fd2d3SAndreas Gohr } 440b3fd2d3SAndreas Gohr 450b3fd2d3SAndreas Gohr /** 460b3fd2d3SAndreas Gohr * @return ControlBag 470b3fd2d3SAndreas Gohr */ 48*dad993c5SAndreas Gohr public function controls(): ControlBag 490b3fd2d3SAndreas Gohr { 500b3fd2d3SAndreas Gohr return $this->controls; 510b3fd2d3SAndreas Gohr } 520b3fd2d3SAndreas Gohr 530b3fd2d3SAndreas Gohr /** 540b3fd2d3SAndreas Gohr * @return TokenInterface 550b3fd2d3SAndreas Gohr */ 56*dad993c5SAndreas Gohr public function token(): TokenInterface 570b3fd2d3SAndreas Gohr { 580b3fd2d3SAndreas Gohr return $this->token; 590b3fd2d3SAndreas Gohr } 600b3fd2d3SAndreas Gohr} 61