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

conedevelopment / bazar / 20693413327

04 Jan 2026 01:11PM UTC coverage: 66.68% (+2.6%) from 64.117%
20693413327

Pull #236

github

web-flow
Merge 3b69d9033 into f6c84deae
Pull Request #236: Discount Rules

213 of 312 new or added lines in 18 files covered. (68.27%)

105 existing lines in 40 files now uncovered.

1627 of 2440 relevant lines covered (66.68%)

18.61 hits per line

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

90.48
/src/Gateway/Manager.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Cone\Bazar\Gateway;
6

7
use Cone\Bazar\Interfaces\Checkoutable;
8
use Cone\Bazar\Interfaces\Gateway\Manager as Contract;
9
use Illuminate\Contracts\Container\Container;
10
use Illuminate\Support\Manager as BaseManager;
11

12
class Manager extends BaseManager implements Contract
13
{
14
    /**
15
     * Create a new manager instance.
16
     */
17
    public function __construct(Container $container)
9✔
18
    {
19
        parent::__construct($container);
9✔
20

21
        $this->drivers['cash'] = $this->createDriver('cash');
9✔
22
        $this->drivers['transfer'] = $this->createDriver('transfer');
9✔
23
    }
24

25
    /**
26
     * Get the default driver name.
27
     */
UNCOV
28
    public function getDefaultDriver(): string
×
29
    {
30
        return $this->config->get('bazar.gateway.default');
×
31
    }
32

33
    /**
34
     * Get the available drivers for the given model.
35
     */
36
    public function getAvailableDrivers(?Checkoutable $model = null): array
1✔
37
    {
38
        foreach (array_keys(array_diff_key($this->customCreators, parent::getDrivers())) as $key) {
1✔
39
            if (! isset($this->drivers[$key])) {
1✔
40
                $this->drivers[$key] = $this->createDriver($key);
1✔
41
            }
42
        }
43

44
        return array_filter(parent::getDrivers(), static function (Driver $driver) use ($model): bool {
1✔
45
            return is_null($model) ? $driver->enabled() : $driver->available($model);
1✔
46
        });
1✔
47
    }
48

49
    /**
50
     * Create the transfer driver.
51
     */
52
    public function createTransferDriver(): TransferDriver
9✔
53
    {
54
        return new TransferDriver(
9✔
55
            $this->config->get('bazar.gateway.drivers.transfer', [])
9✔
56
        );
9✔
57
    }
58

59
    /**
60
     * Create the cash driver.
61
     */
62
    public function createCashDriver(): CashDriver
9✔
63
    {
64
        return new CashDriver(
9✔
65
            $this->config->get('bazar.gateway.drivers.cash', [])
9✔
66
        );
9✔
67
    }
68
}
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