Conditions | 5 |
Paths | 9 |
Total Lines | 30 |
Code Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
16 | public function generateClientsTable($clients) |
||
17 | { |
||
18 | $rows = []; |
||
19 | foreach ($clients as $client) { |
||
20 | $redirectUris = $client->getRedirectUri(); |
||
21 | $rows[] = [ |
||
22 | 'id' => $client->getPrimaryKey(), |
||
23 | 'identifier' => $client->getIdentifier(), |
||
24 | 'type' => $client->isConfidential() ? 'Confidential' : 'Public', |
||
25 | 'redirect_uris' => $redirectUris |
||
26 | ? ( |
||
27 | $redirectUris[0] |
||
28 | . (count($redirectUris) > 1 |
||
29 | ? ' +' . (count($redirectUris) - 1) . ' more' |
||
30 | : '') |
||
31 | ) |
||
32 | : '', |
||
33 | 'grant_types' => implode(', ', Oauth2Module::getGrantTypeIdentifiers($client->getGrantTypes())), |
||
34 | ]; |
||
35 | } |
||
36 | |||
37 | return Table::widget([ |
||
38 | 'headers' => [ |
||
39 | 'ID', |
||
40 | 'Identifier', |
||
41 | 'Type', |
||
42 | 'Redirect URIs', |
||
43 | 'Grant Types', |
||
44 | ], |
||
45 | 'rows' => $rows, |
||
46 | ]); |
||
49 |