Code Duplication    Length = 10-10 lines in 2 locations

src/DatabaseRepository.php 1 location

@@ 250-259 (lines=10) @@
247
     * @return mixed
248
     * @throws \Nwidart\Modules\Exceptions\ModuleNotFoundException
249
     */
250
    public function findOrFail(string $name)
251
    {
252
        $module = $this->find($name);
253
254
        if ($module !== null) {
255
            return $module;
256
        }
257
258
        throw new ModuleNotFoundException("Module [{$name}] does not exist!");
259
    }
260
261
    /**
262
     * Find a specific module. If there return that, otherwise create it.

src/FileRepository.php 1 location

@@ 388-397 (lines=10) @@
385
     *
386
     * @throws ModuleNotFoundException
387
     */
388
    public function findOrFail(string $name)
389
    {
390
        $module = $this->find($name);
391
392
        if ($module !== null) {
393
            return $module;
394
        }
395
396
        throw new ModuleNotFoundException("Module [{$name}] does not exist!");
397
    }
398
399
    /**
400
     * Get all modules as laravel collection instance.