Skip to content

Commit

Permalink
[TASK] Apply TYPO3 coding standards from EXT:solr 12.0.x-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dkd-kaehm committed Aug 15, 2023
1 parent ca4d7df commit 63f51d8
Show file tree
Hide file tree
Showing 36 changed files with 86 additions and 87 deletions.
18 changes: 9 additions & 9 deletions Build/Test/UnitTestsBootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

declare(strict_types=1);

use TYPO3\TestingFramework\Core\Testbase;
use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Configuration\ConfigurationManager;
use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend;
use TYPO3\CMS\Core\Cache\Backend\NullBackend;
use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend;
use TYPO3\CMS\Core\Configuration\ConfigurationManager;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder;
use TYPO3\CMS\Core\Package\Cache\PackageCacheInterface;
use TYPO3\CMS\Core\Package\UnitTestPackageManager;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Package\PackageManager;
use TYPO3\CMS\Core\Package\UnitTestPackageManager;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Testbase;

/*
* This file is part of the TYPO3 CMS project.
Expand All @@ -31,7 +31,7 @@
call_user_func(function () {
$testbase = new Testbase();

// These if's are for core testing (package typo3/cms) only. cms-composer-installer does
// These ifs are for core testing (package typo3/cms) only. cms-composer-installer does
// not create the autoload-include.php file that sets these env vars and sets composer
// mode to true. testing-framework can not be used without composer anyway, so it is safe
// to do this here. This way it does not matter if 'bin/phpunit' or 'vendor/phpunit/phpunit/phpunit'
Expand Down
4 changes: 2 additions & 2 deletions Classes/ContextMenu/Preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\ContextMenu;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\ContextMenu;

use TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider;
use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException;
Expand Down
4 changes: 2 additions & 2 deletions Classes/Controller/Backend/PreviewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Controller\Backend;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Controller\Backend;

use ApacheSolrForTypo3\Tika\Service\Tika\AbstractService;
use ApacheSolrForTypo3\Tika\Service\Tika\AppService;
use ApacheSolrForTypo3\Tika\Service\Tika\ServerService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Controller\Backend\SolrModule;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -16,7 +14,9 @@
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Messaging\AbstractMessage;

namespace ApacheSolrForTypo3\Tika\Controller\Backend\SolrModule;

use ApacheSolrForTypo3\Solr\Controller\Backend\Search\AbstractModuleController;
use ApacheSolrForTypo3\Tika\Service\Tika\AbstractService;
use ApacheSolrForTypo3\Tika\Service\Tika\AppService;
Expand All @@ -29,7 +29,7 @@
use Throwable;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Core\Http\RedirectResponse;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\View\ViewInterface;

Expand Down
4 changes: 2 additions & 2 deletions Classes/Hooks/BackendControllerHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Hooks;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Hooks;

use TYPO3\CMS\Backend\Controller\BackendController;
use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException;
use TYPO3\CMS\Backend\Routing\UriBuilder;
Expand Down
4 changes: 2 additions & 2 deletions Classes/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika;

/**
* Run, check, and stop external processes. Linux only.
* @author Ingo Renner <[email protected]>
Expand Down
7 changes: 3 additions & 4 deletions Classes/Report/TikaStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Report;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Report;

use ApacheSolrForTypo3\Solr\ConnectionManager;
use ApacheSolrForTypo3\Solr\System\Solr\SolrConnection;
use ApacheSolrForTypo3\Tika\Service\Tika\ServerService;
Expand Down Expand Up @@ -64,10 +64,9 @@ public function __construct(array $extensionConfiguration = null)

public function getLabel(): string
{
return 'Tika';
return 'Tika';
}


/**
* Checks whether Tika is properly configured
* @return array
Expand Down
4 changes: 2 additions & 2 deletions Classes/Service/Extractor/AbstractExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Service\Extractor;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Service\Extractor;

use ApacheSolrForTypo3\Tika\Service\File\SizeValidator;
use ApacheSolrForTypo3\Tika\Util;
use Psr\Log\LoggerAwareInterface;
Expand Down
4 changes: 2 additions & 2 deletions Classes/Service/Extractor/LanguageDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Service\Extractor;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Service\Extractor;

use ApacheSolrForTypo3\Tika\Service\Tika\ServiceFactory;
use Psr\Http\Client\ClientExceptionInterface;
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException;
Expand Down
4 changes: 2 additions & 2 deletions Classes/Service/Extractor/MetaDataExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Service\Extractor;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Service\Extractor;

use ApacheSolrForTypo3\Tika\Service\Tika\AppService;
use ApacheSolrForTypo3\Tika\Service\Tika\ServerService;
use ApacheSolrForTypo3\Tika\Service\Tika\ServiceFactory;
Expand Down
4 changes: 2 additions & 2 deletions Classes/Service/Extractor/TextExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Service\Extractor;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Service\Extractor;

use ApacheSolrForTypo3\Tika\Service\File\SizeValidator;
use ApacheSolrForTypo3\Tika\Service\Tika\ServiceFactory;
use ApacheSolrForTypo3\Tika\Util;
Expand Down
4 changes: 2 additions & 2 deletions Classes/Service/File/SizeValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Service\File;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Service\File;

use ApacheSolrForTypo3\Tika\Util;
use TYPO3\CMS\Core\Resource\FileInterface;

Expand Down
7 changes: 3 additions & 4 deletions Classes/Service/Tika/AbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Service\Tika;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Service\Tika;

use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Psr\Log\LogLevel;
Expand All @@ -29,9 +29,8 @@
*/
abstract class AbstractService implements ServiceInterface, LoggerAwareInterface
{
protected const JAVA_COMMAND_OPTIONS_REGEX = '/-D(?P<property>[\w.]+)=(?P<value>"[^"]+"|\'[^\']+\'|[^\\s\'"]+)/';

use LoggerAwareTrait;
protected const JAVA_COMMAND_OPTIONS_REGEX = '/-D(?P<property>[\w.]+)=(?P<value>"[^"]+"|\'[^\']+\'|[^\\s\'"]+)/';

/**
* @var array
Expand Down
4 changes: 2 additions & 2 deletions Classes/Service/Tika/AppService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Service\Tika;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Service\Tika;

use ApacheSolrForTypo3\Tika\Utility\FileUtility;
use ApacheSolrForTypo3\Tika\Utility\ShellUtility;
use RuntimeException;
Expand Down
8 changes: 4 additions & 4 deletions Classes/Service/Tika/ServerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Service\Tika;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Service\Tika;

use ApacheSolrForTypo3\Tika\Process;
use ApacheSolrForTypo3\Tika\Utility\FileUtility;
use GuzzleHttp\Exception\BadResponseException;
Expand Down Expand Up @@ -281,8 +281,8 @@ protected function queryTika(RequestInterface $request): string
} catch (Throwable $exception) {
$message = $exception->getMessage();
if (
strpos($message, 'Connection refused') === false &&
strpos($message, 'HTTP request failed') === false
!str_contains($message, 'Connection refused') &&
!str_contains($message, 'HTTP request failed')
) {
// If the server is simply not available it would say Connection refused
// since that is not the case something else went wrong
Expand Down
4 changes: 2 additions & 2 deletions Classes/Service/Tika/ServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Service\Tika;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Service\Tika;

use ApacheSolrForTypo3\Tika\Util;
use InvalidArgumentException;
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException;
Expand Down
4 changes: 2 additions & 2 deletions Classes/Service/Tika/ServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Service\Tika;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Service\Tika;

use TYPO3\CMS\Core\Resource\FileInterface;

/**
Expand Down
4 changes: 2 additions & 2 deletions Classes/Service/Tika/SolrCellService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

declare(strict_types=1);

namespace ApacheSolrForTypo3\Tika\Service\Tika;

/*
* This file is part of the TYPO3 CMS project.
*
Expand All @@ -17,6 +15,8 @@
* The TYPO3 project - inspiring people to share!
*/

namespace ApacheSolrForTypo3\Tika\Service\Tika;

use ApacheSolrForTypo3\Solr\ConnectionManager;
use ApacheSolrForTypo3\Solr\System\Solr\SolrConnection;
use Solarium\QueryType\Extract\Query;
Expand Down
Loading

0 comments on commit 63f51d8

Please sign in to comment.