File tree Expand file tree Collapse file tree 5 files changed +20
-0
lines changed
Expand file tree Collapse file tree 5 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,14 @@ parameters:
99 - 'var_dump ()'
1010 message : ' avoid committing debug calls'
1111
12+ exceptions :
13+ check :
14+ missingCheckedExceptionInThrows : true
15+ tooWideThrowType : true
16+
17+ uncheckedExceptionClasses :
18+ - LogicException
19+
1220 level : 8
1321 paths :
1422 - src
Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ public function __construct(
3737
3838
3939
40+ /**
41+ * @throws GrammarProcessing\CannotConsumeTokenException
42+ * @throws GrammarProcessing\UnexpectedTokenException
43+ */
4044 public function parseGrammarFromSource (string $ source ): GrammarProcessing \Grammar
4145 {
4246 return $ this ->parseGrammarFromAbstractSyntaxTree (
Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ public function __construct(
4343
4444
4545
46+ /**
47+ * @throws UnexpectedTokenException
48+ */
4649 public function tokenizeSource (string $ source ): TokenStream
4750 {
4851 return $ this ->lexicalGrammar ->parseSource ($ source );
@@ -55,6 +58,7 @@ public function tokenizeSource(string $source): TokenStream
5558 * @param TRootSymbol $rootSymbol
5659 * @return AbstractSyntaxTree<TRootSymbol>
5760 * @throws CannotConsumeTokenException
61+ * @throws UnexpectedTokenException
5862 */
5963 public function parseSource (string $ source , string $ rootSymbol ): AbstractSyntaxTree
6064 {
Original file line number Diff line number Diff line change @@ -102,6 +102,9 @@ public function consumeTokenWithType(string $type): Token
102102
103103
104104
105+ /**
106+ * @throws CannotConsumeTokenException
107+ */
105108 public function consumeTokenWithValue (string $ value ): Token
106109 {
107110 if (isset ($ this ->tokens [$ this ->currentToken ]) === FALSE ) {
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ function getPattern(array $nonterminals): string;
1717
1818 /**
1919 * @param array<string, Symbol> $nonterminals
20+ * @throws GrammarProcessing\CannotConsumeTokenException
2021 */
2122 function acceptNode (
2223 GrammarProcessing \Error $ error ,
You can’t perform that action at this time.
0 commit comments