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

conedevelopment / bazar / 20303456369

17 Dec 2025 12:52PM UTC coverage: 64.206% (+0.7%) from 63.48%
20303456369

Pull #235

github

web-flow
Merge b49f7f980 into 090ff8496
Pull Request #235: Coupons & Discounts

176 of 240 new or added lines in 23 files covered. (73.33%)

3 existing lines in 2 files now uncovered.

1087 of 1693 relevant lines covered (64.21%)

16.93 hits per line

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

87.5
/src/Models/Tax.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Cone\Bazar\Models;
6

7
use Cone\Bazar\Interfaces\Models\Tax as Contract;
8
use Cone\Root\Traits\InteractsWithProxy;
9
use Illuminate\Database\Eloquent\Casts\Attribute;
10
use Illuminate\Database\Eloquent\Relations\MorphPivot;
11

12
class Tax extends MorphPivot implements Contract
13
{
14
    use InteractsWithProxy;
15

16
    /**
17
     * The attributes that should have default values.
18
     *
19
     * @var array<string, mixed>
20
     */
21
    protected $attributes = [
22
        'value' => 0,
23
    ];
24

25
    /**
26
     * The attributes that are mass assignable.
27
     *
28
     * @var list<string>
29
     */
30
    protected $fillable = [
31
        'value',
32
    ];
33

34
    /**
35
     * The table associated with the model.
36
     *
37
     * @var string
38
     */
39
    protected $table = 'bazar_taxes';
40

41
    /**
42
     * Get the proxied interface.
43
     */
44
    public static function getProxiedInterface(): string
45
    {
46
        return Contract::class;
1✔
47
    }
48

49
    /**
50
     * {@inheritdoc}
51
     */
52
    public function casts(): array
53
    {
54
        return [
16✔
55
            'value' => 'float',
16✔
56
        ];
16✔
57
    }
58

59
    /**
60
     * Get the formatted value attribute.
61
     */
62
    protected function formattedValue(): Attribute
63
    {
64
        return new Attribute(
1✔
65
            get: fn (): string => $this->format()
1✔
66
        );
1✔
67
    }
68

69
    /**
70
     * Get the formatted tax.
71
     */
72
    public function format(): string
73
    {
NEW
74
        return $this->pivotParent?->checkoutable?->getCurrency()?->format($this->value) ?: '';
×
75
    }
76
}
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