fschmtt / keycloak-rest-api-client-php

PHP client to interact with Keycloak's Admin REST API.
MIT License
26 stars 18 forks source link

Define an enum for required user actions #106

Open elnurvl opened 5 months ago

elnurvl commented 5 months ago

An enum will make it easier to see available options for the property and prevent bugs.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.18%. Comparing base (66a5526) to head (ea36f8c). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #106 +/- ## ======================================= Coverage 95.18% 95.18% ======================================= Files 32 32 Lines 706 706 ======================================= Hits 672 672 Misses 34 34 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

fschmtt commented 5 months ago

Generally I'm in favor of improving types, but the current implementation of (de-)serialization would require refactoring, because right now only arrays/lists of Representation collections (represented by Collection classes) can be deserialized.

With the current implementation, the deserialization would make an array<string> out of the user actions instead of an array<RequiredAction> or RequiredActionCollection.

(De-)Serialization seems to be the biggest issue and limiting factor in this library ATM 😅 Definitely needs improvement, whether it's custom or using something like e.g. Symfony Serializer