Completed
Push — develop ( 86c33f...64265e )
by Mohamed
07:18
created

CountTrait::count()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the Tinyissue package.
5
 *
6
 * (c) Mohamed Alsharaf <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Tinyissue\Model\Traits\Tag;
13
14
use Illuminate\Database\Eloquent;
15
16
/**
17
 * CountTrait is trait class containing the methods for counting database records for the Tag model.
18
 *
19
 * @author Mohamed Alsharaf <[email protected]>
20
 *
21
 * @method Eloquent\Model where($column, $operator = null, $value = null, $boolean = 'and')
22
 */
23
trait CountTrait
24
{
25
    /**
26
     * Count number of tags.
27
     *
28
     * @return int
29
     */
30 2
    public function count()
31
    {
32 2
        return $this->where('group', '=', false)->count();
33
    }
34
}
35