1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* MIT License |
5
|
|
|
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace SprykerEco\Zed\Econda\Business\Model; |
9
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\LocaleTransfer; |
|
|
|
|
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* @deprecated Must be refactored into a Transfer object instead. |
14
|
|
|
*/ |
15
|
|
|
class BatchResult implements BatchResultInterface |
|
|
|
|
16
|
|
|
{ |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @var int |
20
|
|
|
*/ |
21
|
|
|
protected $totalCount = 0; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var int |
25
|
|
|
*/ |
26
|
|
|
protected $processedCount = 0; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var int |
30
|
|
|
*/ |
31
|
|
|
protected $fetchedCount = 0; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var int |
35
|
|
|
*/ |
36
|
|
|
protected $successCount = 0; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var \SprykerEco\Zed\Econda\Business\Model\FailedResult[] |
40
|
|
|
*/ |
41
|
|
|
protected $failed = []; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var int |
45
|
|
|
*/ |
46
|
|
|
protected $failedCount = 0; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var int |
50
|
|
|
*/ |
51
|
|
|
protected $deletedCount = 0; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @var bool |
55
|
|
|
*/ |
56
|
|
|
protected $isFailed = false; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @var \Generated\Shared\Transfer\LocaleTransfer|null |
60
|
|
|
*/ |
61
|
|
|
protected $processedLocale = null; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @return int |
65
|
|
|
*/ |
66
|
|
|
public function getFetchedCount() |
67
|
|
|
{ |
68
|
|
|
return $this->fetchedCount; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @param int $fetchedCount |
73
|
|
|
* |
74
|
|
|
* @return void |
75
|
|
|
*/ |
76
|
|
|
public function setFetchedCount($fetchedCount) |
77
|
|
|
{ |
78
|
|
|
$this->fetchedCount = (int)$fetchedCount; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @return int |
83
|
|
|
*/ |
84
|
|
|
public function getProcessedCount() |
85
|
|
|
{ |
86
|
|
|
return $this->processedCount; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @param int $processedCount |
91
|
|
|
* |
92
|
|
|
* @return void |
93
|
|
|
*/ |
94
|
|
|
public function setProcessedCount($processedCount) |
95
|
|
|
{ |
96
|
|
|
$this->processedCount = $processedCount; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @return int |
101
|
|
|
*/ |
102
|
|
|
public function getTotalCount() |
103
|
|
|
{ |
104
|
|
|
return $this->totalCount; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @param int $totalCount |
109
|
|
|
* |
110
|
|
|
* @return void |
111
|
|
|
*/ |
112
|
|
|
public function setTotalCount($totalCount) |
113
|
|
|
{ |
114
|
|
|
$this->totalCount = $totalCount; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @param \SprykerEco\Zed\Econda\Business\Model\FailedResultInterface $failed |
119
|
|
|
* |
120
|
|
|
* @return void |
121
|
|
|
*/ |
122
|
|
|
public function addFailedResult(FailedResultInterface $failed) |
123
|
|
|
{ |
124
|
|
|
$this->failed[] = $failed; |
125
|
|
|
$this->failedCount += $failed->getFailedCount(); |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* @return int |
130
|
|
|
*/ |
131
|
|
|
public function getFailedCount() |
132
|
|
|
{ |
133
|
|
|
return $this->failedCount; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @return int |
138
|
|
|
*/ |
139
|
|
|
public function getSuccessCount() |
140
|
|
|
{ |
141
|
|
|
return $this->totalCount - $this->getFailedCount(); |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @param int $increment |
146
|
|
|
* |
147
|
|
|
* @return void |
148
|
|
|
*/ |
149
|
|
|
public function increaseProcessed($increment = 1) |
150
|
|
|
{ |
151
|
|
|
$this->processedCount += $increment; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* @return bool |
156
|
|
|
*/ |
157
|
|
|
public function isFailed() |
158
|
|
|
{ |
159
|
|
|
return $this->isFailed; |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* @param bool $failed |
164
|
|
|
* |
165
|
|
|
* @return void |
166
|
|
|
*/ |
167
|
|
|
public function setIsFailed($failed = true) |
168
|
|
|
{ |
169
|
|
|
$this->isFailed = $failed; |
170
|
|
|
} |
171
|
|
|
|
172
|
|
|
/** |
173
|
|
|
* @return \Generated\Shared\Transfer\LocaleTransfer|null |
174
|
|
|
*/ |
175
|
|
|
public function getProcessedLocale() |
176
|
|
|
{ |
177
|
|
|
return $this->processedLocale; |
178
|
|
|
} |
179
|
|
|
|
180
|
|
|
/** |
181
|
|
|
* @param \Generated\Shared\Transfer\LocaleTransfer $processedLocale |
182
|
|
|
* |
183
|
|
|
* @return void |
184
|
|
|
*/ |
185
|
|
|
public function setProcessedLocale(LocaleTransfer $processedLocale) |
186
|
|
|
{ |
187
|
|
|
$this->processedLocale = $processedLocale; |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
/** |
191
|
|
|
* @param int $amount |
192
|
|
|
* |
193
|
|
|
* @return void |
194
|
|
|
*/ |
195
|
|
|
public function increaseProcessedCount($amount) |
196
|
|
|
{ |
197
|
|
|
$this->processedCount += $amount; |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* @return int |
202
|
|
|
*/ |
203
|
|
|
public function getDeletedCount() |
204
|
|
|
{ |
205
|
|
|
return $this->deletedCount; |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* @param int $deletedCount |
210
|
|
|
* |
211
|
|
|
* @return void |
212
|
|
|
*/ |
213
|
|
|
public function setDeletedCount($deletedCount) |
214
|
|
|
{ |
215
|
|
|
$this->deletedCount = $deletedCount; |
216
|
|
|
} |
217
|
|
|
|
218
|
|
|
/** |
219
|
|
|
* @param int $amount |
220
|
|
|
* |
221
|
|
|
* @return void |
222
|
|
|
*/ |
223
|
|
|
public function increaseDeletedCount($amount) |
224
|
|
|
{ |
225
|
|
|
$this->deletedCount += $amount; |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
} |
229
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths