Code Duplication    Length = 14-14 lines in 2 locations

src/Loaders/ProposedOkFilenameLoaderFactory.php 1 location

@@ 100-113 (lines=14) @@
97
     * @return string The actual source directory
98
     * @throws \Exception Is thrown, if the actual source directory can not be loaded
99
     */
100
    protected function getSourceDir(FilesystemAdapterInterface $filesystemAdapter) : string
101
    {
102
103
        // try to load the actual status
104
        $status = $this->getRegistryProcessor()->getAttribute(RegistryKeys::STATUS);
105
106
        // query whether or not the configured source directory is available
107
        if (is_array($status) && $filesystemAdapter->isDir($sourceDir = $status[RegistryKeys::SOURCE_DIRECTORY])) {
108
            return $sourceDir;
109
        }
110
111
        // throw an exception if the the actual source directory can not be loaded
112
        throw new \Exception(sprintf('Can\'t load source directory to create file writer instance for'));
113
    }
114
115
    /**
116
     * Create's and return's the apropriate loader instance.

src/Subjects/FileResolver/FileResolverFactory.php 1 location

@@ 123-136 (lines=14) @@
120
     * @return string The actual source directory
121
     * @throws \Exception Is thrown, if the actual source directory can not be loaded
122
     */
123
    protected function getSourceDir(FilesystemAdapterInterface $filesystemAdapter) : string
124
    {
125
126
        // try to load the actual status
127
        $status = $this->getRegistryProcessor()->getAttribute(RegistryKeys::STATUS);
128
129
        // query whether or not the configured source directory is available
130
        if (is_array($status) && $filesystemAdapter->isDir($sourceDir = $status[RegistryKeys::SOURCE_DIRECTORY])) {
131
            return $sourceDir;
132
        }
133
134
        // throw an exception if the the actual source directory can not be loaded
135
        throw new \Exception(sprintf('Can\'t load source directory to create file writer instance for'));
136
    }
137
138
    /**
139
     * Creates and returns the file resolver instance for the subject with the passed configuration.