1<?php
2/**
3 * This file is part of the FreeDSx LDAP package.
4 *
5 * (c) Chad Sikorra <Chad.Sikorra@gmail.com>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10
11namespace FreeDSx\Ldap\Protocol\ClientProtocolHandler;
12
13use FreeDSx\Ldap\Protocol\LdapMessageResponse;
14
15/**
16 * Logic for handling an unbind operation.
17 *
18 * @author Chad Sikorra <Chad.Sikorra@gmail.com>
19 */
20class ClientUnbindHandler implements RequestHandlerInterface
21{
22    use MessageCreationTrait;
23
24    /**
25     * {@inheritDoc}
26     */
27    public function handleRequest(ClientProtocolContext $context): ?LdapMessageResponse
28    {
29        $queue = $context->getQueue();
30        $message = $context->messageToSend();
31        $queue->sendMessage($message);
32        $queue->close();
33
34        return null;
35    }
36}
37