| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function getJobs() : array |
||
| 33 | { |
||
| 34 | $contents = file_get_contents($this->filename); |
||
| 35 | |||
| 36 | $lines = explode(PHP_EOL, $contents); |
||
| 37 | |||
| 38 | $jobs = []; |
||
| 39 | |||
| 40 | foreach ($lines as $line) { |
||
| 41 | $cronLineRegEx = "/^(\@\w+|[^\s]+\s[^\s]+\s[^\s]+\s[^\s]+\s[^\s]+)\s+(.*)$/"; |
||
| 42 | |||
| 43 | if (preg_match($cronLineRegEx, $line, $matches)) { |
||
| 44 | $jobs[] = new SystemJob( |
||
| 45 | $matches[1], |
||
| 46 | $matches[2] |
||
| 47 | ); |
||
| 48 | } |
||
| 49 | } |
||
| 50 | |||
| 51 | return $jobs; |
||
| 52 | } |
||
| 53 | } |
||
| 54 |