Skip to content

Commit

Permalink
Fix code for TYPO3 12
Browse files Browse the repository at this point in the history
  • Loading branch information
ipf committed Feb 27, 2025
1 parent 6d36af5 commit a36b01a
Show file tree
Hide file tree
Showing 77 changed files with 814 additions and 1,688 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ jobs:
fail-fast: false
matrix:
env:
- { php: 8.0 }
- { php: 8.1 }
- { php: 8.2 }
- { php: 8.3 }

env: ${{ matrix.env }}

Expand Down Expand Up @@ -42,7 +41,6 @@ jobs:

- name: Check coding style
run: composer lint
if: ${{ matrix.env.php == '8.1' }}

- name: Run Unit Tests
run: |
Expand Down
10 changes: 5 additions & 5 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
use TYPO3\CodingStandards\CsFixerConfig;

$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->exclude('node_modules')
->in(__DIR__);

return (new PhpCsFixer\Config)
->setRules([
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
])

$config = CsFixerConfig::create();

return $config
->setFinder($finder);
2 changes: 1 addition & 1 deletion .php-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.1
8.2
24 changes: 10 additions & 14 deletions Classes/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,9 @@ class SearchController extends ActionController

protected ?object $searchProvider = null;

private LoggerInterface $logger;
private readonly LoggerInterface $logger;

public function __construct(LogManagerInterface $logManager)
{
$this->logger = $logManager->getLogger('find');
}
public function __construct(private readonly LogManagerInterface $logManager, private readonly AssetCollector $assetCollector) {}

/**
* @throws NoSuchArgumentException
Expand All @@ -68,12 +65,11 @@ public function detailAction(string $id): ResponseInterface
$underlyingQueryScriptTagContent = FrontendUtility::addQueryInformationAsJavaScript(
$underlyingQueryInfo['q'],
$this->settings,
(int) $underlyingQueryInfo['position'],
(int)$underlyingQueryInfo['position'],
$arguments
);

GeneralUtility::makeInstance(AssetCollector::class)
->addInlineJavaScript('underlyingQueryVar', $underlyingQueryScriptTagContent, ['type' => 'text/javascript'], ['priority' => true]);
$this - \ASSETCOLLECTOR->addInlineJavaScript('underlyingQueryVar', $underlyingQueryScriptTagContent, ['type' => 'text/javascript'], ['priority' => true]);
}

$this->addStandardAssignments();
Expand All @@ -87,9 +83,6 @@ public function detailAction(string $id): ResponseInterface
return $this->htmlResponse();
}

/**
* Index Action.
*/
public function indexAction(): ResponseInterface
{
if (array_key_exists('id', $this->requestArguments)) {
Expand Down Expand Up @@ -158,7 +151,7 @@ protected function addStandardAssignments(): void
$this->searchProvider->setConfigurationValue('extendedSearch', $this->searchProvider->isExtendedSearch());
$this->searchProvider->setConfigurationValue(
'uid',
$this->configurationManager->getContentObject()->data['uid']
$this->request->getAttribute('currentContentObject')->data['uid']
);
$this->searchProvider->setConfigurationValue('prefixID', 'tx_find_find');
$this->searchProvider->setConfigurationValue('pageTitle', $GLOBALS['TSFE']->page['title']);
Expand All @@ -172,8 +165,11 @@ protected function initializeConnection($activeConnection): void
$connectionConfiguration = $this->settings['connections'][$activeConnection];

/* @var ServiceProviderInterface $searchProvider */
$this->searchProvider = GeneralUtility::makeInstance($connectionConfiguration['provider'], $activeConnection,
$this->settings);
$this->searchProvider = GeneralUtility::makeInstance(
$connectionConfiguration['provider'],
$activeConnection,
$this->settings
);
$this->searchProvider->connect();
}
}
74 changes: 0 additions & 74 deletions Classes/Hooks/RealUrl.php

This file was deleted.

5 changes: 1 addition & 4 deletions Classes/Service/AbstractServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ public function getRequestArguments()
return $this->requestArguments;
}

/**
* @param array $requestArguments
*/
public function setRequestArguments($requestArguments)
public function setRequestArguments(array $requestArguments)
{
$this->requestArguments = $requestArguments;
}
Expand Down
37 changes: 5 additions & 32 deletions Classes/Service/ServiceProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,44 +46,17 @@ public function getRequestArguments();

public function isExtendedSearch();

/**
* @param $query
*
* @return mixed
*/
public function search($query);

/**
* @param string $actionName
*/
public function setAction($actionName);

/**
* @param $key
* @param $value
*
* @return mixed
*/
public function setAction(string $actionName);

public function setConfigurationValue($key, $value);

/**
* @param string $key
*/
public function setControllerExtensionKey($key);
public function setControllerExtensionKey(string $key);

public function setCounter();

/**
* @param array $requestArguments
*
* @return mixed
*/
public function setRequestArguments($requestArguments);

/**
* @param $settings
*
* @return mixed
*/
public function setRequestArguments(array $requestArguments);

public function suggestQuery($settings);
}
Loading

0 comments on commit a36b01a

Please sign in to comment.