Completed
Push — master ( bd326e...3b0d07 )
by Paweł
12:10 queued 06:38
created

VersionDecorator::addVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of the PHP SDK library for the Superdesk Content API.
5
 *
6
 * Copyright 2015 Sourcefabric z.u. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2015 Sourcefabric z.ú.
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace Superdesk\ContentApiSdk\Api\Request;
16
17
use Superdesk\ContentApiSdk\ContentApiSdk;
18
19
/**
20
 * Version decorator for API request.
21
 */
22
class VersionDecorator extends RequestDecorator
23
{
24
    /**
25
     * Adds version to request uri.
26
     *
27
     * @return self
28
     */
29
    public function addVersion()
30
    {
31
        $this->setUri(sprintf('%s/%s', ContentApiSdk::getVersionURL(), ltrim($this->getUri(), '/')));
32
33
        return $this;
34
    }
35
}
36