diff --git a/.github/workflows/php.yaml b/.github/workflows/php.yaml index 2a1fa36..87a8dde 100644 --- a/.github/workflows/php.yaml +++ b/.github/workflows/php.yaml @@ -74,57 +74,28 @@ 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" runs-on: "ubuntu-latest" - needs: ["php-lint", "php-qs"] + needs: ["php-lint", "php-cs-fixer"] strategy: fail-fast: false diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 4636902..63a3de4 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -8,6 +8,7 @@ $config = new PhpCsFixer\Config(); return $config->setFinder($finder) + ->setCacheFile('.Build/.php_cs.cache') ->setRules([ '@Symfony' => true, 'phpdoc_align' => false, 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/Table/DefaultMatchProvider.php b/Classes/Table/DefaultMatchProvider.php index 83e0775..efe9b3b 100644 --- a/Classes/Table/DefaultMatchProvider.php +++ b/Classes/Table/DefaultMatchProvider.php @@ -16,7 +16,7 @@ /*************************************************************** * Copyright notice * - * (c) 2008-2022 Rene Nitzsche (rene@system25.de) + * (c) 2008-2024 Rene Nitzsche (rene@system25.de) * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is @@ -422,7 +422,7 @@ public function setCurrentRound($round) */ public function getClubIdsOfRunningMatches() { - if (!$this->clubIdsOfRunningMatches) { + if (null === $this->clubIdsOfRunningMatches) { $values = []; foreach ($this->getRounds() as $round) { diff --git a/Classes/Table/Volleyball/Comparator.php b/Classes/Table/Volleyball/Comparator.php index a36e7a6..084e613 100644 --- a/Classes/Table/Volleyball/Comparator.php +++ b/Classes/Table/Volleyball/Comparator.php @@ -7,7 +7,11 @@ /*************************************************************** * Copyright notice * +<<<<<<< HEAD + * (c) 2011-2024 Rene Nitzsche (rene@system25.de) +======= * (c) 2011-2023 Rene Nitzsche (rene@system25.de) +>>>>>>> master * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is @@ -45,10 +49,10 @@ public function setTeamData(array &$teamdata) public function compare($t1, $t2) { // Zwangsabstieg prüfen - if ($t1['static_position'] ?? false) { + if (-1 == ($t1['static_position'] ?? 0)) { return 1; } - if ($t2['static_position'] ?? false) { + if (-1 == ($t2['static_position'] ?? 0)) { return -1; } diff --git a/Classes/Table/Volleyball/Comparator3Point.php b/Classes/Table/Volleyball/Comparator3Point.php index 789ff9d..4b57241 100644 --- a/Classes/Table/Volleyball/Comparator3Point.php +++ b/Classes/Table/Volleyball/Comparator3Point.php @@ -52,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/MatchReport.php b/Classes/Twig/Data/MatchReport.php index 44ce221..998fc90 100644 --- a/Classes/Twig/Data/MatchReport.php +++ b/Classes/Twig/Data/MatchReport.php @@ -228,7 +228,7 @@ protected function getLineup($players, $system) /** * @param Profile $player * - * @return \System25\T3sports\Twig\Data\Player + * @return Player */ protected function substPlayer(Profile $player) { @@ -259,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); } @@ -295,7 +295,7 @@ protected function uniquePlayerNames() /** * @param Profile $player * - * @return \System25\T3sports\Twig\Data\Player + * @return Player */ protected function buildPlayer($player) { @@ -303,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/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 212c78b..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) diff --git a/Tests/Unit/PHP/Table/Football/TableTest.php b/Tests/Unit/PHP/Table/Football/TableTest.php index 2228bca..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; @@ -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) diff --git a/Tests/Unit/PHP/Table/Volleyball/TableTest.php b/Tests/Unit/PHP/Table/Volleyball/TableTest.php index a929917..6b5074d 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 = ''; $confId = ''; $leagueTable = Builder::buildByCompetitionAndMatches($league, $matches, $config, $confId); @@ -84,7 +84,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) diff --git a/ext_localconf.php b/ext_localconf.php index ee04e12..a1179c0 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,30 +1,27 @@ 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); @@ -35,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()) { - Icons::getIconRegistry()->registerIcon( +$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 (!TYPO3::isTYPO121OrHigher()) { + 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 0f003e1..0726a3c 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,6 +2,7 @@ backupGlobals="true" backupStaticAttributes="false" bootstrap=".Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php" + cacheResultFile=".Build/.phpunit.result.cache" colors="true" convertErrorsToExceptions="true" convertWarningsToExceptions="true"