GeneralHelpInfo   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 54
ccs 0
cts 37
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getHelp() 0 48 1
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
  }