Completed
Push — typo3v9 ( efc308...b63611 )
by Tomas Norre
06:24
created

CallbackExecutionStrategy::fetchByCallback()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 3
dl 0
loc 6
ccs 0
cts 5
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
namespace AOE\Crawler\CrawlStrategy;
4
5
/*
6
 * This file is part of the TYPO3 Crawler Extension.
7
 *
8
 * It is free software; you can redistribute it and/or modify it under
9
 * the terms of the GNU General Public License, either version 2
10
 * of the License, or any later version.
11
 *
12
 * For the full copyright and license information, please read the
13
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
 * The TYPO3 project - inspiring people to share!
16
 */
17
18
use AOE\Crawler\Controller\CrawlerController;
19
use TYPO3\CMS\Core\Utility\GeneralUtility;
20
21
/**
22
 * Used for hooks (e.g. crawling external files)
23
 */
24
class CallbackExecutionStrategy
25
{
26
27
    /**
28
     * In the future, the callback should implement an interface.
29
     *
30
     * @param string $callbackClassName
31
     * @param array $parameters
32
     * @param CrawlerController $crawlerController
33
     * @return mixed
34
     */
35
    public function fetchByCallback(string $callbackClassName, array $parameters, CrawlerController $crawlerController)
36
    {
37
        // Calling custom object
38
        $callBackObj = GeneralUtility::makeInstance($callbackClassName);
39
        return $callBackObj->crawler_execute($parameters, $crawlerController);
40
    }
41
}
42