EcondaFacade::exportFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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;
9
10
use Generated\Shared\Transfer\BatchResultTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\BatchResultTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Generated\Shared\Transfer\LocaleTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\LocaleTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Spryker\Zed\Kernel\Business\AbstractFacade;
13
use SprykerEco\Zed\Econda\Business\Exporter\Writer\File\FileWriterInterface;
14
use Symfony\Component\Console\Output\OutputInterface;
15
16
/**
17
 * @method \SprykerEco\Zed\Econda\Business\EcondaBusinessFactory getFactory()
18
 */
19
class EcondaFacade extends AbstractFacade implements EcondaFacadeInterface
20
{
21
    /**
22
     * {@inheritDoc}
23
     *
24
     * @api
25
     *
26
     * @param string $type
27
     * @param string $locale
28
     *
29
     * @return string
30
     */
31
    public function getFileContent($type, $locale): string
32
    {
33
        return $this->getFactory()->createEcondaCsvFileReader()->readFile($type, $locale);
34
    }
35
36
    /**
37
     * {@inheritDoc}
38
     *
39
     * @api
40
     *
41
     * @param \Symfony\Component\Console\Output\OutputInterface $output
42
     *
43
     * @return array
44
     */
45
    public function exportFile(OutputInterface $output): array
46
    {
47
        return $this->getFactory()->createRunner()->runExport($output);
48
    }
49
50
    /**
51
     * {@inheritDoc}
52
     *
53
     * @api
54
     *
55
     * @param \Generated\Shared\Transfer\LocaleTransfer $localeTransfer
56
     * @param \Generated\Shared\Transfer\BatchResultTransfer $result
57
     * @param \SprykerEco\Zed\Econda\Business\Exporter\Writer\File\FileWriterInterface $dataWriter
58
     * @param \Symfony\Component\Console\Output\OutputInterface $output
59
     *
60
     * @return void
61
     */
62
    public function exportCategories(
63
        LocaleTransfer $localeTransfer,
64
        BatchResultTransfer $result,
65
        FileWriterInterface $dataWriter,
66
        OutputInterface $output
67
    ): void {
68
        $this->getFactory()
69
            ->createCategoryCollectorManager()
70
            ->runCollector(
71
                $localeTransfer,
72
                $result,
73
                $dataWriter,
74
                $output
75
            );
76
    }
77
78
    /**
79
     * {@inheritDoc}
80
     *
81
     * @api
82
     *
83
     * @param \Generated\Shared\Transfer\LocaleTransfer $localeTransfer
84
     * @param \Generated\Shared\Transfer\BatchResultTransfer $result
85
     * @param \SprykerEco\Zed\Econda\Business\Exporter\Writer\File\FileWriterInterface $dataWriter
86
     * @param \Symfony\Component\Console\Output\OutputInterface $output
87
     *
88
     * @return void
89
     */
90
    public function exportProducts(
91
        LocaleTransfer $localeTransfer,
92
        BatchResultTransfer $result,
93
        FileWriterInterface $dataWriter,
94
        OutputInterface $output
95
    ): void {
96
        $this->getFactory()
97
            ->createProductCollectorManager()
98
            ->runCollector(
99
                $localeTransfer,
100
                $result,
101
                $dataWriter,
102
                $output
103
            );
104
    }
105
}
106