Skip to content

Commit

Permalink
[TASK] Drop TemplateHelper::pi_autoCacheFields
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverklee committed Aug 22, 2024
1 parent cda2560 commit b2cab15
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 29 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- Drop unused `AbstractPlugin` code from `TemplateHelper`
(#3237, #3238, #3240, #3241, #3242, #3243, #3245, #3246, #3250, #3251, #3253,
#3255, #3256, #3258, #3260, #3261, #3263, #3264, #3265, #3266, #3268, #3269,
#3270)
#3270, #3273)
- Drop redundant type casts (#3229, #3267)
- Drop redundant null coalescing operators (#3228)
- Remove dead code from `TemplateHelper` (#3220, #3221, #3222, #3223, #3224)
Expand Down
19 changes: 1 addition & 18 deletions Classes/Templating/TemplateHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ abstract class TemplateHelper
*/
private $altLLkey = '';

/**
* @var array
*/
private $pi_autoCacheFields = [];

/**
* @var bool
*/
Expand Down Expand Up @@ -1588,7 +1583,7 @@ protected function pi_linkTP_keepPIvars(string $str, array $overrulePIvars = [],
}

/**
* Returns TRUE if the array $inArray contains only values allowed to be cached based on the configuration in $this->pi_autoCacheFields
* Returns TRUE if the array $inArray contains only values allowed to be cached.
* Used by ->pi_linkTP_keepPIvars
* This is an advanced form of evaluation of whether a URL should be cached or not.
*
Expand All @@ -1600,18 +1595,6 @@ public function pi_autoCache(array $inArray): bool
foreach ($inArray as $fN => $fV) {
if (!\strcmp($inArray[$fN], '')) {
unset($inArray[$fN]);
} elseif (\is_array($this->pi_autoCacheFields[$fN])) {
if (\is_array($this->pi_autoCacheFields[$fN]['range'])
&& (int)$inArray[$fN] >= (int)$this->pi_autoCacheFields[$fN]['range'][0]
&& (int)$inArray[$fN] <= (int)$this->pi_autoCacheFields[$fN]['range'][1]
) {
unset($inArray[$fN]);
}
if (\is_array($this->pi_autoCacheFields[$fN]['list'])
&& \in_array($inArray[$fN], $this->pi_autoCacheFields[$fN]['list'], true)
) {
unset($inArray[$fN]);
}
}
}

Expand Down
10 changes: 0 additions & 10 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1775,11 +1775,6 @@ parameters:
count: 1
path: Classes/Service/RegistrationProcessor.php

-
message: "#^Cannot cast mixed to int\\.$#"
count: 2
path: Classes/Templating/TemplateHelper.php

-
message: "#^Constructor of class OliverKlee\\\\Seminars\\\\Templating\\\\TemplateHelper has an unused parameter \\$_\\.$#"
count: 1
Expand Down Expand Up @@ -1835,11 +1830,6 @@ parameters:
count: 1
path: Classes/Templating/TemplateHelper.php

-
message: "#^Property OliverKlee\\\\Seminars\\\\Templating\\\\TemplateHelper\\:\\:\\$pi_autoCacheFields type has no value type specified in iterable type array\\.$#"
count: 1
path: Classes/Templating/TemplateHelper.php

-
message: "#^Cannot cast mixed to int\\.$#"
count: 2
Expand Down

0 comments on commit b2cab15

Please sign in to comment.