Skip to content

Commit 5076e17

Browse files
csrbarberclaude
andcommitted
refactor: Return roles array directly from listEnvironmentRoles
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 22a8ef5 commit 5076e17

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/RBAC.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public function createEnvironmentRole(
191191
*
192192
* @throws Exception\WorkOSException
193193
*
194-
* @return array{0: Resource\Role[]}
194+
* @return Resource\Role[]
195195
*/
196196
public function listEnvironmentRoles()
197197
{
@@ -204,7 +204,7 @@ public function listEnvironmentRoles()
204204
\array_push($roles, Resource\Role::constructFromResponse($responseData));
205205
}
206206

207-
return [$roles];
207+
return $roles;
208208
}
209209

210210
/**

tests/WorkOS/RBACTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function testListEnvironmentRoles()
181181

182182
$role = $this->roleFixture();
183183

184-
list($roles) = $this->rbac->listEnvironmentRoles();
184+
$roles = $this->rbac->listEnvironmentRoles();
185185
$this->assertSame($role, $roles[0]->toArray());
186186
}
187187

0 commit comments

Comments
 (0)