Code Duplication    Length = 14-14 lines in 2 locations

src/Subjects/AbstractSubject.php 1 location

@@ 690-703 (lines=14) @@
687
     *
688
     * @return string The target directory for the artefact export
689
     */
690
    public function getTargetDir()
691
    {
692
693
        // load the status from the registry processor
694
        $status = $this->getRegistryProcessor()->getAttribute(RegistryKeys::STATUS);
695
696
        // query whether or not a target directory (mandatory) has been configured
697
        if (isset($status[RegistryKeys::TARGET_DIRECTORY])) {
698
            return $status[RegistryKeys::TARGET_DIRECTORY];
699
        }
700
701
        // throw an exception if the root category is NOT available
702
        throw new \Exception(sprintf('Can\'t find a target directory in status data for import %s', $this->getSerial()));
703
    }
704
705
    /**
706
     * Register the passed observer with the specific type.

src/Plugins/AbstractPlugin.php 1 location

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