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

@@ 224-237 (lines=14) @@
221
     *
222
     * @return string The name of the target directory
223
     */
224
    protected function getTargetDir()
225
    {
226
227
        // load the actual status
228
        $status = $this->getRegistryProcessor()->getAttribute(RegistryKeys::STATUS);
229
230
        // query whether or not the configured source directory is available
231
        if (!is_dir($sourceDir = $status[RegistryKeys::SOURCE_DIRECTORY])) {
232
            throw new \Exception(sprintf('Configured source directory %s is not available!', $sourceDir));
233
        }
234
235
        // return the source directory where we want to export to
236
        return $sourceDir;
237
    }
238
}
239