Passed
Push — tests/adding-tests ( ae6a06 )
by Tomas Norre
05:39
created

CallbackExecutionStrategy   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 10
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A fetchByCallback() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AOE\Crawler\CrawlStrategy;
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 AOE\Crawler\Controller\CrawlerController;
23
use TYPO3\CMS\Core\Utility\GeneralUtility;
24
25
/**
26
 * Used for hooks (e.g. crawling external files)
27
 */
28
class CallbackExecutionStrategy
29
{
30
    /**
31
     * In the future, the callback should implement an interface.
32
     */
33 1
    public function fetchByCallback(string $callbackClassName, array $parameters, CrawlerController $crawlerController)
34
    {
35
        // Calling custom object
36 1
        $callBackObj = GeneralUtility::makeInstance($callbackClassName);
37 1
        return $callBackObj->crawler_execute($parameters, $crawlerController);
38
    }
39
}
40