Fix a bug that Validator bypasses array checking

For checking array with “sometimes”
Validator calls function passesOptionalCheck to check if attribute key
is set.
“passesOptionalCheck” uses array_dot to flatten the input data, so for
input like “items”: [“good1”, “good2”, “good3”] become array(“items.0”
=> “good1”, “items.1” => “good2”, “items.2” => “good3”). Checking
attribute with array_key_exists here will always return false and
validation is skipped
Fix indentation
Add test case, Fix inconsistent indentation
Fix indentation
Well it doesn't look good in Sublime but fine lol
Merge branch '4.2' of https://github.com/Seitk/framework into Seitk-4.2
Fix some formatting.