#451 PHPStan level 5

This commit is contained in:
Roland Gruber 2025-09-08 07:54:44 +02:00
parent c8a07b218a
commit 011d148e33
5 changed files with 11 additions and 25 deletions

View file

@ -1,5 +1,6 @@
<?php
use LAM\JOB\Job;
use LAM\PDF\PDFEntry;
use LAM\PDF\PDFLabelValue;
use LAM\PDF\PDFTable;
@ -2322,6 +2323,7 @@ abstract class baseModule {
* Returns a list of jobs that can be run.
*
* @param LAMConfig $config configuration
* @return Job[] jobs
*/
public function getSupportedJobs(&$config) {
return [];

View file

@ -762,10 +762,7 @@ class freeRadius extends baseModule {
}
/**
* Returns a list of jobs that can be run.
*
* @param LAMConfig $config configuration
* @return array list of jobs
* {@inheritDoc}
*/
public function getSupportedJobs(&$config) {
return [
@ -835,15 +832,7 @@ if (interface_exists('\LAM\JOB\Job', false)) {
}
/**
* Checks if a user is expired.
*
* @param integer $jobID job ID
* @param array $options job settings
* @param PDO $pdo PDO
* @param DateTime $now current time
* @param array $policyOptions list of policy options by getPolicyOptions()
* @param array $user user attributes
* @param boolean $isDryRun just do a dry run, nothing is modified
* {@inheritDoc}
*/
protected function checkSingleUser($jobID, $options, &$pdo, $now, $policyOptions, $user, $isDryRun) {
$expireTime = DateTime::createFromFormat('d M Y H:i', $user['radiusexpiration'][0], new DateTimeZone('UTC'));

View file

@ -752,9 +752,9 @@ class shadowAccount extends baseModule implements passwordService, AccountStatus
* Sets the expiration date of this account.
* If all parameters are null, the expiration date will be removed.
*
* @param string|null $year year (e.g. 2040)
* @param string|null $month month (e.g. 8)
* @param string|null $day day (e.g. 27)
* @param int|null $year year (e.g. 2040)
* @param int|null $month month (e.g. 8)
* @param int|null $day day (e.g. 27)
*/
public function setExpirationDate($year, $month, $day) {
if (($year == null) && ($month == null) && ($day == null)) {
@ -824,10 +824,7 @@ class shadowAccount extends baseModule implements passwordService, AccountStatus
}
/**
* Returns a list of jobs that can be run.
*
* @param LAMConfig $config configuration
* @return array list of jobs
* {@inheritDoc}
*/
public function getSupportedJobs(&$config) {
return [

View file

@ -3382,7 +3382,7 @@ class windowsUser extends baseModule implements passwordService, AccountStatusPr
// room number
if (!$this->isBooleanConfigOptionSet('windowsUser_hideroomnumber', true)) {
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'windowsUser_roomNumber',
'roomnumber', null, null, $errors, '/;[ ]*/');
'roomnumber', null, [], $errors, '/;[ ]*/');
}
// carLicense
if (!$this->isBooleanConfigOptionSet('windowsUser_hidecarLicense', true)) {
@ -4627,10 +4627,7 @@ class windowsUser extends baseModule implements passwordService, AccountStatusPr
}
/**
* Returns a list of jobs that can be run.
*
* @param LAMConfig $config configuration
* @return array list of jobs
* {@inheritDoc}
*/
public function getSupportedJobs(&$config) {
return [

View file

@ -56,6 +56,7 @@ parameters:
- '#Call to .*method .* on an unknown class LAM\\DB\\CronDatabase.*#'
- '#.* has invalid type LAM\\ENV\\.*#'
- '#.* has invalid type LAM\\DB\\.*#'
- '#.* has invalid return type LAM\\JOB\\.*#'
- '#Call to an undefined method baseModule::getBackupEmail\(\).#'
- '#Call to an undefined method baseModule::getMembers\(\).#'
- '#Call to an undefined method baseModule::getNextGIDs\(\).#'