Skip to content
Snippets Groups Projects
Commit c1e29f7e authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

upgrade to phpstan 2, fixes #4958

Closes #4958

Merge request !3722
parent fac89b11
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "f64a6bfba9a1758196b21c6394535191", "content-hash": "5bc2e4ef41517f46c14d02cfecdd95d9",
"packages": [ "packages": [
{ {
"name": "algo26-matthias/idna-convert", "name": "algo26-matthias/idna-convert",
...@@ -6516,20 +6516,20 @@ ...@@ -6516,20 +6516,20 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "1.11.0", "version": "2.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "666cb1703742cea9cc80fee631f0940e1592fa6e" "reference": "6c98c7600fc717b2c78c11ef60040d5b1e359c82"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/666cb1703742cea9cc80fee631f0940e1592fa6e", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6c98c7600fc717b2c78c11ef60040d5b1e359c82",
"reference": "666cb1703742cea9cc80fee631f0940e1592fa6e", "reference": "6c98c7600fc717b2c78c11ef60040d5b1e359c82",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2|^8.0" "php": "^7.4|^8.0"
}, },
"conflict": { "conflict": {
"phpstan/phpstan-shim": "*" "phpstan/phpstan-shim": "*"
...@@ -6570,7 +6570,7 @@ ...@@ -6570,7 +6570,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-05-13T06:02:22+00:00" "time": "2024-11-17T14:17:00+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
...@@ -8742,9 +8742,10 @@ ...@@ -8742,9 +8742,10 @@
"ext-pcre": "*", "ext-pcre": "*",
"ext-pdo": "*", "ext-pdo": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-dom": "*" "ext-dom": "*",
"ext-iconv": "*"
}, },
"platform-dev": [], "platform-dev": {},
"platform-overrides": { "platform-overrides": {
"php": "8.1" "php": "8.1"
}, },
......
...@@ -112,7 +112,7 @@ if ($GLOBALS['ASSETS_URL'][0] === '/') { ...@@ -112,7 +112,7 @@ if ($GLOBALS['ASSETS_URL'][0] === '/') {
$GLOBALS['ASSETS_URL'] = $GLOBALS['ABSOLUTE_URI_STUDIP'] . $GLOBALS['ASSETS_URL']; $GLOBALS['ASSETS_URL'] = $GLOBALS['ABSOLUTE_URI_STUDIP'] . $GLOBALS['ASSETS_URL'];
} }
require 'config.inc.php'; require $GLOBALS['STUDIP_BASE_PATH'] . '/config/config.inc.php';
require 'lib/helpers.php'; require 'lib/helpers.php';
require 'lib/phplib/page_open.php'; require 'lib/phplib/page_open.php';
......
...@@ -1781,26 +1781,28 @@ class Course extends SimpleORMap implements Range, PrivacyObject, StudipItem, Fe ...@@ -1781,26 +1781,28 @@ class Course extends SimpleORMap implements Range, PrivacyObject, StudipItem, Fe
public function getFullName($format = 'default') public function getFullName($format = 'default')
{ {
$template = [ $template = [
'name' => '%1$s', 'name' => '%{name}',
'name-semester' => '%1$s (%4$s)', 'name-semester' => '%{name} (%{semester})',
'number-name' => '%3$s %1$s', 'number-name' => '%{number} %{name}',
'number-name-semester' => '%3$s %1$s (%4$s)', 'number-name-semester' => '%{number} %{name} (%{semester})',
'number-type-name' => '%3$s %2$s: %1$s', 'number-type-name' => '%{number} %{type}: %{name}',
'sem-duration-name' => '%4$s', 'sem-duration-name' => '%{semester}',
'type' => '%2$s', 'type' => '%{type}',
'type-name' => '%2$s: %1$s', 'type-name' => '%{type}: %{name}',
'type-number-name' => '%2$s: %3$s %1$s', 'type-number-name' => '%{type}: %{number} %{name}',
]; ];
if ($format === 'default' || !isset($template[$format])) { if ($format === 'default' || !isset($template[$format])) {
$format = Config::get()->IMPORTANT_SEMNUMBER ? 'type-number-name' : 'type-name'; $format = Config::get()->IMPORTANT_SEMNUMBER ? 'type-number-name' : 'type-name';
} }
$sem_type = $this->getSemType(); $sem_type = $this->getSemType();
$data[0] = $this->name; $data = array_map('trim', [
$data[1] = $sem_type['name']; 'name' => $this->name,
$data[2] = $this->veranstaltungsnummer; 'type' => $sem_type['name'],
$data[3] = $this->getTextualSemester(); 'number' => $this->veranstaltungsnummer,
return trim(vsprintf($template[$format], array_map('trim', $data))); 'semester' => $this->getTextualSemester(),
]);
return trim(studip_interpolate($template[$format], $data));
} }
/** /**
......
...@@ -442,7 +442,7 @@ class Seminar_Auth ...@@ -442,7 +442,7 @@ class Seminar_Auth
// init of output via I18N // init of output via I18N
$_language_path = init_i18n($_SESSION['_language']); $_language_path = init_i18n($_SESSION['_language']);
include 'config.inc.php'; include $GLOBALS['STUDIP_BASE_PATH'] . '/config/config.inc.php';
if (!empty($_SESSION['contrast'])) { if (!empty($_SESSION['contrast'])) {
PageLayout::addStylesheet('accessibility.css'); PageLayout::addStylesheet('accessibility.css');
......
...@@ -125,7 +125,7 @@ if (!empty($_SESSION['contrast']) || UserConfig::get($GLOBALS['user']->id)->USER ...@@ -125,7 +125,7 @@ if (!empty($_SESSION['contrast']) || UserConfig::get($GLOBALS['user']->id)->USER
// init of output via I18N // init of output via I18N
$_language_path = init_i18n($_SESSION['_language']); $_language_path = init_i18n($_SESSION['_language']);
//force reload of config to get translated data //force reload of config to get translated data
include 'config.inc.php'; include $GLOBALS['STUDIP_BASE_PATH'] . '/config/config.inc.php';
// Try to select the course or institute given by the parameter 'cid' // Try to select the course or institute given by the parameter 'cid'
// in the current request. // in the current request.
......
...@@ -13,7 +13,6 @@ parameters: ...@@ -13,7 +13,6 @@ parameters:
- lib - lib
- vendor - vendor
excludePaths: excludePaths:
- lib/classes/ZipArchiveLegacyTrait.php
- lib/ilias_interface/studip_referrer_7x.php - lib/ilias_interface/studip_referrer_7x.php
- lib/ilias_interface/studip_referrer_8x.php - lib/ilias_interface/studip_referrer_8x.php
tmpDir: .caches tmpDir: .caches
......
...@@ -37,7 +37,7 @@ StudipFileloader::load( ...@@ -37,7 +37,7 @@ StudipFileloader::load(
foreach($added_configs as $key => $value) { foreach($added_configs as $key => $value) {
$GLOBALS[$key] = $value; $GLOBALS[$key] = $value;
} }
require 'config/config.inc.php'; require $GLOBALS['STUDIP_BASE_PATH'] . '/config/config.inc.php';;
require_once __DIR__ . '/../../lib/bootstrap-autoload.php'; require_once __DIR__ . '/../../lib/bootstrap-autoload.php';
// Do not send mails of any kind during tests // Do not send mails of any kind during tests
......
...@@ -27,8 +27,8 @@ $CACHING_ENABLE = false; ...@@ -27,8 +27,8 @@ $CACHING_ENABLE = false;
date_default_timezone_set('Europe/Berlin'); date_default_timezone_set('Europe/Berlin');
require 'config.inc.php'; require $GLOBALS['STUDIP_BASE_PATH'] . '/config/config.inc.php';;
require 'mvv_config.php'; require $GLOBALS['STUDIP_BASE_PATH'] . '/config/mvv_config.php';
require_once __DIR__ . '/../../lib/bootstrap-autoload.php'; require_once __DIR__ . '/../../lib/bootstrap-autoload.php';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment