Skip to content

Commit

Permalink
Merge pull request #691 from DiamondLightSource/improve/make_php_lint…
Browse files Browse the repository at this point in the history
…_active

Make psalm passing part of the build

Only changes build proces
  • Loading branch information
John-Holt-Tessella authored Nov 2, 2023
2 parents 4b7047c + a250c12 commit c82aac0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions api/src/Authentication/Type/LDAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions api/src/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c82aac0

Please sign in to comment.