Skip to content

refactor: typed component configuration and registration flow#620

Draft
Copilot wants to merge 2 commits intorefactor/components-use-php-config-filesfrom
copilot/sub-pr-619
Draft

refactor: typed component configuration and registration flow#620
Copilot wants to merge 2 commits intorefactor/components-use-php-config-filesfrom
copilot/sub-pr-619

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

Component configs needed clearer naming, a common interface with explicit getters, singleton instances, setter-based inputs, and stricter typing across registration.

  • Component configuration interface: Added ComponentConfigurationInterface defining getters for slug/name/identifier/view/default parameters/types/descriptions/dependencies plus a setter for inputs.
  • Singleton configuration implementation: Introduced ComponentConfiguration to wrap PHP config arrays into per-slug singletons with typed accessors and guarded input mutation.
  • Register integration: Updated Register to consume configuration objects via getters, renamed parameter types for clarity, strengthened type validation, and improved error messaging for view data/config loading.
  • Type safety & compatibility: Preserved legacy dependency key via deprecated handling while preferring dependencies; tightened signatures and casting to maintain expected shapes.

Example:

use ComponentLibrary\Component\Config\ComponentConfiguration;

// Wrap raw config array into a typed singleton
$config = ComponentConfiguration::getInstance($rawConfig);

$slug = $config->getSlug();
$defaults = $config->getDefaultParameters();
$view = $config->getView();

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: sebastianthulin <797129+sebastianthulin@users.noreply.github.com>
@sonarqubecloud
Copy link

Copy link
Contributor Author

Copilot AI commented Feb 26, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/carthage-software/mago/zipball/46f00467fbfaaf00e2c9fe6a1ed61c441ce25cf6
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9y8fKH /usr/bin/composer install (http block)
  • https://api.github.com/repos/doctrine/inflector/zipball/6d6c96277ea252fc1304627204c3d5e6e15faa3b
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9y8fKH /usr/bin/composer install (http block)
  • https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9y8fKH /usr/bin/composer install (http block)
  • https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9y8fKH /usr/bin/composer install (http block)
  • https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9y8fKH /usr/bin/composer install (http block)
  • https://api.github.com/repos/symfony/translation-contracts/zipball/65a8bc82080447fae78373aa10f8d13b38338977
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9y8fKH /usr/bin/composer install (http block)
  • https://api.github.com/repos/symfony/translation/zipball/d1fdeefd0707d15eb150c04e8837bf0b15ebea39
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9y8fKH /usr/bin/composer install (http block)
  • https://api.github.com/repos/voku/portable-ascii/zipball/87337c91b9dfacee02452244ee14ab3c43bc485a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9y8fKH /usr/bin/composer install (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Refactor component configuration variable naming and interface refactor: typed component configuration and registration flow Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants