Skip to content

Commit

Permalink
Cleanup fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesbochmann committed Jan 8, 2024
1 parent 471ae7f commit 02d1440
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 34 deletions.
4 changes: 2 additions & 2 deletions Configuration/Backend/AjaxRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
return [
'blob_image' => [
'path' => '/blob/image',
'target' => \DMK\MkContentAi\Controller\AjaxController::class.'::blobImage',
'target' => DMK\MkContentAi\Controller\AjaxController::class.'::blobImage',
],
'image_prompt' => [
'path' => '/image/prompt',
'target' => \DMK\MkContentAi\Controller\AiImageController::class.'::promptResultAjaxAction',
'target' => DMK\MkContentAi\Controller\AiImageController::class.'::promptResultAjaxAction',
],
];
4 changes: 2 additions & 2 deletions Configuration/Backend/Modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
'labels' => 'LLL:EXT:mkcontentai/Resources/Private/Language/locallang_contentai.xlf',
'extensionName' => 'Mkcontentai',
'controllerActions' => [
\DMK\MkContentAi\Controller\AiImageController::class => [
DMK\MkContentAi\Controller\AiImageController::class => [
'filelist', 'variants', 'prompt', 'promptResult', 'saveFile', 'upscale', 'extend', 'cropAndExtend',
],
\DMK\MkContentAi\Controller\SettingsController::class => [
DMK\MkContentAi\Controller\SettingsController::class => [
'settings',
],
],
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

return [
'mkcontentai' => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'provider' => TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'source' => 'EXT:mkcontentai/Resources/Public/Icons/Extension.svg',
],
];
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/sys_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@

defined('TYPO3') || exit;

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('mkcontentai', 'Configuration/TypoScript', 'DMK Content AI');
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('mkcontentai', 'Configuration/TypoScript', 'DMK Content AI');
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
* of the License, or any later version.
*/

$GLOBALS['TCA']['tt_content']['columns']['image']['config']['customControls']['addHeader']['userFunc'] = \DMK\MkContentAi\User\InlineControl\ImageGenerationButton::class.'->render';
$GLOBALS['TCA']['tt_content']['columns']['image']['config']['customControls']['addHeader']['userFunc'] = DMK\MkContentAi\User\InlineControl\ImageGenerationButton::class.'->render';
38 changes: 19 additions & 19 deletions Tests/UnitTestsBootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use TYPO3\CMS\Core\Information\Typo3Version;

call_user_func(function () {
$testbase = new \TYPO3\TestingFramework\Core\Testbase();
$testbase = new TYPO3\TestingFramework\Core\Testbase();

// These if's 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
Expand All @@ -34,42 +34,42 @@

$testbase->defineSitePath();

$requestType = \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE | \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_CLI;
\TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, $requestType);
$requestType = TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE | TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_CLI;
TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, $requestType);

$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath().'/typo3conf/ext');
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath().'/typo3temp/assets');
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath().'/typo3temp/var/tests');
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath().'/typo3temp/var/transient');
$testbase->createDirectory(TYPO3\CMS\Core\Core\Environment::getPublicPath().'/typo3conf/ext');
$testbase->createDirectory(TYPO3\CMS\Core\Core\Environment::getPublicPath().'/typo3temp/assets');
$testbase->createDirectory(TYPO3\CMS\Core\Core\Environment::getPublicPath().'/typo3temp/var/tests');
$testbase->createDirectory(TYPO3\CMS\Core\Core\Environment::getPublicPath().'/typo3temp/var/transient');

// Retrieve an instance of class loader and inject to core bootstrap
$classLoader = require $testbase->getPackagesPath().'/autoload.php';
\TYPO3\CMS\Core\Core\Bootstrap::initializeClassLoader($classLoader);
TYPO3\CMS\Core\Core\Bootstrap::initializeClassLoader($classLoader);

// Initialize default TYPO3_CONF_VARS
$configurationManager = new \TYPO3\CMS\Core\Configuration\ConfigurationManager();
$configurationManager = new TYPO3\CMS\Core\Configuration\ConfigurationManager();
$GLOBALS['TYPO3_CONF_VARS'] = $configurationManager->getDefaultConfiguration();

$cache = new \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend(
$cache = new TYPO3\CMS\Core\Cache\Frontend\PhpFrontend(
'core',
new \TYPO3\CMS\Core\Cache\Backend\NullBackend('production', [])
new TYPO3\CMS\Core\Cache\Backend\NullBackend('production', [])
);
// Set all packages to active
if (version_compare((new Typo3Version())->getVersion(), '11.3.0', '>')) {
$packageManager = \TYPO3\CMS\Core\Core\Bootstrap::createPackageManager(
\TYPO3\CMS\Core\Package\UnitTestPackageManager::class,
\TYPO3\CMS\Core\Core\Bootstrap::createPackageCache($cache)
$packageManager = TYPO3\CMS\Core\Core\Bootstrap::createPackageManager(
TYPO3\CMS\Core\Package\UnitTestPackageManager::class,
TYPO3\CMS\Core\Core\Bootstrap::createPackageCache($cache)
);
} else {
$packageManager = \TYPO3\CMS\Core\Core\Bootstrap::createPackageManager(
\TYPO3\CMS\Core\Package\UnitTestPackageManager::class,
$packageManager = TYPO3\CMS\Core\Core\Bootstrap::createPackageManager(
TYPO3\CMS\Core\Package\UnitTestPackageManager::class,
$cache
);
}
\TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Package\PackageManager::class, $packageManager);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::setPackageManager($packageManager);
TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance(TYPO3\CMS\Core\Package\PackageManager::class, $packageManager);
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::setPackageManager($packageManager);

$testbase->dumpClassLoadingInformation();

\TYPO3\CMS\Core\Utility\GeneralUtility::purgeInstances();
TYPO3\CMS\Core\Utility\GeneralUtility::purgeInstances();
});
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@
"@test"
],
"lint:php": [
".Build/bin/parallel-lint ./*"
"[ -e .Build/bin/parallel-lint ] || composer update",
"echo 'parallel-lint fails with a exception if executed inside the vendor/dmk/mkcontentai folder'",
"[ -e ../../autoload.php ] && mv ../../autoload.php ../../autoload.php.bak",
".Build/bin/parallel-lint ./Classes",
"[ -e ../../autoload.php.bak ] && mv ../../autoload.php.bak ../../autoload.php"
],
"lint:yaml": [
".Build/bin/yaml-lint --ansi -n -v ./Configuration ./Resources"
Expand Down
4 changes: 2 additions & 2 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
use TYPO3\CMS\Core\Utility\GeneralUtility;

// Hook into the button bar (only for TYPO3 ^11 version)
$typo3Version = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Information\Typo3Version::class);
$typo3Version = GeneralUtility::makeInstance(TYPO3\CMS\Core\Information\Typo3Version::class);

if (11 == $typo3Version->getMajorVersion()) {
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Backend\Template\Components\ButtonBar']['getButtonsHook']['ButtonBarHook']
= ButtonBarHook::class.'->getButtons';
}

$GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders'][1697195476] =
\DMK\MkContentAi\ContextMenu\ContentAiItemProvider::class;
DMK\MkContentAi\ContextMenu\ContentAiItemProvider::class;
10 changes: 5 additions & 5 deletions ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
defined('TYPO3') or exit;

(static function () {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
'Mkcontentai',
'system',
'contentai',
'',
[
\DMK\MkContentAi\Controller\AiImageController::class => 'filelist, variants, prompt, promptResult, saveFile, upscale, extend, cropAndExtend',
\DMK\MkContentAi\Controller\SettingsController::class => 'settings',
DMK\MkContentAi\Controller\AiImageController::class => 'filelist, variants, prompt, promptResult, saveFile, upscale, extend, cropAndExtend',
DMK\MkContentAi\Controller\SettingsController::class => 'settings',
],
[
'access' => 'user,group',
Expand All @@ -32,6 +32,6 @@
]
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_mkcontentai_domain_model_image', 'EXT:mkcontentai/Resources/Private/Language/locallang_csh_tx_mkcontentai_domain_model_image.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_mkcontentai_domain_model_image');
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_mkcontentai_domain_model_image', 'EXT:mkcontentai/Resources/Private/Language/locallang_csh_tx_mkcontentai_domain_model_image.xlf');
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_mkcontentai_domain_model_image');
})();

0 comments on commit 02d1440

Please sign in to comment.