GeneralHelpInfo::getHelp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 48
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 48
ccs 0
cts 37
cp 0
rs 9.125
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 2
1
<?php
2
3
  namespace Funivan\Console\CommandCron;
4
5
  /**
6
   * @author Ivan Shcherbak <[email protected]>
7
   */
8
  class GeneralHelpInfo {
9
10
    /**
11
     * @return string
12
     */
13
    public static function getHelp() {
14
      return <<<HELP
15
General tag definition
16
<comment>[tag] [time] [options] [arguments]</comment>
17
18
Description:
19
20
<comment>tag</comment> - @crontab
21
22
<comment>time</comment> - time in cron format       (required)
23
       # ┌───────────── min (0 - 59)
24
       # │ ┌────────────── hour (0 - 23)
25
       # │ │ ┌─────────────── day of month (1 - 31)
26
       # │ │ │ ┌──────────────── month (1 - 12)
27
       # │ │ │ │ ┌───────────────── day of week (0 - 6) (0 to 6 are Sunday to Saturday)
28
       # │ │ │ │ │
29
       # │ │ │ │ │
30
       # * * * * *
31
      <comment>
32
        There is one simple difference between system crontab and current time annotation. 
33
        If you want to run command every/(min|hour|day|month) you should ignore first asterisk.
34
        For example: 
35
          - every 10 minutes                  : /10 * * * *
36
          - every 20 minutes every 3 hours    : /20 /3 * * *
37
      </comment>
38
39
       
40
<comment>options</comment>    - command options        (optional)
41
<comment>arguments</comment>  - command arguments      (optional)
42
43
 
44
<comment>Some examples:</comment>
45
If you want to run commands on server just add @crontab tag to command
46
Run command at 07:45 every day  
47
/**
48
 * @crontab 45 07 * * * 
49
 */
50
51
Some commands have arguments and options
52
Add options/arguments after time definition
53
54
/**
55
 * @crontab 10 10 * * * --no-cache test  
56
 */
57
58
HELP;
59
60
    }
61
  }