Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component type is not tracked when hyphen notation is used #147

Open
mabar opened this issue Jun 19, 2024 · 1 comment
Open

Component type is not tracked when hyphen notation is used #147

mabar opened this issue Jun 19, 2024 · 1 comment

Comments

@mabar
Copy link

mabar commented Jun 19, 2024

Sub-components accessed via hyphen notation are treated as mixed

$this['document']['head'];
$this['document-head'];
$this->getComponent('document')->getComponent('head');
$this->getComponent('document-head');

Current result

  1     Dumped type: HeadControl
  2     Dumped type: mixed~null
  3     Dumped type: HeadControl
  4     Dumped type: mixed~null

Expected result:

All should return HeadControl. Or report that this syntax is not supported.
Which variant would you prefer?

@ondrejmirtes
Copy link
Member

The hyphen syntax should be easy to add. When this syntax is encountered, the extension could ask for type of getComponent('document')->getComponent('head'); internally.

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

No branches or pull requests

2 participants