Skip to content

Commit

Permalink
Fix pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
digedag committed Jan 6, 2024
1 parent 1f1eaf7 commit 7b50110
Show file tree
Hide file tree
Showing 43 changed files with 235 additions and 209 deletions.
47 changes: 9 additions & 38 deletions .github/workflows/php.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]"
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"
Expand Down
7 changes: 7 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")
;
3 changes: 2 additions & 1 deletion Classes/Filter/MatchFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use System25\T3sports\Model\Profile;
use System25\T3sports\Utility\MatchTableBuilder;
use System25\T3sports\Utility\ScopeController;
use tx_rnbase;

/***************************************************************
* Copyright notice
Expand Down Expand Up @@ -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));
}
}
Expand Down
6 changes: 4 additions & 2 deletions Classes/Filter/MatchNoteFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions Classes/Filter/StadiumFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Classes/Frontend/Action/ProfileList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Frontend/Marker/ProfileMarker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));

Expand Down
2 changes: 1 addition & 1 deletion Classes/Frontend/Marker/TeamMarker.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
*/
class TeamMarker extends BaseMarker
{
private $options = null;
private $options;
private $profileRepo;

public function __construct($options = null)
Expand Down
8 changes: 5 additions & 3 deletions Classes/Frontend/View/LeagueTableAllTimeView.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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 = [];
Expand Down
8 changes: 5 additions & 3 deletions Classes/Frontend/View/LeagueTableView.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use System25\T3sports\Model\Team;
use System25\T3sports\Table\ITableType;
use tx_rnbase;
use tx_rnbase_util_Templates;

/***************************************************************
* Copyright notice
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions Classes/Frontend/View/MatchCrossTableView.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ private function findMatch(&$matches, $home, $guest)
$ret[] = $matches[$i];
}
}

// Die Paarung gibt es nicht.
return count($ret) ? $ret : $this->noMatchStr;
}
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 @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Classes/Frontend/View/StadiumList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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###';
}

Expand Down
4 changes: 2 additions & 2 deletions Classes/Hook/MatchChartHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions Classes/Hook/MatchHistoryHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion Classes/Hook/TtNewsMarker.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Sys25\RnBase\Utility\Strings;
use System25\T3sports\Model\Repository\MatchRepository;
use tx_rnbase;
use tx_ttnews;

/***************************************************************
* Copyright notice
Expand Down Expand Up @@ -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)
{
Expand All @@ -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;
}
Expand Down
5 changes: 4 additions & 1 deletion Classes/Model/MatchReportModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down Expand Up @@ -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)) {
Expand All @@ -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());
}
Expand Down Expand Up @@ -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());
}
Expand Down
3 changes: 2 additions & 1 deletion Classes/Statistics/PlayerStatisticsMarker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
*
Expand Down
5 changes: 3 additions & 2 deletions Classes/Statistics/Service/PlayerStatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use System25\T3sports\Service\ProfileService;
use System25\T3sports\Statistics\PlayerStatisticsMarker;
use System25\T3sports\Statistics\StatisticsHelper;
use tx_rnbase;

/***************************************************************
* Copyright notice
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -204,7 +205,7 @@ public function getResult()

public function getMarker(ConfigurationInterface $configurations)
{
return \tx_rnbase::makeInstance(PlayerStatisticsMarker::class);
return tx_rnbase::makeInstance(PlayerStatisticsMarker::class);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Classes/Statistics/Service/StatsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Loading

0 comments on commit 7b50110

Please sign in to comment.