DateConverterTestDouble::getTotalEnglishDays()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 3
rs 10
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