Code Duplication    Length = 9-12 lines in 2 locations

src/Jobs/LDAPAllSyncJob.php 1 location

@@ 63-71 (lines=9) @@
60
    /**
61
     * @throws Exception
62
     */
63
    public function validateRegenerateTime()
64
    {
65
        $regenerateTime = Config::inst()->get(LDAPAllSyncJob::class, 'regenerate_time');
66
67
        // don't allow this job to run less than every 15 minutes, as it could take a while.
68
        if ($regenerateTime !== null && $regenerateTime < 900) {
69
            throw new Exception('LDAPAllSyncJob::regenerate_time must be 15 minutes or greater');
70
        }
71
    }
72
73
    /**
74
     * {@inheritDoc}

src/Jobs/LDAPMemberSyncJob.php 1 location

@@ 62-73 (lines=12) @@
59
    /**
60
     * @throws Exception
61
     */
62
    public function validateRegenerateTime()
63
    {
64
        $regenerateTime = Config::inst()->get(
65
            LDAPMemberSyncJob::class,
66
            'regenerate_time'
67
        );
68
69
        // don't allow this job to run less than every 15 minutes, as it could take a while.
70
        if ($regenerateTime !== null && $regenerateTime < 900) {
71
            throw new Exception('LDAPMemberSyncJob::regenerate_time must be 15 minutes or greater');
72
        }
73
    }
74
75
    /**
76
     * {@inheritDoc}