Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 35 additions & 28 deletions .github/workflows/php.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,41 @@ jobs:
- 8.4

php-compatibility:
name: "PHPCompatibility"
runs-on: ubuntu-latest
needs: php-lint
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "8.0"
coverage: none
tools: composer:v2
- name: Prepare TYPO3
uses: ./.github/actions/t3prepare
with:
php-version: ${{ matrix.php-version }}
- name: "Run PHP CS with PHPCompatibility rule"
run: "composer test:phpcompat ${{ matrix.php-version }}"
strategy:
fail-fast: false
matrix:
php-version:
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
- 8.4
name: "PHPCompatibility"
runs-on: ubuntu-latest
needs: php-lint
steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "8.4"
coverage: none

- name: "Install PHPCompatibility"
run: |
composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer global require --dev \
squizlabs/php_codesniffer \
phpcompatibility/php-compatibility \
dealerdirect/phpcodesniffer-composer-installer \
--no-interaction

- name: "Run PHPCompatibility"
run: |
phpcs \
--ignore='.Build/*,Resources/*' \
--standard=PHPCompatibility \
--runtime-set testVersion ${{ matrix.php-version }} \
-p \
Classes Migrations Legacy tests

strategy:
fail-fast: false
matrix:
php-version: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]

code-style:
name: Check code style
Expand Down
4 changes: 3 additions & 1 deletion Classes/Backend/Form/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ protected function compileFormData($table, $uid, $record)
'returnUrl' => '',
];
}
$formDataCompilerInput['request'] = $this->module->getRequest();
if (TYPO3::isTYPO121OrHigher()) {
$formDataCompilerInput['request'] = $this->module->getRequest();
}

if (TYPO3::isTYPO130OrHigher()) {
$this->formDataCache[$cacheKey] = $this->formDataCompiler->compile($formDataCompilerInput, tx_rnbase::makeInstance(TcaDatabaseRecord::class));
Expand Down
5 changes: 4 additions & 1 deletion Classes/Backend/Module/BaseModFunc.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ abstract class BaseModFunc implements IModFunc
/* @var $mod IModule */
protected $mod;

private function init(IModule $module, $conf)
/**
* make private when t3 11 support is dropped.
*/
public function init(IModule $module, $conf)
{
$this->mod = $module;
}
Expand Down
37 changes: 20 additions & 17 deletions Classes/Backend/Module/BaseModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,16 @@ abstract class BaseModule extends BaseScriptClass implements IModule

/** @var string */
protected $selector;
/** @var ServerRequestInterface */
protected $request;
protected $languageTool;

/**
* Initializes the backend module by setting internal variables, initializing the menu.
*/
public function init()
{
$this->languageTool = tx_rnbase::makeInstance(LanguageTool::class);
parent::init();

if (0 === $this->id) {
Expand All @@ -102,7 +106,7 @@ public function init()
*/
public function getRequest(): ?ServerRequestInterface
{
return null;
return $this->request;
}

/**
Expand Down Expand Up @@ -130,6 +134,7 @@ public function __invoke(
$response = null
) {
$GLOBALS['MCONF']['script'] = '_DISPATCH';
$this->request = $request;
$this->init();
$this->main($request);

Expand Down Expand Up @@ -185,7 +190,7 @@ protected function prepareModuleParts($parts)

$parts->setContent($this->moduleContent());
$parts->setButtons($this->getButtons());
$parts->setTitle($this->getFormTool()->getLanguageService()->getLL('title'));
$parts->setTitle($this->getLanguageService()->getLL('title'));
$parts->setFuncMenu($this->getFuncMenu());
// if we got no array the user got no permissions for the
// selected page or no page is selected
Expand Down Expand Up @@ -258,7 +263,7 @@ public function getFormTool()
{
if (!$this->formTool) {
$this->formTool = tx_rnbase::makeInstance(ToolBox::class);
$this->formTool->init($this->getDoc(), $this);
$this->formTool->init($this->getModTemplate()->getDoc(), $this);
}

return $this->formTool;
Expand Down Expand Up @@ -348,11 +353,10 @@ public function printContent($returnContent = false)

if ($returnContent) {
return $content;
} else {
echo $content;

return null;
}
echo $content;

return null;
}

/**
Expand Down Expand Up @@ -422,17 +426,16 @@ protected function getFuncMenu()
}

return $menu;
}
$items = $this->getFuncMenuItems($this->MOD_MENU['function']);
$useTabs = intval($this->getConfigurations()->get('_cfg.funcmenu.useTabs')) > 0;
if ($useTabs) {
$menu = $this->getFormTool()->showTabMenu($this->getPid(), 'function', $this->getName(), $items);
} else {
$items = $this->getFuncMenuItems($this->MOD_MENU['function']);
$useTabs = intval($this->getConfigurations()->get('_cfg.funcmenu.useTabs')) > 0;
if ($useTabs) {
$menu = $this->getFormTool()->showTabMenu($this->getPid(), 'function', $this->getName(), $items);
} else {
$menu = $this->getFormTool()->showMenu($this->getPid(), 'function', $this->getName(), $items, $this->getModuleScript());
}

return $menu['menu'];
$menu = $this->getFormTool()->showMenu($this->getPid(), 'function', $this->getName(), $items, $this->getModuleScript());
}

return $menu['menu'];
}

/**
Expand Down Expand Up @@ -654,6 +657,6 @@ public function getRouteIdentifier()
*/
public function getLanguageService()
{
return $this->getFormTool()->getLanguageService();
return $this->languageTool;
}
}
4 changes: 2 additions & 2 deletions Classes/Backend/Template/ModuleTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ public function renderContent(ModuleParts $parts)
{
if (TYPO3::isTYPO121OrHigher()) {
return $this->renderContent12($parts);
} else {
return $this->renderContent76($parts);
}

return $this->renderContent76($parts);
}

public function getPageRenderer()
Expand Down
4 changes: 2 additions & 2 deletions Classes/Configuration/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1108,9 +1108,9 @@ private function getVal(string $key, array $tsArray): array
return ['', $currentArray[$segmentWithDot]];
} elseif (isset($currentArray[$segment])) {
return [$currentArray[$segment], []];
} else {
return ['', []];
}

return ['', []];
}

// tiefer steigen, wenn weiterer Pfad existiert
Expand Down
7 changes: 3 additions & 4 deletions Classes/Database/ResultIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ public function count()
$row = $result->fetchAssociative();

return (int) array_shift($row);
} else {
$row = $result->fetch();

return (int) $row['cnt'];
}
$row = $result->fetch();

return (int) $row['cnt'];
}
}
4 changes: 2 additions & 2 deletions Classes/Frontend/Controller/MainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,9 @@ private function _getParameterAction($parameters)
$action = $parameters->offsetExists('action') ? $parameters->offsetGet('action') : '';
if (!is_array($action)) {
return $action;
} else {
return key($action);
}

return key($action);
}

/**
Expand Down
13 changes: 6 additions & 7 deletions Classes/Search/SearchBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,13 @@ public function search(array $fields, array $options = [])

if ($queryOrBuilder instanceof QueryBuilder) {
return $this->countQuery($queryOrBuilder);
} else {
$what = 'COUNT(*) AS cnt';
$from = '('.$queryOrBuilder.') AS COUNTWRAP';
$sqlOptions = [
'enablefieldsoff' => true,
'sqlonly' => empty($options['sqlonly']) ? 0 : $options['sqlonly'],
];
}
$what = 'COUNT(*) AS cnt';
$from = '('.$queryOrBuilder.') AS COUNTWRAP';
$sqlOptions = [
'enablefieldsoff' => true,
'sqlonly' => empty($options['sqlonly']) ? 0 : $options['sqlonly'],
];
}
$result = $this->getDatabaseConnection()->doSelect(
$what,
Expand Down
2 changes: 1 addition & 1 deletion Classes/Utility/Arrays.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public static function removeNotIn(array $data, array $needle)
}

/**
* @see \TYPO3\CMS\Core\Utility\ArrayUtility::arrayDiffAssocRecursive()
* @see ArrayUtility::arrayDiffAssocRecursive()
*/
public static function arrayDiffAssocRecursive(array $array1, array $array2)
{
Expand Down
6 changes: 2 additions & 4 deletions Classes/Utility/Misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,8 @@ public static function mayday($msg, $extKey = '')
$dieOnMayday = (int) ConfigurationProcessor::getExtensionCfgValue('rn_base', 'dieOnMayday');
if ($dieOnMayday) {
exit($sPage);
} else {
echo $sPage;
}
echo $sPage;
}

/**
Expand Down Expand Up @@ -738,9 +737,8 @@ public static function sendErrorMail($mailAddr, $actionName, Throwable $e, array
$lock = Lock::getInstance('errormail', 60);
if ($lock->isLocked()) {
return;
} else {
$lock->lockProcess();
}
$lock->lockProcess();
} else {
$lock = null;
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Utility/Spyc.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ private function _yamlizeArray($array, $indent)
}

return $string;
} else {
return false;
}

return false;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions Classes/Utility/TSFAL.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/***************************************************************
* Copyright notice
*
* (c) 2013-2024 Rene Nitzsche
* (c) 2013-2026 Rene Nitzsche
* Contact: rene@system25.de
* All rights reserved
*
Expand Down Expand Up @@ -493,7 +493,7 @@ public static function getMediaTCA($ref, $options = [])
}

$config = [];
if (TYPO3::isTYPO115OrHigher()) {
if (TYPO3::isTYPO121OrHigher()) {
$config = [
'type' => 'file',
'appearance' => $customSettingOverride['appearance'] ?? [],
Expand Down
4 changes: 2 additions & 2 deletions Classes/Utility/TYPO3.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ private static function findTYPO3Version(): string
$t3version = tx_rnbase::makeInstance('TYPO3\CMS\Core\Information\Typo3Version');

return $t3version->getVersion();
} else {
return TYPO3_version;
}

return TYPO3_version;
}

/**
Expand Down
11 changes: 5 additions & 6 deletions Classes/Utility/XmlElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,12 @@ public function addCData($value, $key = null)
$node = $this->addChild($key);

return $node->addCData($value);
} else {
$node = dom_import_simplexml($this);
$no = $node->ownerDocument;
$node->appendChild($no->createCDATASection($value));

return $this;
}
$node = dom_import_simplexml($this);
$no = $node->ownerDocument;
$node->appendChild($no->createCDATASection($value));

return $this;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@
]
},
"branch-alias": {
"dev-master": "1.19.x-dev",
"dev-upgrade/typo3_13": "1.19.x-dev"
"dev-master": "1.20.x-dev",
"dev-bugfix/t3-11-module-error": "1.20.x-dev"
}
}
}
Loading