@@ -412,75 +412,100 @@ abstract class SomeClass {
412
412
}
413
413
414
414
class SomeClass {
415
- /**
416
- * Validates something.
417
- *
418
- * @param string $method The set method parameter.
419
- *
420
- * @return string The validated method.
421
- *
422
- * @throws Prefix_Invalid_Argument_Exception The invalid argument exception.
423
- * @throws InvalidArgumentException The invalid argument exception.
424
- */
425
- protected function validate_something ( $ something ) {
426
- if ( ! Prefix_Validator::is_string ( $ something ) ) {
427
- throw Prefix_Invalid_Argument_Exception::invalid_string_parameter ( $ something , 'something ' );
428
- }
429
-
430
- if ( ! in_array ( $ something , $ this ->valid_http_something , true ) ) {
431
- throw new InvalidArgumentException ( sprintf ( '%s is not a valid HTTP something ' , $ something ) );
432
- }
433
-
434
- return $ something ;
435
- }
415
+ /**
416
+ * Validates something.
417
+ *
418
+ * @param string $method The set method parameter.
419
+ *
420
+ * @return string The validated method.
421
+ *
422
+ * @throws Prefix_Invalid_Argument_Exception The invalid argument exception.
423
+ * @throws InvalidArgumentException The invalid argument exception.
424
+ */
425
+ protected function validate_something ( $ something ) {
426
+ if ( ! Prefix_Validator::is_string ( $ something ) ) {
427
+ throw Prefix_Invalid_Argument_Exception::invalid_string_parameter ( $ something , 'something ' );
428
+ }
429
+
430
+ if ( ! in_array ( $ something , $ this ->valid_http_something , true ) ) {
431
+ throw new InvalidArgumentException ( sprintf ( '%s is not a valid HTTP something ' , $ something ) );
432
+ }
433
+
434
+ return $ something ;
435
+ }
436
+
437
+ /**
438
+ * Comment
439
+ *
440
+ * @throws Exception1 Comment.
441
+ * @throws Exception2 Comment.
442
+ * @throws Exception3 Comment.
443
+ */
444
+ public function foo () {
445
+ switch ($ foo ) {
446
+ case 1 :
447
+ throw Exception1::a ();
448
+ case 2 :
449
+ throw Exception1::b ();
450
+ case 3 :
451
+ throw Exception1::c ();
452
+ case 4 :
453
+ throw Exception2::a ();
454
+ case 5 :
455
+ throw Exception2::b ();
456
+ default :
457
+ throw new Exception3 ;
458
+
459
+ }
460
+ }
436
461
}
437
462
438
463
namespace Test\Admin {
439
- class NameSpacedClass {
440
- /**
441
- * @throws \ExceptionFromGlobalNamespace
442
- */
443
- public function ExceptionInGlobalNamespace () {
444
- throw new \ExceptionFromGlobalNamespace ();
445
- }
446
-
447
- /**
448
- * @throws ExceptionFromSameNamespace
449
- */
450
- public function ExceptionInSameNamespace () {
451
- throw new ExceptionFromSameNamespace ();
452
- }
453
-
454
- /**
455
- * @throws \Test\Admin\ExceptionFromSameNamespace
456
- */
457
- public function ExceptionInSameNamespaceToo () {
458
- throw new ExceptionFromSameNamespace ();
459
- }
460
-
461
- /**
462
- * @throws \Different\NameSpaceName\ExceptionFromDifferentNamespace
463
- */
464
- public function ExceptionInSameNamespaceToo () {
465
- throw new \Different \NameSpaceName \ExceptionFromDifferentNamespace ();
466
- }
467
- }
464
+ class NameSpacedClass {
465
+ /**
466
+ * @throws \ExceptionFromGlobalNamespace
467
+ */
468
+ public function ExceptionInGlobalNamespace () {
469
+ throw new \ExceptionFromGlobalNamespace ();
470
+ }
471
+
472
+ /**
473
+ * @throws ExceptionFromSameNamespace
474
+ */
475
+ public function ExceptionInSameNamespace () {
476
+ throw new ExceptionFromSameNamespace ();
477
+ }
478
+
479
+ /**
480
+ * @throws \Test\Admin\ExceptionFromSameNamespace
481
+ */
482
+ public function ExceptionInSameNamespaceToo () {
483
+ throw new ExceptionFromSameNamespace ();
484
+ }
485
+
486
+ /**
487
+ * @throws \Different\NameSpaceName\ExceptionFromDifferentNamespace
488
+ */
489
+ public function ExceptionInSameNamespaceToo () {
490
+ throw new \Different \NameSpaceName \ExceptionFromDifferentNamespace ();
491
+ }
492
+ }
468
493
}
469
494
470
495
namespace {
471
- class GlobalNameSpaceClass {
472
- /**
473
- * @throws SomeGlobalException
474
- */
475
- public function ThrowGlobalException () {
476
- throw new SomeGlobalException ();
477
- }
478
-
479
- /**
480
- * @throws \SomeGlobalException
481
- */
482
- public function ThrowGlobalExceptionToo () {
483
- throw new SomeGlobalException ();
484
- }
485
- }
496
+ class GlobalNameSpaceClass {
497
+ /**
498
+ * @throws SomeGlobalException
499
+ */
500
+ public function ThrowGlobalException () {
501
+ throw new SomeGlobalException ();
502
+ }
503
+
504
+ /**
505
+ * @throws \SomeGlobalException
506
+ */
507
+ public function ThrowGlobalExceptionToo () {
508
+ throw new SomeGlobalException ();
509
+ }
510
+ }
486
511
}
0 commit comments