Skip to content

Commit 4034806

Browse files
committed
fix bug CartInterface
1 parent 782a896 commit 4034806

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

depfile.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ layers:
77
- type: className
88
regex: ^Bavix\\.*Legacy$
99

10+
- name: Contract
11+
collectors:
12+
- type: className
13+
regex: ^Bavix\\Wallet\\Interfaces\\.*
14+
1015
- name: UI
1116
collectors:
1217
- type: className
@@ -109,11 +114,18 @@ layers:
109114
regex: ^Illuminate\\Contracts\\Cache\\Repository$
110115

111116
ruleset:
117+
Contract:
118+
- InternalException
119+
- DtoInterface
120+
- UIException
121+
- Model
122+
112123
UI:
113124
- AssemblerDtoInterface # delete as soon as possible
114125
- InternalException
115126
- ServiceInterface
116127
- UIException
128+
- Contract
117129
- Model
118130
- Legacy # delete as soon as possible
119131

@@ -126,15 +138,19 @@ ruleset:
126138
- Config
127139
- Cache
128140

141+
DtoInterface:
142+
- Contract
129143
Dto:
130144
- DtoInterface
145+
- Contract
131146

132147
Model:
133148
- AssemblerDtoInterface
134149
- InternalException
135150
- ServiceInterface
136151
- EloquentModel
137152
- UIException
153+
- Contract
138154
- Legacy
139155
- UI
140156

@@ -159,6 +175,7 @@ ruleset:
159175
- EloquentModel
160176
- DtoInterface
161177
- UIException
178+
- Contract
162179
- Model
163180
Service:
164181
- AssemblerDtoInterface
@@ -168,21 +185,25 @@ ruleset:
168185
- EloquentModel
169186
- DtoInterface
170187
- UIException
188+
- Contract
171189
- Model
172190

173191
AssemblerDtoInterface:
174192
- EloquentModel
175193
- DtoInterface
194+
- Contract
176195
AssemblerDto:
177196
- AssemblerDtoInterface
178197
- ServiceInterface
179198
- EloquentModel
180199
- DtoInterface
200+
- Contract
181201
- Dto
182202

183203
Legacy:
184204
- AssemblerDtoInterface
185205
- ServiceInterface
186206
- DtoInterface
187207
- UIException
208+
- Contract
188209
- Model

src/Interfaces/CartInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
namespace Bavix\Wallet\Interfaces;
66

7-
use Bavix\Wallet\Internal\Dto\BasketDto;
7+
use Bavix\Wallet\Internal\Dto\BasketDtoInterface;
88
use Bavix\Wallet\Internal\Exceptions\CartEmptyException;
99

1010
interface CartInterface
1111
{
1212
/**
1313
* @throws CartEmptyException
1414
*/
15-
public function getBasketDto(): BasketDto;
15+
public function getBasketDto(): BasketDtoInterface;
1616
}

src/Objects/Cart.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Bavix\Wallet\Interfaces\Customer;
1010
use Bavix\Wallet\Interfaces\Product;
1111
use Bavix\Wallet\Internal\Dto\BasketDto;
12+
use Bavix\Wallet\Internal\Dto\BasketDtoInterface;
1213
use Bavix\Wallet\Internal\Dto\ItemDto;
1314
use Bavix\Wallet\Internal\Exceptions\CartEmptyException;
1415
use Bavix\Wallet\Internal\Exceptions\ExceptionInterface;
@@ -113,7 +114,7 @@ public function getQuantity(Product $product): int
113114
/**
114115
* @throws CartEmptyException
115116
*/
116-
public function getBasketDto(): BasketDto
117+
public function getBasketDto(): BasketDtoInterface
117118
{
118119
$items = array_map(
119120
fn (Product $product): ItemDto => new ItemDto($product, $this->getQuantity($product)),

0 commit comments

Comments
 (0)