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

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