Skip to content

Commit

Permalink
#76 fix parameter order of implode()
Browse files Browse the repository at this point in the history
  • Loading branch information
digedag committed May 15, 2022
1 parent cb45eda commit d1a0257
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 18 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
'@Symfony' => true,
'phpdoc_align' => false,
'no_superfluous_phpdoc_tags' => false,
'single_line_comment_spacing' => false,
])
->setLineEnding("\n")
;
2 changes: 1 addition & 1 deletion Classes/Frontend/Action/MatchCrossTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private function getTeamsByUid($teamIds)
if (!count($teamIds)) {
return [];
}
$teamIds = implode($teamIds, ',');
$teamIds = implode(',', $teamIds);
$what = '*';
$from = 'tx_cfcleague_teams';
$options['where'] = 'tx_cfcleague_teams.uid IN ('.$teamIds.') ';
Expand Down
2 changes: 1 addition & 1 deletion Classes/Frontend/View/LeagueTableAllTimeView.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected function _createTable($templateList, $viewData, &$penalties, &$marks,
}
// Jetzt die einzelnen Teile zusammenfügen
$markerArray = [];
$subpartArray['###ROW###'] = implode($parts, $configurations->get('leaguetableAllTime.table.implode'));
$subpartArray['###ROW###'] = implode($configurations->get('leaguetableAllTime.table.implode'), $parts);

return \tx_rnbase_util_Templates::substituteMarkerArrayCached($templateList, $markerArray, $subpartArray);
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Frontend/View/LeagueTableView.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected function _createPenalties($template, &$penalties, $configurations)
if (count($parts)) {
// Zum Schluß das Haupttemplate zusammenstellen
$markerArray = [];
$subpartArray['###PENALTY###'] = implode($parts, $configurations->get('leaguetable.penalty.implode'));
$subpartArray['###PENALTY###'] = implode($configurations->get('leaguetable.penalty.implode'), $parts);
$out = Templates::substituteMarkerArrayCached($template, $markerArray, $subpartArray); // , $wrappedSubpartArray);
} else { // Keine Strafen vorhanden, es wird ein leerer String gesendet
$out = '';
Expand Down Expand Up @@ -172,7 +172,7 @@ protected function _createTable($templateList, $viewData, &$penalties, &$marks,
}
// Jetzt die einzelnen Teile zusammenfügen
$markerArray = [];
$subpartArray['###ROW###'] = implode($parts, $configurations->get('leaguetable.table.implode'));
$subpartArray['###ROW###'] = implode($configurations->get('leaguetable.table.implode'), $parts);

return Templates::substituteMarkerArrayCached($templateList, $markerArray, $subpartArray);
}
Expand Down
7 changes: 4 additions & 3 deletions Classes/Frontend/View/MatchCrossTableView.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ private function _createDatalines($template, $datalines, &$teams, ConfigurationI
$listBuilder = tx_rnbase::makeInstance(ListBuilder::class, tx_rnbase::makeInstance(MatchMarkerBuilderInfo::class));

$lines = [];
$markerArray = [];
// Über alle Zeilen iterieren
foreach ($datalines as $uid => $matches) {
$rowRollCnt = 0;
Expand All @@ -179,13 +180,13 @@ private function _createDatalines($template, $datalines, &$teams, ConfigurationI
$rowRollCnt = ($rowRollCnt >= $rowRoll) ? 0 : $rowRollCnt + 1;
}
// Jetzt die einzelnen Teile zusammenfügen
$subpartArray['###MATCHS###'] = implode($parts, $configurations->get('matchcrosstable.dataline.implode'));
$subpartArray['###MATCHS###'] = implode($configurations->get('matchcrosstable.dataline.implode'), $parts);
// Und das Team ins MarkerArray
$lineTemplate = $teamMarker->parseTemplate($template, $teams[$uid], $this->formatter, 'matchcrosstable.dataline.team.', 'DATALINE_TEAM');
$lines[] = Templates::substituteMarkerArrayCached($lineTemplate, $markerArray, $subpartArray);
}

return implode($lines, $configurations->get('matchcrosstable.dataline.implode'));
return implode($configurations->get('matchcrosstable.dataline.implode'), $lines);
}

/**
Expand All @@ -212,7 +213,7 @@ private function _createHeadline($template, &$teams, ConfigurationInterface $con
}
Misc::pullTT();

$subpartArray['###TEAM###'] = implode($parts, $configurations->get('matchcrosstable.headline.team.implode'));
$subpartArray['###TEAM###'] = implode($configurations->get('matchcrosstable.headline.team.implode'), $parts);
$markerArray = [
'###TEAMCOUNT###' => count($teams),
];
Expand Down
2 changes: 1 addition & 1 deletion Classes/Frontend/View/ScopeSelectionView.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected function _fillTemplate($template, &$itemsArr, Link $link, $markerName,
unset($keepVars[strtolower($markerName)]);
}
// Jetzt die einzelnen Teile zusammenfügen
$out = implode($parts, $configurations->get('scopeSelection.'.$confName.'.implode'));
$out = implode($configurations->get('scopeSelection.'.$confName.'.implode'), $parts);

// Im Haupttemplate stellen wir die ausgewählte Saison als Marker zur Verfügung
$markerArray = $configurations->getFormatter()->getItemMarkerArrayWrapped($currItem->getProperty(), $itemConfId.'current.', 0, $markerName.'_CURRENT_', $currItem->getColumnNames());
Expand Down
2 changes: 1 addition & 1 deletion Classes/Statistics/PlayerStatisticsMarker.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function parseTemplate($srvTemplate, &$stats, &$formatter, $statsConfId,
}
// Jetzt die einzelnen Teile zusammenfügen
$subpartArray = [];
$subpartArray['###'.$statsMarker.'_PROFILE###'] = implode($parts, $configurations->get($statsMarker.'profile.implode'));
$subpartArray['###'.$statsMarker.'_PROFILE###'] = implode($configurations->get($statsMarker.'profile.implode'), $parts);

$markerArray['###PLAYERCOUNT###'] = count($parts);

Expand Down
2 changes: 1 addition & 1 deletion Classes/Statistics/Service/PlayerSummaryStatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function _setAdditionalData(&$scopeArr, &$teams, &$compUids)
foreach ($teams as $team) {
$teamIds[] = $team->getUid();
}
$matchCount = $comp->getNumberOfMatches(implode($teamIds, ',')); // Spiele gesamt
$matchCount = $comp->getNumberOfMatches(implode(',', $teamIds)); // Spiele gesamt
$this->result['numberOfMatches'] = $this->result['numberOfMatches'] + $matchCount;
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/Statistics/TeamStatisticsMarker.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function parseTemplate($srvTemplate, &$stats, $formatter, $statsConfId, $
}
// Jetzt die einzelnen Teile zusammenfügen
$subpartArray = [];
$subpartArray['###'.$statsMarker.'_TEAM###'] = implode($parts, $configurations->get($statsMarker.'team.implode'));
$subpartArray['###'.$statsMarker.'_TEAM###'] = implode($configurations->get($statsMarker.'team.implode'), $parts);

$markerArray['###TEAMCOUNT###'] = count($parts);

Expand Down
2 changes: 1 addition & 1 deletion Classes/Utility/MatchProfileProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private function resolveProfiles(Match $match)
$uids[] = $match->getProperty('substitutes_guest');
}

$uids = implode($uids, ',');
$uids = implode(',', $uids);

$rows = $this->profileRepo->findByUids($uids);

Expand Down
6 changes: 3 additions & 3 deletions models/class.tx_cfcleaguefe_models_match.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function getTeam4Player($playerUid)
if ($this->getProperty('substitutes_home')) {
$uids[] = $this->getProperty('substitutes_home');
}
$uids = implode($uids, ',');
$uids = implode(',', $uids);
$uids = Strings::intExplode(',', $uids);
if (in_array($playerUid, $uids)) {
return 1;
Expand All @@ -256,7 +256,7 @@ public function getTeam4Player($playerUid)
if ($this->getProperty('substitutes_guest')) {
$uids[] = $this->getProperty('substitutes_guest');
}
$uids = implode($uids, ',');
$uids = implode(',', $uids);
$uids = Strings::intExplode(',', $uids);
if (in_array($playerUid, $uids)) {
return 2;
Expand Down Expand Up @@ -332,7 +332,7 @@ public function _resolveProfiles()
$uids[] = $this->getProperty('substitutes_guest');
}

$uids = implode($uids, ',');
$uids = implode(',', $uids);

$what = '*';
$from = 'tx_cfcleague_profiles';
Expand Down
4 changes: 2 additions & 2 deletions models/class.tx_cfcleaguefe_models_team.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ public function isDummy()
*/
public static function getTeams($competitionIds, $clubIds)
{
$competitionIds = implode(Strings::intExplode(',', $competitionIds), ',');
$clubIds = implode(Strings::intExplode(',', $clubIds), ',');
$competitionIds = implode(',', Strings::intExplode(',', $competitionIds));
$clubIds = implode(',', Strings::intExplode(',', $clubIds));

// $what = tx_cfcleaguefe_models_team::getWhat();
$what = 'tx_cfcleague_teams.*';
Expand Down
2 changes: 1 addition & 1 deletion util/class.tx_cfcleaguefe_util_LeagueTableWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private function _createTable($templateList, $tableData, &$penalties, &$marks, C
}
// Jetzt die einzelnen Teile zusammenfügen
$markerArray = [];
$subpartArray['###ROW###'] = implode($parts, $configurations->get($confId.'table.implode'));
$subpartArray['###ROW###'] = implode($configurations->get($confId.'table.implode'), $parts);

return Templates::substituteMarkerArrayCached($templateList, $markerArray, $subpartArray);
}
Expand Down

0 comments on commit d1a0257

Please sign in to comment.