diff --git a/.gitignore b/.gitignore index b95bdcc..e47c8b1 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,5 @@ composer.lock # Ignore testing stuff /.Build -/Resources/Private/Php /composer.json.orig /composer.json.testing diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index e8f2f11..0c21e46 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -411,9 +411,9 @@ fi case ${TEST_SUITE} in cgl) if [ "${CGLCHECK_DRY_RUN}" -eq 1 ]; then - COMMAND="php -dxdebug.mode=off .Build/bin/php-cs-fixer fix -v --dry-run --diff --config=Build/cgl/.php-cs-fixer.dist.php --using-cache=no ." + COMMAND="php -dxdebug.mode=off .Build/bin/php-cs-fixer fix -v --dry-run --diff --config=Build/cgl/.php-cs-fixer.dist.php --using-cache=no" else - COMMAND="php -dxdebug.mode=off .Build/bin/php-cs-fixer fix -v --config=Build/cgl/.php-cs-fixer.dist.php --using-cache=no ." + COMMAND="php -dxdebug.mode=off .Build/bin/php-cs-fixer fix -v --config=Build/cgl/.php-cs-fixer.dist.php --using-cache=no" fi ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name cgl-${SUFFIX} -e COMPOSER_CACHE_DIR=.Build/.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}" SUITE_EXIT_CODE=$? diff --git a/Build/cgl/.php-cs-fixer.dist.php b/Build/cgl/.php-cs-fixer.dist.php index ec64ba4..5afb6a4 100644 --- a/Build/cgl/.php-cs-fixer.dist.php +++ b/Build/cgl/.php-cs-fixer.dist.php @@ -179,6 +179,8 @@ ->in([ __DIR__ . '/../..', ]) + ->exclude('Resources/Private/Php') + ->exclude('Build') ) ->setRiskyAllowed(true) ->setRules($mergedRules); diff --git a/Classes/DataProvider/ServerDataProvider.php b/Classes/DataProvider/ServerDataProvider.php index ec682f9..18dffc0 100644 --- a/Classes/DataProvider/ServerDataProvider.php +++ b/Classes/DataProvider/ServerDataProvider.php @@ -39,9 +39,9 @@ public function getLoginLink( $pleskClient->getPort(), $pleskClient->server()->createSession( $pleskServerRecord->get('username'), - $externalIpAddress + $externalIpAddress, ), - '/smb/web/view' + '/smb/web/view', ); } @@ -50,7 +50,7 @@ public function getLoginLink( '%s://%s:%d', $pleskClient->getProtocol() ?: 'https', $pleskClient->getHost(), - $pleskClient->getPort() + $pleskClient->getPort(), ); } } diff --git a/Classes/Hook/DataHandlerHook.php b/Classes/Hook/DataHandlerHook.php index 140508f..d211804 100644 --- a/Classes/Hook/DataHandlerHook.php +++ b/Classes/Hook/DataHandlerHook.php @@ -48,7 +48,7 @@ public function processDatamap_preProcessFieldArray( array &$incomingFieldArray, string $table, int|string $id, - DataHandler $dataHandler + DataHandler $dataHandler, ): void { if ($table !== self::TABLE || !isset($incomingFieldArray['password'])) { return; diff --git a/Classes/PasswordPolicy/Validator/PleskPasswordValidator.php b/Classes/PasswordPolicy/Validator/PleskPasswordValidator.php index 55b1dfb..62eef44 100644 --- a/Classes/PasswordPolicy/Validator/PleskPasswordValidator.php +++ b/Classes/PasswordPolicy/Validator/PleskPasswordValidator.php @@ -31,7 +31,7 @@ public function validate(string $password, ?ContextData $contextData = null): bo sprintf( $lang->sL('plesk_widget.password_policy:error.maximumLength'), self::MAX_PASSWORD_LENGTH, - ) + ), ); $isValid = false; } diff --git a/Classes/Plesk/Site.php b/Classes/Plesk/Site.php index b78cbe7..6b032fa 100644 --- a/Classes/Plesk/Site.php +++ b/Classes/Plesk/Site.php @@ -52,7 +52,7 @@ public function getHosting(): ?Hosting return new Hosting( $response->data->hosting->vrt_hst->ip_address, - $response->data->hosting->vrt_hst->property + $response->data->hosting->vrt_hst->property, ); } } diff --git a/Classes/Widget/PhpWidget.php b/Classes/Widget/PhpWidget.php index 510dbcf..3cea34a 100644 --- a/Classes/Widget/PhpWidget.php +++ b/Classes/Widget/PhpWidget.php @@ -23,14 +23,14 @@ use TYPO3\CMS\Dashboard\Widgets\WidgetRendererInterface; use TYPO3\CMS\Dashboard\Widgets\WidgetResult; -class PhpWidget implements WidgetRendererInterface +readonly class PhpWidget implements WidgetRendererInterface { public function __construct( - private readonly WidgetConfigurationInterface $configuration, - private readonly BackendViewFactory $backendViewFactory, - private readonly PleskServerRecordService $pleskServerRecordService, - private readonly PleskClientFactory $pleskClientFactory, - private readonly PleskSiteService $pleskSiteService, + private WidgetConfigurationInterface $configuration, + private BackendViewFactory $backendViewFactory, + private PleskServerRecordService $pleskServerRecordService, + private PleskClientFactory $pleskClientFactory, + private PleskSiteService $pleskSiteService, ) {} public function getSettingsDefinitions(): array diff --git a/Classes/Widget/ServerWidget.php b/Classes/Widget/ServerWidget.php index 217f23b..37cb1ed 100644 --- a/Classes/Widget/ServerWidget.php +++ b/Classes/Widget/ServerWidget.php @@ -27,15 +27,15 @@ use TYPO3\CMS\Dashboard\Widgets\WidgetRendererInterface; use TYPO3\CMS\Dashboard\Widgets\WidgetResult; -class ServerWidget implements WidgetRendererInterface +readonly class ServerWidget implements WidgetRendererInterface { public function __construct( - private readonly WidgetConfigurationInterface $configuration, - private readonly BackendViewFactory $backendViewFactory, - private readonly PleskServerRecordService $pleskServerRecordService, - private readonly ServerDataProvider $dataProvider, - private readonly PleskClientFactory $pleskClientFactory, - private readonly PleskSiteService $pleskSiteService, + private WidgetConfigurationInterface $configuration, + private BackendViewFactory $backendViewFactory, + private PleskServerRecordService $pleskServerRecordService, + private ServerDataProvider $dataProvider, + private PleskClientFactory $pleskClientFactory, + private PleskSiteService $pleskSiteService, ) {} public function getSettingsDefinitions(): array @@ -110,7 +110,7 @@ protected function getButtonProvider( ButtonProvider::class, 'Login to Plesk', $this->dataProvider->getLoginLink($pleskClient, $pleskServerRecord, $externalIpAddress), - '_blank' + '_blank', ); } diff --git a/composer.json b/composer.json index aa8c873..5060e30 100644 --- a/composer.json +++ b/composer.json @@ -38,11 +38,6 @@ "PleskX\\": "Resources/Private/Php/plesk/api-php-lib/src" } }, - "autoload-dev": { - "psr-4": { - "StefanFroemken\\PleskWidget\\Tests\\": "Tests" - } - }, "config": { "sort-packages": true, "vendor-dir": ".Build/vendor", diff --git a/ext_emconf.php b/ext_emconf.php index a53fa38..16c1b52 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -16,11 +16,11 @@ 'author_company' => '', 'state' => 'stable', 'clearCacheOnLoad' => 0, - 'version' => '3.0.1', + 'version' => '4.0.0', 'constraints' => [ 'depends' => [ - 'typo3' => '14.1.0-14.4.99', - 'dashboard' => '14.1.0-14.4.99', + 'typo3' => '14.0.0-14.4.99', + 'dashboard' => '14.0.0-14.4.99', ], 'conflicts' => [ ],