You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SimpleSelector::notEmpty() can never return true; deprecate it in favour of isBlank() #138
QueryPath\CSS\SimpleSelector::notEmpty() joins its checks with &&, so it only returns true when the element, ID, classes, combinator, attributes, pseudo-classes and pseudo-elements are all set, which a simple selector can't have (it has at most one ID, and the combinator is usually unset). It is never true in practice, and nothing in src/ or tests/ calls it.
isBlank() is the working inverse and is what the engine uses (PseudoClass::relativeSelector()).
Proposal
It's public, so for 4.x: mark notEmpty()@deprecated in favour of ! isBlank(), and either fix it to be ! $this->isBlank() (also counting the combinator if that's intended) or leave it as is. Remove it in 5.0.
Activity