Issues (216)

Classes/Command/SolrCommandController.php (3 issues)

1
<?php
2
namespace ApacheSolrForTypo3\Solr\Command;
3
4
/**
5
 * This file is part of the TYPO3 CMS project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under
8
 * the terms of the GNU General Public License, either version 2
9
 * of the License, or any later version.
10
 *
11
 * For the full copyright and license information, please read the
12
 * LICENSE.txt file that was distributed with this source code.
13
 *
14
 * The TYPO3 project - inspiring people to share!
15
 */
16
use ApacheSolrForTypo3\Solr\ConnectionManager;
17
use TYPO3\CMS\Core\Utility\GeneralUtility;
18
use TYPO3\CMS\Extbase\Mvc\Controller\CommandController;
0 ignored issues
show
The type TYPO3\CMS\Extbase\Mvc\Controller\CommandController was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
19
20
/**
21
 * Controller to run solr specific tasks via CLI
22
 * @todo @deprecated This class can be dropped when legacy support will be dropped
23
 * @extensionScannerIgnoreFile
24
 */
25
class SolrCommandController extends CommandController
26
{
27
    /**
28
     * Update EXT:solr connections
29
     *
30
     * @param int $rootPageId A site root page id
31
     */
32
    public function updateConnectionsCommand($rootPageId = null)
33
    {
34
        /* @var ConnectionManager $connectionManager */
35
        $connectionManager = GeneralUtility::makeInstance(ConnectionManager::class);
36
        if ($rootPageId !== null) {
37
            $connectionManager->updateConnectionByRootPageId($rootPageId);
0 ignored issues
show
Deprecated Code introduced by
The function ApacheSolrForTypo3\Solr\...onnectionByRootPageId() has been deprecated: Use TYPO3 site config to configure site/connection info ( Ignorable by Annotation )

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

37
            /** @scrutinizer ignore-deprecated */ $connectionManager->updateConnectionByRootPageId($rootPageId);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
38
        } else {
39
            $connectionManager->updateConnections();
0 ignored issues
show
Deprecated Code introduced by
The function ApacheSolrForTypo3\Solr\...er::updateConnections() has been deprecated: will be removed in v11, use SiteRepository ( Ignorable by Annotation )

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

39
            /** @scrutinizer ignore-deprecated */ $connectionManager->updateConnections();

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
40
        }
41
        $this->outputLine('<info>EXT:solr connections are updated in the registry.</info>');
42
    }
43
}
44