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

CallbackExecutionStrategy   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fetchByCallback() 0 6 1
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