CI: Fix psalm UndefinedVariable errors

pull/5020/head
Angel Fernando Quiroz Campos 12 months ago
parent 3afcccfe9b
commit b9871ab657
  1. 11
      src/CoreBundle/Controller/Admin/IndexBlocksController.php

@ -19,11 +19,16 @@ class IndexBlocksController extends BaseController
{ {
private bool $isAdmin = false; private bool $isAdmin = false;
private bool $isSessionAdmin = false; private bool $isSessionAdmin = false;
private $extAuthSource = [];
public function __construct( public function __construct(
private readonly TranslatorInterface $translator, private readonly TranslatorInterface $translator,
private readonly SettingsManager $settingsManager private readonly SettingsManager $settingsManager
) { ) {
$this->extAuthSource = [
'extldap' => [],
'ldap' => [],
];
} }
public function __invoke(): JsonResponse public function __invoke(): JsonResponse
@ -133,7 +138,7 @@ class IndexBlocksController extends BaseController
'label' => $this->translator->trans('Anonymise users list'), 'label' => $this->translator->trans('Anonymise users list'),
]; ];
if (isset($extAuthSource, $extAuthSource['extldap']) && \count($extAuthSource['extldap']) > 0) { if (\count($this->extAuthSource['extldap']) > 0) {
$items[] = [ $items[] = [
'class' => 'item-user-ldap-list', 'class' => 'item-user-ldap-list',
'url' => $this->generateUrl('legacy_main', ['name' => 'admin/ldap_users_list.php']), 'url' => $this->generateUrl('legacy_main', ['name' => 'admin/ldap_users_list.php']),
@ -279,7 +284,7 @@ class IndexBlocksController extends BaseController
]; ];
} }
if (isset($extAuthSource, $extAuthSource['ldap']) && \count($extAuthSource['ldap']) > 0) { if (\count($this->extAuthSource['ldap']) > 0) {
$items[] = [ $items[] = [
'class' => 'item-course-subscription-ldap', 'class' => 'item-course-subscription-ldap',
'url' => $this->generateUrl('legacy_main', ['name' => 'admin/ldap_import_students.php']), 'url' => $this->generateUrl('legacy_main', ['name' => 'admin/ldap_import_students.php']),
@ -483,7 +488,7 @@ class IndexBlocksController extends BaseController
'url' => $this->generateUrl('legacy_main', ['name' => 'session/session_import_drh.php']), 'url' => $this->generateUrl('legacy_main', ['name' => 'session/session_import_drh.php']),
'label' => $this->translator->trans('Import list of HR directors into sessions'), 'label' => $this->translator->trans('Import list of HR directors into sessions'),
]; ];
if (isset($extAuthSource, $extAuthSource['ldap']) && \count($extAuthSource['ldap']) > 0) { if (\count($this->extAuthSource['ldap']) > 0) {
$items[] = [ $items[] = [
'class' => 'item-session-subscription-ldap-import', 'class' => 'item-session-subscription-ldap-import',
'url' => $this->generateUrl('legacy_main', ['name' => 'admin/ldap_import_students_to_session.php']), 'url' => $this->generateUrl('legacy_main', ['name' => 'admin/ldap_import_students_to_session.php']),

Loading…
Cancel
Save