Skip to content

Commit fbe3f19

Browse files
authored
Merge pull request #1052 from bavix/phpstan-fixes
Refactor PHPDoc comments and improve type hints across multiple interfaces and models
2 parents 77ea7a6 + f4a7c87 commit fbe3f19

38 files changed

+535
-1027
lines changed

.github/workflows/deptrac.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,5 @@ jobs:
6464
- name: Install dependencies
6565
run: composer install --prefer-dist --no-progress
6666

67-
- name: Install deptrac
68-
run: composer req --dev qossmic/deptrac-shim
69-
if: hashFiles('vendor/bin/deptrac') == ''
70-
7167
- name: Run deptrac
7268
run: php vendor/bin/deptrac analyse

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"ramsey/uuid": "^4.0"
3232
},
3333
"require-dev": {
34+
"deptrac/deptrac": "^4.2",
3435
"driftingly/rector-laravel": "^2.0",
3536
"ergebnis/phpstan-rules": "^2.1",
3637
"infection/infection": "~0.27",
@@ -77,7 +78,8 @@
7778
"ecs-fix": "@php vendor/bin/ecs check --fix",
7879
"ecs-cc": "@php vendor/bin/ecs --clear-cache",
7980
"rector": "@php vendor/bin/rector process --dry-run",
80-
"rector-fix": "@php vendor/bin/rector process"
81+
"rector-fix": "@php vendor/bin/rector process",
82+
"deptrac": "@php vendor/bin/deptrac analyse"
8183
},
8284
"extra": {
8385
"laravel": {

deptrac.yaml

Lines changed: 73 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,174 @@
1-
parameters:
1+
deptrac:
22
paths:
33
- ./src
4-
54
layers:
65
- name: Legacy
76
collectors:
8-
- type: className
9-
regex: ^Bavix\\.*\\Objects\\Cart$
7+
- type: classLike
8+
value: ^Bavix\\.*\\Objects\\Cart$
109

1110
- name: Contract
1211
collectors:
13-
- type: className
14-
regex: ^Bavix\\Wallet\\Interfaces\\.*
15-
- type: className
16-
regex: ^Bavix\\Wallet\\External\\Contracts\\.*
17-
- type: className
18-
regex: ^Bavix\\Wallet\\External\\Dto\\.*
12+
- type: classLike
13+
value: ^Bavix\\Wallet\\Interfaces\\.*
14+
- type: classLike
15+
value: ^Bavix\\Wallet\\External\\Contracts\\.*
16+
- type: classLike
17+
value: ^Bavix\\Wallet\\External\\Dto\\.*
1918

2019
- name: Api
2120
collectors:
22-
- type: className
23-
regex: ^Bavix\\Wallet\\External\\Api\\.*Interface$
21+
- type: classLike
22+
value: ^Bavix\\Wallet\\External\\Api\\.*Interface$
2423

2524
- name: ApiQuery
2625
collectors:
27-
- type: className
28-
regex: ^Bavix\\Wallet\\External\\Api\\.*Query$
26+
- type: classLike
27+
value: ^Bavix\\Wallet\\External\\Api\\.*Query$
2928

3029
- name: ApiHandler
3130
collectors:
32-
- type: className
33-
regex: ^Bavix\\Wallet\\External\\Api\\.*Handler$
31+
- type: classLike
32+
value: ^Bavix\\Wallet\\External\\Api\\.*Handler$
3433

3534
- name: UI
3635
collectors:
37-
- type: className
38-
regex: ^Bavix\\.*\\Traits\\.*
36+
- type: classLike
37+
value: ^Bavix\\.*\\Traits\\.*
3938

4039
- name: UIException
4140
collectors:
42-
- type: className
43-
regex: ^Illuminate\\Database\\Eloquent\\ModelNotFoundException$
44-
- type: className
45-
regex: ^Bavix\\Wallet\\Exceptions\\.*
41+
- type: classLike
42+
value: ^Illuminate\\Database\\Eloquent\\ModelNotFoundException$
43+
- type: classLike
44+
value: ^Bavix\\Wallet\\Exceptions\\.*
4645

4746
# internal
4847
- name: InternalException
4948
collectors:
50-
- type: className
51-
regex: ^Bavix\\.*\\Internal\\Exceptions\\.*
49+
- type: classLike
50+
value: ^Bavix\\.*\\Internal\\Exceptions\\.*
5251

5352
- name: InternalListener
5453
collectors:
55-
- type: className
56-
regex: ^Bavix\\.*\\Internal\\Listeners\\.*
54+
- type: classLike
55+
value: ^Bavix\\.*\\Internal\\Listeners\\.*
5756

5857
- name: Event
5958
collectors:
60-
- type: className
61-
regex: ^Bavix\\.*\\Internal\\Events\\.*Event$
59+
- type: classLike
60+
value: ^Bavix\\.*\\Internal\\Events\\.*Event$
6261

6362
- name: EventInterface
6463
collectors:
65-
- type: className
66-
regex: ^Bavix\\.*\\Internal\\Events\\.*EventInterface$
64+
- type: classLike
65+
value: ^Bavix\\.*\\Internal\\Events\\.*EventInterface$
6766

6867
- name: Dto
6968
collectors:
70-
- type: className
71-
regex: ^Bavix\\.*\\Internal\\Dto\\.*Dto$
69+
- type: classLike
70+
value: ^Bavix\\.*\\Internal\\Dto\\.*Dto$
7271

7372
- name: DtoInterface
7473
collectors:
75-
- type: className
76-
regex: ^Bavix\\.*\\Internal\\Dto\\.*DtoInterface$
74+
- type: classLike
75+
value: ^Bavix\\.*\\Internal\\Dto\\.*DtoInterface$
7776

7877
- name: AssemblerDto
7978
collectors:
80-
- type: className
81-
regex: ^Bavix\\.*\\Internal\\Assembler\\.*DtoAssembler$
79+
- type: classLike
80+
value: ^Bavix\\.*\\Internal\\Assembler\\.*DtoAssembler$
8281

8382
- name: AssemblerDtoInterface
8483
collectors:
85-
- type: className
86-
regex: ^Bavix\\.*\\Internal\\Assembler\\.*DtoAssemblerInterface$
84+
- type: classLike
85+
value: ^Bavix\\.*\\Internal\\Assembler\\.*DtoAssemblerInterface$
8786

8887
- name: QueryInterface
8988
collectors:
90-
- type: className
91-
regex: ^Bavix\\.*Internal\\Query\\.*QueryInterface$
89+
- type: classLike
90+
value: ^Bavix\\.*Internal\\Query\\.*QueryInterface$
9291

9392
- name: Query
9493
collectors:
95-
- type: className
96-
regex: ^Bavix\\.*Internal\\Query\\.*Query$
94+
- type: classLike
95+
value: ^Bavix\\.*Internal\\Query\\.*Query$
9796

9897
- name: RepositoryInterface
9998
collectors:
100-
- type: className
101-
regex: ^Bavix\\.*Internal\\Repository\\.*RepositoryInterface$
99+
- type: classLike
100+
value: ^Bavix\\.*Internal\\Repository\\.*RepositoryInterface$
102101

103102
- name: Repository
104103
collectors:
105-
- type: className
106-
regex: ^Bavix\\.*Internal\\Repository\\.*Repository$
104+
- type: classLike
105+
value: ^Bavix\\.*Internal\\Repository\\.*Repository$
107106

108107
- name: Transform
109108
collectors:
110-
- type: className
111-
regex: ^Bavix\\.*Internal\\Transform\\.*DtoTransformer$
109+
- type: classLike
110+
value: ^Bavix\\.*Internal\\Transform\\.*DtoTransformer$
112111

113112
- name: TransformInterface
114113
collectors:
115-
- type: className
116-
regex: ^Bavix\\.*Internal\\Transform\\.*DtoTransformerInterface$
114+
- type: classLike
115+
value: ^Bavix\\.*Internal\\Transform\\.*DtoTransformerInterface$
117116

118117
- name: Infra
119118
collectors:
120-
- type: className
121-
regex: ^Bavix\\.*Internal\\Service\\.*Service$
119+
- type: classLike
120+
value: ^Bavix\\.*Internal\\Service\\.*Service$
122121

123122
- name: ServiceDecorator
124123
collectors:
125-
- type: className
126-
regex: ^Bavix\\.*Decorator\\.*Decorator
124+
- type: classLike
125+
value: ^Bavix\\.*Decorator\\.*Decorator
127126

128127
# contracts
129128
- name: Model
130129
collectors:
131-
- type: className
132-
regex: ^Bavix\\.*Models\\Transaction$
133-
- type: className
134-
regex: ^Bavix\\.*Models\\Transfer$
135-
- type: className
136-
regex: ^Bavix\\.*Models\\Wallet$
130+
- type: classLike
131+
value: ^Bavix\\.*Models\\Transaction$
132+
- type: classLike
133+
value: ^Bavix\\.*Models\\Transfer$
134+
- type: classLike
135+
value: ^Bavix\\.*Models\\Wallet$
137136

138137
- name: Service
139138
collectors:
140-
- type: className
141-
regex: ^Bavix\\.*Services\\.*Service$
139+
- type: classLike
140+
value: ^Bavix\\.*Services\\.*Service$
142141

143142
- name: ServiceInterface
144143
collectors:
145-
- type: className
146-
regex: ^Bavix\\.*Service\\.*ServiceInterface$
147-
- type: className
148-
regex: ^Bavix\\.*Services\\.*ServiceInterface$
144+
- type: classLike
145+
value: ^Bavix\\.*Service\\.*ServiceInterface$
146+
- type: classLike
147+
value: ^Bavix\\.*Services\\.*ServiceInterface$
149148

150149
# framework
151150
- name: EloquentModel
152151
collectors:
153-
- type: className
154-
regex: ^Illuminate\\Database\\Eloquent\\Model$
152+
- type: classLike
153+
value: ^Illuminate\\Database\\Eloquent\\Model$
155154

156155
- name: Config
157156
collectors:
158-
- type: className
159-
regex: ^Illuminate\\Config\\Repository$
157+
- type: classLike
158+
value: ^Illuminate\\Config\\Repository$
160159

161160
- name: Cache
162161
collectors:
163-
- type: className
164-
regex: ^Illuminate\\Contracts\\Cache\\Repository$
162+
- type: classLike
163+
value: ^Illuminate\\Contracts\\Cache\\Repository$
165164

166165
ruleset:
167166
Contract:
168167
- InternalException
169168
- DtoInterface
170169
- UIException
171170
- Model
171+
- EloquentModel
172172

173173
ApiQuery:
174174
- Api
@@ -196,6 +196,7 @@ parameters:
196196
- UIException
197197
- Contract
198198
- Model
199+
- EloquentModel
199200
- Legacy # delete as soon as possible
200201

201202
UIException:

0 commit comments

Comments
 (0)