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