Skip to content

Commit

Permalink
[TASK] Remove unused arguments from ext_getObjTree()
Browse files Browse the repository at this point in the history
ExtendedTemplateService->ext_getObjTree() has
unused properties. Since "ExtendedTemplateService"
is marked as internal, these methods can be removed.

Resolves: #96539
Releases: main
Change-Id: If5328a790ce167156750cb26a097c257cdb368cb
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73017
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
bmack authored and lolli42 committed Jan 14, 2022
1 parent ade1708 commit 702aa61
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
20 changes: 5 additions & 15 deletions typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php
Expand Up @@ -160,15 +160,8 @@ class ExtendedTemplateService extends TemplateService
*/
protected $javaScriptInstructions = [];

/**
* @var \TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser
*/
private $constantParser;
private ConstantConfigurationParser $constantParser;

/**
* @param Context|null $context
* @param \TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser $constantParser
*/
public function __construct(Context $context = null, ConstantConfigurationParser $constantParser = null)
{
parent::__construct($context);
Expand Down Expand Up @@ -314,20 +307,17 @@ public function ext_getSetup($theSetup, $theKey)
* @param array $arr
* @param string $depth_in
* @param string $depthData
* @param string $parentType (unused)
* @param string $parentValue (unused)
* @param string $alphaSort sorts the array keys / tree by alphabet when set to 1
* @param bool $alphaSort sorts the array keys / tree by alphabet when set
* @return string
*/
public function ext_getObjTree($arr, $depth_in, $depthData, $parentType = '', $parentValue = '', $alphaSort = '0')
public function ext_getObjTree($arr, $depth_in, $depthData, bool $alphaSort = false)
{
$HTML = '';
if ($alphaSort == '1') {
if ($alphaSort) {
ksort($arr);
}
$keyArr_num = [];
$keyArr_alpha = [];
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
foreach ($arr as $key => $value) {
// Don't do anything with comments / linenumber registrations...
Expand Down Expand Up @@ -413,7 +403,7 @@ public function ext_getObjTree($arr, $depth_in, $depthData, $parentType = '', $p
}
$HTML .= '</span>';
if ($deeper) {
$HTML .= $this->ext_getObjTree($arr[$key . '.'] ?? [], $depth, $depthData, '', $arr[$key] ?? '', $alphaSort);
$HTML .= $this->ext_getObjTree($arr[$key . '.'] ?? [], $depth, $depthData, $alphaSort);
}
}
}
Expand Down
Expand Up @@ -214,7 +214,7 @@ public function main(ServerRequestInterface $request)
}

$this->view->assign('csh', BackendUtility::cshItem('_MOD_web_info', 'tsconfig_hierarchy', '', '|'));
$this->view->assign('tree', $tmpl->ext_getObjTree($pageTsConfig, '', '', '', '', $this->pObj->MOD_SETTINGS['tsconf_alphaSort'] ?? '0'));
$this->view->assign('tree', $tmpl->ext_getObjTree($pageTsConfig, '', '', (bool)($this->pObj->MOD_SETTINGS['tsconf_alphaSort'] ?? false)));
}
$this->view->assign('alphaSort', BackendUtility::getFuncCheck($this->id, 'SET[tsconf_alphaSort]', $this->pObj->MOD_SETTINGS['tsconf_alphaSort'] ?? false, '', '', 'id="checkTsconf_alphaSort"'));
$this->view->assign('dropdownMenu', BackendUtility::getDropdownMenu($this->id, 'SET[tsconf_parts]', $this->pObj->MOD_SETTINGS['tsconf_parts'], $this->pObj->MOD_MENU['tsconf_parts']));
Expand Down
Expand Up @@ -288,7 +288,6 @@ public function main()
$urlParameters = [
'id' => $this->id,
];
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$aHref = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
$assigns['moduleUrl'] = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
Expand Down Expand Up @@ -335,8 +334,8 @@ public function main()
if (!$theKey || !str_replace('-', '', $theKey)) {
$theKey = '';
}
[$theSetup, $theSetupValue] = $this->templateService->ext_getSetup($theSetup, $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType] ?? '');
$tree = $this->templateService->ext_getObjTree($theSetup, $theKey, '', '', $theSetupValue, $this->pObj->MOD_SETTINGS['ts_browser_alphaSort'] ?? '');
[$theSetup] = $this->templateService->ext_getSetup($theSetup, $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType] ?? '');
$tree = $this->templateService->ext_getObjTree($theSetup, $theKey, '', (bool)($this->pObj->MOD_SETTINGS['ts_browser_alphaSort'] ?? false));
$tree = $this->templateService->substituteCMarkers($tree);
$urlParameters = [
'id' => $this->id,
Expand Down

0 comments on commit 702aa61

Please sign in to comment.