Listing::initializeByObject()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 6
rs 9.4285
c 1
b 0
f 1
ccs 5
cts 5
cp 1
cc 1
eloc 5
nc 1
nop 1
crap 1
1
<?php
2
/*
3
 * Copyright 2015 Alexey Maslov <[email protected]>
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 * http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
namespace alxmsl\Google\AndroidPublisher\InAppProducts;
19
20
use alxmsl\Google\ObjectInitializedInterface;
21
use stdClass;
22
23
/**
24
 * Localized in-app purchase data
25
 * @author alxmsl
26
 */
27
final class Listing implements ObjectInitializedInterface {
28
    /**
29
     * @var string description
30
     */
31
    private $description = '';
32
33
    /**
34
     * @var string title
35
     */
36
    private $title = '';
37
38
    /**
39
     * @return string description
40
     */
41 2
    public function getDescription() {
42 2
        return $this->description;
43
    }
44
45
    /**
46
     * @return string title
47
     */
48 2
    public function getTitle() {
49 2
        return $this->title;
50
    }
51
52
    /**
53
     * @inheritdoc
54
     */
55 1
    public static function initializeByObject(stdClass $Object) {
56 1
        $Instance              = new self();
57 1
        $Instance->description = (string) $Object->description;
58 1
        $Instance->title       = (string) $Object->title;
59 1
        return $Instance;
60
    }
61
}
62