Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3/**
4 * SPDX-License-Identifier: EUPL-1.2
5 *
6 * This file is part of icap-flow.
7 *
8 * Licensed under the EUPL, Version 1.2 only (the "Licence");
9 * you may not use this work except in compliance with the Licence.
10 * You may obtain a copy of the Licence at:
11 *
12 *     https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the Licence is distributed on an "AS IS" basis,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 */
18
19declare(strict_types=1);
20
21namespace Ndrstmr\Icap\Transport;
22
23use Ndrstmr\Icap\DTO\IcapResponse;
24
25/**
26 * Optional capability of a {@see TransportSession}: to read a response without keeping it, as
27 * {@see DiscardingTransport} does for a whole exchange.
28 */
29interface DiscardingTransportSession extends TransportSession
30{
31    /**
32     * Like {@see TransportSession::readResponse()}, with a response that is not kept: its body is counted in
33     * {@see IcapResponse::$discardedBodyBytes}. Bytes already read behind the response cause an
34     * {@see \Ndrstmr\Icap\Exception\IcapMalformedResponseException} and end the session, as does a response that is
35     * illegal, cut off or over the budget. `$maxResponseBytes` is the budget for the bytes of the whole response in
36     * place of `Config::getMaxResponseSize()`.
37     */
38    public function readResponseDiscardingBody(int $maxResponseBytes): IcapResponse;
39}