Adding ability to set default client configuration during generation#194
Closed
dcarbone wants to merge 5 commits into
Closed
Adding ability to set default client configuration during generation#194dcarbone wants to merge 5 commits into
dcarbone wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for defining a default FHIR API client configuration during generation, wiring it through generated version configuration and client construction.
Changes:
- Adds
clientConfighandling toVersionDefaultConfigand generatedVersionConfig. - Adds generated client factory support via
VersionClient::fromVersion(). - Adds tests for default client config behavior and refreshes copyright years.
Reviewed changes
Copilot reviewed 66 out of 66 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/VersionDefaultConfigTest.php | Adds client config tests. |
| template/versions/core/class_version.php | Passes generated client config into version config. |
| template/versions/core/class_version_client.php | Adds fromVersion() factory. |
| template/tests/core/versions/test_class_version_config.php | Adds generated version config client tests. |
| template/tests/core/mock/class_mock_version_config.php | Updates mock interface implementation. |
| template/core/versions/interface_version_config.php | Adds getClientConfig(). |
| template/core/versions/class_version_config.php | Adds client config storage and setters. |
| src/Version/VersionDefaultConfig.php | Adds generation-time client config parsing. |
| src/Version/SourceMetadata.php | Copyright update. |
| src/Version/Definition/TypeTestFiles.php | Copyright update. |
| src/Version/Definition/Types.php | Copyright update. |
| src/Version/Definition/TypePropertyDecorator.php | Copyright update. |
| src/Version/Definition/TypeExtractor.php | Copyright update. |
| src/Version/Definition/TypeDecorator.php | Copyright update. |
| src/Version/Definition/TypeDecorationValidator.php | Copyright update. |
| src/Version/Definition/Type.php | Copyright update. |
| src/Version/Definition/SourceTrait.php | Copyright update. |
| src/Version/Definition/Property.php | Copyright update. |
| src/Version/Definition/Properties.php | Copyright update. |
| src/Version/Definition/Enumeration/EnumerationValue.php | Copyright update. |
| src/Version/Definition/Enumeration.php | Copyright update. |
| src/Version/Definition/DocumentationTrait.php | Copyright update. |
| src/Version/Definition/Decorator/UnionElementTypeDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/SimpleTypeElementTypeDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/SimpleTypeElementPropertyDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/SimpleContentElementTypeDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/SequenceElementTypeDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/RestrictionElementTypeDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/ExtensionElementTypeDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/ElementElementTypeDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/ComplexTypeElementTypeDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/ComplexContentElementTypeDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/ChoiceElementTypeDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/ChoiceElementElementPropertyDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/AttributeElementTypeDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/AnyElementTypeDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/AnnotationElementTypeDecorator.php | Copyright update. |
| src/Version/Definition/Decorator/AnnotationElementPropertyTypeDecorator.php | Copyright update. |
| src/Version/Definition.php | Copyright update. |
| src/Version.php | Copyright update. |
| src/Utilities/XMLValueLocationUtils.php | Copyright update. |
| src/Utilities/TypeHintUtils.php | Copyright update. |
| src/Utilities/NameUtils.php | Copyright update. |
| src/Utilities/ImportUtils.php | Copyright update. |
| src/Utilities/FileUtils.php | Copyright update. |
| src/Utilities/ExceptionUtils.php | Copyright update. |
| src/Utilities/DocumentationUtils.php | Copyright update. |
| src/Utilities/CopyrightUtils.php | Copyright update. |
| src/Render/Templates.php | Copyright update. |
| src/LogLevel.php | Copyright update. |
| src/Logger.php | Copyright update. |
| src/Enum/TypeKindEnum.php | Copyright update. |
| src/Enum/PropertyUseEnum.php | Copyright update. |
| src/Enum/PrimitiveTypeEnum.php | Copyright update. |
| src/Enum/ElementNameEnum.php | Copyright update. |
| src/Enum/AttributeNameEnum.php | Copyright update. |
| src/CoreFiles.php | Copyright update. |
| src/CoreFile.php | Copyright update. |
| src/Config/VersionConfig.php | Copyright update. |
| src/Config.php | Copyright update. |
| src/Builder/TypeBuilder.php | Copyright update. |
| src/Builder/Imports.php | Copyright update. |
| src/Builder/Import.php | Copyright update. |
| src/Builder.php | Copyright update. |
| files/funcs.php | Copyright update. |
| files/constants.php | Copyright update. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 67 out of 67 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
template/tests/versions/core/test_class_version_client.php:106
- This assigned
$clientis never used, so the test does not actually verify anything about theVersionClientreturned byfromVersion()beyond the config already stored on$version. Either assert on the returned client or remove the assignment to avoid a misleading success-path test.
Comment on lines
+200
to
+210
| if (!array_key_exists('address', $config) || '' === trim((string)$config['address'])) { | ||
| throw new \InvalidArgumentException( | ||
| 'Client config must include a non-empty "address" key.' | ||
| ); | ||
| } | ||
| foreach (self::_CLIENT_CONFIG_KEYS as $k) { | ||
| if (!array_key_exists($k, $config)) { | ||
| continue; | ||
| } | ||
| $this->_clientConfig[$k] = match ($k) { | ||
| 'address' => (string)$config[$k], |
Comment on lines
+153
to
+155
| $this->_clientConfig = new <?php echo PHPFHIR_CLIENT_CLASSNAME_CONFIG; ?>( | ||
| address: $config['address'], | ||
| defaultFormat: isset($config['defaultFormat']) ? <?php echo $serializeFormatEnum; ?>::from($config['defaultFormat']) : <?php echo $serializeFormatEnum; ?>::XML, |
Owner
Author
|
Eh, this is too compromised. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.