44
55namespace PHPModelGenerator \Model ;
66
7+ use PHPModelGenerator \Exception \ErrorRegistryException ;
8+ use PHPModelGenerator \Exception \InvalidArgumentException ;
9+
710/**
811 * Class GeneratorConfiguration
912 *
@@ -19,6 +22,12 @@ class GeneratorConfiguration
1922 protected $ prettyPrint = true ;
2023 /** @var bool */
2124 protected $ outputEnabled = true ;
25+ /** @var bool */
26+ protected $ collectErrors = true ;
27+ /** @var string */
28+ protected $ errorRegistryClass = ErrorRegistryException::class;
29+ /** @var string */
30+ protected $ exceptionClass = InvalidArgumentException::class;
2231
2332 /**
2433 * @return string
@@ -95,4 +104,61 @@ public function isOutputEnabled(): bool
95104 {
96105 return $ this ->outputEnabled ;
97106 }
107+
108+ /**
109+ * @return bool
110+ */
111+ public function collectErrors (): bool
112+ {
113+ return $ this ->collectErrors ;
114+ }
115+
116+ /**
117+ * @param bool $collectErrors
118+ *
119+ * @return GeneratorConfiguration
120+ */
121+ public function setCollectErrors (bool $ collectErrors ): self
122+ {
123+ $ this ->collectErrors = $ collectErrors ;
124+ return $ this ;
125+ }
126+
127+ /**
128+ * @return string
129+ */
130+ public function getErrorRegistryClass (): string
131+ {
132+ return $ this ->errorRegistryClass ;
133+ }
134+
135+ /**
136+ * @param string $errorRegistryClass
137+ *
138+ * @return GeneratorConfiguration
139+ */
140+ public function setErrorRegistryClass (string $ errorRegistryClass ): self
141+ {
142+ $ this ->errorRegistryClass = $ errorRegistryClass ;
143+ return $ this ;
144+ }
145+
146+ /**
147+ * @return string
148+ */
149+ public function getExceptionClass (): string
150+ {
151+ return $ this ->exceptionClass ;
152+ }
153+
154+ /**
155+ * @param string $exceptionClass
156+ *
157+ * @return GeneratorConfiguration
158+ */
159+ public function setExceptionClass (string $ exceptionClass ): self
160+ {
161+ $ this ->exceptionClass = $ exceptionClass ;
162+ return $ this ;
163+ }
98164}
0 commit comments