|
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\Exporter; |
|
9
|
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\BatchResultTransfer; |
|
|
|
|
|
|
11
|
|
|
use Generated\Shared\Transfer\FailedResultTransfer; |
|
|
|
|
|
|
12
|
|
|
use SprykerEco\Zed\Econda\Business\Exporter\Writer\File\FileWriterInterface; |
|
13
|
|
|
|
|
14
|
|
|
abstract class AbstractExporter implements ExporterInterface |
|
15
|
|
|
{ |
|
16
|
|
|
/** |
|
17
|
|
|
* @var \SprykerEco\Zed\Econda\Dependency\Plugin\EcondaPluginInterface[] |
|
18
|
|
|
*/ |
|
19
|
|
|
protected $collectorPlugins = []; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* @var \Generated\Shared\Transfer\FailedResultTransfer |
|
23
|
|
|
*/ |
|
24
|
|
|
protected $failedResultTransfer; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* @var \Generated\Shared\Transfer\BatchResultTransfer |
|
28
|
|
|
*/ |
|
29
|
|
|
protected $batchResultTransfer; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @var \SprykerEco\Zed\Econda\Business\Exporter\Writer\File\FileWriterInterface |
|
33
|
|
|
*/ |
|
34
|
|
|
protected $writer; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @var \Spryker\Zed\Touch\Persistence\TouchQueryContainerInterface |
|
38
|
|
|
*/ |
|
39
|
|
|
protected $queryContainer; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @param \SprykerEco\Zed\Econda\Business\Exporter\Writer\File\FileWriterInterface $writer |
|
43
|
|
|
* @param array $collectorPlugins |
|
44
|
|
|
*/ |
|
45
|
|
|
public function __construct( |
|
46
|
|
|
FileWriterInterface $writer, |
|
47
|
|
|
array $collectorPlugins = [] |
|
48
|
|
|
) { |
|
49
|
|
|
$this->writer = $writer; |
|
50
|
|
|
$this->collectorPlugins = $collectorPlugins; |
|
51
|
|
|
$this->failedResultTransfer = new FailedResultTransfer(); |
|
52
|
|
|
$this->batchResultTransfer = new BatchResultTransfer(); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @return \SprykerEco\Zed\Econda\Dependency\Plugin\EcondaPluginInterface[] |
|
57
|
|
|
*/ |
|
58
|
|
|
public function getCollectorPlugins(): EcondaPluginInterface |
|
|
|
|
|
|
59
|
|
|
{ |
|
60
|
|
|
return $this->collectorPlugins; |
|
|
|
|
|
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @param string $type |
|
65
|
|
|
* |
|
66
|
|
|
* @return bool |
|
67
|
|
|
*/ |
|
68
|
|
|
protected function isCollectorRegistered($type): bool |
|
69
|
|
|
{ |
|
70
|
|
|
return array_key_exists($type, $this->collectorPlugins); |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* @param \Generated\Shared\Transfer\BatchResultTransfer $result |
|
75
|
|
|
* |
|
76
|
|
|
* @return void |
|
77
|
|
|
*/ |
|
78
|
|
|
protected function resetResult(BatchResultTransfer $result): void |
|
79
|
|
|
{ |
|
80
|
|
|
$result->setProcessedCount(0); |
|
81
|
|
|
$result->setIsFailed(false); |
|
82
|
|
|
$result->setTotalCount(0); |
|
83
|
|
|
$result->setDeletedCount(0); |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* @return \Generated\Shared\Transfer\BatchResultTransfer |
|
88
|
|
|
*/ |
|
89
|
|
|
protected function createDefaultBatchResultTransfer(): BatchResultTransfer |
|
90
|
|
|
{ |
|
91
|
|
|
$resultBatchTransfer = clone $this->batchResultTransfer; |
|
92
|
|
|
$resultBatchTransfer->setDeletedCount(0); |
|
93
|
|
|
$resultBatchTransfer->setFailedCount(0); |
|
94
|
|
|
|
|
95
|
|
|
return $resultBatchTransfer; |
|
96
|
|
|
} |
|
97
|
|
|
} |
|
98
|
|
|
|
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