Visits::getUnChecked()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php namespace jlourenco\base\Models;
2
3
use Illuminate\Database\Eloquent\Model;
4
use jlourenco\base\Repositories\LogRepositoryInterface;
5
use jlourenco\support\Traits\Creation;
6
7
class Visits extends Model
8
{
9
10
    /**
11
     * {@inheritDoc}
12
     */
13
    protected $table = 'Visits';
14
15
    /**
16
     * {@inheritDoc}
17
     */
18
    protected $fillable = [
19
        'ip',
20
        'url',
21
        'browser',
22
    ];
23
24
    public function getUnChecked()
25
    {
26
        return $this->where('checked', 0)
0 ignored issues
show
Documentation Bug introduced by
The method where does not exist on object<jlourenco\base\Models\Visits>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
27
            ->get();
28
    }
29
30
}