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

GetTechTipStats   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 14
ccs 8
cts 8
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTipsInLastDays() 0 5 1
A getTotalTechTipCount() 0 5 1
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