Journal
last analyzed

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 0
cts 0
cp 0
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
addSuccess() 0 1 ?
addFailure() 0 1 ?
1
<?php
2
3
namespace Http\Client\Plugin;
4
5 1
@trigger_error('The '.__NAMESPACE__.'\Journal class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\Journal instead.', E_USER_DEPRECATED);
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
6
7
use Http\Client\Exception;
8
use Psr\Http\Message\RequestInterface;
9
use Psr\Http\Message\ResponseInterface;
10
11
/**
12
 * Records history of http calls.
13
 *
14
 * @author Joel Wurtz <[email protected]>
15
 *
16
 * @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\Journal} instead.
17
 */
18
interface Journal
19
{
20
    /**
21
     * Record a successful call.
22
     *
23
     * @param RequestInterface  $request  Request use to make the call
24
     * @param ResponseInterface $response Response returned by the call
25
     */
26
    public function addSuccess(RequestInterface $request, ResponseInterface $response);
27
28
    /**
29
     * Record a failed call.
30
     *
31
     * @param RequestInterface $request   Request use to make the call
32
     * @param Exception        $exception Exception returned by the call
33
     */
34
    public function addFailure(RequestInterface $request, Exception $exception);
35
}
36