SignalSlotUtility   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 14
c 2
b 0
f 0
dl 0
loc 37
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A emitSignal() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AOE\Crawler\Utility;
6
7
/*
8
 * (c) 2020 AOE GmbH <[email protected]>
9
 *
10
 * This file is part of the TYPO3 Crawler Extension.
11
 *
12
 * It is free software; you can redistribute it and/or modify it under
13
 * the terms of the GNU General Public License, either version 2
14
 * of the License, or any later version.
15
 *
16
 * For the full copyright and license information, please read the
17
 * LICENSE.txt file that was distributed with this source code.
18
 *
19
 * The TYPO3 project - inspiring people to share!
20
 */
21
22
use TYPO3\CMS\Core\Utility\GeneralUtility;
23
use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
24
25
/**
26
 * Class SignalSlotUtility
27
 *
28
 * @codeCoverageIgnore
29
 * @deprecated
30
 */
31
class SignalSlotUtility
32
{
33
    /**
34
     * Predefined signals
35
     */
36
    public const SIGNAL_QUEUEITEM_PREPROCESS = 'queueItemPreProcess';
37
38
    public const SIGNAL_QUEUEITEM_POSTPROCESS = 'queueItemPostProcess';
39
40
    public const SIGNAL_INVOKE_QUEUE_CHANGE = 'invokeQueueChange';
41
42
    public const SIGNAL_URL_ADDED_TO_QUEUE = 'urlAddedToQueue';
43
44
    public const SIGNAL_DUPLICATE_URL_IN_QUEUE = 'duplicateUrlInQueue';
45
46
    public const SIGNAL_URL_CRAWLED = 'urlCrawled';
47
48
    public const SIGNAL_QUEUE_ENTRY_FLUSH = 'queueEntryFlush';
49
50
    /**
51
     * Emits a signal to the signal slot dispatcher
52
     *
53
     * @param string $class
54
     * @param string $signal
55
     * @deprecated
56
     */
57
    public static function emitSignal($class, $signal, array $payload = []): void
58
    {
59
        trigger_error(
60
            'The SignalSlots of the TYPO3 Crawler is deprecated since v9.2.1 and will be removed in v11.x,
61
            we will introduce psr-14 Middelware replacements when dropping support for TYPO3 9 LTS',
62
            E_USER_DEPRECATED
63
        );
64
65
        /** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */
66
        $signalSlotDispatcher = GeneralUtility::makeInstance(Dispatcher::class);
67
        $signalSlotDispatcher->dispatch($class, $signal, $payload);
68
    }
69
}
70