Skip to content

rendering with strict=true does not throw for missing nested variables in context #23

@hubermat

Description

@hubermat

When I have the following nested context:

[
  'person' => [
    'firstName' => 'Foo',
    'lastName' => 'Bar',
    'zip' => '12345'
  ]
]

and want to get variables from this context with strict checking (should throw an exception, if the variable does not exist), it throws an exception correctly for $context->get('bogusvariable', true), but not for $context->get('person.city', true).
From looking at the code, I found out that for nested variables the check for $strict is missing in Context::findVariableInContext.

Linked pull request fixes this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions