Skip to content

Commit

Permalink
[CODESTYLE] Run phpcs fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
tinzog committed Jan 20, 2025
1 parent 26a3e1b commit eebd6f9
Show file tree
Hide file tree
Showing 47 changed files with 96 additions and 107 deletions.
2 changes: 1 addition & 1 deletion Classes/Command/Foreign/Status/AllCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AllCommand extends Command
* @codeCoverageIgnore
* @noinspection PhpUnused
*/
public function __construct(\TYPO3\CMS\Core\Console\CommandRegistry $cmdRegistry)
public function __construct(CommandRegistry $cmdRegistry)
{
parent::__construct();
$this->cmdRegistry = $cmdRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class FileProvider implements ProviderServiceInterface, LoggerAwareInterface
* @codeCoverageIgnore
* @noinspection PhpUnused
*/
public function __construct(\TYPO3\CMS\Core\Configuration\ExtensionConfiguration $extConf)
public function __construct(ExtensionConfiguration $extConf)
{
$this->extConf = $extConf->get('in2publish_core');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use In2code\In2publishCore\CommonInjection\FlexFormServiceInjection;
use In2code\In2publishCore\CommonInjection\LocalDatabaseInjection;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Resource\Capabilities;
use TYPO3\CMS\Core\Resource\Driver\DriverInterface;
use TYPO3\CMS\Core\Resource\Driver\DriverRegistry;
use TYPO3\CMS\Core\Resource\ResourceStorageInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;

class FalDriverService
Expand All @@ -24,7 +24,7 @@ class FalDriverService
* @codeCoverageIgnore
* @noinspection PhpUnused
*/
public function __construct(\TYPO3\CMS\Core\Resource\Driver\DriverRegistry $driverRegistry)
public function __construct(DriverRegistry $driverRegistry)
{
$this->driverRegistry = $driverRegistry;
}
Expand Down Expand Up @@ -55,18 +55,18 @@ protected function createFalDriver(array $storage): DriverInterface
$driver = $this->getDriverObject($storage['driver'], $storageConfiguration);
$driver->setStorageUid($storage['uid']);

$capabilities = new \TYPO3\CMS\Core\Resource\Capabilities();
$capabilities = new Capabilities();

if ($storage['is_browsable'] ?? null) {
$capabilities->addCapabilities(\TYPO3\CMS\Core\Resource\Capabilities::CAPABILITY_BROWSABLE);
$capabilities->addCapabilities(Capabilities::CAPABILITY_BROWSABLE);
}
if ($storage['is_public'] ?? null) {
$capabilities->addCapabilities(\TYPO3\CMS\Core\Resource\Capabilities::CAPABILITY_PUBLIC);
$capabilities->addCapabilities(Capabilities::CAPABILITY_PUBLIC);
}
if ($storage['is_writable'] ?? null) {
$capabilities->addCapabilities(\TYPO3\CMS\Core\Resource\Capabilities::CAPABILITY_WRITABLE);
$capabilities->addCapabilities(Capabilities::CAPABILITY_WRITABLE);
}
$capabilities->addCapabilities(\TYPO3\CMS\Core\Resource\Capabilities::CAPABILITY_HIERARCHICAL_IDENTIFIERS);
$capabilities->addCapabilities(Capabilities::CAPABILITY_HIERARCHICAL_IDENTIFIERS);

$driver->mergeConfigurationCapabilities($capabilities);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract class AbstractProcessor implements TcaPreProcessor
* @codeCoverageIgnore
* @noinspection PhpUnused
*/
public function __construct(\Psr\Container\ContainerInterface $container)
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use In2code\In2publishCore\Component\Core\Resolver\SelectStandaloneMmResolver;
use In2code\In2publishCore\Utility\DatabaseUtility;

use function array_filter;
use function array_key_exists;
use function implode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
use In2code\In2publishCore\Component\Core\Publisher\Exception\FalPublisherExecutionFailedException;
use In2code\In2publishCore\Component\RemoteCommandExecution\RemoteCommandDispatcherInjection;
use In2code\In2publishCore\Component\RemoteCommandExecution\RemoteCommandRequest;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Utility\GeneralUtility;

use function bin2hex;
use function get_class;
Expand Down Expand Up @@ -57,8 +59,8 @@ public function finish(): void
$configuration = json_encode($instruction->getConfiguration(), JSON_THROW_ON_ERROR);
$data[] = [
'request_token' => $requestToken,
'crdate' => \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Context\Context::class)->getPropertyFromAspect('date', 'timestamp'),
'tstamp' => \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Context\Context::class)->getPropertyFromAspect('date', 'timestamp'),
'crdate' => GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp'),
'tstamp' => GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp'),
'instruction' => $class,
'configuration' => $configuration,
];
Expand Down
2 changes: 1 addition & 1 deletion Classes/Component/Core/Record/Factory/RecordFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class RecordFactory
* @codeCoverageIgnore
* @noinspection PhpUnused
*/
public function __construct(\In2code\In2publishCore\Component\Core\Record\Factory\DatabaseRecordFactoryFactory $databaseRecordFactoryFactory)
public function __construct(DatabaseRecordFactoryFactory $databaseRecordFactoryFactory)
{
$this->databaseRecordFactoryFactory = $databaseRecordFactoryFactory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ExcludedTablesService
* @noinspection PhpUnused
*/
public function injectConfigContainer(
\In2code\In2publishCore\Component\ConfigContainer\ConfigContainer $configContainer
ConfigContainer $configContainer
): void {
$this->excludeRelatedTables = $configContainer->get('excludeRelatedTables');
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Component/Core/Service/RelevantTablesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class RelevantTablesService
* @codeCoverageIgnore
* @noinspection PhpUnused
*/
public function __construct(\In2code\In2publishCore\Component\Core\Service\Database\TableContentService $tableContentService)
public function __construct(TableContentService $tableContentService)
{
$this->tableContentService = $tableContentService;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TaskRepository
* @codeCoverageIgnore
* @noinspection PhpUnused
*/
public function __construct(\In2code\In2publishCore\Component\PostPublishTaskExecution\Domain\Factory\TaskFactory $taskFactory)
public function __construct(TaskFactory $taskFactory)
{
$this->creationDate = (new DateTime('now'))->format('Y-m-d H:i:s');
$this->taskFactory = $taskFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ExecuteCommand extends Command implements LoggerAwareInterface
* @codeCoverageIgnore
* @noinspection PhpUnused
*/
public function __construct(\In2code\In2publishCore\Component\RemoteProcedureCall\EnvelopeDispatcher $envelopeDispatcher)
public function __construct(EnvelopeDispatcher $envelopeDispatcher)
{
parent::__construct();
$this->envelopeDispatcher = $envelopeDispatcher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class SshAdapter extends SshBaseAdapter implements AdapterInterface
* @codeCoverageIgnore
* @noinspection PhpUnused
*/
public function __construct(\In2code\In2publishCore\Service\Environment\ForeignEnvironmentService $foreignEnvironmentService)
public function __construct(ForeignEnvironmentService $foreignEnvironmentService)
{
$this->foreignEnvironmentService = $foreignEnvironmentService;
}
Expand Down
6 changes: 3 additions & 3 deletions Classes/Controller/FileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
use In2code\In2publishCore\Utility\LogUtility;
use Psr\Http\Message\ResponseInterface;
use Throwable;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;

Expand Down Expand Up @@ -152,7 +152,7 @@ public function publishFolderAction(string $combinedIdentifier, bool $skipNotifi
[$combinedIdentifier],
),
LocalizationUtility::translate('file_publishing.failure', 'In2publishCore'),
\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR,
ContextualFeedbackSeverity::ERROR,
);
}
}
Expand Down Expand Up @@ -191,7 +191,7 @@ public function publishFileAction(string $combinedIdentifier, bool $skipNotifica
)
. $e->getMessage(),
LocalizationUtility::translate('file_publishing.failure', 'In2publishCore'),
\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR,
ContextualFeedbackSeverity::ERROR,
);
}
}
Expand Down
10 changes: 6 additions & 4 deletions Classes/Controller/RecordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
use Psr\Http\Message\ResponseInterface;
use Throwable;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;

Expand Down Expand Up @@ -92,8 +92,10 @@ class RecordController extends ActionController
public function injectPageRenderer(PageRenderer $pageRenderer): void
{
$this->actualInjectPageRenderer($pageRenderer);
$this->pageRenderer->loadJavaScriptModule('TYPO3/CMS/In2publishCore/BackendModule');
$this->pageRenderer->loadJavaScriptModule('TYPO3/CMS/In2publishCore/BackendEnhancements');

$this->pageRenderer->loadJavaScriptModule('@in2code/in2publish_core/backend-module.js');
$this->pageRenderer->loadJavaScriptModule('@in2code/in2publish_core/backend-enhancements.js');

$this->pageRenderer->addCssFile(
'EXT:in2publish_core/Resources/Public/Css/Modules.css',
'stylesheet',
Expand Down Expand Up @@ -221,7 +223,7 @@ protected function addFlashMessagesAndRedirectToIndex(): ResponseInterface
if (empty($failures)) {
$message = '';
$title = LocalizationUtility::translate('record_published', 'In2publishCore', [$executionTime]);
$severity = \TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::OK;
$severity = ContextualFeedbackSeverity::OK;
} else {
$message = '"' . implode('"; "', array_keys($failures)) . '"';
$title = LocalizationUtility::translate('record_publishing_failure', 'In2publishCore', [$executionTime]);
Expand Down
4 changes: 1 addition & 3 deletions Classes/Controller/Traits/ControllerModuleTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Core\Http\JsonResponse;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Request;
use TYPO3\CMS\Extbase\Mvc\RequestInterface;
Expand Down Expand Up @@ -69,7 +68,6 @@ protected function htmlResponse(string $html = null): ResponseInterface
return $this->render();
}


protected function render(): ResponseInterface
{
$docHeader = $this->moduleTemplate->getDocHeaderComponent();
Expand All @@ -88,4 +86,4 @@ protected function render(): ResponseInterface

return $this->moduleTemplate->renderResponse($this->request->getControllerName() . '/' . ucfirst($this->request->getControllerActionName()));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function indexAction(int $emulatePage = null): ResponseInterface
'containerDump' => $this->configContainerDumper->dump($this->configContainer),
'fullConfig' => $this->configContainer->get(),
'globalConfig' => $this->configContainer->getContextFreeConfig(),
'emulatePage' => $emulatePage
'emulatePage' => $emulatePage,
]);
return $this->htmlResponse();
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Features/AdminTools/Controller/TcaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function indexAction(): ResponseInterface
{
$this->moduleTemplate->assignMultiple([
'incompatibleTca' => $this->cachedTcaPreProcessingService->getIncompatibleTcaParts(),
'compatibleTca' => $this->cachedTcaPreProcessingService->getCompatibleTcaParts()
'compatibleTca' => $this->cachedTcaPreProcessingService->getCompatibleTcaParts(),
]);

return $this->htmlResponse();
Expand Down
2 changes: 1 addition & 1 deletion Classes/Features/AdminTools/Controller/TestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function indexAction(): ResponseInterface

$this->environmentService->setTestResult($success);
$this->moduleTemplate->assignMultiple([
'testingResults' => $testingResults
'testingResults' => $testingResults,
]);
return $this->htmlResponse();
}
Expand Down
5 changes: 3 additions & 2 deletions Classes/Features/AdminTools/Controller/ToolsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use In2code\In2publishCore\Event\CreatedDefaultHelpLabels;
use In2code\In2publishCore\Service\Environment\EnvironmentServiceInjection;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;

use function implode;
Expand All @@ -54,7 +55,7 @@ public function indexAction(): ResponseInterface
$this->addFlashMessage(
implode(PHP_EOL, $messages),
LocalizationUtility::translate('test_state_error', 'In2publishCore'),
\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR,
ContextualFeedbackSeverity::ERROR,
);
}

Expand All @@ -72,7 +73,7 @@ public function indexAction(): ResponseInterface

$this->moduleTemplate->assignMultiple([
'supports' => $event->getSupports(),
'tools' => $this->toolsRegistry->getEntries()
'tools' => $this->toolsRegistry->getEntries(),
]);
return $this->htmlResponse();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
use In2code\In2publishCore\Service\Configuration\IgnoredFieldsServiceInjection;
use In2code\In2publishCore\Utility\ArrayUtility;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;

Expand All @@ -62,7 +62,7 @@ public function indexAction(): ResponseInterface
$tables = $this->getAllNonExcludedTables();
$tables = array_intersect($tables, array_keys($GLOBALS['TCA']));
$this->moduleTemplate->assignMultiple([
'tables' => array_combine($tables, $tables)
'tables' => array_combine($tables, $tables),
]);
return $this->htmlResponse();
}
Expand Down Expand Up @@ -215,7 +215,7 @@ public function transferAction(string $table, int $uid, string $expected): Respo
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.error',
'In2publishCore'
),
\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR,
ContextualFeedbackSeverity::ERROR,
);
return $this->redirect('index');
}
Expand All @@ -231,7 +231,7 @@ public function transferAction(string $table, int $uid, string $expected): Respo
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.error',
'In2publishCore'
),
\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR,
ContextualFeedbackSeverity::ERROR,
);
return $this->redirect('index');
}
Expand Down Expand Up @@ -265,7 +265,7 @@ public function transferAction(string $table, int $uid, string $expected): Respo
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.error',
'In2publishCore'
),
\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR,
ContextualFeedbackSeverity::ERROR,
);
return $this->redirect('index');
}
Expand Down Expand Up @@ -299,7 +299,7 @@ public function transferAction(string $table, int $uid, string $expected): Respo
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.error',
'In2publishCore'
),
\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR,
ContextualFeedbackSeverity::ERROR,
);
return $this->redirect('index');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MetricsAndDebugMiddleware implements MiddlewareInterface
* @codeCoverageIgnore
* @noinspection PhpUnused
*/
public function __construct(\TYPO3\CMS\Core\Http\StreamFactory $streamFactory)
public function __construct(StreamFactory $streamFactory)
{
$this->streamFactory = $streamFactory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
*/

use In2code\In2publishCore\CommonInjection\LocalDatabaseInjection;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Utility\GeneralUtility;

class RunningRequestRepository
{
Expand All @@ -48,7 +50,7 @@ public function add(string $recordId, string $tableName, string $token): void
'record_id' => $recordId,
'table_name' => $tableName,
'request_token' => $token,
'timestamp_begin' => \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Context\Context::class)->getPropertyFromAspect('date', 'timestamp'),
'timestamp_begin' => GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp'),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ class RunningRequestService implements SingletonInterface
protected array $registeredRecords = [];
protected bool $shutdownFunctionRegistered = false;

public function __construct(\In2code\In2publishCore\Features\PreventParallelPublishing\Domain\Repository\RunningRequestRepository $runningRequestRepository)
public function __construct(RunningRequestRepository $runningRequestRepository)
{
$this->requestToken = bin2hex(random_bytes(16));
/**
* @codeCoverageIgnore
* @noinspection PhpUnused
*/
/**
* @codeCoverageIgnore
* @noinspection PhpUnused
*/
$this->runningRequestRepository = $runningRequestRepository;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function inspectAction(string $classification, string $identifier): Respo
$recordTree = $this->recordTreeBuilder->buildRecordTree($request);
}
$this->moduleTemplate->assignMultiple([
'recordTree' => $recordTree
'recordTree' => $recordTree,
]);
return $this->htmlResponse();
}
Expand Down
Loading

0 comments on commit eebd6f9

Please sign in to comment.