Passed
Push — master ( 6aab4a...f2ba87 )
by
unknown
17:34
created

WorkspaceRepository::injectQuerySettings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the TYPO3 CMS project.
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
namespace TYPO3\CMS\Belog\Domain\Repository;
19
20
use TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface;
21
use TYPO3\CMS\Extbase\Persistence\Repository;
22
23
/**
24
 * Repository for workspaces
25
 *
26
 * @internal This class is a TYPO3 Backend implementation and is not considered part of the Public TYPO3 API.
27
 */
28
class WorkspaceRepository extends Repository
29
{
30
    public ?QuerySettingsInterface $querySettings = null;
31
32
    /**
33
     * @param QuerySettingsInterface $querySettings
34
     */
35
    public function injectQuerySettings(QuerySettingsInterface $querySettings): void
36
    {
37
        $this->querySettings = $querySettings;
38
    }
39
40
    /**
41
     * Initializes the repository.
42
     */
43
    public function initializeObject(): void
44
    {
45
        $this->setDefaultQuerySettings($this->querySettings->setRespectStoragePage(false));
0 ignored issues
show
Bug introduced by
The method setRespectStoragePage() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

45
        $this->setDefaultQuerySettings($this->querySettings->/** @scrutinizer ignore-call */ setRespectStoragePage(false));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
46
    }
47
}
48