VersionDecorator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A addVersion() 0 6 1
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