Code Duplication    Length = 23-23 lines in 2 locations

src/Plugins/MissingOptionValuesPlugin.php 1 location

@@ 246-268 (lines=23) @@
243
     * @return void
244
     * @uses \TechDivision\Import\Product\Subjects\BunchSubject::getLastEntityId()
245
     */
246
    public function addArtefacts($type, array $artefacts, $override = true)
247
    {
248
249
        // query whether or not, any artefacts are available
250
        if (sizeof($artefacts) === 0) {
251
            return;
252
        }
253
254
        // serialize the original data, if we're in debug mode
255
        $keys = array_keys($artefacts);
256
        foreach ($keys as $key) {
257
            if (isset($artefacts[$key][ColumnKeys::ORIGINAL_DATA])) {
258
                $artefacts[$key][ColumnKeys::ORIGINAL_DATA] = $this->isDebugMode() ? serialize($artefacts[$key][ColumnKeys::ORIGINAL_DATA]) : null;
259
            }
260
        }
261
262
        // query whether or not, existing artefacts has to be overwritten
263
        if ($override === true) {
264
            $this->overrideArtefacts($type, $artefacts);
265
        } else {
266
            $this->appendArtefacts($type, $artefacts);
267
        }
268
    }
269
270
    /**
271
     * Add the passed product type artefacts to the product with the

src/Subjects/ExportableTrait.php 1 location

@@ 91-113 (lines=23) @@
88
     * @return void
89
     * @uses \TechDivision\Import\Product\Subjects\BunchSubject::getLastEntityId()
90
     */
91
    public function addArtefacts($type, array $artefacts, $override = true)
92
    {
93
94
        // query whether or not, any artefacts are available
95
        if (sizeof($artefacts) === 0) {
96
            return;
97
        }
98
99
        // serialize the original data, if we're in debug mode
100
        $keys = array_keys($artefacts);
101
        foreach ($keys as $key) {
102
            if (isset($artefacts[$key][ColumnKeys::ORIGINAL_DATA])) {
103
                $artefacts[$key][ColumnKeys::ORIGINAL_DATA] = $this->isDebugMode() ? serialize($artefacts[$key][ColumnKeys::ORIGINAL_DATA]) : null;
104
            }
105
        }
106
107
        // query whether or not, existing artefacts has to be overwritten
108
        if ($override === true) {
109
            $this->overrideArtefacts($type, $artefacts);
110
        } else {
111
            $this->appendArtefacts($type, $artefacts);
112
        }
113
    }
114
115
    /**
116
     * Add the passed product type artefacts to the product with the