Passed
Push — sudav3 ( ac6dc6...d2f44f )
by 世昌
02:12
created

MagicAccessTrait::offsetExists()   A

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 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace suda\orm\struct;
3
4
trait MagicAccessTrait
5
{
6
    public function offsetSet($offset, $value)
7
    {
8
        $this->__set($offset, $value);
0 ignored issues
show
Bug introduced by
It seems like __set() 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

8
        $this->/** @scrutinizer ignore-call */ 
9
               __set($offset, $value);
Loading history...
9
    }
10
11
    public function offsetExists($offset)
12
    {
13
        return $this->__isset($offset);
0 ignored issues
show
Bug introduced by
It seems like __isset() 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

13
        return $this->/** @scrutinizer ignore-call */ __isset($offset);
Loading history...
14
    }
15
16
    public function offsetUnset($offset)
17
    {
18
        $this->__unset($offset);
0 ignored issues
show
Bug introduced by
It seems like __unset() 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
        $this->/** @scrutinizer ignore-call */ 
19
               __unset($offset);
Loading history...
19
    }
20
21
    public function offsetGet($offset)
22
    {
23
        return $this->__get($offset);
0 ignored issues
show
Bug introduced by
It seems like __get() 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

23
        return $this->/** @scrutinizer ignore-call */ __get($offset);
Loading history...
24
    }
25
}
26