Fixed some more phpstan issues

This commit is contained in:
Jan Böhmer 2023-06-18 00:00:58 +02:00
parent 2f46fbfc7a
commit e8771ea118
77 changed files with 192 additions and 109 deletions

View file

@ -121,7 +121,7 @@ class CheckRequirementsCommand extends Command
}
$db_drivers_count = 0;
if(!in_array('pdo_mysql', $extensions)) {
if(!in_array('pdo_mysql', $extensions, true)) {
$io->error('pdo_mysql is not installed. You will not be able to use MySQL databases.');
} else {
if (!$only_issues) {
@ -130,7 +130,7 @@ class CheckRequirementsCommand extends Command
$db_drivers_count++;
}
if(!in_array('pdo_sqlite', $extensions)) {
if(!in_array('pdo_sqlite', $extensions, true)) {
$io->error('pdo_sqlite is not installed. You will not be able to use SQLite. databases');
} else {
if (!$only_issues) {
@ -146,13 +146,13 @@ class CheckRequirementsCommand extends Command
$io->error('You have no database drivers installed. You have to install at least one database driver!');
}
if (!in_array('curl', $extensions)) {
if (!in_array('curl', $extensions, true)) {
$io->warning('curl extension is not installed. Install curl extension for better performance');
} elseif (!$only_issues) {
$io->success('PHP extension curl is installed.');
}
$gd_installed = in_array('gd', $extensions);
$gd_installed = in_array('gd', $extensions, true);
if (!$gd_installed) {
$io->error('GD is not installed. GD is required for image processing.');
} elseif (!$only_issues) {

View file

@ -82,7 +82,7 @@ class ConvertToSAMLUserCommand extends Command
$io->confirm('You are going to convert a SAML user to a local user. This means, that the user can only login via the login form. '
. 'The permissions and groups settings of the user will remain unchanged. Do you really want to continue?');
$user->setSAMLUser(false);
$user->setSamlUser(false);
$user->setPassword(SamlUserFactory::SAML_PASSWORD_PLACEHOLDER);
$this->entityManager->flush();
@ -97,7 +97,7 @@ class ConvertToSAMLUserCommand extends Command
$io->confirm('You are going to convert a local user to a SAML user. This means, that the user can only login via SAML afterwards. The password in the DB will be removed. '
. 'The permissions and groups settings of the user will remain unchanged. Do you really want to continue?');
$user->setSAMLUser(true);
$user->setSamlUser(true);
$user->setPassword(SamlUserFactory::SAML_PASSWORD_PLACEHOLDER);
$this->entityManager->flush();

View file

@ -79,13 +79,13 @@ class UserListCommand extends Command
foreach ($users as $user) {
$table->addRow([
$user->getId(),
$user->getID(),
$user->getUsername(),
$user->getFullName(),
$user->getEmail(),
$user->getGroup() instanceof Group ? $user->getGroup()->getName() . ' (ID: ' . $user->getGroup()->getID() . ')' : 'No group',
$user->isDisabled() ? 'Yes' : 'No',
$user->isSAMLUser() ? 'SAML' : 'Local',
$user->isSamlUser() ? 'SAML' : 'Local',
]);
}

View file

@ -73,7 +73,7 @@ class UsersPermissionsCommand extends Command
return Command::FAILURE;
}
$io->note(sprintf('Found user %s with ID %d', $user->getFullName(true), $user->getId()));
$io->note(sprintf('Found user %s with ID %d', $user->getFullName(true), $user->getID()));
$edit_mapping = $this->renderPermissionTable($output, $user, $inherit);