<?php

namespace CleantalkSP\SpbctWP\Scanner\OSCron\Shell;

class OSCronGetEnvCron
{
    /**
     * @var string The command to read the current crontab.
     */
    private static $read_command = 'crontab -l';

    /**
     * Retrieves the current crontab entries.
     *
     * @return string The current crontab entries.
     * @psalm-suppress ForbiddenCode
     */
    public static function get()
    {
        if ( function_exists('shell_exec') ) {
            return (string)@shell_exec(static::$read_command);
        }

        return '';
    }
}
