@@ -927,6 +927,26 @@ public function register(): void
927
927
return new Inflector ();
928
928
});
929
929
930
+ $ this ->app ->singleton (
931
+ ExceptionHandlerInterface::class,
932
+ function (Application $ app ) {
933
+ /** @var ConfigRepository */
934
+ $ config = $ app ['config ' ];
935
+
936
+ return new ErrorHandler (
937
+ $ app ,
938
+ $ app ->make (ResourceMetadataCollectionFactoryInterface::class),
939
+ $ app ->make (ApiPlatformController::class),
940
+ $ app ->make (IdentifiersExtractorInterface::class),
941
+ $ app ->make (ResourceClassResolverInterface::class),
942
+ $ app ->make (Negotiator::class),
943
+ $ config ->get ('api-platform.exception_to_status ' ),
944
+ $ config ->get ('app.debug ' ),
945
+ $ config ->get ('api-platform.error_formats ' )
946
+ );
947
+ }
948
+ );
949
+
930
950
if ($ this ->app ->runningInConsole ()) {
931
951
$ this ->commands ([
932
952
Console \InstallCommand::class,
@@ -1148,26 +1168,6 @@ private function registerGraphQl(): void
1148
1168
formats: $ config ->get ('api-platform.formats ' )
1149
1169
);
1150
1170
});
1151
-
1152
- $ this ->app ->singleton (
1153
- ExceptionHandlerInterface::class,
1154
- function (Application $ app ) {
1155
- /** @var ConfigRepository */
1156
- $ config = $ app ['config ' ];
1157
-
1158
- return new ErrorHandler (
1159
- $ app ,
1160
- $ app ->make (ResourceMetadataCollectionFactoryInterface::class),
1161
- $ app ->make (ApiPlatformController::class),
1162
- $ app ->make (IdentifiersExtractorInterface::class),
1163
- $ app ->make (ResourceClassResolverInterface::class),
1164
- $ app ->make (Negotiator::class),
1165
- $ config ->get ('api-platform.exception_to_status ' ),
1166
- $ config ->get ('app.debug ' ),
1167
- $ config ->get ('api-platform.error_formats ' )
1168
- );
1169
- }
1170
- );
1171
1171
}
1172
1172
1173
1173
/**
0 commit comments