Code Duplication    Length = 20-26 lines in 2 locations

src/Plugins/ExportableTrait.php 1 location

@@ 74-93 (lines=20) @@
71
     *
72
     * @return void
73
     */
74
    public function export($timestamp, $counter)
75
    {
76
77
        // export the artefacts
78
        $this->getExportAdapter()->export($this->getArtefacts(), $this->getTargetDir(), $timestamp, $counter);
79
80
        // initialize the array with the status
81
        $status = array();
82
83
        // add the exported artefacts to the status
84
        foreach ($this->getExportAdapter()->getExportedFilenames() as $filename) {
85
            $status[$filename] = array();
86
        }
87
88
        // update status for the exported files
89
        $this->getRegistryProcessor()->mergeAttributesRecursive(RegistryKeys::STATUS, array(RegistryKeys::FILES => $status));
90
91
        // reset the artefacts
92
        $this->resetArtefacts();
93
    }
94
95
    /**
96
     * Set's the exporter adapter instance.

src/Subjects/ExportableTrait.php 1 location

@@ 237-262 (lines=26) @@
234
     *
235
     * @return void
236
     */
237
    public function export($timestamp, $counter)
238
    {
239
240
        // export the artefacts
241
        $this->getExportAdapter()->export($this->getArtefacts(), $this->getTargetDir(), $timestamp, $counter);
242
243
        // initialize the array with the status
244
        $status = array();
245
246
        // add the exported artefacts to the status
247
        foreach ($this->getExportAdapter()->getExportedFilenames() as $filename) {
248
            $status[$filename] = array();
249
        }
250
251
        // merge the status
252
        $this->mergeStatus(
253
            array(
254
                RegistryKeys::STATUS => array(
255
                    RegistryKeys::FILES => $status
256
                )
257
            )
258
        );
259
260
        // reset the artefacts
261
        $this->resetArtefacts();
262
    }
263
264
    /**
265
     * Set's the exporter adapter instance.