Fact   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 77.78%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 34
ccs 7
cts 9
cp 0.7778
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
A __toString() 0 4 1
A getFact() 0 4 1
1
<?php
2
3
namespace Yandex\Market\Content\Models;
4
5
use Yandex\Common\Model;
6
7
class Fact extends Model
8
{
9
    protected $fact = null;
10
11
    /**
12
     * Constructor
13
     *
14
     * @param array $data
15
     */
16 4
    public function __construct($data)
17
    {
18
        // fix for opinion pro & contra.
19 4
        if (is_string($data)) {
20 2
            $data = ['fact'=>$data];
21
        }
22
23 4
        parent::__construct($data);
24 4
    }
25
26 4
    public function __toString()
27
    {
28 4
        return (string) $this->fact;
29
    }
30
31
    /**
32
     * Retrieve the fact property
33
     *
34
     * @return string|null
35
     */
36
    public function getFact()
37
    {
38
        return $this->fact;
39
    }
40
}
41