Skip to content

Commit 176cb89

Browse files
authored
Merge pull request #76 from fschmtt/add-features-to-serverinfo
Add features to serverinfo
2 parents 01c0dd9 + 1337e6b commit 176cb89

File tree

4 files changed

+52
-16
lines changed

4 files changed

+52
-16
lines changed

.github/workflows/php-integration.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
keycloak: [17.0.0, 18.0.0, 19.0.0, 20.0.0, 21.0.0, 22.0.0]
15+
keycloak: [17.0.0, 18.0.0, 19.0.0, 20.0.0, 21.0.0, 22.0.0, 22.0.5]
1616

1717
env:
1818
KEYCLOAK_VERSION: ${{ matrix.keycloak }}

src/Collection/FeatureCollection.php

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Fschmtt\Keycloak\Collection;
6+
7+
use Fschmtt\Keycloak\Representation\Feature;
8+
9+
/**
10+
* @extends Collection<Feature>
11+
*
12+
* @codeCoverageIgnore
13+
*/
14+
class FeatureCollection extends Collection
15+
{
16+
public static function getRepresentationClass(): string
17+
{
18+
return Feature::class;
19+
}
20+
}

src/Representation/Feature.php

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Fschmtt\Keycloak\Representation;
6+
7+
/**
8+
* @method string|null getName()
9+
* @method string|null getLabel()
10+
* @method string|null getType()
11+
* @method string[]|null getDependencies()
12+
* @method bool|null getEnabled()
13+
*
14+
* @codeCoverageIgnore
15+
*/
16+
class Feature extends Representation
17+
{
18+
public function __construct(
19+
protected ?string $name = null,
20+
protected ?string $label = null,
21+
protected ?string $type = null,
22+
/** @var string[] $dependencies */
23+
protected ?array $dependencies = null,
24+
protected ?bool $enabled = null,
25+
) {
26+
}
27+
}

src/Representation/ServerInfo.php

+4-15
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Fschmtt\Keycloak\Representation;
66

77
use Fschmtt\Keycloak\Attribute\Since;
8+
use Fschmtt\Keycloak\Collection\FeatureCollection;
89
use Fschmtt\Keycloak\Collection\PasswordPolicyTypeCollection;
910
use Fschmtt\Keycloak\Type\Map;
1011

@@ -15,6 +16,7 @@
1516
* @method array|null getComponentTypes()
1617
* @method CryptoInfo|null getCryptoInfo()
1718
* @method array|null getEnums()
19+
* @method FeatureCollection|null getFeatures()
1820
* @method array|null getIdentityProviders()
1921
* @method MemoryInfo|null getMemoryInfo()
2022
* @method PasswordPolicyType[]|null getPasswordPolicies()
@@ -24,21 +26,6 @@
2426
* @method array|null getSocialProviders()
2527
* @method SystemInfo|null getSystemInfo()
2628
* @method array|null getThemes()
27-
* @method self withBuiltinProtocolMappers(?array $builtinProtocolMappers)
28-
* @method self withClientImporters(?array $clientImporters)
29-
* @method self withClientInstallations(?array $clientInstallations)
30-
* @method self withComponentTypes(?array $componentTypes)
31-
* @method self withCryptoInfo(?CryptoInfo $componentTypes)
32-
* @method self withEnums(?array $enums)
33-
* @method self withIdentityProviders(?array $identityProviders)
34-
* @method self withMemoryInfo(?MemoryInfo $memoryInfo)
35-
* @method self withPasswordPolicies(?array $passwordPolicies)
36-
* @method self withProtocolMapperTypes(?MemoryInfo $protocolMapperTypes)
37-
* @method self withProfileInfo(?ProfileInfo $profileInfo)
38-
* @method self withProviders(?array $providers)
39-
* @method self withSocialProviders(?array $socialProviders)
40-
* @method self withSystemInfo(?SystemInfo $systemInfo)
41-
* @method self withThemes(?array $themes)
4229
*
4330
* @codeCoverageIgnore
4431
*/
@@ -52,6 +39,8 @@ public function __construct(
5239
#[Since('20.0.0')]
5340
protected ?CryptoInfo $cryptoInfo = null,
5441
protected ?Map $enums = null,
42+
#[Since('22.0.4')]
43+
protected ?FeatureCollection $features = null,
5544
protected ?Map $identityProviders = null,
5645
protected ?MemoryInfo $memoryInfo = null,
5746
protected ?PasswordPolicyTypeCollection $passwordPolicies = null,

0 commit comments

Comments
 (0)