Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explictly check for stdClass in VariableStore initializer #802

Merged
merged 2 commits into from
Feb 18, 2019

Conversation

smgallo
Copy link
Contributor

@smgallo smgallo commented Feb 15, 2019

Description

Since stdClass objects are not an instance of Traversable and is_traversable() is not available until PHP 7.x we need an explicit check for stdClass when initializing the VariableStore with the contents of variables declared in an action configuration. For example,

"variables": {
   "var1": 10,
   "var2": "some string"
}

Now, an error is properly thrown

Motivation and Context

Previous error:

2019-02-15 00:09:25 [error] (ETL\VariableStore): ETL\VariableStore::__construct() Expected array or VariableStore, got object

Improved error:

2019-02-15 15:09:01 [error] Error verifying sections: ('xdmod.gallo': Error verifying actions: xdmod.gallo.xdmod-public-user ((ETL\VariableStore): Value for bad1 must be scalar, array provided))

Tests performed

Manual tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project as found in the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@smgallo smgallo added the bug Bugfixes label Feb 15, 2019
@smgallo smgallo added this to the 8.1.0 milestone Feb 15, 2019
@smgallo smgallo requested a review from plessbd February 15, 2019 21:23
@smgallo smgallo merged commit 3a161fc into xdmod8.1 Feb 18, 2019
@smgallo smgallo deleted the etl-improve-parse-error-msg branch February 18, 2019 15:55
@smgallo smgallo changed the title Explictly check for stdClass in variable initializer Explictly check for stdClass in VariableStore initializer Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugfixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants