Passed
Branch dev5a (b4693d)
by Ron
27:36
created

GetTechTipStats::getTotalTipsCount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
namespace App\Domains\TechTips;
4
5
use Illuminate\Support\Facades\Log;
6
7
use Carbon\Carbon;
8
9
use App\TechTips;
10
11
12
class GetTechTipStats
13
{
14 4
    public function getTipsInLastDays($numDays = 30)
15
    {
16 4
        $tips = TechTips::where('created_at', '>', Carbon::now()->subDays($numDays))->count();
17 4
        Log::debug('Retrieved new Tech Tip count for last '.$numDays.' days.  Count - $tips');
18
19 4
        return $tips;
20
    }
21
22 4
    public function getTotalTipsCount()
23
    {
24 4
        $tipsTotal = TechTips::all()->count();
25 4
        Log::debug('Retrieved total Tech Tip count.  Count - '.$tipsTotal);
26
27 4
        return $tipsTotal;
28
    }
29
}
30