Code Duplication    Length = 14-14 lines in 2 locations

src/Plugins/MissingOptionValuesPlugin.php 1 location

@@ 214-227 (lines=14) @@
211
     *
212
     * @return string The name of the target directory
213
     */
214
    protected function getTargetDir()
215
    {
216
217
        // load the actual status
218
        $status = $this->getRegistryProcessor()->getAttribute(RegistryKeys::STATUS);
219
220
        // query whether or not the configured source directory is available
221
        if (!is_dir($sourceDir = $status[RegistryKeys::SOURCE_DIRECTORY])) {
222
            throw new \Exception(sprintf('Configured source directory %s is not available!', $sourceDir));
223
        }
224
225
        // return the source directory where we want to export to
226
        return $sourceDir;
227
    }
228
}
229

src/Subjects/FileResolver/AbstractFileResolver.php 1 location

@@ 187-200 (lines=14) @@
184
     * @return void
185
     * @throws \Exception Is thrown if the configured source directory is not available
186
     */
187
    protected function initialize($serial)
188
    {
189
190
        // load the actual status
191
        $status = $this->getRegistryProcessor()->getAttribute(RegistryKeys::STATUS);
192
193
        // query whether or not the configured source directory is available
194
        if (!is_dir($sourceDir = $status[RegistryKeys::SOURCE_DIRECTORY])) {
195
            throw new \Exception(sprintf('Configured source directory "%s" is not available!', $sourceDir));
196
        }
197
198
        // set the source directory
199
        $this->setSourceDir($sourceDir);
200
    }
201
202
    /**
203
     * Sets the subject configuration instance.