Passed
Pull Request — master (#97)
by Romain
03:28
created

getExampleProperties()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * Copyright (C) 2018
5
 * Nathan Boiron <[email protected]>
6
 * Romain Canon <[email protected]>
7
 *
8
 * This file is part of the TYPO3 NotiZ project.
9
 * It is free software; you can redistribute it and/or modify it
10
 * under the terms of the GNU General Public License, either
11
 * version 3 of the License, or any later version.
12
 *
13
 * For the full copyright and license information, see:
14
 * http://www.gnu.org/licenses/gpl-3.0.html
15
 */
16
17
namespace CuyZ\Notiz\Domain\Event\Scheduler;
18
19
use Exception;
20
use Throwable;
21
use TYPO3\CMS\Scheduler\Task\AbstractTask;
22
23
/**
24
 * Event triggered when an exception/error was thrown during the execution of a
25
 * scheduler task.
26
 */
27
class SchedulerTaskExecutionFailedEvent extends SchedulerTaskEvent
28
{
29
    /**
30
     * @label Event/Scheduler/SchedulerTask:execution_failed.marker.exception
31
     * @marker
32
     *
33
     * @var Throwable
34
     */
35
    protected $exception;
36
37
    /**
38
     * @param AbstractTask $task
39
     * @param Throwable $exception
40
     */
41
    public function run(AbstractTask $task, $exception)
42
    {
43
        $this->checkTaskFilter($task);
44
        $this->fillTaskData($task);
45
46
        $this->exception = $exception;
47
    }
48
49
    /**
50
     * @return array
51
     */
52
    public function getExampleProperties()
53
    {
54
        return parent::getExampleProperties() +
55
            [
56
                'exception' => new Exception('Some fake exception message', 1337),
57
            ];
58
    }
59
}
60