File tree Expand file tree Collapse file tree 2 files changed +11
-15
lines changed
Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -507,18 +507,14 @@ public function getThrowableName(Throwable $throwable): string
507507 $ name = $ throwable ->getName () . ' ( ' . $ name . ') ' ;
508508 } else {
509509 // Check if the exception class has FriendlyException attribute
510- try {
511- $ reflectionClass = new ReflectionClass ($ throwable );
512- if (class_exists ('Yiisoft\FriendlyException\Attribute\FriendlyException ' )) {
513- $ attributes = $ reflectionClass ->getAttributes ('Yiisoft\FriendlyException\Attribute\FriendlyException ' );
514-
515- if (!empty ($ attributes )) {
516- $ friendlyExceptionAttribute = $ attributes [0 ]->newInstance ();
517- $ name = $ friendlyExceptionAttribute ->name . ' ( ' . $ name . ') ' ;
518- }
510+ $ reflectionClass = new ReflectionClass ($ throwable );
511+ if (class_exists (\Yiisoft \FriendlyException \Attribute \FriendlyException::class)) {
512+ $ attributes = $ reflectionClass ->getAttributes (\Yiisoft \FriendlyException \Attribute \FriendlyException::class);
513+
514+ if (!empty ($ attributes )) {
515+ $ friendlyExceptionAttribute = $ attributes [0 ]->newInstance ();
516+ $ name = $ friendlyExceptionAttribute ->name . ' ( ' . $ name . ') ' ;
519517 }
520- } catch (\Throwable $ e ) {
521- // Ignore exception and keep default name
522518 }
523519 }
524520
Original file line number Diff line number Diff line change 2727$ solution = $ isFriendlyException ? $ throwable ->getSolution () : null ;
2828
2929// Check if the exception class has FriendlyException attribute
30- if ($ solution === null && class_exists (' Yiisoft\FriendlyException\Attribute\FriendlyException ' )) {
30+ if ($ solution === null && class_exists (\ Yiisoft \FriendlyException \Attribute \FriendlyException::class )) {
3131 try {
3232 $ reflectionClass = new ReflectionClass ($ throwable );
33- $ attributes = $ reflectionClass ->getAttributes (' Yiisoft\FriendlyException\Attribute\FriendlyException ' );
33+ $ attributes = $ reflectionClass ->getAttributes (\ Yiisoft \FriendlyException \Attribute \FriendlyException::class );
3434
3535 if (!empty ($ attributes )) {
3636 $ friendlyExceptionAttribute = $ attributes [0 ]->newInstance ();
111111 // Check if the exception class has FriendlyException attribute
112112 $ hasFriendlyNameFromAttribute = false ;
113113
114- if (class_exists (' Yiisoft\FriendlyException\Attribute\FriendlyException ' )) {
114+ if (class_exists (\ Yiisoft \FriendlyException \Attribute \FriendlyException::class )) {
115115 try {
116116 $ reflectionClass = new ReflectionClass ($ throwable );
117- $ attributes = $ reflectionClass ->getAttributes (' Yiisoft\FriendlyException\Attribute\FriendlyException ' );
117+ $ attributes = $ reflectionClass ->getAttributes (\ Yiisoft \FriendlyException \Attribute \FriendlyException::class );
118118
119119 if (!empty ($ attributes )) {
120120 $ friendlyExceptionAttribute = $ attributes [0 ]->newInstance ();
You can’t perform that action at this time.
0 commit comments