Code Duplication    Length = 14-14 lines in 2 locations

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.

src/Plugins/MissingOptionValuesPlugin.php 1 location

@@ 317-330 (lines=14) @@
314
     *
315
     * @return string The name of the target directory
316
     */
317
    protected function getTargetDir()
318
    {
319
320
        // load the actual status
321
        $status = $this->getRegistryProcessor()->getAttribute(RegistryKeys::STATUS);
322
323
        // query whether or not the configured source directory is available
324
        if (!is_dir($sourceDir = $status[RegistryKeys::SOURCE_DIRECTORY])) {
325
            throw new \Exception(sprintf('Configured source directory %s is not available!', $sourceDir));
326
        }
327
328
        // return the source directory where we want to export to
329
        return $sourceDir;
330
    }
331
}
332