Skip to content

Issue #20: Enhance error reporting#21

Open
OnkelTem wants to merge 1 commit intoromaricdrigon:masterfrom
OnkelTem:master
Open

Issue #20: Enhance error reporting#21
OnkelTem wants to merge 1 commit intoromaricdrigon:masterfrom
OnkelTem:master

Conversation

@OnkelTem
Copy link

See #20

Copy link
Owner

@romaricdrigon romaricdrigon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your work, I added some comments. If you need help with the tests, I can assist once I get what the code is doing :)

private $messages = [];

public function __construct($node_path, $message)
public function __construct($node_path, $messages, $paths)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure of why we need to pass an array of messages? The code is much less visible and I'm not sure current($messages) will always return what we expect. What about having $message (string) and an extra parameter $previousMessages(array) ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it looks like there's a small indentation glitch just in front of the constructor.

/**
* @throws Exception\NodeValidatorException
*/
public function validateNode($name, $type, $node, $data, $path = '')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation glitch again.

return $this->messages;
}

public function getReport()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure to understand what getReport()is giving? As it will become part of MetaYaml API, there should be a test over it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants