Skip to content

Commit 16775d4

Browse files
authored
phpstan CI (#339)
1 parent 73bbefc commit 16775d4

File tree

6 files changed

+82
-8
lines changed

6 files changed

+82
-8
lines changed

.github/workflows/phpstan.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: phpstan
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
submodules: true
15+
- uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: "8.3"
18+
tools: composer
19+
- run: composer install --dev
20+
- run: ./vendor/bin/phpstan --memory-limit=-1 analyse ./resources/

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"require-dev": {
88
"phpunit/phpunit": ">=12",
99
"robiningelbrecht/phpunit-coverage-tools": "<2",
10-
"squizlabs/php_codesniffer": "*"
10+
"squizlabs/php_codesniffer": "*",
11+
"phpstan/phpstan": "^2.1"
1112
},
1213
"config": {
1314
"platform": {

composer.lock

Lines changed: 54 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/lib/UnityLDAP.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,31 +464,31 @@ public function getUserEntry($uid)
464464
{
465465
$uid = ldap_escape($uid, "", LDAP_ESCAPE_DN);
466466
return $this->getEntry(
467-
unityLDAP::RDN . "=$uid," . CONFIG["ldap"]["user_ou"],
467+
UnityLDAP::RDN . "=$uid," . CONFIG["ldap"]["user_ou"],
468468
);
469469
}
470470

471471
public function getGroupEntry($gid)
472472
{
473473
$gid = ldap_escape($gid, "", LDAP_ESCAPE_DN);
474474
return $this->getEntry(
475-
unityLDAP::RDN . "=$gid," . CONFIG["ldap"]["group_ou"],
475+
UnityLDAP::RDN . "=$gid," . CONFIG["ldap"]["group_ou"],
476476
);
477477
}
478478

479479
public function getPIGroupEntry($gid)
480480
{
481481
$gid = ldap_escape($gid, "", LDAP_ESCAPE_DN);
482482
return $this->getEntry(
483-
unityLDAP::RDN . "=$gid," . CONFIG["ldap"]["pigroup_ou"],
483+
UnityLDAP::RDN . "=$gid," . CONFIG["ldap"]["pigroup_ou"],
484484
);
485485
}
486486

487487
public function getOrgGroupEntry($gid)
488488
{
489489
$gid = ldap_escape($gid, "", LDAP_ESCAPE_DN);
490490
return $this->getEntry(
491-
unityLDAP::RDN . "=$gid," . CONFIG["ldap"]["orggroup_ou"],
491+
UnityLDAP::RDN . "=$gid," . CONFIG["ldap"]["orggroup_ou"],
492492
);
493493
}
494494
}

resources/lib/UnityOrg.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function inOrg($user, $ignorecache = false)
5050

5151
public function getOrgMembers($ignorecache = false)
5252
{
53-
$members = $this->getGroupMemberUIDs($ignorecache);
53+
$members = $this->getOrgMemberUIDs($ignorecache);
5454
$out = [];
5555
foreach ($members as $member) {
5656
$user_obj = new UnityUser(

resources/lib/phpopenldaper

0 commit comments

Comments
 (0)