Passed
Push — refactor/backendModule-ValueOb... ( ab393e...9011ea )
by Tomas Norre
16:36
created

AbstractRequestForm::findCrawler()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AOE\Crawler\Backend\RequestForm;
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
class AbstractRequestForm
26
{
27
    /**
28
     * @var CrawlerController
29
     */
30
    protected $crawlerController;
31
32
    protected function findCrawler(): CrawlerController
33
    {
34
        if (! $this->crawlerController instanceof CrawlerController) {
0 ignored issues
show
introduced by
$this->crawlerController is always a sub-type of AOE\Crawler\Controller\CrawlerController.
Loading history...
35
            $this->crawlerController = GeneralUtility::makeInstance(CrawlerController::class);
36
        }
37
        return $this->crawlerController;
38
    }
39
}
40