GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 151e35...1ba630 )
by Marc
10s
created

SchedulingViewCommand::getTimelineStr()   C

Complexity

Conditions 9
Paths 76

Size

Total Lines 73
Code Lines 38

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 30
CRAP Score 9.0027

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 73
ccs 30
cts 31
cp 0.9677
rs 5.9846
c 1
b 0
f 0
cc 9
eloc 38
nc 76
nop 5
crap 9.0027

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * @package: chapi
4
 *
5
 * @author:  msiebeneicher
6
 * @since:   2015-09-09
7
 *
8
 * @link:    https://github.com/msiebeneicher/chapi/issues/24
9
 */
10
11
12
namespace Chapi\Commands;
13
14
use Chapi\Component\DatePeriod\DatePeriodFactoryInterface;
15
use Chapi\Entity\Chronos\ChronosJobEntity;
16
use Chapi\Service\Chronos\JobStatsServiceInterface;
17
use Chapi\Service\JobDependencies\JobDependencyServiceInterface;
18
use Chapi\Service\JobRepository\JobRepositoryInterface;
19
use Symfony\Component\Console\Helper\Table;
20
use Symfony\Component\Console\Input\InputOption;
21
22
class SchedulingViewCommand extends AbstractCommand
23
{
24
    /**
25
     * @var JobStatsServiceInterface $oJobStatsService
26
     */
27
    private $oJobStatsService;
28
29
    /**
30
     * @var JobDependencyServiceInterface $oJobDependencyService
31
     */
32
    private $oJobDependencyService;
33
34
    /**
35
     * @var JobRepositoryInterface  $oJobRepositoryChronos
36
     */
37
    private $oJobRepositoryChronos;
38
39
    /**
40
     * @var DatePeriodFactoryInterface  $oDatePeriodFactory
41
     */
42
    private $oDatePeriodFactory;
43
44
    /**
45
     * Configures the current command.
46
     */
47 3
    protected function configure()
48
    {
49 3
        $this->setName('scheduling')
50 3
            ->setDescription('Display upcoming jobs in a specified timeframe.')
51 3
            ->addOption('starttime', 's', InputOption::VALUE_OPTIONAL, 'Start time to display the jobs', null)
52 3
            ->addOption('endtime', 'e', InputOption::VALUE_OPTIONAL, 'End time to display the jobs', null)
53
        ;
54 3
    }
55
56
    /**
57
     * @return int
58
     */
59 3
    protected function process()
60
    {
61
        // init necessary services
62 3
        $this->oJobStatsService = $this->getContainer()->get(JobStatsServiceInterface::DIC_NAME);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
63 3
        $this->oJobDependencyService = $this->getContainer()->get(JobDependencyServiceInterface::DIC_NAME);
64 3
        $this->oJobRepositoryChronos = $this->getContainer()->get(JobRepositoryInterface::DIC_NAME_CHRONOS);
65 3
        $this->oDatePeriodFactory = $this->getContainer()->get(DatePeriodFactoryInterface::DIC_NAME);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
66
67
        // init timeframe by user input
68 3
        $_iCurrentTime = time() + 60; // default 1min in the future
69
70 3
        $_sStartTime = $this->oInput->getOption('starttime');
71 3
        $_sEndTime = $this->oInput->getOption('endtime');
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
72
73 3
        $_iStartTime = ($_sStartTime == null) ? $_iCurrentTime : strtotime($_sStartTime);
74 3
        if ($_sStartTime != null && $_iStartTime < $_iCurrentTime)
75
        {
76 1
            $_iStartTime = strtotime($_sStartTime . ' + 24 hours');
77
        }
78
79 3
        $_iEndTime = ($_sEndTime == null) ? $_iStartTime + 7200 : strtotime($_sEndTime);
80
81
        // print table for timeframe
82 3
        $this->printTimeLineTable($_iStartTime, $_iEndTime);
83
84 3
        return 0;
85
    }
86
87
    /**
88
     * @param int $iStartTime
89
     * @param int $iEndTime
90
     */
91 3
    private function printTimeLineTable($iStartTime, $iEndTime)
92
    {
93 3
        $_oDatePeriod = $this->createDatePeriod(null, $iStartTime, null, $iEndTime, 'PT1M');
94
95 3
        $_oTable = new Table($this->oOutput);
96 3
        $_oTable->setHeaders(array(
97 3
            'Job',
98 3
            'Timeline for ' . date('Y-m-d H:i', $iStartTime) . ' till ' . date('Y-m-d H:i', $iEndTime)
99
        ));
100
101 3
        $_aJobs = $this->getJobsWhichShouldStartInPeriod($iStartTime, $iEndTime);
102
103 3
        $_iRowCount = 0;
104
105
        /** @var ChronosJobEntity $_oJobEntity */
106 3
        foreach ($_aJobs as $_oJobEntity)
107
        {
108 3
            if (!empty($_oJobEntity->schedule))
109
            {
110 3
                $_bPrintTime = (0 == ($_iRowCount % 5)) ? true : false;
111 3
                $_oJobStats = $this->oJobStatsService->getJobStats($_oJobEntity->name);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
112
113 3
                $_oJobDatePeriod = $this->createDatePeriodForJob($_oJobEntity, $iEndTime);
114 3
                $_fJobRunTime = $_oJobStats->histogram->mean / 1000;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
115
116 3
                $_oTable->addRow(
117
                    array(
118 3
                        $_oJobEntity->name,
119 3
                        $this->getTimelineStr(
120
                            $_oDatePeriod,
121
                            $_oJobDatePeriod,
122
                            $_fJobRunTime,
123
                            $_bPrintTime
124
                        )
125
                    )
126
                );
127
128 3
                ++$_iRowCount;
129
130
                // print child jobs
131 3
                $this->printChildJobs($_oTable, $_oDatePeriod, $_oJobDatePeriod, $_oJobEntity->name, $_fJobRunTime, $_iRowCount, 0);
132
            }
133
        }
134
135 3
        $_oTable->render();
136 3
    }
137
138
    /**
139
     * @param Table $oTable
140
     * @param \DatePeriod $oDisplayPeriod
141
     * @param \DatePeriod $oJobDatePeriod
142
     * @param string $sParentJobName
143
     * @param float $fParentJobRunTime
144
     * @param int $iRowCount
145
     * @param int $iCurrentChildLevel
146
     */
147 3
    private function printChildJobs(
148
        Table $oTable,
149
        \DatePeriod $oDisplayPeriod,
150
        \DatePeriod $oJobDatePeriod,
151
        $sParentJobName,
152
        $fParentJobRunTime,
153
        &$iRowCount,
154
        $iCurrentChildLevel = 0
155
    )
156
    {
157 3
        $_aChildJobs = $this->oJobDependencyService->getChildJobs($sParentJobName, JobDependencyServiceInterface::REPOSITORY_LOCAL);
158
159 3
        foreach ($_aChildJobs as $_sChildJobName)
160
        {
161 1
            $_bPrintTime = (0 == ($iRowCount % 5)) ? true : false;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
162 1
            $_oChildJobStats = $this->oJobStatsService->getJobStats($_sChildJobName);
163
164 1
            $oTable->addRow(
165
                array(
166 1
                    str_repeat('   ', $iCurrentChildLevel) . '|_ ' . $_sChildJobName,
167 1
                    $this->getTimelineStr(
168
                        $oDisplayPeriod,
169
                        $oJobDatePeriod,
170 1
                        $_oChildJobStats->histogram->mean / 1000,
171
                        $_bPrintTime,
172
                        round($fParentJobRunTime)
173
                    )
174
                )
175
            );
176
177 1
            ++$iRowCount;
178
179
            // next level
180 1
            $this->printChildJobs(
181
                $oTable,
182
                $oDisplayPeriod,
183
                $oJobDatePeriod,
184
                $_sChildJobName,
185 1
                $_oChildJobStats->histogram->mean / 1000 + $fParentJobRunTime,
186
                $iRowCount,
187 1
                ++$iCurrentChildLevel
188
            );
189
        }
190 3
    }
191
192
    /**
193
     * @param \DatePeriod $oDatePeriod
194
     * @param \DatePeriod $oJobDatePeriod
195
     * @param float $fRunSeconds
196
     * @param boolean $bPrintTime
197
     * @param int $iJobStartTimeDelay
198
     * @return string
199
     */
200 3
    private function getTimelineStr(
201
        \DatePeriod $oDatePeriod,
202
        \DatePeriod $oJobDatePeriod,
203
        $fRunSeconds = 0.0,
204
        $bPrintTime = true,
205
        $iJobStartTimeDelay = 0
206
    )
207
    {
208 3
        $_sTimeline = '';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
209 3
        $_aStartTimes = $this->getJobStartTimesInPeriod($oJobDatePeriod, $iJobStartTimeDelay);
210
211 3
        $_bJobStarted = false;
212 3
        $_sSpacer = '-';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
213
214 3
        $_iRunMinutes = ($fRunSeconds > 0) ? round($fRunSeconds / 60) : 0;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
215 3
        $_iPrintedRunMinutes = 0;
216
217 3
        $_bHasToCloseFinalTag = false;
218
219
        /** @var \DateTime $_oTime */
220 3
        foreach ($oDatePeriod as $_oTime)
221
        {
222 3
            $_bPrintJobEnd = false;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
223 3
            $_bPrintJobStart = false;
224
225 3
            if (isset($_aStartTimes[$_oTime->format('YmdHi')]))
226
            {
227 3
                $_bJobStarted = true;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
228 3
                $_bPrintJobStart = true;
229 3
                $_sSpacer = '=';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
230
            }
231
232 3
            if ($_bJobStarted)
233
            {
234 3
                ++$_iPrintedRunMinutes;
235
236 3
                if ($_iRunMinutes <= $_iPrintedRunMinutes)
237
                {
238 3
                    $_bJobStarted = false;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
239 3
                    $_bPrintJobEnd = true;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
240 3
                    $_sSpacer = '-';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 12 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
241 3
                    $_iPrintedRunMinutes = 0;
242
                }
243
            }
244
245 3
            $_iMod = ((int) $_oTime->format('i')) % 15;
246
247 3
            if ($_iMod == 0)
248
            {
249 3
                if ($bPrintTime)
250
                {
251 3
                    $_sTimeline .= $this->parseTimeLineStrMark($_bPrintJobStart, $_bPrintJobEnd, $_bHasToCloseFinalTag, $_oTime->format('H>i'), $_oTime->format('H:i'));
252
253
                }
254
                else
255
                {
256 3
                    $_sTimeline .= $this->parseTimeLineStrMark($_bPrintJobStart, $_bPrintJobEnd, $_bHasToCloseFinalTag, str_repeat('>', 5), str_repeat($_sSpacer, 5));
257
                }
258
            }
259
            else
260
            {
261 3
                $_sTimeline .= $this->parseTimeLineStrMark($_bPrintJobStart, $_bPrintJobEnd, $_bHasToCloseFinalTag, '>', $_sSpacer);
262
            }
263
        }
264
265
        // add final tag to the end if you runs longer than current timeframe
266 3
        if ($_bHasToCloseFinalTag)
267
        {
268
            $_sTimeline .= '</comment>';
269
        }
270
271 3
        return $_sTimeline;
272
    }
273
274
    /**
275
     * @param bool $bPrintJobStart
276
     * @param bool $bPrintJobEnd
277
     * @param bool $bHasToCloseFinalTag
278
     * @param string $sStartStopMark
279
     * @param string $sSpacer
280
     * @return string
281
     */
282 3
    private function parseTimeLineStrMark($bPrintJobStart, $bPrintJobEnd, &$bHasToCloseFinalTag, $sStartStopMark, $sSpacer)
283
    {
284 3
        if ($bPrintJobStart && $bPrintJobEnd)
285
        {
286
            $_sTimelineSnippet = sprintf('<comment>%s</comment>', $sStartStopMark);
287
        }
288 3
        elseif ($bPrintJobStart)
289
        {
290 3
            $_sTimelineSnippet = sprintf('<comment>%s', $sStartStopMark);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
291 3
            $bHasToCloseFinalTag = true;
292
        }
293 3
        elseif ($bPrintJobEnd)
294
        {
295 3
            $_sTimelineSnippet = sprintf('%s</comment>', $sStartStopMark);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
296 3
            $bHasToCloseFinalTag = false;
297
        }
298
        else
299
        {
300 3
            $_sTimelineSnippet = $sSpacer;
301
        }
302
303 3
        return $_sTimelineSnippet;
304
    }
305
306
    /**
307
     * @param \DatePeriod $oJobDatePeriod
308
     * @param int $iJobStartTimeDelay
309
     * @return array
310
     */
311 3
    private function getJobStartTimesInPeriod(\DatePeriod $oJobDatePeriod, $iJobStartTimeDelay = 0)
312
    {
313 3
        $_aStartTimes = [];
314
315
        /** @var \DateTime $_oJobTime */
316 3
        foreach ($oJobDatePeriod as $_oJobTime)
317
        {
318 3
            if ($iJobStartTimeDelay > 0)
319
            {
320 1
                $_oJobTime->add(new \DateInterval('PT' . $iJobStartTimeDelay . 'S'));
321
            }
322
323 3
            $_aStartTimes[$_oJobTime->format('YmdHi')] = $_oJobTime;
324
        }
325
326 3
        return $_aStartTimes;
327
    }
328
329
    /**
330
     * @param ChronosJobEntity $oJobEntity
331
     * @param int $iEndTime
332
     * @return \DatePeriod
333
     */
334 3
    private function createDatePeriodForJob(ChronosJobEntity $oJobEntity, $iEndTime)
335
    {
336 3
        $_oIso8601Entity = $this->oDatePeriodFactory->createIso8601Entity($oJobEntity->schedule);
337 3
        return $this->createDatePeriod($_oIso8601Entity->sStartTime, 0, null, $iEndTime, $_oIso8601Entity->sInterval);
338
    }
339
340
    /**
341
     * @param string $sDateTimeStart
342
     * @param int $iTimestampStart
343
     * @param string $sDateTimeEnd
344
     * @param int $iTimestampEnd
345
     * @param string $sDateInterval
346
     * @return \DatePeriod
347
     */
348 3
    private function createDatePeriod($sDateTimeStart = '', $iTimestampStart = 0, $sDateTimeEnd = '', $iTimestampEnd = 0, $sDateInterval = 'PT1M')
349
    {
350 3
        $_oDateStart = new \DateTime($sDateTimeStart);
351 3
        if ($iTimestampStart > 0)
352
        {
353 3
            $_oDateStart->setTimestamp($iTimestampStart);
354
        }
355
356 3
        $_oDateEnd = new \DateTime($sDateTimeEnd);
357 3
        if ($iTimestampEnd > 0)
358
        {
359 3
            $_oDateEnd->setTimestamp($iTimestampEnd);
360
        }
361
362 3
        $_oDateInterval = new \DateInterval($sDateInterval);
363
364 3
        return new \DatePeriod($_oDateStart, $_oDateInterval, $_oDateEnd);
365
    }
366
367
    /**
368
     * @param int $iStartTime
369
     * @param int $iEndTime
370
     * @return ChronosJobEntity[]
371
     */
372 3
    private function getJobsWhichShouldStartInPeriod($iStartTime, $iEndTime)
373
    {
374 3
        $_oJobCollection = $this->oJobRepositoryChronos->getJobs();
375
376 3
        $_aJobs = [];
377
378
        /** @var ChronosJobEntity $_oJobEntity */
379 3
        foreach ($_oJobCollection as $_oJobEntity)
380
        {
381
            if (
382 3
                $_oJobEntity->isSchedulingJob()
383 3
                && false === $_oJobEntity->disabled
384 3
                && false === strpos($_oJobEntity->schedule, 'R0')
385
            )
386
            {
387 3
                $_oJobDatePeriod = $this->createDatePeriodForJob($_oJobEntity, $iEndTime);
388 3
                if ($this->isPeriodInTimeFrame($_oJobDatePeriod, $iStartTime, $iEndTime))
389
                {
390 3
                    $_aJobs[] = $_oJobEntity;
391
                }
392
            }
393
        }
394
395 3
        return $_aJobs;
396
    }
397
398
    /**
399
     * @param \DatePeriod $oJobDatePeriod
400
     * @param int $iStartTime
401
     * @param int $iEndTime
402
     * @return bool
403
     */
404 3
    private function isPeriodInTimeFrame(\DatePeriod $oJobDatePeriod, $iStartTime, $iEndTime)
405
    {
406 3
        $_iLastTime = 0;
407
408
        /** @var \DateTime $_oJobTime */
409 3
        foreach ($oJobDatePeriod as $_oJobTime)
410
        {
411
            // jobs under 1 hours should always be displayed (break after the second loop)
412 3
            if ($_oJobTime->getTimestamp() - $_iLastTime <= 3600)
413
            {
414 3
                return true;
415
            }
416
417
            // is one starting point in timeframe?
418 3
            if ($_oJobTime->getTimestamp() >= $iStartTime && $_oJobTime->getTimestamp() <= $iEndTime)
419
            {
420
                return true;
421
            }
422
423 3
            $_iLastTime = $_oJobTime->getTimestamp();
424
        }
425
426
        return false;
427
    }
428
}