Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: phpstan

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
tools: composer
- run: composer install --dev
- run: ./vendor/bin/phpstan --memory-limit=-1 analyse ./resources/
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"require-dev": {
"phpunit/phpunit": ">=12",
"robiningelbrecht/phpunit-coverage-tools": "<2",
"squizlabs/php_codesniffer": "*"
"squizlabs/php_codesniffer": "*",
"phpstan/phpstan": "^2.1"
},
"config": {
"platform": {
Expand Down
55 changes: 54 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions resources/lib/UnityLDAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,31 +464,31 @@ public function getUserEntry($uid)
{
$uid = ldap_escape($uid, "", LDAP_ESCAPE_DN);
return $this->getEntry(
unityLDAP::RDN . "=$uid," . CONFIG["ldap"]["user_ou"],
UnityLDAP::RDN . "=$uid," . CONFIG["ldap"]["user_ou"],
);
}

public function getGroupEntry($gid)
{
$gid = ldap_escape($gid, "", LDAP_ESCAPE_DN);
return $this->getEntry(
unityLDAP::RDN . "=$gid," . CONFIG["ldap"]["group_ou"],
UnityLDAP::RDN . "=$gid," . CONFIG["ldap"]["group_ou"],
);
}

public function getPIGroupEntry($gid)
{
$gid = ldap_escape($gid, "", LDAP_ESCAPE_DN);
return $this->getEntry(
unityLDAP::RDN . "=$gid," . CONFIG["ldap"]["pigroup_ou"],
UnityLDAP::RDN . "=$gid," . CONFIG["ldap"]["pigroup_ou"],
);
}

public function getOrgGroupEntry($gid)
{
$gid = ldap_escape($gid, "", LDAP_ESCAPE_DN);
return $this->getEntry(
unityLDAP::RDN . "=$gid," . CONFIG["ldap"]["orggroup_ou"],
UnityLDAP::RDN . "=$gid," . CONFIG["ldap"]["orggroup_ou"],
);
}
}
2 changes: 1 addition & 1 deletion resources/lib/UnityOrg.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function inOrg($user, $ignorecache = false)

public function getOrgMembers($ignorecache = false)
{
$members = $this->getGroupMemberUIDs($ignorecache);
$members = $this->getOrgMemberUIDs($ignorecache);
$out = [];
foreach ($members as $member) {
$user_obj = new UnityUser(
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/phpopenldaper