Liker::disliked()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Osnova\Services\Timeline;
4
5
class Liker extends Author
6
{
7
    /**
8
     * Get like sign.
9
     * "1" means that user liked entity, "-1" - disliked.
10
     *
11
     * @return int
12
     */
13
    public function getSign()
14
    {
15
        return intval($this->getData('sign'));
16
    }
17
18
    /**
19
     * Determines whether the user liked entity.
20
     *
21
     * @return bool
22
     */
23
    public function liked()
24
    {
25
        return $this->getSign() === 1;
26
    }
27
28
    /**
29
     * Determines whether the user disliked entity.
30
     *
31
     * @return bool
32
     */
33
    public function disliked()
34
    {
35
        return $this->getSign() === -1;
36
    }
37
}
38