DateConverterTestDouble   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 15
c 2
b 1
f 0
dl 0
loc 43
rs 10
wmc 8

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getTotalEnglishDays() 0 3 1
A getCalendarData() 0 3 1
A getTotalNepaliDays() 0 3 1
A isInRangeNep() 0 8 2
A isLeapYear() 0 3 1
A isInRangeEng() 0 8 2
1
<?php
2
3
namespace Pratiksh\Nepalidate\Tests\Unit\Doubles;
4
5
use Pratiksh\Nepalidate\Services\DateConverter;
6
7
class DateConverterTestDouble extends DateConverter
8
{
9
    // Expose protected methods for testing
10
    public function isInRangeEng($yy, $mm, $dd): bool
11
    {
12
        try {
13
            $this->is_in_range_eng($yy, $mm, $dd);
14
15
            return true;
16
        } catch (\Throwable $th) {
17
            return false;
18
        }
19
    }
20
21
    public function isInRangeNep($yy, $mm, $dd): bool
22
    {
23
        try {
24
            $this->is_in_range_nep($yy, $mm, $dd);
25
26
            return true;
27
        } catch (\Throwable $th) {
28
            return false;
29
        }
30
    }
31
32
    public function isLeapYear($year)
33
    {
34
        return $this->is_leap_year($year);
35
    }
36
37
    public function getTotalEnglishDays($year, $month, $day)
38
    {
39
        return $this->calculateTotalEnglishDays($year, $month, $day);
40
    }
41
42
    public function getTotalNepaliDays($year, $month, $day)
43
    {
44
        return $this->calculateTotalNepaliDays($year, $month, $day);
45
    }
46
47
    public function getCalendarData()
48
    {
49
        return $this->calendarData;
50
    }
51
}
52