Passed
Push — master ( 0e85a7...3ec6ca )
by Gabriel
02:46
created

PropertyRecordTrait::getStatus()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace ByTIC\Models\SmartProperties\RecordsTraits\HasStatus;
4
5
use ByTIC\Models\SmartProperties\Properties\AbstractProperty\Generic;
6
7
/**
8
 * Trait PropertyRecordTrait
9
 * @package ByTIC\Models\SmartProperties\RecordsTraits\HasStatus
10
 */
11
trait PropertyRecordTrait
12
{
13
    /**
14
     * @return Generic
15
     */
16
    public function getStatus()
17
    {
18
        return $this->getSmartProperty('Status');
0 ignored issues
show
Bug introduced by
It seems like getSmartProperty() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        return $this->/** @scrutinizer ignore-call */ getSmartProperty('Status');
Loading history...
19
    }
20
21
    /**
22
     * @param $value
23
     */
24
    public function setStatus($value)
25
    {
26
        /** @noinspection PhpUnhandledExceptionInspection */
27
        $this->setSmartProperty('Status', $value);
0 ignored issues
show
Bug introduced by
It seems like setSmartProperty() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        $this->/** @scrutinizer ignore-call */ 
28
               setSmartProperty('Status', $value);
Loading history...
28
    }
29
30
    /**
31
     * @param $status
32
     * @return Generic
33
     */
34
    public function getNewStatus($status)
35
    {
36
        /** @noinspection PhpUnhandledExceptionInspection */
37
        return $this->getNewSmartPropertyFromValue('Status', $status);
0 ignored issues
show
Bug introduced by
It seems like getNewSmartPropertyFromValue() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

37
        return $this->/** @scrutinizer ignore-call */ getNewSmartPropertyFromValue('Status', $status);
Loading history...
38
    }
39
40
    /**
41
     * @param bool $status
42
     * @return bool|void
43
     */
44
    public function updateStatus($status = false)
45
    {
46
        /** @noinspection PhpUnhandledExceptionInspection */
47
        return $this->updateSmartProperty('Status', $status);
0 ignored issues
show
Bug introduced by
It seems like updateSmartProperty() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

47
        return $this->/** @scrutinizer ignore-call */ updateSmartProperty('Status', $status);
Loading history...
48
    }
49
}