diff --git a/lib/Data.php b/lib/Data.php index 52f81fc..6250bb9 100644 --- a/lib/Data.php +++ b/lib/Data.php @@ -1,7 +1,7 @@ 0) { + if ($missingLen > 1) { + if ($missingLen > 2) { + $last = array_pop($missing); + $missing = implode(', ', $missing); + $missing .= ", and $last"; + } else { + $missing = implode(' and ', $missing); + } + + throw new \Exception("\"$jsonPath\" is missing the required $missing properties.".\PHP_EOL); + } + + throw new \Exception("\"$jsonPath\" is missing the required {$missing[0]} property.".\PHP_EOL); } - self::$grammars[$grammar['scopeName']] = $grammar; return true; } } \ No newline at end of file diff --git a/lib/Highlighter.php b/lib/Highlighter.php index 74573ec..e61097d 100644 --- a/lib/Highlighter.php +++ b/lib/Highlighter.php @@ -1,7 +1,7 @@