• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

conedevelopment / bazar / 20312681017

17 Dec 2025 06:08PM UTC coverage: 63.972% (-0.4%) from 64.395%
20312681017

push

github

iamgergo
wip

2 of 6 new or added lines in 1 file covered. (33.33%)

5 existing lines in 2 files now uncovered.

1092 of 1707 relevant lines covered (63.97%)

18.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

42.86
/src/Bazar.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Cone\Bazar;
6

7
use Cone\Bazar\Enums\Currency;
8
use Illuminate\Support\Facades\Config;
9

10
abstract class Bazar
11
{
12
    /**
13
     * The package version.
14
     *
15
     * @var string
16
     */
17
    public const VERSION = '1.4.0';
18

19
    /**
20
     * The currency in use.
21
     */
22
    protected static ?Currency $currency = null;
23

24
    /**
25
     * Get all the available currencies.
26
     */
27
    public static function getCurrencies(): array
28
    {
UNCOV
29
        $currencies = array_filter(Currency::cases(), static function (Currency $currency): bool {
×
UNCOV
30
            return $currency->available();
×
UNCOV
31
        });
×
32

UNCOV
33
        return array_values($currencies);
×
34
    }
35

36
    /**
37
     * Get the default currency.
38
     */
39
    public static function getDefaultCurrency(): Currency
40
    {
41
        return Currency::tryFrom(Config::get('bazar.currencies.default', 'USD')) ?: Currency::USD;
1✔
42
    }
43

44
    /**
45
     * Get the currency in use.
46
     */
47
    public static function getCurrency(): Currency
48
    {
49
        return static::$currency ??= static::getDefaultCurrency();
86✔
50
    }
51

52
    /**
53
     * Set the currency in use.
54
     */
55
    public static function setCurrency(Currency $currency): void
56
    {
57
        static::$currency = $currency;
1✔
58
    }
59
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc