99use SimpleSAML \XML \Assert \Assert ;
1010use SimpleSAML \XML \Attribute ;
1111use SimpleSAML \XML \Constants as C ;
12+ use SimpleSAML \XMLSchema \Exception \SchemaViolationException ;
1213use SimpleSAML \XMLSchema \Type \StringValue ;
1314use SimpleSAML \XMLSchema \XML \Constants \NS ;
1415
@@ -204,7 +205,7 @@ function (Attribute $attr) {
204205
205206 if ($ namespace === NS ::LOCAL ) {
206207 // If ##local then all namespaces must be null
207- Assert::allNull ($ actual_namespaces );
208+ Assert::allNull ($ actual_namespaces, SchemaviolationException::class );
208209 } elseif (is_array ($ namespace )) {
209210 // Make a local copy of the property that we can edit
210211 $ allowed_namespaces = $ namespace ;
@@ -227,17 +228,18 @@ function (Attribute $attr) {
227228 rtrim (implode (', ' , $ diff )),
228229 self ::NS ,
229230 ),
231+ SchemaViolationException::class,
230232 );
231233 } else {
232234 if ($ namespace === NS ::OTHER ) {
233235 // All attributes must be namespaced, ergo non-null
234- Assert::allNotNull ($ actual_namespaces );
236+ Assert::allNotNull ($ actual_namespaces, SchemaViolationException::class );
235237
236238 // Must be any namespace other than the parent element
237- Assert::allNotSame ($ actual_namespaces , self ::NS );
239+ Assert::allNotSame ($ actual_namespaces , self ::NS , SchemaViolationException::class );
238240 } elseif ($ namespace === NS ::TARGETNAMESPACE ) {
239241 // Must be the same namespace as the one of the parent element
240- Assert::allSame ($ actual_namespaces , self ::NS );
242+ Assert::allSame ($ actual_namespaces , self ::NS , SchemaViolationException::class );
241243 }
242244 }
243245
0 commit comments