Skip to content

Commit

Permalink
Merge pull request #76 from fschmtt/add-features-to-serverinfo
Browse files Browse the repository at this point in the history
Add features to serverinfo
  • Loading branch information
fschmtt authored Nov 17, 2023
2 parents 01c0dd9 + 1337e6b commit 176cb89
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
keycloak: [17.0.0, 18.0.0, 19.0.0, 20.0.0, 21.0.0, 22.0.0]
keycloak: [17.0.0, 18.0.0, 19.0.0, 20.0.0, 21.0.0, 22.0.0, 22.0.5]

env:
KEYCLOAK_VERSION: ${{ matrix.keycloak }}
Expand Down
20 changes: 20 additions & 0 deletions src/Collection/FeatureCollection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

namespace Fschmtt\Keycloak\Collection;

use Fschmtt\Keycloak\Representation\Feature;

/**
* @extends Collection<Feature>
*
* @codeCoverageIgnore
*/
class FeatureCollection extends Collection
{
public static function getRepresentationClass(): string
{
return Feature::class;
}
}
27 changes: 27 additions & 0 deletions src/Representation/Feature.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace Fschmtt\Keycloak\Representation;

/**
* @method string|null getName()
* @method string|null getLabel()
* @method string|null getType()
* @method string[]|null getDependencies()
* @method bool|null getEnabled()
*
* @codeCoverageIgnore
*/
class Feature extends Representation
{
public function __construct(
protected ?string $name = null,
protected ?string $label = null,
protected ?string $type = null,
/** @var string[] $dependencies */
protected ?array $dependencies = null,
protected ?bool $enabled = null,
) {
}
}
19 changes: 4 additions & 15 deletions src/Representation/ServerInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Fschmtt\Keycloak\Representation;

use Fschmtt\Keycloak\Attribute\Since;
use Fschmtt\Keycloak\Collection\FeatureCollection;
use Fschmtt\Keycloak\Collection\PasswordPolicyTypeCollection;
use Fschmtt\Keycloak\Type\Map;

Expand All @@ -15,6 +16,7 @@
* @method array|null getComponentTypes()
* @method CryptoInfo|null getCryptoInfo()
* @method array|null getEnums()
* @method FeatureCollection|null getFeatures()
* @method array|null getIdentityProviders()
* @method MemoryInfo|null getMemoryInfo()
* @method PasswordPolicyType[]|null getPasswordPolicies()
Expand All @@ -24,21 +26,6 @@
* @method array|null getSocialProviders()
* @method SystemInfo|null getSystemInfo()
* @method array|null getThemes()
* @method self withBuiltinProtocolMappers(?array $builtinProtocolMappers)
* @method self withClientImporters(?array $clientImporters)
* @method self withClientInstallations(?array $clientInstallations)
* @method self withComponentTypes(?array $componentTypes)
* @method self withCryptoInfo(?CryptoInfo $componentTypes)
* @method self withEnums(?array $enums)
* @method self withIdentityProviders(?array $identityProviders)
* @method self withMemoryInfo(?MemoryInfo $memoryInfo)
* @method self withPasswordPolicies(?array $passwordPolicies)
* @method self withProtocolMapperTypes(?MemoryInfo $protocolMapperTypes)
* @method self withProfileInfo(?ProfileInfo $profileInfo)
* @method self withProviders(?array $providers)
* @method self withSocialProviders(?array $socialProviders)
* @method self withSystemInfo(?SystemInfo $systemInfo)
* @method self withThemes(?array $themes)
*
* @codeCoverageIgnore
*/
Expand All @@ -52,6 +39,8 @@ public function __construct(
#[Since('20.0.0')]
protected ?CryptoInfo $cryptoInfo = null,
protected ?Map $enums = null,
#[Since('22.0.4')]
protected ?FeatureCollection $features = null,
protected ?Map $identityProviders = null,
protected ?MemoryInfo $memoryInfo = null,
protected ?PasswordPolicyTypeCollection $passwordPolicies = null,
Expand Down

0 comments on commit 176cb89

Please sign in to comment.