Commit 7ec08899 authored by Matthias Adrowski's avatar Matthias Adrowski
Browse files

[TASK] Rector run

parent 792af6d1
......@@ -168,7 +168,7 @@ abstract class AbstractRestController extends ActionController {
try {
parent::processRequest($request, $response);
} catch (Exception $exception) {
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(self::class);
$logger->critical(
'AbstractRestController::processRequest - Request failed with an exception',
[
......@@ -244,10 +244,10 @@ abstract class AbstractRestController extends ActionController {
* @throws Exception
*/
public function errorAction(): void {
$validationResults = $this->arguments->getValidationResults();
$validationResults = $this->arguments->validate();
$errors = $validationResults->getFlattenedErrors();
if (count($errors)) {
if (is_countable($errors) ? count($errors) : 0) {
$message = 'The request could not be completed due to a conflict with the current state of the resource. ';
$violatedProperties = $this->getViolatedProperties($errors);
......
......@@ -98,7 +98,7 @@ class BearerTokenService implements SingletonInterface {
public function verifyToken($bearerToken): bool {
if (!empty($bearerToken)) {
$payload = $this->decodeToken($bearerToken, $this->privateKey, TRUE);
$payload = $this->decodeToken($bearerToken, $this->privateKey);
if ($payload !== NULL) {
$expire = $payload->exp;
......
......@@ -243,9 +243,7 @@ class PaginationService {
*/
protected function buildUrlSegments(array $parameters): string {
$urlSegments = array_map(
function ($value, $key) {
return $key . '/' . urlencode($value);
}, array_values($parameters), array_keys($parameters)
fn($value, $key) => $key . '/' . urlencode($value), array_values($parameters), array_keys($parameters)
);
return '/' . implode('/', $urlSegments);
}
......
......@@ -61,6 +61,7 @@ class RegistrationService implements SingletonInterface {
public function registerAccessGroup(
$apiKey, $extensionName, $accessGroupName = '', array $entitiesConfiguration = []
): void {
$accessGroup = [];
if ($apiKey === '') {
throw new \InvalidArgumentException('The api key must not be empty', 1414666527);
}
......@@ -126,7 +127,7 @@ class RegistrationService implements SingletonInterface {
}
ExtensionUtility::configurePlugin(
$vendorName . '.' . $extensionName, 'Rest' . $apiKey, $controller, $controller
'Service', 'Rest' . $apiKey, $controller, $controller
);
}
......
......@@ -7,26 +7,14 @@ $EM_CONF[$_EXTKEY] = array(
'author' => 'Markus Günther',
'author_email' => 'markus@sgalinski.de',
'author_company' => 'sgalinski Internet Services',
'shy' => '',
'dependencies' => '',
'conflicts' => '',
'priority' => '',
'module' => '',
'state' => 'stable',
'internal' => '',
'uploadfolder' => 0,
'createDirs' => '',
'modify_tables' => '',
'clearCacheOnLoad' => 0,
'lockType' => '',
'version' => '4.3.2',
'constraints' => array(
'depends' => array(
'typo3' => '10.0.0-10.9.99',
'typo3' => '^10.4',
),
'conflicts' => array(),
'suggests' => array(),
),
'suggests' => array(),
'_md5_values_when_last_written' => '',
);
<?php
if (!defined('TYPO3_MODE')) {
if (!defined('TYPO3')) {
die('Access denied.');
}
......@@ -9,28 +9,28 @@ call_user_func(
// Configure logger for the services controllers
$GLOBALS['TYPO3_CONF_VARS']['LOG']['SGalinski']['SgRest']['writerConfiguration'] = [
TYPO3\CMS\Core\Log\LogLevel::EMERGENCY => [
'TYPO3\CMS\Core\Log\Writer\DatabaseWriter' => ['logTable' => 'tx_sgrest_log'],
\TYPO3\CMS\Core\Log\Writer\DatabaseWriter::class => ['logTable' => 'tx_sgrest_log'],
],
TYPO3\CMS\Core\Log\LogLevel::ALERT => [
'TYPO3\CMS\Core\Log\Writer\DatabaseWriter' => ['logTable' => 'tx_sgrest_log'],
\TYPO3\CMS\Core\Log\Writer\DatabaseWriter::class => ['logTable' => 'tx_sgrest_log'],
],
TYPO3\CMS\Core\Log\LogLevel::CRITICAL => [
'TYPO3\CMS\Core\Log\Writer\DatabaseWriter' => ['logTable' => 'tx_sgrest_log'],
\TYPO3\CMS\Core\Log\Writer\DatabaseWriter::class => ['logTable' => 'tx_sgrest_log'],
],
TYPO3\CMS\Core\Log\LogLevel::ERROR => [
'TYPO3\CMS\Core\Log\Writer\DatabaseWriter' => ['logTable' => 'tx_sgrest_log'],
\TYPO3\CMS\Core\Log\Writer\DatabaseWriter::class => ['logTable' => 'tx_sgrest_log'],
],
TYPO3\CMS\Core\Log\LogLevel::WARNING => [
'TYPO3\CMS\Core\Log\Writer\DatabaseWriter' => ['logTable' => 'tx_sgrest_log'],
\TYPO3\CMS\Core\Log\Writer\DatabaseWriter::class => ['logTable' => 'tx_sgrest_log'],
],
TYPO3\CMS\Core\Log\LogLevel::NOTICE => [
'TYPO3\CMS\Core\Log\Writer\DatabaseWriter' => ['logTable' => 'tx_sgrest_log'],
\TYPO3\CMS\Core\Log\Writer\DatabaseWriter::class => ['logTable' => 'tx_sgrest_log'],
],
TYPO3\CMS\Core\Log\LogLevel::INFO => [
'TYPO3\CMS\Core\Log\Writer\DatabaseWriter' => ['logTable' => 'tx_sgrest_log'],
\TYPO3\CMS\Core\Log\Writer\DatabaseWriter::class => ['logTable' => 'tx_sgrest_log'],
],
TYPO3\CMS\Core\Log\LogLevel::DEBUG => [
'TYPO3\CMS\Core\Log\Writer\DatabaseWriter' => ['logTable' => 'tx_sgrest_log'],
\TYPO3\CMS\Core\Log\Writer\DatabaseWriter::class => ['logTable' => 'tx_sgrest_log'],
],
];
......
......@@ -26,7 +26,7 @@
call_user_func(
static function () {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask']['options']['tables']['tx_sgrest_log'] = [
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['tx_sgrest_log'] = [
'dateField' => 'time_micro',
'expirePeriod' => 30
];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment