File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55namespace TypeLang \Mapper \Type \Builder ;
66
7+ use TypeLang \Mapper \Exception \Definition \Shape \ShapeFieldsNotSupportedException ;
78use TypeLang \Mapper \Exception \Definition \Template \Hint \TemplateArgumentHintsNotSupportedException ;
89use TypeLang \Mapper \Exception \Definition \Template \MissingTemplateArgumentsException ;
910use TypeLang \Mapper \Exception \Definition \Template \MissingTemplateArgumentsInRangeException ;
1516
1617final class Assert
1718{
19+ /**
20+ * @throws ShapeFieldsNotSupportedException
21+ */
22+ public static function expectNoShapeFields (NamedTypeNode $ stmt ): void
23+ {
24+ if ($ stmt ->fields === null ) {
25+ return ;
26+ }
27+
28+ throw ShapeFieldsNotSupportedException::becauseTooManyShapeFields ($ stmt );
29+ }
30+
1831 /**
1932 * @throws TemplateArgumentsNotSupportedException
2033 */
Original file line number Diff line number Diff line change @@ -37,24 +37,6 @@ protected function expectNoTemplateArguments(TypeStatement $stmt): void
3737 Assert::expectNoTemplateArguments ($ stmt );
3838 }
3939
40- /**
41- * @api
42- *
43- * @throws ShapeFieldsNotSupportedException
44- */
45- protected function expectNoShapeFields (TypeStatement $ stmt ): void
46- {
47- if (!$ stmt instanceof NamedTypeNode) {
48- return ;
49- }
50-
51- if ($ stmt ->fields === null ) {
52- return ;
53- }
54-
55- throw ShapeFieldsNotSupportedException::becauseTooManyShapeFields ($ stmt );
56- }
57-
5840 /**
5941 * @api
6042 *
@@ -173,4 +155,18 @@ protected function expectNoAnyTemplateArgumentHint(TypeStatement $stmt): void
173155
174156 Assert::expectNoAnyTemplateArgumentsHints ($ stmt );
175157 }
158+
159+ /**
160+ * @api
161+ *
162+ * @throws ShapeFieldsNotSupportedException
163+ */
164+ protected function expectNoShapeFields (TypeStatement $ stmt ): void
165+ {
166+ if (!$ stmt instanceof NamedTypeNode) {
167+ return ;
168+ }
169+
170+ Assert::expectNoShapeFields ($ stmt );
171+ }
176172}
You can’t perform that action at this time.
0 commit comments