Passed
Push — master ( 2a90e7...a622eb )
by Ron
02:27 queued 14s
created

GetTechTipStats::getTipsInLastDays()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
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 1
dl 0
loc 5
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
class GetTechTipStats
12
{
13 2
    public function getTipsInLastDays($numDays = 30)
14
    {
15 2
        $tips = TechTips::where('created_at', '>', Carbon::now()->subDays($numDays))->count();
16 2
        Log::debug('Retrieved new Tech Tip count for last '.$numDays.' days.  Count - $tips');
17 2
        return $tips;
18
    }
19
20 2
    public function getTotalTechTipCount()
21
    {
22 2
        $tipsTotal = TechTips::all()->count();
23 2
        Log::debug('Retrieved total Tech Tip count.  Count - $tips');
24 2
        return $tipsTotal;
25
    }
26
}
27