MoslemPray::getFacadeRoot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Ianrizky\MoslemPray\Facades;
4
5
use Ianrizky\MoslemPray\Manager;
6
use Ianrizky\MoslemPray\MoslemPray as BaseClass;
7
use Illuminate\Support\Facades\Facade as BaseFacade;
8
9
/**
10
 * @method static \Ianrizky\MoslemPray\Drivers\MyQuran myquran() Create an instance of the PrayerTimes driver.
11
 * @method static \Ianrizky\MoslemPray\Contracts\Response\HasPrayerTime getPrayerTime(mixed $city, \Illuminate\Support\Carbon|string|null $date = null) Return prayer time based on the given city and date.
12
 * @method static \Ianrizky\MoslemPray\Contracts\Response\HasPrayerTimeCollection getPrayerTimePerMonth(mixed $city, \Illuminate\Support\Carbon|string|int|null $year = null, int|null $month = null) Return list of prayer time based on the given city and month.
13
 *
14
 * @see \Ianrizky\MoslemPray\Manager
15
 */
16
class MoslemPray extends BaseFacade
17
{
18
    /**
19
     * {@inheritDoc}
20
     */
21
    protected static function getFacadeAccessor(): string
22
    {
23
        return Manager::class;
24
    }
25
26
    /**
27
     * {@inheritDoc}
28
     */
29
    public static function getFacadeRoot(): Manager
30
    {
31
        return parent::getFacadeRoot();
32
    }
33
34
    /**
35
     * {@inheritDoc}
36
     */
37
    public static function __callStatic($method, $args)
38
    {
39
        if (BaseClass::isDriverAvailable($method)) {
40
            return static::getFacadeRoot()->driver($method);
41
        }
42
43
        return parent::__callStatic($method, $args);
44
    }
45
}
46