Issue #3392903 by borisson_, Wim Leers, phenaproxima: Validate inputs of...
Issue #3392903 by borisson_, Wim Leers, phenaproxima: Validate inputs of TypeResolver::resolveExpression(): only allow %parent, %type and %key
(cherry picked from commit 94e4d471)
thrownew\LogicException('`'.$expression.'` is not a valid dynamic type expression. Dynamic type expressions must contain at least `%parent`, `%key`, or `%type`.`');
}
if($name==='%type'&&$previous_name!=='%parent'){
thrownew\LogicException('`%type` can only used when immediately preceded by `%parent` in `'.$expression.'`');
* @testWith ["[foo.%bar.qux]", "`foo.%bar.qux` is not a valid dynamic type expression. Dynamic type expressions must contain at least `%parent`, `%key`, or `%type`.`", {"foo": "foo"}]
* ["[%paren.field_type]", "`%paren.field_type` is not a valid dynamic type expression. Dynamic type expressions must contain at least `%parent`, `%key`, or `%type`."]
* ["[something.%type]", "`%type` can only used when immediately preceded by `%parent` in `something.%type`", {"something": "something"}]