Completed
Push — feature/configuration ( 48ff2d...765854 )
by Stéphane
53:12 queued 25:50
created

Put::__destruct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
cc 2
eloc 3
nc 2
nop 0
crap 6
1
<?php
2
/**
3
 * This file is part of the bee4/transport package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 *
7
 * @copyright Bee4 2015
8
 * @author  Stephane HULARD <[email protected]>
9
 * @package Bee4\Transport\Message\Request\Http
10
 */
11
12
namespace Bee4\Transport\Message\Request\Http;
13
14
use Bee4\Transport\Message\WithBodyStreamTrait;
15
16
/**
17
 * HTTP POST Request object
18
 * @package Bee4\Transport\Message\Request\Http
19
 */
20
class Put extends HttpRequest
21
{
22
    use WithBodyStreamTrait;
23
24 2
    protected function prepare()
25
    {
26 2
        $this->addOption('method', 'PUT');
27 2
        $this->addOption('body', $this->getBody());
28 2
    }
29
30
    /**
31
     * Handle resource management
32
     */
33
    public function __destruct()
34
    {
35
        if ($this->hasBodyStream()) {
36
            fclose($this->getBody());
37
        }
38
    }
39
}
40