From a38203a6b6fc32f5a7bf6d35dab2f19f02fd2963 Mon Sep 17 00:00:00 2001 From: John Holt Date: Thu, 2 Nov 2023 16:53:11 +0000 Subject: [PATCH 1/4] Make psalm passing part of the build --- api/psalm.xml | 2 ++ api/src/Authentication/Type/LDAP.php | 3 +++ api/src/Page.php | 3 +++ 3 files changed, 8 insertions(+) diff --git a/api/psalm.xml b/api/psalm.xml index 899614d54..5a570b022 100644 --- a/api/psalm.xml +++ b/api/psalm.xml @@ -1,11 +1,13 @@ + diff --git a/api/src/Authentication/Type/LDAP.php b/api/src/Authentication/Type/LDAP.php index c223a7bea..5badfd5ef 100644 --- a/api/src/Authentication/Type/LDAP.php +++ b/api/src/Authentication/Type/LDAP.php @@ -30,6 +30,9 @@ function authenticate($login, $password) if ($conn) { // Tested against LDAP version 3 (could add support for older versions here) + /** + * @psalm-suppress UndefinedConstant + */ ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3); // use a secure connection for LDAP, if configured this way (default is unsecured as this was the historical setting) diff --git a/api/src/Page.php b/api/src/Page.php index 1f2c3c3d7..72ffa2f98 100644 --- a/api/src/Page.php +++ b/api/src/Page.php @@ -923,6 +923,9 @@ function _ldap_search($search, $email = False) if ($ds) { // Explictly set the protocol version to prevent bind errors + /** + * @psalm-suppress UndefinedConstant + */ ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); $r = ldap_bind($ds); $sr = ldap_search($ds, $ldap_search, $search); From e8ea8860d95d95523b438a9acf07afb64ee65adf Mon Sep 17 00:00:00 2001 From: John Holt Date: Thu, 2 Nov 2023 17:06:13 +0000 Subject: [PATCH 2/4] Update ci file --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d515daeb1..709c7f49c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,9 +61,8 @@ jobs: php_version: 7.3 version: 9 - # Note, lint errors are being escaped here - so this will report, but not cause the build to fail - name: Run Psalm - run: psalm --output-format=github || exit 0 + run: psalm --output-format=github js_build: name: JavaScript build, test and lint From 95f86183fdfcebd18ecdc3ba81275119078670a2 Mon Sep 17 00:00:00 2001 From: John Holt Date: Thu, 2 Nov 2023 17:15:26 +0000 Subject: [PATCH 3/4] UNdo changes in psalm.xml config --- api/psalm.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/psalm.xml b/api/psalm.xml index 5a570b022..4242ff6b9 100644 --- a/api/psalm.xml +++ b/api/psalm.xml @@ -1,13 +1,11 @@ - +> From a250c122a08165af9442452ee8456e279f133af7 Mon Sep 17 00:00:00 2001 From: John Holt Date: Thu, 2 Nov 2023 17:16:23 +0000 Subject: [PATCH 4/4] undo changes to psalm config --- api/psalm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/psalm.xml b/api/psalm.xml index 4242ff6b9..899614d54 100644 --- a/api/psalm.xml +++ b/api/psalm.xml @@ -5,7 +5,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" -> +>