Feature request from pantaoran, posted on GitHub Mar 23, 2016
I observe that in app/code/Magento/Store/Model/ScopeInterface.php there are 5 different scope type constants which are ambiguous and probably should be unified.
interface ScopeInterface
{
/**#@+
* Scope types
*/
const SCOPE_STORES = 'stores';
const SCOPE_WEBSITES = 'websites';
const SCOPE_STORE = 'store';
const SCOPE_GROUP = 'group';
const SCOPE_WEBSITE = 'website';
/**#@-*/
}
Both "store/stores" and "website/websites" exist once in singular and once in plural. It is not clear to the developer in any way which one should be used.
We ran into this problem today in our team, where I wrote code to set some config values, and another team member wrote code to read them, but I used the plural constants and he used the singular ones. We didn't notice the problem for weeks because we always tested with the default config values and didn't bother to set storeview-specific ones, and even when we did, I guess they must use a fall-back to default scope values when the store specific ones are not found.
I searched through the core code for use, and both versions seem to be used, although the singular versions are used much more often. Can we please simplify this important interface to only use one spelling per type?
Or is there a compelling reason to keep both singular and plural for these that I'm not understanding? I feel strange for bringing this up here because I can't possibly be the first person to notice this...
... View more