diff --git a/.github/workflows/php.yaml b/.github/workflows/php.yaml index 2a1fa36..d4c5371 100644 --- a/.github/workflows/php.yaml +++ b/.github/workflows/php.yaml @@ -74,50 +74,21 @@ jobs: - "8.0" - "8.1" - "8.2" - php-qs: - name: "PHP QS" - + php-cs-fixer: + name: PHP-CS-Fixer runs-on: ubuntu-latest - needs: php-lint - - strategy: - matrix: - command: - - "test:phpcs" -# - "test:phpmd" -# - "test:phpstan" - php-version: - - "7.4" steps: - - name: "Checkout" - uses: "actions/checkout@v2" - + - uses: actions/checkout@master + with: + ref: ${{ github.ref }} - name: Setup PHP uses: shivammathur/setup-php@master with: - php-version: "${{ matrix.php-version }}" - extensions: "${{ env.PHP_EXTENSIONS }}" - - - name: "Determine composer cache directory" - id: "determine-composer-cache-directory" - run: "echo \"::set-output name=directory::$(composer config cache-dir)\"" - - - name: "Cache dependencies installed with composer" - uses: "actions/cache@v2.0.0" - with: - path: "${{ steps.determine-composer-cache-directory.outputs.directory }}" - key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-" - - - name: "Install composer dependencies" - run: "composer install --no-interaction --no-progress --no-suggest" - - - name: "Run command" - run: "composer ${{ matrix.command }}" - -# - run: composer require friendsofphp/php-cs-fixer -# - run: .Build/bin/php-cs-fixer fix --diff --dry-run + php-version: 8.1 + - run: "composer install --no-interaction --no-progress --no-suggest" +# - run: composer require friendsofphp/php-cs-fixer:3.35.1 + - run: .Build/bin/php-cs-fixer fix --diff --dry-run php-unit: name: "PHP Unit" diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index d105f80..63a3de4 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -8,11 +8,18 @@ $config = new PhpCsFixer\Config(); return $config->setFinder($finder) + ->setCacheFile('.Build/.php_cs.cache') ->setRules([ '@Symfony' => true, 'phpdoc_align' => false, 'no_superfluous_phpdoc_tags' => false, 'single_line_comment_spacing' => false, + 'global_namespace_import' => [ + 'import_classes' => true, 'import_constants' => false, 'import_functions' => false + ], + 'phpdoc_separation' => [ + 'skip_unlisted_annotations' => true, + ], ]) ->setLineEnding("\n") ; diff --git a/Classes/Filter/MatchFilter.php b/Classes/Filter/MatchFilter.php index 2d18801..f9ddd88 100644 --- a/Classes/Filter/MatchFilter.php +++ b/Classes/Filter/MatchFilter.php @@ -9,6 +9,7 @@ use System25\T3sports\Model\Profile; use System25\T3sports\Utility\MatchTableBuilder; use System25\T3sports\Utility\ScopeController; +use tx_rnbase; /*************************************************************** * Copyright notice @@ -114,7 +115,7 @@ public function parseTemplate($template, &$formatter, $confId, $marker = 'FILTER $profileSubpart = Templates::getSubpart($template, $profSubpartName); $profile = Profile::getProfileInstance($filterData); - $profileMarker = \tx_rnbase::makeInstance('tx_cfcleaguefe_util_ProfileMarker'); + $profileMarker = tx_rnbase::makeInstance('tx_cfcleaguefe_util_ProfileMarker'); $subpartArray[$profSubpartName] = $profileMarker->parseTemplate($profileSubpart, $profile, $formatter, $confId.$key.'.', strtoupper($key)); } } diff --git a/Classes/Filter/MatchNoteFilter.php b/Classes/Filter/MatchNoteFilter.php index a6ed16a..bea0de1 100644 --- a/Classes/Filter/MatchNoteFilter.php +++ b/Classes/Filter/MatchNoteFilter.php @@ -4,6 +4,8 @@ use Sys25\RnBase\Frontend\Filter\BaseFilter; use Sys25\RnBase\Frontend\Request\RequestInterface; +use Tx_Rnbase_Configuration_ProcessorInterface; +use tx_rnbase_IParameters; /*************************************************************** * Copyright notice @@ -39,8 +41,8 @@ class MatchNoteFilter extends BaseFilter * * @param array $fields * @param array $options - * @param \tx_rnbase_IParameters $parameters - * @param \Tx_Rnbase_Configuration_ProcessorInterface $configurations + * @param tx_rnbase_IParameters $parameters + * @param Tx_Rnbase_Configuration_ProcessorInterface $configurations * @param string $confId */ protected function initFilter(&$fields, &$options, RequestInterface $request) diff --git a/Classes/Filter/StadiumFilter.php b/Classes/Filter/StadiumFilter.php index c0ff1c8..0812a3e 100644 --- a/Classes/Filter/StadiumFilter.php +++ b/Classes/Filter/StadiumFilter.php @@ -6,6 +6,8 @@ use Sys25\RnBase\Frontend\Request\RequestInterface; use System25\T3sports\Search\SearchBuilder; use System25\T3sports\Utility\ScopeController; +use tx_rnbase_configurations; +use tx_rnbase_IParameters; /*************************************************************** * Copyright notice @@ -41,8 +43,8 @@ class StadiumFilter extends BaseFilter * * @param array $fields * @param array $options - * @param \tx_rnbase_IParameters $parameters - * @param \tx_rnbase_configurations $configurations + * @param tx_rnbase_IParameters $parameters + * @param tx_rnbase_configurations $configurations * @param string $confId */ protected function initFilter(&$fields, &$options, RequestInterface $request) diff --git a/Classes/Frontend/Action/ProfileList.php b/Classes/Frontend/Action/ProfileList.php index 3a0dcfc..dcdbe0b 100644 --- a/Classes/Frontend/Action/ProfileList.php +++ b/Classes/Frontend/Action/ProfileList.php @@ -47,7 +47,7 @@ class ProfileList extends AbstractAction { private $profileRepo; - public function __construct(?ProfileRepository $repo = null) + public function __construct(ProfileRepository $repo = null) { $this->profileRepo = $repo ?: new ProfileRepository(); } diff --git a/Classes/Frontend/Marker/ProfileMarker.php b/Classes/Frontend/Marker/ProfileMarker.php index a84ea3b..46e4dc6 100644 --- a/Classes/Frontend/Marker/ProfileMarker.php +++ b/Classes/Frontend/Marker/ProfileMarker.php @@ -82,7 +82,7 @@ public function initLabelMarkers(FormatUtil $formatter, $profileConfId, $default protected function prepareTemplate($template, $profile, $formatter, $confId, $marker = 'PROFILE') { $this->tnDecorator->addTeamNotes($profile, $this->options['team'] ?? null); -// $profile->addTeamNotes($this->options['team']); + // $profile->addTeamNotes($this->options['team']); $profile->setProperty('firstpicture', $profile->getProperty('t3images')); $profile->setProperty('pictures', $profile->getProperty('t3images')); diff --git a/Classes/Frontend/Marker/TeamMarker.php b/Classes/Frontend/Marker/TeamMarker.php index b6d8a37..62de3fa 100644 --- a/Classes/Frontend/Marker/TeamMarker.php +++ b/Classes/Frontend/Marker/TeamMarker.php @@ -44,7 +44,7 @@ */ class TeamMarker extends BaseMarker { - private $options = null; + private $options; private $profileRepo; public function __construct($options = null) diff --git a/Classes/Frontend/View/LeagueTableAllTimeView.php b/Classes/Frontend/View/LeagueTableAllTimeView.php index 24f515f..01a9abf 100644 --- a/Classes/Frontend/View/LeagueTableAllTimeView.php +++ b/Classes/Frontend/View/LeagueTableAllTimeView.php @@ -5,6 +5,8 @@ use Sys25\RnBase\Frontend\Marker\Templates; use Sys25\RnBase\Frontend\Request\RequestInterface; use tx_rnbase; +use tx_rnbase_util_Templates; +use tx_rnbase_util_TYPO3; /*************************************************************** * Copyright notice @@ -34,7 +36,7 @@ */ class LeagueTableAllTimeView extends LeagueTableView { -// public function createOutput($template, &$viewData, &$configurations, &$formatter) + // public function createOutput($template, &$viewData, &$configurations, &$formatter) public function createOutput($template, RequestInterface $request, $formatter) { $marks = $markerArray = $penalties = []; @@ -88,7 +90,7 @@ protected function _createTable($templateList, $viewData, &$penalties, &$marks, $markerArray = []; $subpartArray['###ROW###'] = implode($configurations->get('leaguetableAllTime.table.implode'), $parts); - return \tx_rnbase_util_Templates::substituteMarkerArrayCached($templateList, $markerArray, $subpartArray); + return tx_rnbase_util_Templates::substituteMarkerArrayCached($templateList, $markerArray, $subpartArray); } /** @@ -155,7 +157,7 @@ protected function _setMark(&$row, &$marks) protected function _createControls($template, $viewData, $configurations) { $link = $configurations->createLink(); - $pid = \tx_rnbase_util_TYPO3::getTSFE()->id; // Das Ziel der Seite vorbereiten + $pid = tx_rnbase_util_TYPO3::getTSFE()->id; // Das Ziel der Seite vorbereiten $link->destination($pid); // Das Ziel der Seite vorbereiten $markerArray = []; diff --git a/Classes/Frontend/View/LeagueTableView.php b/Classes/Frontend/View/LeagueTableView.php index 7422758..3f23eb0 100644 --- a/Classes/Frontend/View/LeagueTableView.php +++ b/Classes/Frontend/View/LeagueTableView.php @@ -13,6 +13,7 @@ use System25\T3sports\Model\Team; use System25\T3sports\Table\ITableType; use tx_rnbase; +use tx_rnbase_util_Templates; /*************************************************************** * Copyright notice @@ -56,6 +57,7 @@ public function createOutput($template, RequestInterface $request, $formatter) $table = $viewData->offsetGet('table'); if (is_object($table)) { $viewData->offsetUnset('table'); + // Ausgabe mit neuem Verfahren return $this->showLeagueTable($table, $template, $request); } @@ -259,15 +261,15 @@ protected function _createControls($template, $viewData, $configurations) '###CONTROL_POINTSYSTEM###' => '', ]; if ($viewData->offsetGet('tabletype_select')) { - $subpartArray['###CONTROL_TABLETYPE###'] = $this->_fillControlTemplate(\tx_rnbase_util_Templates::getSubpart($template, '###CONTROL_TABLETYPE###'), $viewData->offsetGet('tabletype_select'), $link, 'TABLETYPE', $configurations); + $subpartArray['###CONTROL_TABLETYPE###'] = $this->_fillControlTemplate(tx_rnbase_util_Templates::getSubpart($template, '###CONTROL_TABLETYPE###'), $viewData->offsetGet('tabletype_select'), $link, 'TABLETYPE', $configurations); } if ($viewData->offsetGet('tablescope_select')) { - $subpartArray['###CONTROL_TABLESCOPE###'] = $this->_fillControlTemplate(\tx_rnbase_util_Templates::getSubpart($template, '###CONTROL_TABLESCOPE###'), $viewData->offsetGet('tablescope_select'), $link, 'TABLESCOPE', $configurations); + $subpartArray['###CONTROL_TABLESCOPE###'] = $this->_fillControlTemplate(tx_rnbase_util_Templates::getSubpart($template, '###CONTROL_TABLESCOPE###'), $viewData->offsetGet('tablescope_select'), $link, 'TABLESCOPE', $configurations); } if ($viewData->offsetGet('pointsystem_select')) { - $subpartArray['###CONTROL_POINTSYSTEM###'] = $this->_fillControlTemplate(\tx_rnbase_util_Templates::getSubpart($template, '###CONTROL_POINTSYSTEM###'), $viewData->offsetGet('pointsystem_select'), $link, 'POINTSYSTEM', $configurations); + $subpartArray['###CONTROL_POINTSYSTEM###'] = $this->_fillControlTemplate(tx_rnbase_util_Templates::getSubpart($template, '###CONTROL_POINTSYSTEM###'), $viewData->offsetGet('pointsystem_select'), $link, 'POINTSYSTEM', $configurations); } return Templates::substituteMarkerArrayCached($template, $markerArray, $subpartArray); diff --git a/Classes/Frontend/View/MatchCrossTableView.php b/Classes/Frontend/View/MatchCrossTableView.php index de97b3c..89ef008 100644 --- a/Classes/Frontend/View/MatchCrossTableView.php +++ b/Classes/Frontend/View/MatchCrossTableView.php @@ -141,6 +141,7 @@ private function findMatch(&$matches, $home, $guest) $ret[] = $matches[$i]; } } + // Die Paarung gibt es nicht. return count($ret) ? $ret : $this->noMatchStr; } diff --git a/Classes/Frontend/View/ScopeSelectionView.php b/Classes/Frontend/View/ScopeSelectionView.php index 5b991e4..4ff84cb 100644 --- a/Classes/Frontend/View/ScopeSelectionView.php +++ b/Classes/Frontend/View/ScopeSelectionView.php @@ -53,7 +53,7 @@ class ScopeSelectionView extends BaseView public function createOutput($template, RequestInterface $request, $formatter) { $configurations = $request->getConfigurations(); -// $viewData = $request->getViewContext(); + // $viewData = $request->getViewContext(); $viewData = $configurations->getViewData(); $link = $configurations->createLink(); $link->destination(TYPO3::getTSFE()->id); // Das Ziel der Seite vorbereiten diff --git a/Classes/Frontend/View/StadiumList.php b/Classes/Frontend/View/StadiumList.php index c939197..45d2dfb 100644 --- a/Classes/Frontend/View/StadiumList.php +++ b/Classes/Frontend/View/StadiumList.php @@ -2,6 +2,7 @@ namespace System25\T3sports\Frontend\View; +use Exception; use Sys25\RnBase\Frontend\Marker\BaseMarker; use Sys25\RnBase\Frontend\Marker\ListBuilder; use Sys25\RnBase\Frontend\Marker\Templates; @@ -96,7 +97,7 @@ private function getMap($items, $configurations, $confId, $markerPrefix) $map->addMarker($marker); } $ret = $map->draw(); - } catch (\Exception $e) { + } catch (Exception $e) { $ret = '###LABEL_mapNotAvailable###'; } diff --git a/Classes/Hook/MatchChartHook.php b/Classes/Hook/MatchChartHook.php index f43b2ef..1ece7da 100644 --- a/Classes/Hook/MatchChartHook.php +++ b/Classes/Hook/MatchChartHook.php @@ -45,8 +45,8 @@ public function addChart($params, $parent) $marker = $params['marker']; $confId = $params['confid']; $template = $params['template']; - if (!BaseMarker::containsMarker($template, 'MARKERMODULE__CHARTMATCH') && - !BaseMarker::containsMarker($template, $marker.'_CHARTMATCH')) { + if (!BaseMarker::containsMarker($template, 'MARKERMODULE__CHARTMATCH') + && !BaseMarker::containsMarker($template, $marker.'_CHARTMATCH')) { return; } diff --git a/Classes/Hook/MatchHistoryHook.php b/Classes/Hook/MatchHistoryHook.php index 2dcfd93..1377ada 100644 --- a/Classes/Hook/MatchHistoryHook.php +++ b/Classes/Hook/MatchHistoryHook.php @@ -51,8 +51,8 @@ public function addMatches($params, $parent) { $marker = $params['marker']; $template = $params['template']; - if (BaseMarker::containsMarker($template, 'MARKERMODULE__MATCHHISTORY') || - BaseMarker::containsMarker($template, $marker.'_MATCHHISTORY')) { + if (BaseMarker::containsMarker($template, 'MARKERMODULE__MATCHHISTORY') + || BaseMarker::containsMarker($template, $marker.'_MATCHHISTORY')) { $formatter = $params['formatter']; $matches = $this->getMarkerValue($params, $formatter); $markerArray['###MARKERMODULE__MATCHHISTORY###'] = $matches; // backward diff --git a/Classes/Hook/TtNewsMarker.php b/Classes/Hook/TtNewsMarker.php index 919059c..091ef1a 100644 --- a/Classes/Hook/TtNewsMarker.php +++ b/Classes/Hook/TtNewsMarker.php @@ -8,6 +8,7 @@ use Sys25\RnBase\Utility\Strings; use System25\T3sports\Model\Repository\MatchRepository; use tx_rnbase; +use tx_ttnews; /*************************************************************** * Copyright notice @@ -55,7 +56,7 @@ class TtNewsMarker * @param array $markerArray marker array from tt_news * @param array $row tt_news record * @param array $lConf tt_news config-array - * @param \tx_ttnews $ttnews tt_news plugin instance + * @param tx_ttnews $ttnews tt_news plugin instance */ public function extraItemMarkerProcessor($markerArray, $row, $lConf, $ttnews) { @@ -68,6 +69,7 @@ public function extraItemMarkerProcessor($markerArray, $row, $lConf, $ttnews) foreach ($markerNames as $markerName) { $markerArray['###NEWS_'.$markerName.'###'] = $this->handleMarker($markerArray['###NEWS_'.$markerName.'###'], $regExpr); } + // $GLOBALS['TSFE']->register['SECTION_FRAME'] = $pObj->cObj->data['section_frame']; // Access to section_frame by TS return $markerArray; } diff --git a/Classes/Model/MatchReportModel.php b/Classes/Model/MatchReportModel.php index e7790e9..e246295 100644 --- a/Classes/Model/MatchReportModel.php +++ b/Classes/Model/MatchReportModel.php @@ -499,6 +499,7 @@ protected function _getNames2($profiles, $confIdAll) $sep = $this->_configurations->get($confIdAll.'seperator'); $sep = (strlen($sep) > 2) ? substr($sep, 1, strlen($sep) - 2) : $sep; $ret = implode($sep, $ret); + // Jetzt noch ein Wrap über alles return $this->_formatter->stdWrap($ret, $this->_configurations->get($confIdAll), $this->match->getProperty()); } @@ -551,7 +552,7 @@ protected function _wrapTickers(&$tickerArr, $confIdAll) foreach ($tickerArr as $ticker) { $ret[] = $this->mnDecorator->wrap($this->_formatter, $confIdAll.'ticker.', $ticker); } -// \tx_rnbase_util_Debug::debug([$ret, $confIdAll], __FILE__.':'.__LINE__); // TODO: remove me + // \tx_rnbase_util_Debug::debug([$ret, $confIdAll], __FILE__.':'.__LINE__); // TODO: remove me // exit(); // Die einzelnen Meldungen verbinden if (count($ret)) { @@ -564,6 +565,7 @@ protected function _wrapTickers(&$tickerArr, $confIdAll) } $conf = $this->_configurations->get($confIdAll); + // Jetzt noch ein Wrap über alles return $this->_formatter->stdWrap($ret, $conf, $this->match->getProperty()); } @@ -607,6 +609,7 @@ protected function _getLineUp($players, $system, $confId) $sep = $hits[1]; } $ret = implode(' - ', $partArr); + // Jetzt noch ein Wrap über alles return $this->_formatter->stdWrap($ret, $conf, $this->match->getProperty()); } diff --git a/Classes/Statistics/PlayerStatisticsMarker.php b/Classes/Statistics/PlayerStatisticsMarker.php index 7fad9f2..9a0a81b 100644 --- a/Classes/Statistics/PlayerStatisticsMarker.php +++ b/Classes/Statistics/PlayerStatisticsMarker.php @@ -6,6 +6,7 @@ use System25\T3sports\Frontend\Marker\ProfileMarker; use System25\T3sports\Model\Profile; use tx_rnbase; +use tx_rnbase_util_FormatUtil; /*************************************************************** * Copyright notice @@ -42,7 +43,7 @@ class PlayerStatisticsMarker * * @param string $srvTemplate * @param array $stats - * @param \tx_rnbase_util_FormatUtil $formatter + * @param tx_rnbase_util_FormatUtil $formatter * @param string $statsConfId * @param string $statsMarker * diff --git a/Classes/Statistics/Service/PlayerStatistics.php b/Classes/Statistics/Service/PlayerStatistics.php index 94aec91..613028b 100644 --- a/Classes/Statistics/Service/PlayerStatistics.php +++ b/Classes/Statistics/Service/PlayerStatistics.php @@ -13,6 +13,7 @@ use System25\T3sports\Service\ProfileService; use System25\T3sports\Statistics\PlayerStatisticsMarker; use System25\T3sports\Statistics\StatisticsHelper; +use tx_rnbase; /*************************************************************** * Copyright notice @@ -80,7 +81,7 @@ class PlayerStatistics implements StatsServiceInterface /** @var ProfileService */ protected $profileSrv; - public function __construct(?TeamRepository $teamRepo = null, ?ProfileService $profileSrv = null) + public function __construct(TeamRepository $teamRepo = null, ProfileService $profileSrv = null) { $this->teamRepo = $teamRepo ?: new TeamRepository(); $this->profileSrv = $profileSrv ?: new ProfileService(); @@ -204,7 +205,7 @@ public function getResult() public function getMarker(ConfigurationInterface $configurations) { - return \tx_rnbase::makeInstance(PlayerStatisticsMarker::class); + return tx_rnbase::makeInstance(PlayerStatisticsMarker::class); } /** diff --git a/Classes/Statistics/Service/StatsServiceProvider.php b/Classes/Statistics/Service/StatsServiceProvider.php index 963af62..b936a2e 100644 --- a/Classes/Statistics/Service/StatsServiceProvider.php +++ b/Classes/Statistics/Service/StatsServiceProvider.php @@ -37,7 +37,7 @@ class StatsServiceProvider implements \TYPO3\CMS\Core\SingletonInterface * * @var StatsServiceProvider */ - private static $instance = null; + private static $instance; public function addStatsService(StatsServiceInterface $indexer) { diff --git a/Classes/Statistics/Service/VisitorStatistics.php b/Classes/Statistics/Service/VisitorStatistics.php index 3cca7d9..cfc72b6 100644 --- a/Classes/Statistics/Service/VisitorStatistics.php +++ b/Classes/Statistics/Service/VisitorStatistics.php @@ -5,6 +5,7 @@ use Sys25\RnBase\Configuration\ConfigurationInterface; use System25\T3sports\Model\Fixture; use System25\T3sports\Statistics\TeamStatisticsMarker; +use tx_rnbase; /** * ************************************************************* @@ -148,7 +149,7 @@ private function sortResult() */ public function getMarker(ConfigurationInterface $configurations) { - return \tx_rnbase::makeInstance(TeamStatisticsMarker::class); + return tx_rnbase::makeInstance(TeamStatisticsMarker::class); } /** diff --git a/Classes/Statistics/Statistics.php b/Classes/Statistics/Statistics.php index 18b2608..a618e24 100644 --- a/Classes/Statistics/Statistics.php +++ b/Classes/Statistics/Statistics.php @@ -161,7 +161,7 @@ public static function createStatistics(&$matches, $scopeArr, &$services, &$conf */ public static function lookupStatistics($config) { - $provider = \System25\T3sports\Statistics\Service\StatsServiceProvider::getInstance(); + $provider = Service\StatsServiceProvider::getInstance(); $types = $provider->getStatsTypes(); // FIXME: das sollte besser gehen... $labelPrefix = 'LLL:EXT:cfc_league_fe/Resources/Private/Language/locallang_db.xlf:plugin.competition.flexform.statistics.type.%s'; diff --git a/Classes/Statistics/TeamStatisticsMarker.php b/Classes/Statistics/TeamStatisticsMarker.php index 07ed990..e74657f 100644 --- a/Classes/Statistics/TeamStatisticsMarker.php +++ b/Classes/Statistics/TeamStatisticsMarker.php @@ -2,6 +2,7 @@ namespace System25\T3sports\Statistics; +use Exception; use Sys25\RnBase\Frontend\Marker\BaseMarker; use Sys25\RnBase\Frontend\Marker\FormatUtil; use Sys25\RnBase\Frontend\Marker\Templates; @@ -74,7 +75,7 @@ public function parseTemplate($srvTemplate, &$stats, $formatter, $statsConfId, $ foreach ($stats as $teamStat) { try { $team = $this->teamRepo->findByUid($teamStat['team']); - } catch (\Exception $e) { + } catch (Exception $e) { continue; // Ohne Team wird auch nix gezeigt } $team->setProperty(array_merge($teamStat, $team->getProperties())); diff --git a/Classes/Table/DefaultMatchProvider.php b/Classes/Table/DefaultMatchProvider.php index 218b255..efe9b3b 100644 --- a/Classes/Table/DefaultMatchProvider.php +++ b/Classes/Table/DefaultMatchProvider.php @@ -2,6 +2,7 @@ namespace System25\T3sports\Table; +use Exception; use Sys25\RnBase\Configuration\ConfigurationInterface; use Sys25\RnBase\Search\SearchBase; use System25\T3sports\Model\Competition; @@ -60,7 +61,7 @@ class DefaultMatchProvider implements IMatchProvider /** * @var Competition */ - private $league = null; + private $league; private $scope; @@ -79,7 +80,7 @@ class DefaultMatchProvider implements IMatchProvider /** * @var array */ - private $clubIdsOfRunningMatches = null; + private $clubIdsOfRunningMatches; /** * @var array @@ -387,11 +388,11 @@ public static function getLeagueFromScope($scopeArr) $leagueUid = (int) $scopeArr['COMP_UIDS']; } if (!$leagueUid) { - throw new \Exception('Could not find a valid competition.'); + throw new Exception('Could not find a valid competition.'); } $league = Competition::getCompetitionInstance($leagueUid); if (!$league->isValid()) { - throw new \Exception('Competition with uid '.intval($leagueUid).' is not valid!'); + throw new Exception('Competition with uid '.intval($leagueUid).' is not valid!'); } return $league; diff --git a/Classes/Table/Football/Comparator.php b/Classes/Table/Football/Comparator.php index 6e486db..58f2fd2 100644 --- a/Classes/Table/Football/Comparator.php +++ b/Classes/Table/Football/Comparator.php @@ -75,6 +75,7 @@ public function compare($t1, $t2) return $t1diff > $t2diff ? -1 : 1; } + // Bei den Minuspunkten ist weniger mehr return $t1['points2'] < $t2['points2'] ? -1 : 1; } @@ -155,6 +156,7 @@ public function compareH2H($t1, $t2) return $t1H2HPoints > $t2H2HPoints ? -1 : 1; } + // Bei den Minuspunkten ist weniger mehr return $t1['points2'] < $t2['points2'] ? -1 : 1; } diff --git a/Classes/Table/Football/ComparatorH2H.php b/Classes/Table/Football/ComparatorH2H.php index d2af13d..7cfd699 100644 --- a/Classes/Table/Football/ComparatorH2H.php +++ b/Classes/Table/Football/ComparatorH2H.php @@ -101,6 +101,7 @@ public function compare($t1, $t2) return $t1H2HPoints > $t2H2HPoints ? -1 : 1; } + // Bei den Minuspunkten ist weniger mehr return $t1['points2'] < $t2['points2'] ? -1 : 1; } diff --git a/Classes/Table/Football/Table.php b/Classes/Table/Football/Table.php index cb2aa5d..8ef3bd1 100644 --- a/Classes/Table/Football/Table.php +++ b/Classes/Table/Football/Table.php @@ -49,7 +49,7 @@ class Table extends AbstractService implements ITableType public const TABLE_TYPE = 'football'; /** @var TeamDataContainer */ - protected $_teamData = null; + protected $_teamData; /** @var ConfigurationInterface */ protected $configuration; @@ -230,9 +230,9 @@ protected function initTeams(IMatchProvider $matchProvider, Configurator $config if (!$teamId) { continue; } // Ignore teams without given id -// if ($team instanceof Team && $team->isDummy()) { -// continue; -// } // Ignore dummy teams + // if ($team instanceof Team && $team->isDummy()) { + // continue; + // } // Ignore dummy teams if ($this->_teamData->teamExists($team)) { continue; } @@ -404,7 +404,7 @@ protected function handleMatches(&$matches, Configurator $configurator) } } -// unset($this->_teamData[0]); // Remove dummy data from teams without id + // unset($this->_teamData[0]); // Remove dummy data from teams without id } /** diff --git a/Classes/Table/Volleyball/Comparator.php b/Classes/Table/Volleyball/Comparator.php index 923e022..29195bf 100644 --- a/Classes/Table/Volleyball/Comparator.php +++ b/Classes/Table/Volleyball/Comparator.php @@ -7,7 +7,7 @@ /*************************************************************** * Copyright notice * - * (c) 2011-2020 Rene Nitzsche (rene@system25.de) + * (c) 2011-2024 Rene Nitzsche (rene@system25.de) * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is @@ -32,6 +32,8 @@ */ class Comparator implements IComparator { + private $_teamData; + public function setTeamData(array &$teamdata) { $this->_teamData = $teamdata; @@ -43,10 +45,10 @@ public function setTeamData(array &$teamdata) public function compare($t1, $t2) { // Zwangsabstieg prüfen - if ($t1['static_position']) { + if (-1 == ($t1['static_position'] ?? 0)) { return 1; } - if ($t2['static_position']) { + if (-1 == ($t2['static_position'] ?? 0)) { return -1; } @@ -73,6 +75,7 @@ public function compare($t1, $t2) return $t1diff > $t2diff ? -1 : 1; } + // Bei den Minuspunkten ist weniger mehr return $t1['points2'] < $t2['points2'] ? -1 : 1; } diff --git a/Classes/Table/Volleyball/Comparator3Point.php b/Classes/Table/Volleyball/Comparator3Point.php index 7610bde..666d339 100644 --- a/Classes/Table/Volleyball/Comparator3Point.php +++ b/Classes/Table/Volleyball/Comparator3Point.php @@ -34,6 +34,8 @@ */ class Comparator3Point implements IComparator { + private $_teamData; + public function setTeamData(array &$teamdata) { $this->_teamData = $teamdata; @@ -50,10 +52,10 @@ public function setTeamData(array &$teamdata) public function compare($t1, $t2) { // Zwangsabstieg prüfen - if ($t1['static_position']) { + if (-1 == ($t2['static_position'] ?? 0)) { return 1; } - if ($t2['static_position']) { + if (-1 == ($t2['static_position'] ?? 0)) { return -1; } diff --git a/Classes/Twig/Data/MatchNote.php b/Classes/Twig/Data/MatchNote.php index 8da2c3b..4722341 100644 --- a/Classes/Twig/Data/MatchNote.php +++ b/Classes/Twig/Data/MatchNote.php @@ -2,6 +2,9 @@ namespace System25\T3sports\Twig\Data; +use tx_cfcleague_models_MatchNote; +use tx_cfcleague_util_ServiceRegistry; + /*************************************************************** * Copyright notice * @@ -32,7 +35,7 @@ class MatchNote { protected $profileSrv; - /** @var \tx_cfcleague_models_MatchNote[] */ + /** @var tx_cfcleague_models_MatchNote[] */ protected $matchNote; /** @var Player */ @@ -42,14 +45,14 @@ class MatchNote protected $player2; /** - * @param \tx_cfcleague_models_MatchNote $note + * @param tx_cfcleague_models_MatchNote $note * @param Player $player */ - public function __construct(\tx_cfcleague_models_MatchNote $note, $player = null) + public function __construct(tx_cfcleague_models_MatchNote $note, $player = null) { $this->matchNote = $note; $this->player = $player; - $this->profileSrv = \tx_cfcleague_util_ServiceRegistry::getProfileService(); + $this->profileSrv = tx_cfcleague_util_ServiceRegistry::getProfileService(); } public function getUid() @@ -104,23 +107,23 @@ public function getType() public function isChange() { - return \tx_cfcleague_models_MatchNote::TYPE_CHANGEOUT == $this->getType(); + return tx_cfcleague_models_MatchNote::TYPE_CHANGEOUT == $this->getType(); } public function isGoal() { $goalTypes = [ - \tx_cfcleague_models_MatchNote::TYPE_GOAL, - \tx_cfcleague_models_MatchNote::TYPE_GOAL_HEADER, - \tx_cfcleague_models_MatchNote::TYPE_GOAL_PENALTY, - \tx_cfcleague_models_MatchNote::TYPE_GOAL_OWN, + tx_cfcleague_models_MatchNote::TYPE_GOAL, + tx_cfcleague_models_MatchNote::TYPE_GOAL_HEADER, + tx_cfcleague_models_MatchNote::TYPE_GOAL_PENALTY, + tx_cfcleague_models_MatchNote::TYPE_GOAL_OWN, ]; return in_array($this->getType(), $goalTypes); } /** - * @return \tx_cfcleague_models_MatchNote + * @return tx_cfcleague_models_MatchNote */ public function getMatchNote() { diff --git a/Classes/Twig/Data/MatchReport.php b/Classes/Twig/Data/MatchReport.php index ac34a96..998fc90 100644 --- a/Classes/Twig/Data/MatchReport.php +++ b/Classes/Twig/Data/MatchReport.php @@ -2,9 +2,13 @@ namespace System25\T3sports\Twig\Data; +use Exception; use System25\T3sports\Model\Fixture; use System25\T3sports\Model\Profile; use System25\T3sports\Utility\ServiceRegistry; +use tx_cfcleague_models_MatchNote; +use tx_cfcleaguefe_util_MatchTicker; +use Tx_Rnbase_Utility_Strings; /*************************************************************** * Copyright notice @@ -38,10 +42,10 @@ class MatchReport { protected $match; - /** @var \tx_cfcleague_models_MatchNote[] */ + /** @var tx_cfcleague_models_MatchNote[] */ protected $tickerArr; - /** @var \tx_cfcleague_models_MatchNote[] */ + /** @var tx_cfcleague_models_MatchNote[] */ protected $tickerByTeam = [ 'home' => [], 'guest' => [], @@ -203,7 +207,7 @@ public function getAssists() */ protected function getLineup($players, $system) { - $system = \Tx_Rnbase_Utility_Strings::trimExplode('-', $system); + $system = Tx_Rnbase_Utility_Strings::trimExplode('-', $system); $players = is_array($players) ? array_values($players) : []; $partCnt = 0; @@ -224,7 +228,7 @@ protected function getLineup($players, $system) /** * @param Profile $player * - * @return \System25\T3sports\Twig\Data\Player + * @return Player */ protected function substPlayer(Profile $player) { @@ -241,7 +245,7 @@ protected function initMatchTicker() if (!is_array($this->tickerArr)) { $this->tickerArr = []; // Der Ticker wird immer chronologisch ermittelt - $matchNotes = &\tx_cfcleaguefe_util_MatchTicker::getTicker4Match($this->match); + $matchNotes = &tx_cfcleaguefe_util_MatchTicker::getTicker4Match($this->match); // Jetzt die Tickermeldungen noch den Spielern zuordnen for ($i = 0; $i < count($matchNotes); ++$i) { $note = $matchNotes[$i]; @@ -255,7 +259,7 @@ protected function initMatchTicker() $player = Profile::getProfileInstance($playerUid); $player = $this->buildPlayer($player); } - $matchNote = new \System25\T3sports\Twig\Data\MatchNote($note, $player); + $matchNote = new MatchNote($note, $player); if ($player) { $player->addMatchNote($matchNote); } @@ -268,7 +272,7 @@ protected function initMatchTicker() if ($player) { $this->tickerByTeam[$matchNote->getMatchNote()->isHome() ? 'home' : 'guest'][] = $matchNote; } - } catch (\Exception $e) { + } catch (Exception $e) { } } } @@ -291,7 +295,7 @@ protected function uniquePlayerNames() /** * @param Profile $player * - * @return \System25\T3sports\Twig\Data\Player + * @return Player */ protected function buildPlayer($player) { @@ -299,7 +303,7 @@ protected function buildPlayer($player) if (isset($this->players[$player->getUid()])) { $player = $this->players[$player->getUid()]; } else { - $player = new \System25\T3sports\Twig\Data\Player($player); + $player = new Player($player); // Keep a reference to each player $this->players[$player->getUid()] = $player; diff --git a/Classes/Twig/Data/Player.php b/Classes/Twig/Data/Player.php index 52e4947..21ffedd 100644 --- a/Classes/Twig/Data/Player.php +++ b/Classes/Twig/Data/Player.php @@ -2,6 +2,10 @@ namespace System25\T3sports\Twig\Data; +use tx_cfcleague_models_MatchNote; +use tx_cfcleague_models_Profile; +use tx_cfcleague_util_ServiceRegistry; + /*************************************************************** * Copyright notice * @@ -32,7 +36,7 @@ */ class Player { - /** @var \tx_cfcleague_models_MatchNote[] */ + /** @var tx_cfcleague_models_MatchNote[] */ protected $matchNotes = []; protected $matchNotesByType = []; @@ -43,10 +47,10 @@ class Player protected $uniqueName = true; - public function __construct(\tx_cfcleague_models_Profile $profile) + public function __construct(tx_cfcleague_models_Profile $profile) { $this->profile = $profile; - $this->profileSrv = \tx_cfcleague_util_ServiceRegistry::getProfileService(); + $this->profileSrv = tx_cfcleague_util_ServiceRegistry::getProfileService(); } public function getUid() @@ -76,7 +80,7 @@ public function hasMatchNoteType($type) /** * @param int $type * - * @return \tx_cfcleague_models_MatchNote[] + * @return tx_cfcleague_models_MatchNote[] */ public function getMatchNotesByType($type) { @@ -88,15 +92,15 @@ public function getMatchNotesByType($type) */ public function isCardYellow() { - return $this->hasMatchNoteType(\tx_cfcleague_models_MatchNote::TYPE_CARD_YELLOW); + return $this->hasMatchNoteType(tx_cfcleague_models_MatchNote::TYPE_CARD_YELLOW); } /** - * @return \tx_cfcleague_models_MatchNote[] + * @return tx_cfcleague_models_MatchNote[] */ public function getChangedOut() { - return $this->getMatchNotesByType(\tx_cfcleague_models_MatchNote::TYPE_CHANGEOUT); + return $this->getMatchNotesByType(tx_cfcleague_models_MatchNote::TYPE_CHANGEOUT); } /** @@ -104,7 +108,7 @@ public function getChangedOut() */ public function isCardYellowRed() { - return $this->hasMatchNoteType(\tx_cfcleague_models_MatchNote::TYPE_CARD_YELLOWRED); + return $this->hasMatchNoteType(tx_cfcleague_models_MatchNote::TYPE_CARD_YELLOWRED); } /** @@ -112,7 +116,7 @@ public function isCardYellowRed() */ public function isCardRed() { - return $this->hasMatchNoteType(\tx_cfcleague_models_MatchNote::TYPE_CARD_RED); + return $this->hasMatchNoteType(tx_cfcleague_models_MatchNote::TYPE_CARD_RED); } /** @@ -120,11 +124,11 @@ public function isCardRed() */ public function isCaptain() { - return $this->hasMatchNoteType(\tx_cfcleague_models_MatchNote::TYPE_CAPTAIN); + return $this->hasMatchNoteType(tx_cfcleague_models_MatchNote::TYPE_CAPTAIN); } /** - * @return \tx_cfcleague_models_MatchNote[] + * @return tx_cfcleague_models_MatchNote[] */ public function getMatchNotes() { @@ -132,7 +136,7 @@ public function getMatchNotes() } /** - * @return \tx_cfcleague_models_Profile + * @return tx_cfcleague_models_Profile */ public function getProfile() { diff --git a/Classes/Twig/Extension/DataProvider.php b/Classes/Twig/Extension/DataProvider.php index 2eb01b8..9b742bf 100644 --- a/Classes/Twig/Extension/DataProvider.php +++ b/Classes/Twig/Extension/DataProvider.php @@ -3,6 +3,9 @@ namespace System25\T3sports\Twig\Extension; use System25\T3sports\Model\Fixture; +use Twig_Extension; +use Twig_SimpleFunction; +use tx_rnbase; /*************************************************************** * Copyright notice @@ -27,18 +30,18 @@ * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -class DataProvider extends \Twig_Extension +class DataProvider extends Twig_Extension { public function getFunctions() { return [ - new \Twig_SimpleFunction('buildMatchReport', [$this, 'buildMatchReport']), + new Twig_SimpleFunction('buildMatchReport', [$this, 'buildMatchReport']), ]; } public function buildMatchReport(Fixture $match) { - return \tx_rnbase::makeInstance(\System25\T3sports\Twig\Data\MatchReport::class, $match); + return tx_rnbase::makeInstance(\System25\T3sports\Twig\Data\MatchReport::class, $match); } /** diff --git a/Classes/Utility/MapsUtil.php b/Classes/Utility/MapsUtil.php index 8dcd728..f47b9c3 100644 --- a/Classes/Utility/MapsUtil.php +++ b/Classes/Utility/MapsUtil.php @@ -144,6 +144,7 @@ public static function lookupAddress($street, $city, $state, $zip, $country) if (!Extensions::isLoaded('wec_map')) { return false; } + // FIXME: integrate rn_base return false; diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php index 7482ad9..739b002 100644 --- a/Configuration/TCA/Overrides/sys_template.php +++ b/Configuration/TCA/Overrides/sys_template.php @@ -8,7 +8,7 @@ $extKey = 'cfc_league_fe'; // list static templates in templates selection - \Sys25\RnBase\Utility\Extensions::addStaticFile($extKey, 'static/', 'T3sports'); - \Sys25\RnBase\Utility\Extensions::addStaticFile($extKey, 'static/cal/', 'T3sports cal-events'); - \Sys25\RnBase\Utility\Extensions::addStaticFile($extKey, 'static/volleyball/', 'T3sports for Volleyball'); + Sys25\RnBase\Utility\Extensions::addStaticFile($extKey, 'static/', 'T3sports'); + Sys25\RnBase\Utility\Extensions::addStaticFile($extKey, 'static/cal/', 'T3sports cal-events'); + Sys25\RnBase\Utility\Extensions::addStaticFile($extKey, 'static/volleyball/', 'T3sports for Volleyball'); }); diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index d251330..9e3850b 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -17,12 +17,12 @@ // Das tt_content-Feld pi_flexform einblenden $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['tx_cfcleaguefe_competition'] = 'pi_flexform'; - \Sys25\RnBase\Utility\Extensions::addPiFlexFormValue( + Sys25\RnBase\Utility\Extensions::addPiFlexFormValue( 'tx_cfcleaguefe_competition', 'FILE:EXT:cfc_league_fe/Configuration/Flexform/plugin_competition.xml' ); - \Sys25\RnBase\Utility\Extensions::addPlugin( + Sys25\RnBase\Utility\Extensions::addPlugin( [ 'LLL:EXT:'.$extKey.'/Resources/Private/Language/locallang_db.xlf:plugin.competition.label', 'tx_cfcleaguefe_competition', @@ -41,7 +41,7 @@ // Das tt_content-Feld pi_flexform einblenden $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['tx_cfcleaguefe_report'] = 'pi_flexform'; - \Sys25\RnBase\Utility\Extensions::addPiFlexFormValue( + Sys25\RnBase\Utility\Extensions::addPiFlexFormValue( 'tx_cfcleaguefe_report', 'FILE:EXT:cfc_league_fe/Configuration/Flexform/plugin_report.xml' ); @@ -62,7 +62,7 @@ * @param string $extensionKey The extension key * @throws \RuntimeException */ - \Sys25\RnBase\Utility\Extensions::addPlugin( + Sys25\RnBase\Utility\Extensions::addPlugin( [ 'LLL:EXT:cfc_league_fe/Resources/Private/Language/locallang_db.xlf:plugin.report.label', 'tx_cfcleaguefe_report', diff --git a/Migrations/Code/ClassAliasMap.php b/Migrations/Code/ClassAliasMap.php index 0e30c70..7f827eb 100644 --- a/Migrations/Code/ClassAliasMap.php +++ b/Migrations/Code/ClassAliasMap.php @@ -3,70 +3,70 @@ declare(strict_types=1); return [ - 'tx_cfcleaguefe_actions_ClubList' => \System25\T3sports\Frontend\Action\ClubList::class, - 'tx_cfcleaguefe_actions_ClubView' => \System25\T3sports\Frontend\Action\ClubDetails::class, - 'tx_cfcleaguefe_actions_LeagueTable' => \System25\T3sports\Frontend\Action\LeagueTable::class, - 'tx_cfcleaguefe_actions_LeagueTableShow' => \System25\T3sports\Frontend\Action\LeagueTable::class, - 'tx_cfcleaguefe_actions_LeagueTableAllTime' => \System25\T3sports\Frontend\Action\LeagueTableAllTime::class, - 'tx_cfcleaguefe_actions_LiveTickerList' => \System25\T3sports\Frontend\Action\LiveTickerList::class, - 'tx_cfcleaguefe_actions_MatchCrossTable' => \System25\T3sports\Frontend\Action\MatchCrossTable::class, - 'tx_cfcleaguefe_actions_MatchReport' => \System25\T3sports\Frontend\Action\MatchReport::class, - 'tx_cfcleaguefe_actions_MatchTable' => \System25\T3sports\Frontend\Action\MatchTable::class, - 'tx_cfcleaguefe_actions_ProfileList' => \System25\T3sports\Frontend\Action\ProfileList::class, - 'tx_cfcleaguefe_actions_StadiumView' => \System25\T3sports\Frontend\Action\StadiumDetails::class, - 'tx_cfcleaguefe_actions_StadiumList' => \System25\T3sports\Frontend\Action\StadiumList::class, - 'tx_cfcleaguefe_actions_ProfileView' => \System25\T3sports\Frontend\Action\ProfileDetails::class, - 'tx_cfcleaguefe_actions_TableChart' => \System25\T3sports\Frontend\Action\TableChart::class, - 'tx_cfcleaguefe_actions_TeamList' => \System25\T3sports\Frontend\Action\TeamList::class, - 'tx_cfcleaguefe_actions_TeamView' => \System25\T3sports\Frontend\Action\TeamDetails::class, - 'tx_cfcleaguefe_actions_Statistics' => \System25\T3sports\Frontend\Action\Statistics::class, - 'tx_cfcleaguefe_actions_CompetitionSelection' => \System25\T3sports\Frontend\Action\ScopeSelection::class, + 'tx_cfcleaguefe_actions_ClubList' => System25\T3sports\Frontend\Action\ClubList::class, + 'tx_cfcleaguefe_actions_ClubView' => System25\T3sports\Frontend\Action\ClubDetails::class, + 'tx_cfcleaguefe_actions_LeagueTable' => System25\T3sports\Frontend\Action\LeagueTable::class, + 'tx_cfcleaguefe_actions_LeagueTableShow' => System25\T3sports\Frontend\Action\LeagueTable::class, + 'tx_cfcleaguefe_actions_LeagueTableAllTime' => System25\T3sports\Frontend\Action\LeagueTableAllTime::class, + 'tx_cfcleaguefe_actions_LiveTickerList' => System25\T3sports\Frontend\Action\LiveTickerList::class, + 'tx_cfcleaguefe_actions_MatchCrossTable' => System25\T3sports\Frontend\Action\MatchCrossTable::class, + 'tx_cfcleaguefe_actions_MatchReport' => System25\T3sports\Frontend\Action\MatchReport::class, + 'tx_cfcleaguefe_actions_MatchTable' => System25\T3sports\Frontend\Action\MatchTable::class, + 'tx_cfcleaguefe_actions_ProfileList' => System25\T3sports\Frontend\Action\ProfileList::class, + 'tx_cfcleaguefe_actions_StadiumView' => System25\T3sports\Frontend\Action\StadiumDetails::class, + 'tx_cfcleaguefe_actions_StadiumList' => System25\T3sports\Frontend\Action\StadiumList::class, + 'tx_cfcleaguefe_actions_ProfileView' => System25\T3sports\Frontend\Action\ProfileDetails::class, + 'tx_cfcleaguefe_actions_TableChart' => System25\T3sports\Frontend\Action\TableChart::class, + 'tx_cfcleaguefe_actions_TeamList' => System25\T3sports\Frontend\Action\TeamList::class, + 'tx_cfcleaguefe_actions_TeamView' => System25\T3sports\Frontend\Action\TeamDetails::class, + 'tx_cfcleaguefe_actions_Statistics' => System25\T3sports\Frontend\Action\Statistics::class, + 'tx_cfcleaguefe_actions_CompetitionSelection' => System25\T3sports\Frontend\Action\ScopeSelection::class, - 'tx_cfcleaguefe_filter_Match' => \System25\T3sports\Filter\MatchFilter::class, - 'tx_cfcleaguefe_filter_MatchNote' => \System25\T3sports\Filter\MatchNoteFilter::class, - 'tx_cfcleaguefe_filter_Stadium' => \System25\T3sports\Filter\StadiumFilter::class, - 'tx_cfcleaguefe_filter_Team' => \System25\T3sports\Filter\TeamFilter::class, + 'tx_cfcleaguefe_filter_Match' => System25\T3sports\Filter\MatchFilter::class, + 'tx_cfcleaguefe_filter_MatchNote' => System25\T3sports\Filter\MatchNoteFilter::class, + 'tx_cfcleaguefe_filter_Stadium' => System25\T3sports\Filter\StadiumFilter::class, + 'tx_cfcleaguefe_filter_Team' => System25\T3sports\Filter\TeamFilter::class, - 'tx_cfcleaguefe_search_Builder' => \System25\T3sports\Search\SearchBuilder::class, - 'tx_cfcleaguefe_search_Competition' => \System25\T3sports\Search\CompetitionSearch::class, - 'tx_cfcleaguefe_search_Profile' => \System25\T3sports\Search\ProfileSearch::class, - 'tx_cfcleaguefe_search_Team' => \System25\T3sports\Search\TeamSearch::class, + 'tx_cfcleaguefe_search_Builder' => System25\T3sports\Search\SearchBuilder::class, + 'tx_cfcleaguefe_search_Competition' => System25\T3sports\Search\CompetitionSearch::class, + 'tx_cfcleaguefe_search_Profile' => System25\T3sports\Search\ProfileSearch::class, + 'tx_cfcleaguefe_search_Team' => System25\T3sports\Search\TeamSearch::class, - 'tx_cfcleaguefe_sv1_Competitions' => \System25\T3sports\Service\CompetitionService::class, - 'tx_cfcleaguefe_sv1_Teams' => \System25\T3sports\Service\TeamService::class, - 'tx_cfcleaguefe_sv1_Profiles' => \System25\T3sports\Service\ProfileService::class, - 'tx_cfcleaguefe_sv1_Matches' => \System25\T3sports\Service\MatchService::class, + 'tx_cfcleaguefe_sv1_Competitions' => System25\T3sports\Service\CompetitionService::class, + 'tx_cfcleaguefe_sv1_Teams' => System25\T3sports\Service\TeamService::class, + 'tx_cfcleaguefe_sv1_Profiles' => System25\T3sports\Service\ProfileService::class, + 'tx_cfcleaguefe_sv1_Matches' => System25\T3sports\Service\MatchService::class, - 'tx_cfcleaguefe_sv2_PlayerStatistics' => \System25\T3sports\Statistics\Service\PlayerStatistics::class, - 'tx_cfcleaguefe_sv2_PlayerStatisticsMarker' => \System25\T3sports\Statistics\PlayerStatisticsMarker::class, - 'tx_cfcleaguefe_sv2_PlayerSummaryStatistics' => \System25\T3sports\Statistics\Service\PlayerSummaryStatistics::class, - 'tx_cfcleaguefe_sv2_PlayerSummaryStatisticsMarker' => \System25\T3sports\Statistics\PlayerSummaryStatisticsMarker::class, - 'tx_cfcleaguefe_sv2_AssistStatistics' => \System25\T3sports\Statistics\Service\AssistStatistics::class, - 'tx_cfcleaguefe_sv2_ScorerStatistics' => \System25\T3sports\Statistics\Service\ScorerStatistics::class, - 'tx_cfcleaguefe_sv2_VisitorStatistics' => \System25\T3sports\Statistics\Service\VisitorStatistics::class, - 'tx_cfcleaguefe_sv2_TeamStatisticsMarker' => \System25\T3sports\Statistics\TeamStatisticsMarker::class, + 'tx_cfcleaguefe_sv2_PlayerStatistics' => System25\T3sports\Statistics\Service\PlayerStatistics::class, + 'tx_cfcleaguefe_sv2_PlayerStatisticsMarker' => System25\T3sports\Statistics\PlayerStatisticsMarker::class, + 'tx_cfcleaguefe_sv2_PlayerSummaryStatistics' => System25\T3sports\Statistics\Service\PlayerSummaryStatistics::class, + 'tx_cfcleaguefe_sv2_PlayerSummaryStatisticsMarker' => System25\T3sports\Statistics\PlayerSummaryStatisticsMarker::class, + 'tx_cfcleaguefe_sv2_AssistStatistics' => System25\T3sports\Statistics\Service\AssistStatistics::class, + 'tx_cfcleaguefe_sv2_ScorerStatistics' => System25\T3sports\Statistics\Service\ScorerStatistics::class, + 'tx_cfcleaguefe_sv2_VisitorStatistics' => System25\T3sports\Statistics\Service\VisitorStatistics::class, + 'tx_cfcleaguefe_sv2_TeamStatisticsMarker' => System25\T3sports\Statistics\TeamStatisticsMarker::class, - 'tx_cfcleaguefe_util_AddressMarker' => \System25\T3sports\Frontend\Marker\AddressMarker::class, - 'tx_cfcleaguefe_util_ClubMarker' => \System25\T3sports\Frontend\Marker\ClubMarker::class, - 'tx_cfcleaguefe_util_CompetitionMarker' => \System25\T3sports\Frontend\Marker\CompetitionMarker::class, - 'tx_cfcleaguefe_util_Maps' => \System25\T3sports\Utility\MapsUtil::class, - 'tx_cfcleaguefe_util_MatchMarker' => \System25\T3sports\Frontend\Marker\MatchMarker::class, - 'tx_cfcleaguefe_util_ProfileMarker' => \System25\T3sports\Frontend\Marker\ProfileMarker::class, - 'tx_cfcleaguefe_util_ScopeController' => \System25\T3sports\Utility\ScopeController::class, - 'tx_cfcleaguefe_util_StadiumMarker' => \System25\T3sports\Frontend\Marker\StadiumMarker::class, - 'tx_cfcleaguefe_util_TeamMarker' => \System25\T3sports\Frontend\Marker\TeamMarker::class, + 'tx_cfcleaguefe_util_AddressMarker' => System25\T3sports\Frontend\Marker\AddressMarker::class, + 'tx_cfcleaguefe_util_ClubMarker' => System25\T3sports\Frontend\Marker\ClubMarker::class, + 'tx_cfcleaguefe_util_CompetitionMarker' => System25\T3sports\Frontend\Marker\CompetitionMarker::class, + 'tx_cfcleaguefe_util_Maps' => System25\T3sports\Utility\MapsUtil::class, + 'tx_cfcleaguefe_util_MatchMarker' => System25\T3sports\Frontend\Marker\MatchMarker::class, + 'tx_cfcleaguefe_util_ProfileMarker' => System25\T3sports\Frontend\Marker\ProfileMarker::class, + 'tx_cfcleaguefe_util_ScopeController' => System25\T3sports\Utility\ScopeController::class, + 'tx_cfcleaguefe_util_StadiumMarker' => System25\T3sports\Frontend\Marker\StadiumMarker::class, + 'tx_cfcleaguefe_util_TeamMarker' => System25\T3sports\Frontend\Marker\TeamMarker::class, - 'tx_cfcleaguefe_models_address' => \System25\T3sports\Model\Address::class, - 'tx_cfcleaguefe_models_club' => \System25\T3sports\Model\Club::class, - 'tx_cfcleaguefe_models_competition' => \System25\T3sports\Model\Competition::class, - 'tx_cfcleaguefe_models_competition_penalty' => \System25\T3sports\Model\CompetitionPenalty::class, - 'tx_cfcleaguefe_models_competition_round' => \System25\T3sports\Model\CompetitionRound::class, - 'tx_cfcleaguefe_models_match' => \System25\T3sports\Model\Fixture::class, - 'tx_cfcleaguefe_models_match_note' => \System25\T3sports\Model\MatchNote::class, - 'tx_cfcleaguefe_models_matchtable' => \System25\T3sports\Utility\MatchTableBuilder::class, - 'tx_cfcleaguefe_models_profile' => \System25\T3sports\Model\Profile::class, - 'tx_cfcleaguefe_models_saison' => \System25\T3sports\Model\Saison::class, - 'tx_cfcleaguefe_models_team' => \System25\T3sports\Model\Team::class, - 'tx_cfcleaguefe_models_teamNote' => \System25\T3sports\Model\TeamNote::class, - 'tx_cfcleaguefe_models_teamNoteType' => \System25\T3sports\Model\TeamNoteType::class, + 'tx_cfcleaguefe_models_address' => System25\T3sports\Model\Address::class, + 'tx_cfcleaguefe_models_club' => System25\T3sports\Model\Club::class, + 'tx_cfcleaguefe_models_competition' => System25\T3sports\Model\Competition::class, + 'tx_cfcleaguefe_models_competition_penalty' => System25\T3sports\Model\CompetitionPenalty::class, + 'tx_cfcleaguefe_models_competition_round' => System25\T3sports\Model\CompetitionRound::class, + 'tx_cfcleaguefe_models_match' => System25\T3sports\Model\Fixture::class, + 'tx_cfcleaguefe_models_match_note' => System25\T3sports\Model\MatchNote::class, + 'tx_cfcleaguefe_models_matchtable' => System25\T3sports\Utility\MatchTableBuilder::class, + 'tx_cfcleaguefe_models_profile' => System25\T3sports\Model\Profile::class, + 'tx_cfcleaguefe_models_saison' => System25\T3sports\Model\Saison::class, + 'tx_cfcleaguefe_models_team' => System25\T3sports\Model\Team::class, + 'tx_cfcleaguefe_models_teamNote' => System25\T3sports\Model\TeamNote::class, + 'tx_cfcleaguefe_models_teamNoteType' => System25\T3sports\Model\TeamNoteType::class, ]; diff --git a/Tests/Unit/PHP/Table/Football/AllTimeTableTest.php b/Tests/Unit/PHP/Table/Football/AllTimeTableTest.php index 9808f88..07604b7 100644 --- a/Tests/Unit/PHP/Table/Football/AllTimeTableTest.php +++ b/Tests/Unit/PHP/Table/Football/AllTimeTableTest.php @@ -81,7 +81,8 @@ public function testLeagueTableAllTime() private function getFixturePath($filename) { - return Extensions::extPath('cfc_league_fe').'Tests/fixtures/'.$filename; + return __DIR__.'/../../../../fixtures/'.$filename; + // return Extensions::extPath('cfc_league_fe').'Tests/fixtures/'.$filename; } private function makeInstances($yamlData, $clazzName) @@ -114,6 +115,7 @@ private function prepareLeague($leagueName) $league->setTeams($teams); $league->setPenalties([]); $league->setMatches($matches, 2); + // Und jetzt die Spiele return $league; } diff --git a/Tests/Unit/PHP/Table/Football/TableTest.php b/Tests/Unit/PHP/Table/Football/TableTest.php index a234db7..3609235 100644 --- a/Tests/Unit/PHP/Table/Football/TableTest.php +++ b/Tests/Unit/PHP/Table/Football/TableTest.php @@ -4,7 +4,6 @@ use Sys25\RnBase\Testing\BaseTestCase; use Sys25\RnBase\Testing\TestUtility; -use Sys25\RnBase\Utility\Extensions; use Sys25\RnBase\Utility\Spyc; use System25\T3sports\Model\Competition; use System25\T3sports\Table\Builder; @@ -83,7 +82,7 @@ public function testLeagueTableWithDummyTeam() $this->assertEquals($expected[$idx]['goals2'], $score['goals2']); $this->assertEquals($expected[$idx]['goals_diff'], $score['goals_diff']); } -// print_r($scoreLine); + // print_r($scoreLine); } /** @@ -162,7 +161,7 @@ public function testLeagueTableWithThreePointSystem() private function getFixturePath($filename) { - return Extensions::extPath('cfc_league_fe').'Tests/fixtures/'.$filename; + return __DIR__.'/../../../../fixtures/'.$filename; } private function makeInstances($yamlData, $clazzName) @@ -195,6 +194,7 @@ private function prepareLeague($leagueName) $league->setTeams($teams); $league->setPenalties([]); $league->setMatches($matches, 2); + // Und jetzt die Spiele return $league; } diff --git a/Tests/Unit/PHP/Table/Volleyball/TableTest.php b/Tests/Unit/PHP/Table/Volleyball/TableTest.php index 3772707..78925ec 100644 --- a/Tests/Unit/PHP/Table/Volleyball/TableTest.php +++ b/Tests/Unit/PHP/Table/Volleyball/TableTest.php @@ -4,7 +4,6 @@ use Sys25\RnBase\Testing\BaseTestCase; use Sys25\RnBase\Testing\TestUtility; -use Sys25\RnBase\Utility\Extensions; use Sys25\RnBase\Utility\Spyc; use System25\T3sports\Model\Competition; use System25\T3sports\Table\Builder; @@ -49,6 +48,7 @@ public function testLeagueTableWithTwoPointSystem() $config = TestUtility::createConfigurations([ 'tableType' => '0', ], 'cfc_league_fe'); + $confId = ''; $leagueTable = Builder::buildByCompetitionAndMatches($league, $matches, $config, $confId); $leagueTable->getMatchProvider()->setTeams($league->getTeams(), false); @@ -83,7 +83,7 @@ public function testLeagueTableWithTwoPointSystem() private function getFixturePath($filename) { - return Extensions::extPath('cfc_league_fe').'Tests/fixtures/'.$filename; + return __DIR__.'/../../../../fixtures/'.$filename; } private function makeInstances($yamlData, $clazzName) @@ -116,6 +116,7 @@ private function prepareLeague($leagueName) $league->setTeams($teams); $league->setPenalties([]); $league->setMatches($matches, 2); + // Und jetzt die Spiele return $league; } diff --git a/composer.json b/composer.json index 6a54d09..693ed23 100644 --- a/composer.json +++ b/composer.json @@ -30,11 +30,11 @@ "digedag/rn-base" : "~1.18" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.1.0", - "nimut/testing-framework": "^4.0 || ^5.0 || ^6.0", + "friendsofphp/php-cs-fixer": "^3.46", + "typo3/testing-framework": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0", "mikey179/vfsstream": "^1.4 || ^1.6", "phpcompatibility/php-compatibility": "^9.3.5", - "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.0" + "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.0 || ^9.0" }, "autoload" : { "psr-4": { "System25\\T3sports\\": "Classes" } diff --git a/ext_localconf.php b/ext_localconf.php index ee1a90c..a1179c0 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -6,22 +6,22 @@ // Page module hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info']['tx_cfcleaguefe_competition']['plugin'] = - \System25\T3sports\Hook\PageLayout::class.'->getPluginSummary'; + System25\T3sports\Hook\PageLayout::class.'->getPluginSummary'; $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info']['tx_cfcleaguefe_report']['plugin'] = - \System25\T3sports\Hook\PageLayout::class.'->getPluginSummary'; + System25\T3sports\Hook\PageLayout::class.'->getPluginSummary'; if (Sys25\RnBase\Utility\Extensions::isLoaded('tt_news')) { // Hook for tt_news - $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_news']['extraItemMarkerHook'][] = \System25\T3sports\Hook\TtNewsMarker::class; + $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_news']['extraItemMarkerHook'][] = System25\T3sports\Hook\TtNewsMarker::class; } // LeagueTable in Match -$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cfc_league_fe']['matchMarker_afterSubst'][] = \System25\T3sports\Hook\TableMatchMarker::class.'->addLeagueTable'; +$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cfc_league_fe']['matchMarker_afterSubst'][] = System25\T3sports\Hook\TableMatchMarker::class.'->addLeagueTable'; // Matchtable current round in Match -$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cfc_league_fe']['matchMarker_initRecord'][] = \System25\T3sports\Hook\TableMatchMarker::class.'->addCurrentRound'; +$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cfc_league_fe']['matchMarker_initRecord'][] = System25\T3sports\Hook\TableMatchMarker::class.'->addCurrentRound'; // Hook für historische Spiele -$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cfc_league_fe']['matchMarker_afterSubst'][] = \System25\T3sports\Hook\MatchHistoryHook::class.'->addMatches'; -$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cfc_league_fe']['matchMarker_afterSubst'][] = \System25\T3sports\Hook\MatchChartHook::class.'->addChart'; +$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cfc_league_fe']['matchMarker_afterSubst'][] = System25\T3sports\Hook\MatchHistoryHook::class.'->addMatches'; +$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cfc_league_fe']['matchMarker_afterSubst'][] = System25\T3sports\Hook\MatchChartHook::class.'->addChart'; System25\T3sports\Utility\Misc::registerTableStrategy('default', 'LLL:EXT:cfc_league_fe/Resources/Private/Language/locallang_db.xlf:tablestrategy_default', System25\T3sports\Table\Football\Comparator::class); System25\T3sports\Utility\Misc::registerTableStrategy('head2head', 'LLL:EXT:cfc_league_fe/Resources/Private/Language/locallang_db.xlf:tablestrategy_head2head', System25\T3sports\Table\Football\ComparatorH2H::class); @@ -32,24 +32,24 @@ // FIXME: use DI for T3 10.x and higher // if (!\Sys25\RnBase\Utility\TYPO3::isTYPO104OrHigher()) { // } -$provider = \System25\T3sports\Statistics\Service\StatsServiceProvider::getInstance(); -$provider->addStatsService(new \System25\T3sports\Statistics\Service\PlayerStatistics()); -$provider->addStatsService(new \System25\T3sports\Statistics\Service\ScorerStatistics()); -$provider->addStatsService(new \System25\T3sports\Statistics\Service\AssistStatistics()); -$provider->addStatsService(new \System25\T3sports\Statistics\Service\PlayerSummaryStatistics()); -$provider->addStatsService(new \System25\T3sports\Statistics\Service\VisitorStatistics()); - -if (\Sys25\RnBase\Utility\Environment::isBackend()) { +$provider = System25\T3sports\Statistics\Service\StatsServiceProvider::getInstance(); +$provider->addStatsService(new System25\T3sports\Statistics\Service\PlayerStatistics()); +$provider->addStatsService(new System25\T3sports\Statistics\Service\ScorerStatistics()); +$provider->addStatsService(new System25\T3sports\Statistics\Service\AssistStatistics()); +$provider->addStatsService(new System25\T3sports\Statistics\Service\PlayerSummaryStatistics()); +$provider->addStatsService(new System25\T3sports\Statistics\Service\VisitorStatistics()); + +if (Sys25\RnBase\Utility\Environment::isBackend()) { Sys25\RnBase\Backend\Utility\Icons::getIconRegistry()->registerIcon( 't3sports_plugin', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, ['source' => 'EXT:cfc_league_fe/Resources/Public/Icons/ext_icon.svg'] ); // Apply PageTSconfig if (!Sys25\RnBase\Utility\TYPO3::isTYPO121OrHigher()) { // since T3 12 pagets is loaded by convention - \Sys25\RnBase\Utility\Extensions::addPageTSConfig( + Sys25\RnBase\Utility\Extensions::addPageTSConfig( '' ); } diff --git a/phpunit.xml b/phpunit.xml index d6e5c8b..0726a3c 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,7 +1,8 @@