Ticket #522 (closed bug: fixed)
jSelectorInterface not compatible with jSelectorFactory
| Reported by: | doubleface | Owned by: | doubleface |
|---|---|---|---|
| Priority: | normal | Milestone: | Jelix 1.0.3 |
| Component: | jelix:core | Version: | 1.0.2 |
| Severity: | minor | Keywords: | |
| Cc: | Php version: | ||
| Review: | review+ | Hosting Provider: | |
| Blocked By: | Documentation needed: | no | |
| Blocking: |
Description
The following code does not work :
$s = new jSelectorInterface('test');
$long_selector = $s->toString(true);
$s2 = jSelectorFactory::create($long_selector);
Because here, $long_selector equals "iface:modulename~test" and then jSelectorFactory tries to create a jSelectoriface instead of a jSelectorInterface.
I see 2 solutions :
- Rename jSelectorInterface to jSelectorIface but this may cause a problem to those who already use jSelectorInterface directly (without jClass::incIface), maybe not many people after all.
- Change regexp of jSelectorFactory from "/^([a-z]{3,5})\:([\w~\/\.]+)$/" to "/^([a-z]{3,9})\:([\w~\/\.]+)$/" and change jSelectorInterface::type to "interface"
But maybe I don't see all impacts of such modifications... Your choice.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
