scan_id = (int) $scan_id; $this->profile = $profile; $this->deadline = (float) $deadline; } /** * Seconds left in the current step */ public function remaining() { return $this->deadline - microtime(true); } public function out_of_time() { return $this->remaining() <= 0; } /** * Whether the administrator allowed a given external service */ public function allows($service) { if ($service === 'wporg') { return (bool) AOWPCS_Settings::get('external_wporg'); } if ($service === 'vuln') { return AOWPCS_Settings::get('vuln_provider') !== 'none'; } return false; } /** * Maximum number of files a file walk may visit */ public function max_files() { return (int) AOWPCS_Settings::get('scan_max_files'); } }