Code Duplication    Length = 14-14 lines in 2 locations

src/Plugins/AbstractPlugin.php 1 location

@@ 141-154 (lines=14) @@
138
     *
139
     * @return string The target directory for the artefact export
140
     */
141
    public function getTargetDir()
142
    {
143
144
        // load the status from the registry processor
145
        $status = $this->getRegistryProcessor()->getAttribute(RegistryKeys::STATUS);
146
147
        // query whether or not a target directory (mandatory) has been configured
148
        if (isset($status[RegistryKeys::TARGET_DIRECTORY])) {
149
            return $status[RegistryKeys::TARGET_DIRECTORY];
150
        }
151
152
        // throw an exception if the root category is NOT available
153
        throw new \Exception(sprintf('Can\'t find a target directory in status data for import %s', $this->getSerial()));
154
    }
155
156
    /**
157
     * Return's the application instance.

src/Subjects/AbstractSubject.php 1 location

@@ 670-683 (lines=14) @@
667
     *
668
     * @return string The target directory for the artefact export
669
     */
670
    public function getTargetDir()
671
    {
672
673
        // load the status from the registry processor
674
        $status = $this->getRegistryProcessor()->getAttribute(RegistryKeys::STATUS);
675
676
        // query whether or not a target directory (mandatory) has been configured
677
        if (isset($status[RegistryKeys::TARGET_DIRECTORY])) {
678
            return $status[RegistryKeys::TARGET_DIRECTORY];
679
        }
680
681
        // throw an exception if the root category is NOT available
682
        throw new \Exception(sprintf('Can\'t find a target directory in status data for import %s', $this->getSerial()));
683
    }
684
685
    /**
686
     * Register the passed observer with the specific type.