Test case
1 generated file · +15 −0test/inputs/graphql/github1.graphql
Mgraphql-phpdefault / TopLevel.php+15 −0
| @@ -169,6 +169,9 @@ class TopLevel { | ||
| 169 | 169 | * @throws Exception |
| 170 | 170 | */ |
| 171 | 171 | public static function from(stdClass $obj): TopLevel { |
| 172 | + if (!property_exists($obj, 'data')) { | |
| 173 | + throw new Exception("Missing required property"); | |
| 174 | + } | |
| 172 | 175 | return new TopLevel( |
| 173 | 176 | TopLevel::fromData($obj->{'data'}) |
| 174 | 177 | ,TopLevel::fromErrors($obj->{'errors'}) |
| @@ -270,6 +273,9 @@ class Data { | ||
| 270 | 273 | * @throws Exception |
| 271 | 274 | */ |
| 272 | 275 | public static function from(stdClass $obj): Data { |
| 276 | + if (!property_exists($obj, 'viewer')) { | |
| 277 | + throw new Exception("Missing required property"); | |
| 278 | + } | |
| 273 | 279 | return new Data( |
| 274 | 280 | Data::fromViewer($obj->{'viewer'}) |
| 275 | 281 | ); |
| @@ -430,6 +436,12 @@ class User { | ||
| 430 | 436 | * @throws Exception |
| 431 | 437 | */ |
| 432 | 438 | public static function from(stdClass $obj): User { |
| 439 | + if (!property_exists($obj, 'login')) { | |
| 440 | + throw new Exception("Missing required property"); | |
| 441 | + } | |
| 442 | + if (!property_exists($obj, 'realName')) { | |
| 443 | + throw new Exception("Missing required property"); | |
| 444 | + } | |
| 433 | 445 | return new User( |
| 434 | 446 | User::fromLogin($obj->{'login'}) |
| 435 | 447 | ,User::fromRealName($obj->{'realName'}) |
| @@ -530,6 +542,9 @@ class Error { | ||
| 530 | 542 | * @throws Exception |
| 531 | 543 | */ |
| 532 | 544 | public static function from(stdClass $obj): Error { |
| 545 | + if (!property_exists($obj, 'message')) { | |
| 546 | + throw new Exception("Missing required property"); | |
| 547 | + } | |
| 533 | 548 | return new Error( |
| 534 | 549 | Error::fromMessage($obj->{'message'}) |
| 535 | 550 | ); |
Test case
1 generated file · +24 −0test/inputs/graphql/github2.graphql
Mgraphql-phpdefault / TopLevel.php+24 −0
| @@ -169,6 +169,9 @@ class TopLevel { | ||
| 169 | 169 | * @throws Exception |
| 170 | 170 | */ |
| 171 | 171 | public static function from(stdClass $obj): TopLevel { |
| 172 | + if (!property_exists($obj, 'data')) { | |
| 173 | + throw new Exception("Missing required property"); | |
| 174 | + } | |
| 172 | 175 | return new TopLevel( |
| 173 | 176 | TopLevel::fromData($obj->{'data'}) |
| 174 | 177 | ,TopLevel::fromErrors($obj->{'errors'}) |
| @@ -270,6 +273,9 @@ class Data { | ||
| 270 | 273 | * @throws Exception |
| 271 | 274 | */ |
| 272 | 275 | public static function from(stdClass $obj): Data { |
| 276 | + if (!property_exists($obj, 'viewer')) { | |
| 277 | + throw new Exception("Missing required property"); | |
| 278 | + } | |
| 273 | 279 | return new Data( |
| 274 | 280 | Data::fromViewer($obj->{'viewer'}) |
| 275 | 281 | ); |
| @@ -421,6 +427,12 @@ class User { | ||
| 421 | 427 | * @throws Exception |
| 422 | 428 | */ |
| 423 | 429 | public static function from(stdClass $obj): User { |
| 430 | + if (!property_exists($obj, 'login')) { | |
| 431 | + throw new Exception("Missing required property"); | |
| 432 | + } | |
| 433 | + if (!property_exists($obj, 'repositories')) { | |
| 434 | + throw new Exception("Missing required property"); | |
| 435 | + } | |
| 424 | 436 | return new User( |
| 425 | 437 | User::fromLogin($obj->{'login'}) |
| 426 | 438 | ,User::fromRepositories($obj->{'repositories'}) |
| @@ -605,6 +617,12 @@ class RepositoryConnection { | ||
| 605 | 617 | * @throws Exception |
| 606 | 618 | */ |
| 607 | 619 | public static function from(stdClass $obj): RepositoryConnection { |
| 620 | + if (!property_exists($obj, 'totalCount')) { | |
| 621 | + throw new Exception("Missing required property"); | |
| 622 | + } | |
| 623 | + if (!property_exists($obj, 'nodes')) { | |
| 624 | + throw new Exception("Missing required property"); | |
| 625 | + } | |
| 608 | 626 | return new RepositoryConnection( |
| 609 | 627 | RepositoryConnection::fromTotalCount($obj->{'totalCount'}) |
| 610 | 628 | ,RepositoryConnection::fromNodes($obj->{'nodes'}) |
| @@ -705,6 +723,9 @@ class Repository { | ||
| 705 | 723 | * @throws Exception |
| 706 | 724 | */ |
| 707 | 725 | public static function from(stdClass $obj): Repository { |
| 726 | + if (!property_exists($obj, 'name')) { | |
| 727 | + throw new Exception("Missing required property"); | |
| 728 | + } | |
| 708 | 729 | return new Repository( |
| 709 | 730 | Repository::fromName($obj->{'name'}) |
| 710 | 731 | ); |
| @@ -803,6 +824,9 @@ class Error { | ||
| 803 | 824 | * @throws Exception |
| 804 | 825 | */ |
| 805 | 826 | public static function from(stdClass $obj): Error { |
| 827 | + if (!property_exists($obj, 'message')) { | |
| 828 | + throw new Exception("Missing required property"); | |
| 829 | + } | |
| 806 | 830 | return new Error( |
| 807 | 831 | Error::fromMessage($obj->{'message'}) |
| 808 | 832 | ); |
Test case
1 generated file · +24 −0test/inputs/graphql/github3.graphql
Mgraphql-phpdefault / TopLevel.php+24 −0
| @@ -169,6 +169,9 @@ class TopLevel { | ||
| 169 | 169 | * @throws Exception |
| 170 | 170 | */ |
| 171 | 171 | public static function from(stdClass $obj): TopLevel { |
| 172 | + if (!property_exists($obj, 'data')) { | |
| 173 | + throw new Exception("Missing required property"); | |
| 174 | + } | |
| 172 | 175 | return new TopLevel( |
| 173 | 176 | TopLevel::fromData($obj->{'data'}) |
| 174 | 177 | ,TopLevel::fromErrors($obj->{'errors'}) |
| @@ -270,6 +273,9 @@ class Data { | ||
| 270 | 273 | * @throws Exception |
| 271 | 274 | */ |
| 272 | 275 | public static function from(stdClass $obj): Data { |
| 276 | + if (!property_exists($obj, 'viewer')) { | |
| 277 | + throw new Exception("Missing required property"); | |
| 278 | + } | |
| 273 | 279 | return new Data( |
| 274 | 280 | Data::fromViewer($obj->{'viewer'}) |
| 275 | 281 | ); |
| @@ -431,6 +437,12 @@ class User { | ||
| 431 | 437 | * @throws Exception |
| 432 | 438 | */ |
| 433 | 439 | public static function from(stdClass $obj): User { |
| 440 | + if (!property_exists($obj, 'login')) { | |
| 441 | + throw new Exception("Missing required property"); | |
| 442 | + } | |
| 443 | + if (!property_exists($obj, 'repository')) { | |
| 444 | + throw new Exception("Missing required property"); | |
| 445 | + } | |
| 434 | 446 | return new User( |
| 435 | 447 | User::fromLogin($obj->{'login'}) |
| 436 | 448 | ,User::fromRepository($obj->{'repository'}) |
| @@ -532,6 +544,9 @@ class Repository { | ||
| 532 | 544 | * @throws Exception |
| 533 | 545 | */ |
| 534 | 546 | public static function from(stdClass $obj): Repository { |
| 547 | + if (!property_exists($obj, 'pullRequests')) { | |
| 548 | + throw new Exception("Missing required property"); | |
| 549 | + } | |
| 535 | 550 | return new Repository( |
| 536 | 551 | Repository::fromPullRequests($obj->{'pullRequests'}) |
| 537 | 552 | ); |
| @@ -662,6 +677,9 @@ class PullRequestConnection { | ||
| 662 | 677 | * @throws Exception |
| 663 | 678 | */ |
| 664 | 679 | public static function from(stdClass $obj): PullRequestConnection { |
| 680 | + if (!property_exists($obj, 'nodes')) { | |
| 681 | + throw new Exception("Missing required property"); | |
| 682 | + } | |
| 665 | 683 | return new PullRequestConnection( |
| 666 | 684 | PullRequestConnection::fromNodes($obj->{'nodes'}) |
| 667 | 685 | ); |
| @@ -761,6 +779,9 @@ class PullRequest { | ||
| 761 | 779 | * @throws Exception |
| 762 | 780 | */ |
| 763 | 781 | public static function from(stdClass $obj): PullRequest { |
| 782 | + if (!property_exists($obj, 'state')) { | |
| 783 | + throw new Exception("Missing required property"); | |
| 784 | + } | |
| 764 | 785 | return new PullRequest( |
| 765 | 786 | PullRequest::fromState($obj->{'state'}) |
| 766 | 787 | ); |
| @@ -912,6 +933,9 @@ class Error { | ||
| 912 | 933 | * @throws Exception |
| 913 | 934 | */ |
| 914 | 935 | public static function from(stdClass $obj): Error { |
| 936 | + if (!property_exists($obj, 'message')) { | |
| 937 | + throw new Exception("Missing required property"); | |
| 938 | + } | |
| 915 | 939 | return new Error( |
| 916 | 940 | Error::fromMessage($obj->{'message'}) |
| 917 | 941 | ); |
Test case
1 generated file · +27 −0test/inputs/graphql/github4.graphql
Mgraphql-phpdefault / TopLevel.php+27 −0
| @@ -169,6 +169,9 @@ class TopLevel { | ||
| 169 | 169 | * @throws Exception |
| 170 | 170 | */ |
| 171 | 171 | public static function from(stdClass $obj): TopLevel { |
| 172 | + if (!property_exists($obj, 'data')) { | |
| 173 | + throw new Exception("Missing required property"); | |
| 174 | + } | |
| 172 | 175 | return new TopLevel( |
| 173 | 176 | TopLevel::fromData($obj->{'data'}) |
| 174 | 177 | ,TopLevel::fromErrors($obj->{'errors'}) |
| @@ -270,6 +273,9 @@ class Data { | ||
| 270 | 273 | * @throws Exception |
| 271 | 274 | */ |
| 272 | 275 | public static function from(stdClass $obj): Data { |
| 276 | + if (!property_exists($obj, 'viewer')) { | |
| 277 | + throw new Exception("Missing required property"); | |
| 278 | + } | |
| 273 | 279 | return new Data( |
| 274 | 280 | Data::fromViewer($obj->{'viewer'}) |
| 275 | 281 | ); |
| @@ -493,6 +499,15 @@ class User { | ||
| 493 | 499 | * @throws Exception |
| 494 | 500 | */ |
| 495 | 501 | public static function from(stdClass $obj): User { |
| 502 | + if (!property_exists($obj, 'login')) { | |
| 503 | + throw new Exception("Missing required property"); | |
| 504 | + } | |
| 505 | + if (!property_exists($obj, 'name')) { | |
| 506 | + throw new Exception("Missing required property"); | |
| 507 | + } | |
| 508 | + if (!property_exists($obj, 'repository')) { | |
| 509 | + throw new Exception("Missing required property"); | |
| 510 | + } | |
| 496 | 511 | return new User( |
| 497 | 512 | User::fromLogin($obj->{'login'}) |
| 498 | 513 | ,User::fromName($obj->{'name'}) |
| @@ -596,6 +611,9 @@ class Repository { | ||
| 596 | 611 | * @throws Exception |
| 597 | 612 | */ |
| 598 | 613 | public static function from(stdClass $obj): Repository { |
| 614 | + if (!property_exists($obj, 'pullRequests')) { | |
| 615 | + throw new Exception("Missing required property"); | |
| 616 | + } | |
| 599 | 617 | return new Repository( |
| 600 | 618 | Repository::fromPullRequests($obj->{'pullRequests'}) |
| 601 | 619 | ); |
| @@ -726,6 +744,9 @@ class PullRequestConnection { | ||
| 726 | 744 | * @throws Exception |
| 727 | 745 | */ |
| 728 | 746 | public static function from(stdClass $obj): PullRequestConnection { |
| 747 | + if (!property_exists($obj, 'nodes')) { | |
| 748 | + throw new Exception("Missing required property"); | |
| 749 | + } | |
| 729 | 750 | return new PullRequestConnection( |
| 730 | 751 | PullRequestConnection::fromNodes($obj->{'nodes'}) |
| 731 | 752 | ); |
| @@ -825,6 +846,9 @@ class PullRequest { | ||
| 825 | 846 | * @throws Exception |
| 826 | 847 | */ |
| 827 | 848 | public static function from(stdClass $obj): PullRequest { |
| 849 | + if (!property_exists($obj, 'state')) { | |
| 850 | + throw new Exception("Missing required property"); | |
| 851 | + } | |
| 828 | 852 | return new PullRequest( |
| 829 | 853 | PullRequest::fromState($obj->{'state'}) |
| 830 | 854 | ); |
| @@ -976,6 +1000,9 @@ class Error { | ||
| 976 | 1000 | * @throws Exception |
| 977 | 1001 | */ |
| 978 | 1002 | public static function from(stdClass $obj): Error { |
| 1003 | + if (!property_exists($obj, 'message')) { | |
| 1004 | + throw new Exception("Missing required property"); | |
| 1005 | + } | |
| 979 | 1006 | return new Error( |
| 980 | 1007 | Error::fromMessage($obj->{'message'}) |
| 981 | 1008 | ); |
Test case
1 generated file · +12 −0test/inputs/graphql/github5.graphql
Mgraphql-phpdefault / TopLevel.php+12 −0
| @@ -169,6 +169,9 @@ class TopLevel { | ||
| 169 | 169 | * @throws Exception |
| 170 | 170 | */ |
| 171 | 171 | public static function from(stdClass $obj): TopLevel { |
| 172 | + if (!property_exists($obj, 'data')) { | |
| 173 | + throw new Exception("Missing required property"); | |
| 174 | + } | |
| 172 | 175 | return new TopLevel( |
| 173 | 176 | TopLevel::fromData($obj->{'data'}) |
| 174 | 177 | ,TopLevel::fromErrors($obj->{'errors'}) |
| @@ -270,6 +273,9 @@ class Data { | ||
| 270 | 273 | * @throws Exception |
| 271 | 274 | */ |
| 272 | 275 | public static function from(stdClass $obj): Data { |
| 276 | + if (!property_exists($obj, 'viewer')) { | |
| 277 | + throw new Exception("Missing required property"); | |
| 278 | + } | |
| 273 | 279 | return new Data( |
| 274 | 280 | Data::fromViewer($obj->{'viewer'}) |
| 275 | 281 | ); |
| @@ -430,6 +436,9 @@ class User { | ||
| 430 | 436 | * @throws Exception |
| 431 | 437 | */ |
| 432 | 438 | public static function from(stdClass $obj): User { |
| 439 | + if (!property_exists($obj, 'login')) { | |
| 440 | + throw new Exception("Missing required property"); | |
| 441 | + } | |
| 433 | 442 | return new User( |
| 434 | 443 | User::fromLogin($obj->{'login'}) |
| 435 | 444 | ,User::fromName($obj->{'name'}) |
| @@ -530,6 +539,9 @@ class Error { | ||
| 530 | 539 | * @throws Exception |
| 531 | 540 | */ |
| 532 | 541 | public static function from(stdClass $obj): Error { |
| 542 | + if (!property_exists($obj, 'message')) { | |
| 543 | + throw new Exception("Missing required property"); | |
| 544 | + } | |
| 533 | 545 | return new Error( |
| 534 | 546 | Error::fromMessage($obj->{'message'}) |
| 535 | 547 | ); |
Test case
1 generated file · +12 −0test/inputs/graphql/github6.graphql
Mgraphql-phpdefault / TopLevel.php+12 −0
| @@ -169,6 +169,9 @@ class TopLevel { | ||
| 169 | 169 | * @throws Exception |
| 170 | 170 | */ |
| 171 | 171 | public static function from(stdClass $obj): TopLevel { |
| 172 | + if (!property_exists($obj, 'data')) { | |
| 173 | + throw new Exception("Missing required property"); | |
| 174 | + } | |
| 172 | 175 | return new TopLevel( |
| 173 | 176 | TopLevel::fromData($obj->{'data'}) |
| 174 | 177 | ,TopLevel::fromErrors($obj->{'errors'}) |
| @@ -280,6 +283,9 @@ class Data { | ||
| 280 | 283 | * @throws Exception |
| 281 | 284 | */ |
| 282 | 285 | public static function from(stdClass $obj): Data { |
| 286 | + if (!property_exists($obj, 'resource')) { | |
| 287 | + throw new Exception("Missing required property"); | |
| 288 | + } | |
| 283 | 289 | return new Data( |
| 284 | 290 | Data::fromResource($obj->{'resource'}) |
| 285 | 291 | ); |
| @@ -440,6 +446,9 @@ class UniformResourceLocatable { | ||
| 440 | 446 | * @throws Exception |
| 441 | 447 | */ |
| 442 | 448 | public static function from(stdClass $obj): UniformResourceLocatable { |
| 449 | + if (!property_exists($obj, 'url')) { | |
| 450 | + throw new Exception("Missing required property"); | |
| 451 | + } | |
| 443 | 452 | return new UniformResourceLocatable( |
| 444 | 453 | UniformResourceLocatable::fromURL($obj->{'url'}) |
| 445 | 454 | ,UniformResourceLocatable::fromLogin($obj->{'login'}) |
| @@ -540,6 +549,9 @@ class Error { | ||
| 540 | 549 | * @throws Exception |
| 541 | 550 | */ |
| 542 | 551 | public static function from(stdClass $obj): Error { |
| 552 | + if (!property_exists($obj, 'message')) { | |
| 553 | + throw new Exception("Missing required property"); | |
| 554 | + } | |
| 543 | 555 | return new Error( |
| 544 | 556 | Error::fromMessage($obj->{'message'}) |
| 545 | 557 | ); |
Test case
1 generated file · +42 −0test/inputs/graphql/github7.graphql
Mgraphql-phpdefault / TopLevel.php+42 −0
| @@ -169,6 +169,9 @@ class TopLevel { | ||
| 169 | 169 | * @throws Exception |
| 170 | 170 | */ |
| 171 | 171 | public static function from(stdClass $obj): TopLevel { |
| 172 | + if (!property_exists($obj, 'data')) { | |
| 173 | + throw new Exception("Missing required property"); | |
| 174 | + } | |
| 172 | 175 | return new TopLevel( |
| 173 | 176 | TopLevel::fromData($obj->{'data'}) |
| 174 | 177 | ,TopLevel::fromErrors($obj->{'errors'}) |
| @@ -270,6 +273,9 @@ class Data { | ||
| 270 | 273 | * @throws Exception |
| 271 | 274 | */ |
| 272 | 275 | public static function from(stdClass $obj): Data { |
| 276 | + if (!property_exists($obj, 'viewer')) { | |
| 277 | + throw new Exception("Missing required property"); | |
| 278 | + } | |
| 273 | 279 | return new Data( |
| 274 | 280 | Data::fromViewer($obj->{'viewer'}) |
| 275 | 281 | ); |
| @@ -474,6 +480,15 @@ class User { | ||
| 474 | 480 | * @throws Exception |
| 475 | 481 | */ |
| 476 | 482 | public static function from(stdClass $obj): User { |
| 483 | + if (!property_exists($obj, 'login')) { | |
| 484 | + throw new Exception("Missing required property"); | |
| 485 | + } | |
| 486 | + if (!property_exists($obj, 'starredRepositories')) { | |
| 487 | + throw new Exception("Missing required property"); | |
| 488 | + } | |
| 489 | + if (!property_exists($obj, 'repositories')) { | |
| 490 | + throw new Exception("Missing required property"); | |
| 491 | + } | |
| 477 | 492 | return new User( |
| 478 | 493 | User::fromLogin($obj->{'login'}) |
| 479 | 494 | ,User::fromStarredRepositories($obj->{'starredRepositories'}) |
| @@ -608,6 +623,9 @@ class RepositoryConnection { | ||
| 608 | 623 | * @throws Exception |
| 609 | 624 | */ |
| 610 | 625 | public static function from(stdClass $obj): RepositoryConnection { |
| 626 | + if (!property_exists($obj, 'edges')) { | |
| 627 | + throw new Exception("Missing required property"); | |
| 628 | + } | |
| 611 | 629 | return new RepositoryConnection( |
| 612 | 630 | RepositoryConnection::fromEdges($obj->{'edges'}) |
| 613 | 631 | ); |
| @@ -717,6 +735,9 @@ class RepositoryEdge { | ||
| 717 | 735 | * @throws Exception |
| 718 | 736 | */ |
| 719 | 737 | public static function from(stdClass $obj): RepositoryEdge { |
| 738 | + if (!property_exists($obj, 'node')) { | |
| 739 | + throw new Exception("Missing required property"); | |
| 740 | + } | |
| 720 | 741 | return new RepositoryEdge( |
| 721 | 742 | RepositoryEdge::fromNode($obj->{'node'}) |
| 722 | 743 | ); |
| @@ -1027,6 +1048,21 @@ class Repository { | ||
| 1027 | 1048 | * @throws Exception |
| 1028 | 1049 | */ |
| 1029 | 1050 | public static function from(stdClass $obj): Repository { |
| 1051 | + if (!property_exists($obj, 'name')) { | |
| 1052 | + throw new Exception("Missing required property"); | |
| 1053 | + } | |
| 1054 | + if (!property_exists($obj, 'stargazers')) { | |
| 1055 | + throw new Exception("Missing required property"); | |
| 1056 | + } | |
| 1057 | + if (!property_exists($obj, 'forks')) { | |
| 1058 | + throw new Exception("Missing required property"); | |
| 1059 | + } | |
| 1060 | + if (!property_exists($obj, 'watchers')) { | |
| 1061 | + throw new Exception("Missing required property"); | |
| 1062 | + } | |
| 1063 | + if (!property_exists($obj, 'issues')) { | |
| 1064 | + throw new Exception("Missing required property"); | |
| 1065 | + } | |
| 1030 | 1066 | return new Repository( |
| 1031 | 1067 | Repository::fromName($obj->{'name'}) |
| 1032 | 1068 | ,Repository::fromStargazers($obj->{'stargazers'}) |
| @@ -1133,6 +1169,9 @@ class Connection { | ||
| 1133 | 1169 | * @throws Exception |
| 1134 | 1170 | */ |
| 1135 | 1171 | public static function from(stdClass $obj): Connection { |
| 1172 | + if (!property_exists($obj, 'totalCount')) { | |
| 1173 | + throw new Exception("Missing required property"); | |
| 1174 | + } | |
| 1136 | 1175 | return new Connection( |
| 1137 | 1176 | Connection::fromTotalCount($obj->{'totalCount'}) |
| 1138 | 1177 | ); |
| @@ -1231,6 +1270,9 @@ class Error { | ||
| 1231 | 1270 | * @throws Exception |
| 1232 | 1271 | */ |
| 1233 | 1272 | public static function from(stdClass $obj): Error { |
| 1273 | + if (!property_exists($obj, 'message')) { | |
| 1274 | + throw new Exception("Missing required property"); | |
| 1275 | + } | |
| 1234 | 1276 | return new Error( |
| 1235 | 1277 | Error::fromMessage($obj->{'message'}) |
| 1236 | 1278 | ); |
Test case
1 generated file · +18 −0test/inputs/graphql/github8.graphql
Mgraphql-phpdefault / TopLevel.php+18 −0
| @@ -169,6 +169,9 @@ class TopLevel { | ||
| 169 | 169 | * @throws Exception |
| 170 | 170 | */ |
| 171 | 171 | public static function from(stdClass $obj): TopLevel { |
| 172 | + if (!property_exists($obj, 'data')) { | |
| 173 | + throw new Exception("Missing required property"); | |
| 174 | + } | |
| 172 | 175 | return new TopLevel( |
| 173 | 176 | TopLevel::fromData($obj->{'data'}) |
| 174 | 177 | ,TopLevel::fromErrors($obj->{'errors'}) |
| @@ -280,6 +283,9 @@ class Data { | ||
| 280 | 283 | * @throws Exception |
| 281 | 284 | */ |
| 282 | 285 | public static function from(stdClass $obj): Data { |
| 286 | + if (!property_exists($obj, 'repository')) { | |
| 287 | + throw new Exception("Missing required property"); | |
| 288 | + } | |
| 283 | 289 | return new Data( |
| 284 | 290 | Data::fromRepository($obj->{'repository'}) |
| 285 | 291 | ); |
| @@ -504,6 +510,15 @@ class Repository { | ||
| 504 | 510 | * @throws Exception |
| 505 | 511 | */ |
| 506 | 512 | public static function from(stdClass $obj): Repository { |
| 513 | + if (!property_exists($obj, 'nameWithOwner')) { | |
| 514 | + throw new Exception("Missing required property"); | |
| 515 | + } | |
| 516 | + if (!property_exists($obj, 'n303')) { | |
| 517 | + throw new Exception("Missing required property"); | |
| 518 | + } | |
| 519 | + if (!property_exists($obj, 'n307')) { | |
| 520 | + throw new Exception("Missing required property"); | |
| 521 | + } | |
| 507 | 522 | return new Repository( |
| 508 | 523 | Repository::fromNameWithOwner($obj->{'nameWithOwner'}) |
| 509 | 524 | ,Repository::fromN303($obj->{'n303'}) |
| @@ -892,6 +907,9 @@ class Error { | ||
| 892 | 907 | * @throws Exception |
| 893 | 908 | */ |
| 894 | 909 | public static function from(stdClass $obj): Error { |
| 910 | + if (!property_exists($obj, 'message')) { | |
| 911 | + throw new Exception("Missing required property"); | |
| 912 | + } | |
| 895 | 913 | return new Error( |
| 896 | 914 | Error::fromMessage($obj->{'message'}) |
| 897 | 915 | ); |
Test case
1 generated file · +27 −0test/inputs/graphql/github9.graphql
Mgraphql-phpdefault / TopLevel.php+27 −0
| @@ -169,6 +169,9 @@ class TopLevel { | ||
| 169 | 169 | * @throws Exception |
| 170 | 170 | */ |
| 171 | 171 | public static function from(stdClass $obj): TopLevel { |
| 172 | + if (!property_exists($obj, 'data')) { | |
| 173 | + throw new Exception("Missing required property"); | |
| 174 | + } | |
| 172 | 175 | return new TopLevel( |
| 173 | 176 | TopLevel::fromData($obj->{'data'}) |
| 174 | 177 | ,TopLevel::fromErrors($obj->{'errors'}) |
| @@ -280,6 +283,9 @@ class Data { | ||
| 280 | 283 | * @throws Exception |
| 281 | 284 | */ |
| 282 | 285 | public static function from(stdClass $obj): Data { |
| 286 | + if (!property_exists($obj, 'addReaction')) { | |
| 287 | + throw new Exception("Missing required property"); | |
| 288 | + } | |
| 283 | 289 | return new Data( |
| 284 | 290 | Data::fromAddReaction($obj->{'addReaction'}) |
| 285 | 291 | ); |
| @@ -494,6 +500,15 @@ class AddReactionPayload { | ||
| 494 | 500 | * @throws Exception |
| 495 | 501 | */ |
| 496 | 502 | public static function from(stdClass $obj): AddReactionPayload { |
| 503 | + if (!property_exists($obj, 'clientMutationId')) { | |
| 504 | + throw new Exception("Missing required property"); | |
| 505 | + } | |
| 506 | + if (!property_exists($obj, 'reaction')) { | |
| 507 | + throw new Exception("Missing required property"); | |
| 508 | + } | |
| 509 | + if (!property_exists($obj, 'subject')) { | |
| 510 | + throw new Exception("Missing required property"); | |
| 511 | + } | |
| 497 | 512 | return new AddReactionPayload( |
| 498 | 513 | AddReactionPayload::fromClientMutationID($obj->{'clientMutationId'}) |
| 499 | 514 | ,AddReactionPayload::fromReaction($obj->{'reaction'}) |
| @@ -597,6 +612,9 @@ class Reaction { | ||
| 597 | 612 | * @throws Exception |
| 598 | 613 | */ |
| 599 | 614 | public static function from(stdClass $obj): Reaction { |
| 615 | + if (!property_exists($obj, 'content')) { | |
| 616 | + throw new Exception("Missing required property"); | |
| 617 | + } | |
| 600 | 618 | return new Reaction( |
| 601 | 619 | Reaction::fromContent($obj->{'content'}) |
| 602 | 620 | ); |
| @@ -834,6 +852,12 @@ class Reactable { | ||
| 834 | 852 | * @throws Exception |
| 835 | 853 | */ |
| 836 | 854 | public static function from(stdClass $obj): Reactable { |
| 855 | + if (!property_exists($obj, 'viewerCanReact')) { | |
| 856 | + throw new Exception("Missing required property"); | |
| 857 | + } | |
| 858 | + if (!property_exists($obj, 'reactionGroups')) { | |
| 859 | + throw new Exception("Missing required property"); | |
| 860 | + } | |
| 837 | 861 | return new Reactable( |
| 838 | 862 | Reactable::fromViewerCanReact($obj->{'viewerCanReact'}) |
| 839 | 863 | ,Reactable::fromReactionGroups($obj->{'reactionGroups'}) |
| @@ -934,6 +958,9 @@ class Error { | ||
| 934 | 958 | * @throws Exception |
| 935 | 959 | */ |
| 936 | 960 | public static function from(stdClass $obj): Error { |
| 961 | + if (!property_exists($obj, 'message')) { | |
| 962 | + throw new Exception("Missing required property"); | |
| 963 | + } | |
| 937 | 964 | return new Error( |
| 938 | 965 | Error::fromMessage($obj->{'message'}) |
| 939 | 966 | ); |
Test case
1 generated file · +96 −0test/inputs/json/misc/00ec5.json
Mphpdefault / TopLevel.php+96 −0
| @@ -479,6 +479,30 @@ class TopLevel { | ||
| 479 | 479 | * @throws Exception |
| 480 | 480 | */ |
| 481 | 481 | public static function from(stdClass $obj): TopLevel { |
| 482 | + if (!property_exists($obj, 'basePath')) { | |
| 483 | + throw new Exception("Missing required property"); | |
| 484 | + } | |
| 485 | + if (!property_exists($obj, 'definitions')) { | |
| 486 | + throw new Exception("Missing required property"); | |
| 487 | + } | |
| 488 | + if (!property_exists($obj, 'host')) { | |
| 489 | + throw new Exception("Missing required property"); | |
| 490 | + } | |
| 491 | + if (!property_exists($obj, 'info')) { | |
| 492 | + throw new Exception("Missing required property"); | |
| 493 | + } | |
| 494 | + if (!property_exists($obj, 'paths')) { | |
| 495 | + throw new Exception("Missing required property"); | |
| 496 | + } | |
| 497 | + if (!property_exists($obj, 'produces')) { | |
| 498 | + throw new Exception("Missing required property"); | |
| 499 | + } | |
| 500 | + if (!property_exists($obj, 'schemes')) { | |
| 501 | + throw new Exception("Missing required property"); | |
| 502 | + } | |
| 503 | + if (!property_exists($obj, 'swagger')) { | |
| 504 | + throw new Exception("Missing required property"); | |
| 505 | + } | |
| 482 | 506 | return new TopLevel( |
| 483 | 507 | TopLevel::fromBasePath($obj->{'basePath'}) |
| 484 | 508 | ,TopLevel::fromDefinitions($obj->{'definitions'}) |
| @@ -592,6 +616,9 @@ class Definitions { | ||
| 592 | 616 | * @throws Exception |
| 593 | 617 | */ |
| 594 | 618 | public static function from(stdClass $obj): Definitions { |
| 619 | + if (!property_exists($obj, 'Provider')) { | |
| 620 | + throw new Exception("Missing required property"); | |
| 621 | + } | |
| 595 | 622 | return new Definitions( |
| 596 | 623 | Definitions::fromProvider($obj->{'Provider'}) |
| 597 | 624 | ); |
| @@ -705,6 +732,9 @@ class Provider { | ||
| 705 | 732 | * @throws Exception |
| 706 | 733 | */ |
| 707 | 734 | public static function from(stdClass $obj): Provider { |
| 735 | + if (!property_exists($obj, 'properties')) { | |
| 736 | + throw new Exception("Missing required property"); | |
| 737 | + } | |
| 708 | 738 | return new Provider( |
| 709 | 739 | Provider::fromProperties($obj->{'properties'}) |
| 710 | 740 | ); |
| @@ -856,6 +886,12 @@ class Property { | ||
| 856 | 886 | * @throws Exception |
| 857 | 887 | */ |
| 858 | 888 | public static function from(stdClass $obj): Property { |
| 889 | + if (!property_exists($obj, 'description')) { | |
| 890 | + throw new Exception("Missing required property"); | |
| 891 | + } | |
| 892 | + if (!property_exists($obj, 'type')) { | |
| 893 | + throw new Exception("Missing required property"); | |
| 894 | + } | |
| 859 | 895 | return new Property( |
| 860 | 896 | Property::fromDescription($obj->{'description'}) |
| 861 | 897 | ,Property::fromType($obj->{'type'}) |
| @@ -1105,6 +1141,15 @@ class Info { | ||
| 1105 | 1141 | * @throws Exception |
| 1106 | 1142 | */ |
| 1107 | 1143 | public static function from(stdClass $obj): Info { |
| 1144 | + if (!property_exists($obj, 'description')) { | |
| 1145 | + throw new Exception("Missing required property"); | |
| 1146 | + } | |
| 1147 | + if (!property_exists($obj, 'title')) { | |
| 1148 | + throw new Exception("Missing required property"); | |
| 1149 | + } | |
| 1150 | + if (!property_exists($obj, 'version')) { | |
| 1151 | + throw new Exception("Missing required property"); | |
| 1152 | + } | |
| 1108 | 1153 | return new Info( |
| 1109 | 1154 | Info::fromDescription($obj->{'description'}) |
| 1110 | 1155 | ,Info::fromTitle($obj->{'title'}) |
| @@ -1208,6 +1253,9 @@ class Paths { | ||
| 1208 | 1253 | * @throws Exception |
| 1209 | 1254 | */ |
| 1210 | 1255 | public static function from(stdClass $obj): Paths { |
| 1256 | + if (!property_exists($obj, '/business_service_providers/search')) { | |
| 1257 | + throw new Exception("Missing required property"); | |
| 1258 | + } | |
| 1211 | 1259 | return new Paths( |
| 1212 | 1260 | Paths::fromBusinessServiceProvidersSearch($obj->{'/business_service_providers/search'}) |
| 1213 | 1261 | ); |
| @@ -1307,6 +1355,9 @@ class BusinessServiceProvidersSearch { | ||
| 1307 | 1355 | * @throws Exception |
| 1308 | 1356 | */ |
| 1309 | 1357 | public static function from(stdClass $obj): BusinessServiceProvidersSearch { |
| 1358 | + if (!property_exists($obj, 'get')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1310 | 1361 | return new BusinessServiceProvidersSearch( |
| 1311 | 1362 | BusinessServiceProvidersSearch::fromGet($obj->{'get'}) |
| 1312 | 1363 | ); |
| @@ -1640,6 +1691,21 @@ class Get { | ||
| 1640 | 1691 | * @throws Exception |
| 1641 | 1692 | */ |
| 1642 | 1693 | public static function from(stdClass $obj): Get { |
| 1694 | + if (!property_exists($obj, 'description')) { | |
| 1695 | + throw new Exception("Missing required property"); | |
| 1696 | + } | |
| 1697 | + if (!property_exists($obj, 'parameters')) { | |
| 1698 | + throw new Exception("Missing required property"); | |
| 1699 | + } | |
| 1700 | + if (!property_exists($obj, 'responses')) { | |
| 1701 | + throw new Exception("Missing required property"); | |
| 1702 | + } | |
| 1703 | + if (!property_exists($obj, 'summary')) { | |
| 1704 | + throw new Exception("Missing required property"); | |
| 1705 | + } | |
| 1706 | + if (!property_exists($obj, 'tags')) { | |
| 1707 | + throw new Exception("Missing required property"); | |
| 1708 | + } | |
| 1643 | 1709 | return new Get( |
| 1644 | 1710 | Get::fromDescription($obj->{'description'}) |
| 1645 | 1711 | ,Get::fromParameters($obj->{'parameters'}) |
| @@ -2008,6 +2074,24 @@ class Parameter { | ||
| 2008 | 2074 | * @throws Exception |
| 2009 | 2075 | */ |
| 2010 | 2076 | public static function from(stdClass $obj): Parameter { |
| 2077 | + if (!property_exists($obj, 'description')) { | |
| 2078 | + throw new Exception("Missing required property"); | |
| 2079 | + } | |
| 2080 | + if (!property_exists($obj, 'format')) { | |
| 2081 | + throw new Exception("Missing required property"); | |
| 2082 | + } | |
| 2083 | + if (!property_exists($obj, 'in')) { | |
| 2084 | + throw new Exception("Missing required property"); | |
| 2085 | + } | |
| 2086 | + if (!property_exists($obj, 'name')) { | |
| 2087 | + throw new Exception("Missing required property"); | |
| 2088 | + } | |
| 2089 | + if (!property_exists($obj, 'required')) { | |
| 2090 | + throw new Exception("Missing required property"); | |
| 2091 | + } | |
| 2092 | + if (!property_exists($obj, 'type')) { | |
| 2093 | + throw new Exception("Missing required property"); | |
| 2094 | + } | |
| 2011 | 2095 | return new Parameter( |
| 2012 | 2096 | Parameter::fromDescription($obj->{'description'}) |
| 2013 | 2097 | ,Parameter::fromFormat($obj->{'format'}) |
| @@ -2117,6 +2201,9 @@ class Responses { | ||
| 2117 | 2201 | * @throws Exception |
| 2118 | 2202 | */ |
| 2119 | 2203 | public static function from(stdClass $obj): Responses { |
| 2204 | + if (!property_exists($obj, '200')) { | |
| 2205 | + throw new Exception("Missing required property"); | |
| 2206 | + } | |
| 2120 | 2207 | return new Responses( |
| 2121 | 2208 | Responses::fromThe200($obj->{'200'}) |
| 2122 | 2209 | ); |
| @@ -2268,6 +2355,12 @@ class The200 { | ||
| 2268 | 2355 | * @throws Exception |
| 2269 | 2356 | */ |
| 2270 | 2357 | public static function from(stdClass $obj): The200 { |
| 2358 | + if (!property_exists($obj, 'description')) { | |
| 2359 | + throw new Exception("Missing required property"); | |
| 2360 | + } | |
| 2361 | + if (!property_exists($obj, 'schema')) { | |
| 2362 | + throw new Exception("Missing required property"); | |
| 2363 | + } | |
| 2271 | 2364 | return new The200( |
| 2272 | 2365 | The200::fromDescription($obj->{'description'}) |
| 2273 | 2366 | ,The200::fromSchema($obj->{'schema'}) |
| @@ -2368,6 +2461,9 @@ class Schema { | ||
| 2368 | 2461 | * @throws Exception |
| 2369 | 2462 | */ |
| 2370 | 2463 | public static function from(stdClass $obj): Schema { |
| 2464 | + if (!property_exists($obj, '$ref')) { | |
| 2465 | + throw new Exception("Missing required property"); | |
| 2466 | + } | |
| 2371 | 2467 | return new Schema( |
| 2372 | 2468 | Schema::fromRef($obj->{'$ref'}) |
| 2373 | 2469 | ); |
Test case
1 generated file · +18 −0test/inputs/json/misc/010b1.json
Mphpdefault / TopLevel.php+18 −0
| @@ -345,6 +345,24 @@ class TopLevel { | ||
| 345 | 345 | * @throws Exception |
| 346 | 346 | */ |
| 347 | 347 | public static function from(stdClass $obj): TopLevel { |
| 348 | + if (!property_exists($obj, 'age')) { | |
| 349 | + throw new Exception("Missing required property"); | |
| 350 | + } | |
| 351 | + if (!property_exists($obj, 'country')) { | |
| 352 | + throw new Exception("Missing required property"); | |
| 353 | + } | |
| 354 | + if (!property_exists($obj, 'females')) { | |
| 355 | + throw new Exception("Missing required property"); | |
| 356 | + } | |
| 357 | + if (!property_exists($obj, 'males')) { | |
| 358 | + throw new Exception("Missing required property"); | |
| 359 | + } | |
| 360 | + if (!property_exists($obj, 'total')) { | |
| 361 | + throw new Exception("Missing required property"); | |
| 362 | + } | |
| 363 | + if (!property_exists($obj, 'year')) { | |
| 364 | + throw new Exception("Missing required property"); | |
| 365 | + } | |
| 348 | 366 | return new TopLevel( |
| 349 | 367 | TopLevel::fromAge($obj->{'age'}) |
| 350 | 368 | ,TopLevel::fromCountry($obj->{'country'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/016af.json
Mphpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'total_population')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromTotalPopulation($obj->{'total_population'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class TotalPopulation { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): TotalPopulation { |
| 252 | + if (!property_exists($obj, 'date')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'population')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new TotalPopulation( |
| 250 | 259 | TotalPopulation::fromDate($obj->{'date'}) |
| 251 | 260 | ,TotalPopulation::fromPopulation($obj->{'population'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/033b1.json
Mphpdefault / TopLevel.php+9 −0
| @@ -205,6 +205,15 @@ class TopLevel { | ||
| 205 | 205 | * @throws Exception |
| 206 | 206 | */ |
| 207 | 207 | public static function from(stdClass $obj): TopLevel { |
| 208 | + if (!property_exists($obj, 'base')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'date')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 214 | + if (!property_exists($obj, 'rates')) { | |
| 215 | + throw new Exception("Missing required property"); | |
| 216 | + } | |
| 208 | 217 | return new TopLevel( |
| 209 | 218 | TopLevel::fromBase($obj->{'base'}) |
| 210 | 219 | ,TopLevel::fromDate($obj->{'date'}) |
Test case
1 generated file · +51 −0test/inputs/json/misc/050b0.json
Mphpdefault / TopLevel.php+51 −0
| @@ -518,6 +518,30 @@ class TopLevel { | ||
| 518 | 518 | * @throws Exception |
| 519 | 519 | */ |
| 520 | 520 | public static function from(stdClass $obj): TopLevel { |
| 521 | + if (!property_exists($obj, 'id')) { | |
| 522 | + throw new Exception("Missing required property"); | |
| 523 | + } | |
| 524 | + if (!property_exists($obj, 'identifiers')) { | |
| 525 | + throw new Exception("Missing required property"); | |
| 526 | + } | |
| 527 | + if (!property_exists($obj, 'keywords')) { | |
| 528 | + throw new Exception("Missing required property"); | |
| 529 | + } | |
| 530 | + if (!property_exists($obj, 'links')) { | |
| 531 | + throw new Exception("Missing required property"); | |
| 532 | + } | |
| 533 | + if (!property_exists($obj, 'name')) { | |
| 534 | + throw new Exception("Missing required property"); | |
| 535 | + } | |
| 536 | + if (!property_exists($obj, 'other_names')) { | |
| 537 | + throw new Exception("Missing required property"); | |
| 538 | + } | |
| 539 | + if (!property_exists($obj, 'superseded_by')) { | |
| 540 | + throw new Exception("Missing required property"); | |
| 541 | + } | |
| 542 | + if (!property_exists($obj, 'text')) { | |
| 543 | + throw new Exception("Missing required property"); | |
| 544 | + } | |
| 521 | 545 | return new TopLevel( |
| 522 | 546 | TopLevel::fromID($obj->{'id'}) |
| 523 | 547 | ,TopLevel::fromIdentifiers($obj->{'identifiers'}) |
| @@ -683,6 +707,12 @@ class Identifier { | ||
| 683 | 707 | * @throws Exception |
| 684 | 708 | */ |
| 685 | 709 | public static function from(stdClass $obj): Identifier { |
| 710 | + if (!property_exists($obj, 'identifier')) { | |
| 711 | + throw new Exception("Missing required property"); | |
| 712 | + } | |
| 713 | + if (!property_exists($obj, 'scheme')) { | |
| 714 | + throw new Exception("Missing required property"); | |
| 715 | + } | |
| 686 | 716 | return new Identifier( |
| 687 | 717 | Identifier::fromIdentifier($obj->{'identifier'}) |
| 688 | 718 | ,Identifier::fromScheme($obj->{'scheme'}) |
| @@ -946,6 +976,12 @@ class Link { | ||
| 946 | 976 | * @throws Exception |
| 947 | 977 | */ |
| 948 | 978 | public static function from(stdClass $obj): Link { |
| 979 | + if (!property_exists($obj, 'note')) { | |
| 980 | + throw new Exception("Missing required property"); | |
| 981 | + } | |
| 982 | + if (!property_exists($obj, 'url')) { | |
| 983 | + throw new Exception("Missing required property"); | |
| 984 | + } | |
| 949 | 985 | return new Link( |
| 950 | 986 | Link::fromNote($obj->{'note'}) |
| 951 | 987 | ,Link::fromURL($obj->{'url'}) |
| @@ -1169,6 +1205,12 @@ class OtherName { | ||
| 1169 | 1205 | * @throws Exception |
| 1170 | 1206 | */ |
| 1171 | 1207 | public static function from(stdClass $obj): OtherName { |
| 1208 | + if (!property_exists($obj, 'name')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'note')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1172 | 1214 | return new OtherName( |
| 1173 | 1215 | OtherName::fromName($obj->{'name'}) |
| 1174 | 1216 | ,OtherName::fromNote($obj->{'note'}) |
| @@ -1375,6 +1417,15 @@ class Text { | ||
| 1375 | 1417 | * @throws Exception |
| 1376 | 1418 | */ |
| 1377 | 1419 | public static function from(stdClass $obj): Text { |
| 1420 | + if (!property_exists($obj, 'media_type')) { | |
| 1421 | + throw new Exception("Missing required property"); | |
| 1422 | + } | |
| 1423 | + if (!property_exists($obj, 'title')) { | |
| 1424 | + throw new Exception("Missing required property"); | |
| 1425 | + } | |
| 1426 | + if (!property_exists($obj, 'url')) { | |
| 1427 | + throw new Exception("Missing required property"); | |
| 1428 | + } | |
| 1378 | 1429 | return new Text( |
| 1379 | 1430 | Text::fromMediaType($obj->{'media_type'}) |
| 1380 | 1431 | ,Text::fromTitle($obj->{'title'}) |
Test case
1 generated file · +45 −0test/inputs/json/misc/06bee.json
Mphpdefault / TopLevel.php+45 −0
| @@ -510,6 +510,30 @@ class TopLevel { | ||
| 510 | 510 | * @throws Exception |
| 511 | 511 | */ |
| 512 | 512 | public static function from(stdClass $obj): TopLevel { |
| 513 | + if (!property_exists($obj, 'id')) { | |
| 514 | + throw new Exception("Missing required property"); | |
| 515 | + } | |
| 516 | + if (!property_exists($obj, 'identifiers')) { | |
| 517 | + throw new Exception("Missing required property"); | |
| 518 | + } | |
| 519 | + if (!property_exists($obj, 'keywords')) { | |
| 520 | + throw new Exception("Missing required property"); | |
| 521 | + } | |
| 522 | + if (!property_exists($obj, 'links')) { | |
| 523 | + throw new Exception("Missing required property"); | |
| 524 | + } | |
| 525 | + if (!property_exists($obj, 'name')) { | |
| 526 | + throw new Exception("Missing required property"); | |
| 527 | + } | |
| 528 | + if (!property_exists($obj, 'other_names')) { | |
| 529 | + throw new Exception("Missing required property"); | |
| 530 | + } | |
| 531 | + if (!property_exists($obj, 'superseded_by')) { | |
| 532 | + throw new Exception("Missing required property"); | |
| 533 | + } | |
| 534 | + if (!property_exists($obj, 'text')) { | |
| 535 | + throw new Exception("Missing required property"); | |
| 536 | + } | |
| 513 | 537 | return new TopLevel( |
| 514 | 538 | TopLevel::fromID($obj->{'id'}) |
| 515 | 539 | ,TopLevel::fromIdentifiers($obj->{'identifiers'}) |
| @@ -675,6 +699,12 @@ class Identifier { | ||
| 675 | 699 | * @throws Exception |
| 676 | 700 | */ |
| 677 | 701 | public static function from(stdClass $obj): Identifier { |
| 702 | + if (!property_exists($obj, 'identifier')) { | |
| 703 | + throw new Exception("Missing required property"); | |
| 704 | + } | |
| 705 | + if (!property_exists($obj, 'scheme')) { | |
| 706 | + throw new Exception("Missing required property"); | |
| 707 | + } | |
| 678 | 708 | return new Identifier( |
| 679 | 709 | Identifier::fromIdentifier($obj->{'identifier'}) |
| 680 | 710 | ,Identifier::fromScheme($obj->{'scheme'}) |
| @@ -934,6 +964,12 @@ class Link { | ||
| 934 | 964 | * @throws Exception |
| 935 | 965 | */ |
| 936 | 966 | public static function from(stdClass $obj): Link { |
| 967 | + if (!property_exists($obj, 'note')) { | |
| 968 | + throw new Exception("Missing required property"); | |
| 969 | + } | |
| 970 | + if (!property_exists($obj, 'url')) { | |
| 971 | + throw new Exception("Missing required property"); | |
| 972 | + } | |
| 937 | 973 | return new Link( |
| 938 | 974 | Link::fromNote($obj->{'note'}) |
| 939 | 975 | ,Link::fromURL($obj->{'url'}) |
| @@ -1185,6 +1221,15 @@ class Text { | ||
| 1185 | 1221 | * @throws Exception |
| 1186 | 1222 | */ |
| 1187 | 1223 | public static function from(stdClass $obj): Text { |
| 1224 | + if (!property_exists($obj, 'media_type')) { | |
| 1225 | + throw new Exception("Missing required property"); | |
| 1226 | + } | |
| 1227 | + if (!property_exists($obj, 'title')) { | |
| 1228 | + throw new Exception("Missing required property"); | |
| 1229 | + } | |
| 1230 | + if (!property_exists($obj, 'url')) { | |
| 1231 | + throw new Exception("Missing required property"); | |
| 1232 | + } | |
| 1188 | 1233 | return new Text( |
| 1189 | 1234 | Text::fromMediaType($obj->{'media_type'}) |
| 1190 | 1235 | ,Text::fromTitle($obj->{'title'}) |
Test case
1 generated file · +3 −0test/inputs/json/misc/07540.json
Mphpdefault / TopLevel.php+3 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'cookies')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromCookies($obj->{'cookies'}) |
| 90 | 93 | ); |
Test case
1 generated file · +75 −0test/inputs/json/misc/0779f.json
Mphpdefault / TopLevel.php+75 −0
| @@ -450,6 +450,30 @@ class TopLevel { | ||
| 450 | 450 | * @throws Exception |
| 451 | 451 | */ |
| 452 | 452 | public static function from(stdClass $obj): TopLevel { |
| 453 | + if (!property_exists($obj, 'city')) { | |
| 454 | + throw new Exception("Missing required property"); | |
| 455 | + } | |
| 456 | + if (!property_exists($obj, 'delay')) { | |
| 457 | + throw new Exception("Missing required property"); | |
| 458 | + } | |
| 459 | + if (!property_exists($obj, 'IATA')) { | |
| 460 | + throw new Exception("Missing required property"); | |
| 461 | + } | |
| 462 | + if (!property_exists($obj, 'ICAO')) { | |
| 463 | + throw new Exception("Missing required property"); | |
| 464 | + } | |
| 465 | + if (!property_exists($obj, 'name')) { | |
| 466 | + throw new Exception("Missing required property"); | |
| 467 | + } | |
| 468 | + if (!property_exists($obj, 'state')) { | |
| 469 | + throw new Exception("Missing required property"); | |
| 470 | + } | |
| 471 | + if (!property_exists($obj, 'status')) { | |
| 472 | + throw new Exception("Missing required property"); | |
| 473 | + } | |
| 474 | + if (!property_exists($obj, 'weather')) { | |
| 475 | + throw new Exception("Missing required property"); | |
| 476 | + } | |
| 453 | 477 | return new TopLevel( |
| 454 | 478 | TopLevel::fromCity($obj->{'city'}) |
| 455 | 479 | ,TopLevel::fromDelay($obj->{'delay'}) |
| @@ -978,6 +1002,33 @@ class Status { | ||
| 978 | 1002 | * @throws Exception |
| 979 | 1003 | */ |
| 980 | 1004 | public static function from(stdClass $obj): Status { |
| 1005 | + if (!property_exists($obj, 'avgDelay')) { | |
| 1006 | + throw new Exception("Missing required property"); | |
| 1007 | + } | |
| 1008 | + if (!property_exists($obj, 'closureBegin')) { | |
| 1009 | + throw new Exception("Missing required property"); | |
| 1010 | + } | |
| 1011 | + if (!property_exists($obj, 'closureEnd')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'endTime')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 1017 | + if (!property_exists($obj, 'maxDelay')) { | |
| 1018 | + throw new Exception("Missing required property"); | |
| 1019 | + } | |
| 1020 | + if (!property_exists($obj, 'minDelay')) { | |
| 1021 | + throw new Exception("Missing required property"); | |
| 1022 | + } | |
| 1023 | + if (!property_exists($obj, 'reason')) { | |
| 1024 | + throw new Exception("Missing required property"); | |
| 1025 | + } | |
| 1026 | + if (!property_exists($obj, 'trend')) { | |
| 1027 | + throw new Exception("Missing required property"); | |
| 1028 | + } | |
| 1029 | + if (!property_exists($obj, 'type')) { | |
| 1030 | + throw new Exception("Missing required property"); | |
| 1031 | + } | |
| 981 | 1032 | return new Status( |
| 982 | 1033 | Status::fromAvgDelay($obj->{'avgDelay'}) |
| 983 | 1034 | ,Status::fromClosureBegin($obj->{'closureBegin'}) |
| @@ -1301,6 +1352,21 @@ class Weather { | ||
| 1301 | 1352 | * @throws Exception |
| 1302 | 1353 | */ |
| 1303 | 1354 | public static function from(stdClass $obj): Weather { |
| 1355 | + if (!property_exists($obj, 'meta')) { | |
| 1356 | + throw new Exception("Missing required property"); | |
| 1357 | + } | |
| 1358 | + if (!property_exists($obj, 'temp')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1361 | + if (!property_exists($obj, 'visibility')) { | |
| 1362 | + throw new Exception("Missing required property"); | |
| 1363 | + } | |
| 1364 | + if (!property_exists($obj, 'weather')) { | |
| 1365 | + throw new Exception("Missing required property"); | |
| 1366 | + } | |
| 1367 | + if (!property_exists($obj, 'wind')) { | |
| 1368 | + throw new Exception("Missing required property"); | |
| 1369 | + } | |
| 1304 | 1370 | return new Weather( |
| 1305 | 1371 | Weather::fromMeta($obj->{'meta'}) |
| 1306 | 1372 | ,Weather::fromTemp($obj->{'temp'}) |
| @@ -1511,6 +1577,15 @@ class Meta { | ||
| 1511 | 1577 | * @throws Exception |
| 1512 | 1578 | */ |
| 1513 | 1579 | public static function from(stdClass $obj): Meta { |
| 1580 | + if (!property_exists($obj, 'credit')) { | |
| 1581 | + throw new Exception("Missing required property"); | |
| 1582 | + } | |
| 1583 | + if (!property_exists($obj, 'updated')) { | |
| 1584 | + throw new Exception("Missing required property"); | |
| 1585 | + } | |
| 1586 | + if (!property_exists($obj, 'url')) { | |
| 1587 | + throw new Exception("Missing required property"); | |
| 1588 | + } | |
| 1514 | 1589 | return new Meta( |
| 1515 | 1590 | Meta::fromCredit($obj->{'credit'}) |
| 1516 | 1591 | ,Meta::fromUpdated($obj->{'updated'}) |
Test case
1 generated file · +45 −0test/inputs/json/misc/07c75.json
Mphpdefault / TopLevel.php+45 −0
| @@ -512,6 +512,30 @@ class TopLevel { | ||
| 512 | 512 | * @throws Exception |
| 513 | 513 | */ |
| 514 | 514 | public static function from(stdClass $obj): TopLevel { |
| 515 | + if (!property_exists($obj, 'id')) { | |
| 516 | + throw new Exception("Missing required property"); | |
| 517 | + } | |
| 518 | + if (!property_exists($obj, 'identifiers')) { | |
| 519 | + throw new Exception("Missing required property"); | |
| 520 | + } | |
| 521 | + if (!property_exists($obj, 'keywords')) { | |
| 522 | + throw new Exception("Missing required property"); | |
| 523 | + } | |
| 524 | + if (!property_exists($obj, 'links')) { | |
| 525 | + throw new Exception("Missing required property"); | |
| 526 | + } | |
| 527 | + if (!property_exists($obj, 'name')) { | |
| 528 | + throw new Exception("Missing required property"); | |
| 529 | + } | |
| 530 | + if (!property_exists($obj, 'other_names')) { | |
| 531 | + throw new Exception("Missing required property"); | |
| 532 | + } | |
| 533 | + if (!property_exists($obj, 'superseded_by')) { | |
| 534 | + throw new Exception("Missing required property"); | |
| 535 | + } | |
| 536 | + if (!property_exists($obj, 'text')) { | |
| 537 | + throw new Exception("Missing required property"); | |
| 538 | + } | |
| 515 | 539 | return new TopLevel( |
| 516 | 540 | TopLevel::fromID($obj->{'id'}) |
| 517 | 541 | ,TopLevel::fromIdentifiers($obj->{'identifiers'}) |
| @@ -676,6 +700,12 @@ class Identifier { | ||
| 676 | 700 | * @throws Exception |
| 677 | 701 | */ |
| 678 | 702 | public static function from(stdClass $obj): Identifier { |
| 703 | + if (!property_exists($obj, 'identifier')) { | |
| 704 | + throw new Exception("Missing required property"); | |
| 705 | + } | |
| 706 | + if (!property_exists($obj, 'scheme')) { | |
| 707 | + throw new Exception("Missing required property"); | |
| 708 | + } | |
| 679 | 709 | return new Identifier( |
| 680 | 710 | Identifier::fromIdentifier($obj->{'identifier'}) |
| 681 | 711 | ,Identifier::fromScheme($obj->{'scheme'}) |
| @@ -828,6 +858,12 @@ class Link { | ||
| 828 | 858 | * @throws Exception |
| 829 | 859 | */ |
| 830 | 860 | public static function from(stdClass $obj): Link { |
| 861 | + if (!property_exists($obj, 'note')) { | |
| 862 | + throw new Exception("Missing required property"); | |
| 863 | + } | |
| 864 | + if (!property_exists($obj, 'url')) { | |
| 865 | + throw new Exception("Missing required property"); | |
| 866 | + } | |
| 831 | 867 | return new Link( |
| 832 | 868 | Link::fromNote($obj->{'note'}) |
| 833 | 869 | ,Link::fromURL($obj->{'url'}) |
| @@ -1032,6 +1068,15 @@ class Text { | ||
| 1032 | 1068 | * @throws Exception |
| 1033 | 1069 | */ |
| 1034 | 1070 | public static function from(stdClass $obj): Text { |
| 1071 | + if (!property_exists($obj, 'media_type')) { | |
| 1072 | + throw new Exception("Missing required property"); | |
| 1073 | + } | |
| 1074 | + if (!property_exists($obj, 'title')) { | |
| 1075 | + throw new Exception("Missing required property"); | |
| 1076 | + } | |
| 1077 | + if (!property_exists($obj, 'url')) { | |
| 1078 | + throw new Exception("Missing required property"); | |
| 1079 | + } | |
| 1035 | 1080 | return new Text( |
| 1036 | 1081 | Text::fromMediaType($obj->{'media_type'}) |
| 1037 | 1082 | ,Text::fromTitle($obj->{'title'}) |
Test case
1 generated file · +24 −0test/inputs/json/misc/09f54.json
Mphpdefault / TopLevel.php+24 −0
| @@ -152,6 +152,12 @@ class TopLevel { | ||
| 152 | 152 | * @throws Exception |
| 153 | 153 | */ |
| 154 | 154 | public static function from(stdClass $obj): TopLevel { |
| 155 | + if (!property_exists($obj, 'data')) { | |
| 156 | + throw new Exception("Missing required property"); | |
| 157 | + } | |
| 158 | + if (!property_exists($obj, 'description')) { | |
| 159 | + throw new Exception("Missing required property"); | |
| 160 | + } | |
| 155 | 161 | return new TopLevel( |
| 156 | 162 | TopLevel::fromData($obj->{'data'}) |
| 157 | 163 | ,TopLevel::fromDescription($obj->{'description'}) |
| @@ -304,6 +310,12 @@ class Datum { | ||
| 304 | 310 | * @throws Exception |
| 305 | 311 | */ |
| 306 | 312 | public static function from(stdClass $obj): Datum { |
| 313 | + if (!property_exists($obj, 'anomaly')) { | |
| 314 | + throw new Exception("Missing required property"); | |
| 315 | + } | |
| 316 | + if (!property_exists($obj, 'value')) { | |
| 317 | + throw new Exception("Missing required property"); | |
| 318 | + } | |
| 307 | 319 | return new Datum( |
| 308 | 320 | Datum::fromAnomaly($obj->{'anomaly'}) |
| 309 | 321 | ,Datum::fromValue($obj->{'value'}) |
| @@ -560,6 +572,18 @@ class Description { | ||
| 560 | 572 | * @throws Exception |
| 561 | 573 | */ |
| 562 | 574 | public static function from(stdClass $obj): Description { |
| 575 | + if (!property_exists($obj, 'base_period')) { | |
| 576 | + throw new Exception("Missing required property"); | |
| 577 | + } | |
| 578 | + if (!property_exists($obj, 'missing')) { | |
| 579 | + throw new Exception("Missing required property"); | |
| 580 | + } | |
| 581 | + if (!property_exists($obj, 'title')) { | |
| 582 | + throw new Exception("Missing required property"); | |
| 583 | + } | |
| 584 | + if (!property_exists($obj, 'units')) { | |
| 585 | + throw new Exception("Missing required property"); | |
| 586 | + } | |
| 563 | 587 | return new Description( |
| 564 | 588 | Description::fromBasePeriod($obj->{'base_period'}) |
| 565 | 589 | ,Description::fromMissing($obj->{'missing'}) |
Test case
1 generated file · +39 −0test/inputs/json/misc/0a358.json
Mphpdefault / TopLevel.php+39 −0
| @@ -409,6 +409,27 @@ class TopLevel { | ||
| 409 | 409 | * @throws Exception |
| 410 | 410 | */ |
| 411 | 411 | public static function from(stdClass $obj): TopLevel { |
| 412 | + if (!property_exists($obj, 'count')) { | |
| 413 | + throw new Exception("Missing required property"); | |
| 414 | + } | |
| 415 | + if (!property_exists($obj, 'facets')) { | |
| 416 | + throw new Exception("Missing required property"); | |
| 417 | + } | |
| 418 | + if (!property_exists($obj, 'limit')) { | |
| 419 | + throw new Exception("Missing required property"); | |
| 420 | + } | |
| 421 | + if (!property_exists($obj, 'next')) { | |
| 422 | + throw new Exception("Missing required property"); | |
| 423 | + } | |
| 424 | + if (!property_exists($obj, 'offset')) { | |
| 425 | + throw new Exception("Missing required property"); | |
| 426 | + } | |
| 427 | + if (!property_exists($obj, 'previous')) { | |
| 428 | + throw new Exception("Missing required property"); | |
| 429 | + } | |
| 430 | + if (!property_exists($obj, 'results')) { | |
| 431 | + throw new Exception("Missing required property"); | |
| 432 | + } | |
| 412 | 433 | return new TopLevel( |
| 413 | 434 | TopLevel::fromCount($obj->{'count'}) |
| 414 | 435 | ,TopLevel::fromFacets($obj->{'facets'}) |
| @@ -838,6 +859,24 @@ class Result { | ||
| 838 | 859 | * @throws Exception |
| 839 | 860 | */ |
| 840 | 861 | public static function from(stdClass $obj): Result { |
| 862 | + if (!property_exists($obj, 'code')) { | |
| 863 | + throw new Exception("Missing required property"); | |
| 864 | + } | |
| 865 | + if (!property_exists($obj, 'created_at')) { | |
| 866 | + throw new Exception("Missing required property"); | |
| 867 | + } | |
| 868 | + if (!property_exists($obj, 'id')) { | |
| 869 | + throw new Exception("Missing required property"); | |
| 870 | + } | |
| 871 | + if (!property_exists($obj, 'name')) { | |
| 872 | + throw new Exception("Missing required property"); | |
| 873 | + } | |
| 874 | + if (!property_exists($obj, 'updated_at')) { | |
| 875 | + throw new Exception("Missing required property"); | |
| 876 | + } | |
| 877 | + if (!property_exists($obj, 'uri')) { | |
| 878 | + throw new Exception("Missing required property"); | |
| 879 | + } | |
| 841 | 880 | return new Result( |
| 842 | 881 | Result::fromCode($obj->{'code'}) |
| 843 | 882 | ,Result::fromCreatedAt($obj->{'created_at'}) |
Test case
1 generated file · +489 −0test/inputs/json/misc/0a91a.json
Mphpdefault / TopLevel.php+489 −0
| @@ -470,6 +470,27 @@ class TopLevel { | ||
| 470 | 470 | * @throws Exception |
| 471 | 471 | */ |
| 472 | 472 | public static function from(stdClass $obj): TopLevel { |
| 473 | + if (!property_exists($obj, 'actor')) { | |
| 474 | + throw new Exception("Missing required property"); | |
| 475 | + } | |
| 476 | + if (!property_exists($obj, 'created_at')) { | |
| 477 | + throw new Exception("Missing required property"); | |
| 478 | + } | |
| 479 | + if (!property_exists($obj, 'id')) { | |
| 480 | + throw new Exception("Missing required property"); | |
| 481 | + } | |
| 482 | + if (!property_exists($obj, 'payload')) { | |
| 483 | + throw new Exception("Missing required property"); | |
| 484 | + } | |
| 485 | + if (!property_exists($obj, 'public')) { | |
| 486 | + throw new Exception("Missing required property"); | |
| 487 | + } | |
| 488 | + if (!property_exists($obj, 'repo')) { | |
| 489 | + throw new Exception("Missing required property"); | |
| 490 | + } | |
| 491 | + if (!property_exists($obj, 'type')) { | |
| 492 | + throw new Exception("Missing required property"); | |
| 493 | + } | |
| 473 | 494 | return new TopLevel( |
| 474 | 495 | TopLevel::fromActor($obj->{'actor'}) |
| 475 | 496 | ,TopLevel::fromCreatedAt($obj->{'created_at'}) |
| @@ -852,6 +873,21 @@ class Actor { | ||
| 852 | 873 | * @throws Exception |
| 853 | 874 | */ |
| 854 | 875 | public static function from(stdClass $obj): Actor { |
| 876 | + if (!property_exists($obj, 'avatar_url')) { | |
| 877 | + throw new Exception("Missing required property"); | |
| 878 | + } | |
| 879 | + if (!property_exists($obj, 'gravatar_id')) { | |
| 880 | + throw new Exception("Missing required property"); | |
| 881 | + } | |
| 882 | + if (!property_exists($obj, 'id')) { | |
| 883 | + throw new Exception("Missing required property"); | |
| 884 | + } | |
| 885 | + if (!property_exists($obj, 'login')) { | |
| 886 | + throw new Exception("Missing required property"); | |
| 887 | + } | |
| 888 | + if (!property_exists($obj, 'url')) { | |
| 889 | + throw new Exception("Missing required property"); | |
| 890 | + } | |
| 855 | 891 | return new Actor( |
| 856 | 892 | Actor::fromAvatarURL($obj->{'avatar_url'}) |
| 857 | 893 | ,Actor::fromDisplayLogin($obj->{'display_login'}) |
| @@ -2122,6 +2158,21 @@ class Commit { | ||
| 2122 | 2158 | * @throws Exception |
| 2123 | 2159 | */ |
| 2124 | 2160 | public static function from(stdClass $obj): Commit { |
| 2161 | + if (!property_exists($obj, 'author')) { | |
| 2162 | + throw new Exception("Missing required property"); | |
| 2163 | + } | |
| 2164 | + if (!property_exists($obj, 'distinct')) { | |
| 2165 | + throw new Exception("Missing required property"); | |
| 2166 | + } | |
| 2167 | + if (!property_exists($obj, 'message')) { | |
| 2168 | + throw new Exception("Missing required property"); | |
| 2169 | + } | |
| 2170 | + if (!property_exists($obj, 'sha')) { | |
| 2171 | + throw new Exception("Missing required property"); | |
| 2172 | + } | |
| 2173 | + if (!property_exists($obj, 'url')) { | |
| 2174 | + throw new Exception("Missing required property"); | |
| 2175 | + } | |
| 2125 | 2176 | return new Commit( |
| 2126 | 2177 | Commit::fromAuthor($obj->{'author'}) |
| 2127 | 2178 | ,Commit::fromDistinct($obj->{'distinct'}) |
| @@ -2280,6 +2331,12 @@ class Author { | ||
| 2280 | 2331 | * @throws Exception |
| 2281 | 2332 | */ |
| 2282 | 2333 | public static function from(stdClass $obj): Author { |
| 2334 | + if (!property_exists($obj, 'email')) { | |
| 2335 | + throw new Exception("Missing required property"); | |
| 2336 | + } | |
| 2337 | + if (!property_exists($obj, 'name')) { | |
| 2338 | + throw new Exception("Missing required property"); | |
| 2339 | + } | |
| 2283 | 2340 | return new Author( |
| 2284 | 2341 | Author::fromEmail($obj->{'email'}) |
| 2285 | 2342 | ,Author::fromName($obj->{'name'}) |
| @@ -4527,6 +4584,129 @@ class PullRequest { | ||
| 4527 | 4584 | * @throws Exception |
| 4528 | 4585 | */ |
| 4529 | 4586 | public static function from(stdClass $obj): PullRequest { |
| 4587 | + if (!property_exists($obj, 'additions')) { | |
| 4588 | + throw new Exception("Missing required property"); | |
| 4589 | + } | |
| 4590 | + if (!property_exists($obj, 'assignee')) { | |
| 4591 | + throw new Exception("Missing required property"); | |
| 4592 | + } | |
| 4593 | + if (!property_exists($obj, 'assignees')) { | |
| 4594 | + throw new Exception("Missing required property"); | |
| 4595 | + } | |
| 4596 | + if (!property_exists($obj, 'base')) { | |
| 4597 | + throw new Exception("Missing required property"); | |
| 4598 | + } | |
| 4599 | + if (!property_exists($obj, 'body')) { | |
| 4600 | + throw new Exception("Missing required property"); | |
| 4601 | + } | |
| 4602 | + if (!property_exists($obj, 'changed_files')) { | |
| 4603 | + throw new Exception("Missing required property"); | |
| 4604 | + } | |
| 4605 | + if (!property_exists($obj, 'closed_at')) { | |
| 4606 | + throw new Exception("Missing required property"); | |
| 4607 | + } | |
| 4608 | + if (!property_exists($obj, 'comments')) { | |
| 4609 | + throw new Exception("Missing required property"); | |
| 4610 | + } | |
| 4611 | + if (!property_exists($obj, 'comments_url')) { | |
| 4612 | + throw new Exception("Missing required property"); | |
| 4613 | + } | |
| 4614 | + if (!property_exists($obj, 'commits')) { | |
| 4615 | + throw new Exception("Missing required property"); | |
| 4616 | + } | |
| 4617 | + if (!property_exists($obj, 'commits_url')) { | |
| 4618 | + throw new Exception("Missing required property"); | |
| 4619 | + } | |
| 4620 | + if (!property_exists($obj, 'created_at')) { | |
| 4621 | + throw new Exception("Missing required property"); | |
| 4622 | + } | |
| 4623 | + if (!property_exists($obj, 'deletions')) { | |
| 4624 | + throw new Exception("Missing required property"); | |
| 4625 | + } | |
| 4626 | + if (!property_exists($obj, 'diff_url')) { | |
| 4627 | + throw new Exception("Missing required property"); | |
| 4628 | + } | |
| 4629 | + if (!property_exists($obj, 'head')) { | |
| 4630 | + throw new Exception("Missing required property"); | |
| 4631 | + } | |
| 4632 | + if (!property_exists($obj, 'html_url')) { | |
| 4633 | + throw new Exception("Missing required property"); | |
| 4634 | + } | |
| 4635 | + if (!property_exists($obj, 'id')) { | |
| 4636 | + throw new Exception("Missing required property"); | |
| 4637 | + } | |
| 4638 | + if (!property_exists($obj, 'issue_url')) { | |
| 4639 | + throw new Exception("Missing required property"); | |
| 4640 | + } | |
| 4641 | + if (!property_exists($obj, '_links')) { | |
| 4642 | + throw new Exception("Missing required property"); | |
| 4643 | + } | |
| 4644 | + if (!property_exists($obj, 'locked')) { | |
| 4645 | + throw new Exception("Missing required property"); | |
| 4646 | + } | |
| 4647 | + if (!property_exists($obj, 'maintainer_can_modify')) { | |
| 4648 | + throw new Exception("Missing required property"); | |
| 4649 | + } | |
| 4650 | + if (!property_exists($obj, 'merge_commit_sha')) { | |
| 4651 | + throw new Exception("Missing required property"); | |
| 4652 | + } | |
| 4653 | + if (!property_exists($obj, 'mergeable')) { | |
| 4654 | + throw new Exception("Missing required property"); | |
| 4655 | + } | |
| 4656 | + if (!property_exists($obj, 'mergeable_state')) { | |
| 4657 | + throw new Exception("Missing required property"); | |
| 4658 | + } | |
| 4659 | + if (!property_exists($obj, 'merged')) { | |
| 4660 | + throw new Exception("Missing required property"); | |
| 4661 | + } | |
| 4662 | + if (!property_exists($obj, 'merged_at')) { | |
| 4663 | + throw new Exception("Missing required property"); | |
| 4664 | + } | |
| 4665 | + if (!property_exists($obj, 'merged_by')) { | |
| 4666 | + throw new Exception("Missing required property"); | |
| 4667 | + } | |
| 4668 | + if (!property_exists($obj, 'milestone')) { | |
| 4669 | + throw new Exception("Missing required property"); | |
| 4670 | + } | |
| 4671 | + if (!property_exists($obj, 'number')) { | |
| 4672 | + throw new Exception("Missing required property"); | |
| 4673 | + } | |
| 4674 | + if (!property_exists($obj, 'patch_url')) { | |
| 4675 | + throw new Exception("Missing required property"); | |
| 4676 | + } | |
| 4677 | + if (!property_exists($obj, 'rebaseable')) { | |
| 4678 | + throw new Exception("Missing required property"); | |
| 4679 | + } | |
| 4680 | + if (!property_exists($obj, 'requested_reviewers')) { | |
| 4681 | + throw new Exception("Missing required property"); | |
| 4682 | + } | |
| 4683 | + if (!property_exists($obj, 'review_comment_url')) { | |
| 4684 | + throw new Exception("Missing required property"); | |
| 4685 | + } | |
| 4686 | + if (!property_exists($obj, 'review_comments')) { | |
| 4687 | + throw new Exception("Missing required property"); | |
| 4688 | + } | |
| 4689 | + if (!property_exists($obj, 'review_comments_url')) { | |
| 4690 | + throw new Exception("Missing required property"); | |
| 4691 | + } | |
| 4692 | + if (!property_exists($obj, 'state')) { | |
| 4693 | + throw new Exception("Missing required property"); | |
| 4694 | + } | |
| 4695 | + if (!property_exists($obj, 'statuses_url')) { | |
| 4696 | + throw new Exception("Missing required property"); | |
| 4697 | + } | |
| 4698 | + if (!property_exists($obj, 'title')) { | |
| 4699 | + throw new Exception("Missing required property"); | |
| 4700 | + } | |
| 4701 | + if (!property_exists($obj, 'updated_at')) { | |
| 4702 | + throw new Exception("Missing required property"); | |
| 4703 | + } | |
| 4704 | + if (!property_exists($obj, 'url')) { | |
| 4705 | + throw new Exception("Missing required property"); | |
| 4706 | + } | |
| 4707 | + if (!property_exists($obj, 'user')) { | |
| 4708 | + throw new Exception("Missing required property"); | |
| 4709 | + } | |
| 4530 | 4710 | return new PullRequest( |
| 4531 | 4711 | PullRequest::fromAdditions($obj->{'additions'}) |
| 4532 | 4712 | ,PullRequest::fromAssignee($obj->{'assignee'}) |
| @@ -4915,6 +5095,21 @@ class Base { | ||
| 4915 | 5095 | * @throws Exception |
| 4916 | 5096 | */ |
| 4917 | 5097 | public static function from(stdClass $obj): Base { |
| 5098 | + if (!property_exists($obj, 'label')) { | |
| 5099 | + throw new Exception("Missing required property"); | |
| 5100 | + } | |
| 5101 | + if (!property_exists($obj, 'ref')) { | |
| 5102 | + throw new Exception("Missing required property"); | |
| 5103 | + } | |
| 5104 | + if (!property_exists($obj, 'repo')) { | |
| 5105 | + throw new Exception("Missing required property"); | |
| 5106 | + } | |
| 5107 | + if (!property_exists($obj, 'sha')) { | |
| 5108 | + throw new Exception("Missing required property"); | |
| 5109 | + } | |
| 5110 | + if (!property_exists($obj, 'user')) { | |
| 5111 | + throw new Exception("Missing required property"); | |
| 5112 | + } | |
| 4918 | 5113 | return new Base( |
| 4919 | 5114 | Base::fromLabel($obj->{'label'}) |
| 4920 | 5115 | ,Base::fromRef($obj->{'ref'}) |
| @@ -8588,6 +8783,213 @@ class BaseRepo { | ||
| 8588 | 8783 | * @throws Exception |
| 8589 | 8784 | */ |
| 8590 | 8785 | public static function from(stdClass $obj): BaseRepo { |
| 8786 | + if (!property_exists($obj, 'archive_url')) { | |
| 8787 | + throw new Exception("Missing required property"); | |
| 8788 | + } | |
| 8789 | + if (!property_exists($obj, 'assignees_url')) { | |
| 8790 | + throw new Exception("Missing required property"); | |
| 8791 | + } | |
| 8792 | + if (!property_exists($obj, 'blobs_url')) { | |
| 8793 | + throw new Exception("Missing required property"); | |
| 8794 | + } | |
| 8795 | + if (!property_exists($obj, 'branches_url')) { | |
| 8796 | + throw new Exception("Missing required property"); | |
| 8797 | + } | |
| 8798 | + if (!property_exists($obj, 'clone_url')) { | |
| 8799 | + throw new Exception("Missing required property"); | |
| 8800 | + } | |
| 8801 | + if (!property_exists($obj, 'collaborators_url')) { | |
| 8802 | + throw new Exception("Missing required property"); | |
| 8803 | + } | |
| 8804 | + if (!property_exists($obj, 'comments_url')) { | |
| 8805 | + throw new Exception("Missing required property"); | |
| 8806 | + } | |
| 8807 | + if (!property_exists($obj, 'commits_url')) { | |
| 8808 | + throw new Exception("Missing required property"); | |
| 8809 | + } | |
| 8810 | + if (!property_exists($obj, 'compare_url')) { | |
| 8811 | + throw new Exception("Missing required property"); | |
| 8812 | + } | |
| 8813 | + if (!property_exists($obj, 'contents_url')) { | |
| 8814 | + throw new Exception("Missing required property"); | |
| 8815 | + } | |
| 8816 | + if (!property_exists($obj, 'contributors_url')) { | |
| 8817 | + throw new Exception("Missing required property"); | |
| 8818 | + } | |
| 8819 | + if (!property_exists($obj, 'created_at')) { | |
| 8820 | + throw new Exception("Missing required property"); | |
| 8821 | + } | |
| 8822 | + if (!property_exists($obj, 'default_branch')) { | |
| 8823 | + throw new Exception("Missing required property"); | |
| 8824 | + } | |
| 8825 | + if (!property_exists($obj, 'deployments_url')) { | |
| 8826 | + throw new Exception("Missing required property"); | |
| 8827 | + } | |
| 8828 | + if (!property_exists($obj, 'description')) { | |
| 8829 | + throw new Exception("Missing required property"); | |
| 8830 | + } | |
| 8831 | + if (!property_exists($obj, 'downloads_url')) { | |
| 8832 | + throw new Exception("Missing required property"); | |
| 8833 | + } | |
| 8834 | + if (!property_exists($obj, 'events_url')) { | |
| 8835 | + throw new Exception("Missing required property"); | |
| 8836 | + } | |
| 8837 | + if (!property_exists($obj, 'fork')) { | |
| 8838 | + throw new Exception("Missing required property"); | |
| 8839 | + } | |
| 8840 | + if (!property_exists($obj, 'forks')) { | |
| 8841 | + throw new Exception("Missing required property"); | |
| 8842 | + } | |
| 8843 | + if (!property_exists($obj, 'forks_count')) { | |
| 8844 | + throw new Exception("Missing required property"); | |
| 8845 | + } | |
| 8846 | + if (!property_exists($obj, 'forks_url')) { | |
| 8847 | + throw new Exception("Missing required property"); | |
| 8848 | + } | |
| 8849 | + if (!property_exists($obj, 'full_name')) { | |
| 8850 | + throw new Exception("Missing required property"); | |
| 8851 | + } | |
| 8852 | + if (!property_exists($obj, 'git_commits_url')) { | |
| 8853 | + throw new Exception("Missing required property"); | |
| 8854 | + } | |
| 8855 | + if (!property_exists($obj, 'git_refs_url')) { | |
| 8856 | + throw new Exception("Missing required property"); | |
| 8857 | + } | |
| 8858 | + if (!property_exists($obj, 'git_tags_url')) { | |
| 8859 | + throw new Exception("Missing required property"); | |
| 8860 | + } | |
| 8861 | + if (!property_exists($obj, 'git_url')) { | |
| 8862 | + throw new Exception("Missing required property"); | |
| 8863 | + } | |
| 8864 | + if (!property_exists($obj, 'has_downloads')) { | |
| 8865 | + throw new Exception("Missing required property"); | |
| 8866 | + } | |
| 8867 | + if (!property_exists($obj, 'has_issues')) { | |
| 8868 | + throw new Exception("Missing required property"); | |
| 8869 | + } | |
| 8870 | + if (!property_exists($obj, 'has_pages')) { | |
| 8871 | + throw new Exception("Missing required property"); | |
| 8872 | + } | |
| 8873 | + if (!property_exists($obj, 'has_projects')) { | |
| 8874 | + throw new Exception("Missing required property"); | |
| 8875 | + } | |
| 8876 | + if (!property_exists($obj, 'has_wiki')) { | |
| 8877 | + throw new Exception("Missing required property"); | |
| 8878 | + } | |
| 8879 | + if (!property_exists($obj, 'homepage')) { | |
| 8880 | + throw new Exception("Missing required property"); | |
| 8881 | + } | |
| 8882 | + if (!property_exists($obj, 'hooks_url')) { | |
| 8883 | + throw new Exception("Missing required property"); | |
| 8884 | + } | |
| 8885 | + if (!property_exists($obj, 'html_url')) { | |
| 8886 | + throw new Exception("Missing required property"); | |
| 8887 | + } | |
| 8888 | + if (!property_exists($obj, 'id')) { | |
| 8889 | + throw new Exception("Missing required property"); | |
| 8890 | + } | |
| 8891 | + if (!property_exists($obj, 'issue_comment_url')) { | |
| 8892 | + throw new Exception("Missing required property"); | |
| 8893 | + } | |
| 8894 | + if (!property_exists($obj, 'issue_events_url')) { | |
| 8895 | + throw new Exception("Missing required property"); | |
| 8896 | + } | |
| 8897 | + if (!property_exists($obj, 'issues_url')) { | |
| 8898 | + throw new Exception("Missing required property"); | |
| 8899 | + } | |
| 8900 | + if (!property_exists($obj, 'keys_url')) { | |
| 8901 | + throw new Exception("Missing required property"); | |
| 8902 | + } | |
| 8903 | + if (!property_exists($obj, 'labels_url')) { | |
| 8904 | + throw new Exception("Missing required property"); | |
| 8905 | + } | |
| 8906 | + if (!property_exists($obj, 'language')) { | |
| 8907 | + throw new Exception("Missing required property"); | |
| 8908 | + } | |
| 8909 | + if (!property_exists($obj, 'languages_url')) { | |
| 8910 | + throw new Exception("Missing required property"); | |
| 8911 | + } | |
| 8912 | + if (!property_exists($obj, 'merges_url')) { | |
| 8913 | + throw new Exception("Missing required property"); | |
| 8914 | + } | |
| 8915 | + if (!property_exists($obj, 'milestones_url')) { | |
| 8916 | + throw new Exception("Missing required property"); | |
| 8917 | + } | |
| 8918 | + if (!property_exists($obj, 'mirror_url')) { | |
| 8919 | + throw new Exception("Missing required property"); | |
| 8920 | + } | |
| 8921 | + if (!property_exists($obj, 'name')) { | |
| 8922 | + throw new Exception("Missing required property"); | |
| 8923 | + } | |
| 8924 | + if (!property_exists($obj, 'notifications_url')) { | |
| 8925 | + throw new Exception("Missing required property"); | |
| 8926 | + } | |
| 8927 | + if (!property_exists($obj, 'open_issues')) { | |
| 8928 | + throw new Exception("Missing required property"); | |
| 8929 | + } | |
| 8930 | + if (!property_exists($obj, 'open_issues_count')) { | |
| 8931 | + throw new Exception("Missing required property"); | |
| 8932 | + } | |
| 8933 | + if (!property_exists($obj, 'owner')) { | |
| 8934 | + throw new Exception("Missing required property"); | |
| 8935 | + } | |
| 8936 | + if (!property_exists($obj, 'private')) { | |
| 8937 | + throw new Exception("Missing required property"); | |
| 8938 | + } | |
| 8939 | + if (!property_exists($obj, 'pulls_url')) { | |
| 8940 | + throw new Exception("Missing required property"); | |
| 8941 | + } | |
| 8942 | + if (!property_exists($obj, 'pushed_at')) { | |
| 8943 | + throw new Exception("Missing required property"); | |
| 8944 | + } | |
| 8945 | + if (!property_exists($obj, 'releases_url')) { | |
| 8946 | + throw new Exception("Missing required property"); | |
| 8947 | + } | |
| 8948 | + if (!property_exists($obj, 'size')) { | |
| 8949 | + throw new Exception("Missing required property"); | |
| 8950 | + } | |
| 8951 | + if (!property_exists($obj, 'ssh_url')) { | |
| 8952 | + throw new Exception("Missing required property"); | |
| 8953 | + } | |
| 8954 | + if (!property_exists($obj, 'stargazers_count')) { | |
| 8955 | + throw new Exception("Missing required property"); | |
| 8956 | + } | |
| 8957 | + if (!property_exists($obj, 'stargazers_url')) { | |
| 8958 | + throw new Exception("Missing required property"); | |
| 8959 | + } | |
| 8960 | + if (!property_exists($obj, 'statuses_url')) { | |
| 8961 | + throw new Exception("Missing required property"); | |
| 8962 | + } | |
| 8963 | + if (!property_exists($obj, 'subscribers_url')) { | |
| 8964 | + throw new Exception("Missing required property"); | |
| 8965 | + } | |
| 8966 | + if (!property_exists($obj, 'subscription_url')) { | |
| 8967 | + throw new Exception("Missing required property"); | |
| 8968 | + } | |
| 8969 | + if (!property_exists($obj, 'svn_url')) { | |
| 8970 | + throw new Exception("Missing required property"); | |
| 8971 | + } | |
| 8972 | + if (!property_exists($obj, 'tags_url')) { | |
| 8973 | + throw new Exception("Missing required property"); | |
| 8974 | + } | |
| 8975 | + if (!property_exists($obj, 'teams_url')) { | |
| 8976 | + throw new Exception("Missing required property"); | |
| 8977 | + } | |
| 8978 | + if (!property_exists($obj, 'trees_url')) { | |
| 8979 | + throw new Exception("Missing required property"); | |
| 8980 | + } | |
| 8981 | + if (!property_exists($obj, 'updated_at')) { | |
| 8982 | + throw new Exception("Missing required property"); | |
| 8983 | + } | |
| 8984 | + if (!property_exists($obj, 'url')) { | |
| 8985 | + throw new Exception("Missing required property"); | |
| 8986 | + } | |
| 8987 | + if (!property_exists($obj, 'watchers')) { | |
| 8988 | + throw new Exception("Missing required property"); | |
| 8989 | + } | |
| 8990 | + if (!property_exists($obj, 'watchers_count')) { | |
| 8991 | + throw new Exception("Missing required property"); | |
| 8992 | + } | |
| 8591 | 8993 | return new BaseRepo( |
| 8592 | 8994 | BaseRepo::fromArchiveURL($obj->{'archive_url'}) |
| 8593 | 8995 | ,BaseRepo::fromAssigneesURL($obj->{'assignees_url'}) |
| @@ -9654,6 +10056,57 @@ class MergedBy { | ||
| 9654 | 10056 | * @throws Exception |
| 9655 | 10057 | */ |
| 9656 | 10058 | public static function from(stdClass $obj): MergedBy { |
| 10059 | + if (!property_exists($obj, 'avatar_url')) { | |
| 10060 | + throw new Exception("Missing required property"); | |
| 10061 | + } | |
| 10062 | + if (!property_exists($obj, 'events_url')) { | |
| 10063 | + throw new Exception("Missing required property"); | |
| 10064 | + } | |
| 10065 | + if (!property_exists($obj, 'followers_url')) { | |
| 10066 | + throw new Exception("Missing required property"); | |
| 10067 | + } | |
| 10068 | + if (!property_exists($obj, 'following_url')) { | |
| 10069 | + throw new Exception("Missing required property"); | |
| 10070 | + } | |
| 10071 | + if (!property_exists($obj, 'gists_url')) { | |
| 10072 | + throw new Exception("Missing required property"); | |
| 10073 | + } | |
| 10074 | + if (!property_exists($obj, 'gravatar_id')) { | |
| 10075 | + throw new Exception("Missing required property"); | |
| 10076 | + } | |
| 10077 | + if (!property_exists($obj, 'html_url')) { | |
| 10078 | + throw new Exception("Missing required property"); | |
| 10079 | + } | |
| 10080 | + if (!property_exists($obj, 'id')) { | |
| 10081 | + throw new Exception("Missing required property"); | |
| 10082 | + } | |
| 10083 | + if (!property_exists($obj, 'login')) { | |
| 10084 | + throw new Exception("Missing required property"); | |
| 10085 | + } | |
| 10086 | + if (!property_exists($obj, 'organizations_url')) { | |
| 10087 | + throw new Exception("Missing required property"); | |
| 10088 | + } | |
| 10089 | + if (!property_exists($obj, 'received_events_url')) { | |
| 10090 | + throw new Exception("Missing required property"); | |
| 10091 | + } | |
| 10092 | + if (!property_exists($obj, 'repos_url')) { | |
| 10093 | + throw new Exception("Missing required property"); | |
| 10094 | + } | |
| 10095 | + if (!property_exists($obj, 'site_admin')) { | |
| 10096 | + throw new Exception("Missing required property"); | |
| 10097 | + } | |
| 10098 | + if (!property_exists($obj, 'starred_url')) { | |
| 10099 | + throw new Exception("Missing required property"); | |
| 10100 | + } | |
| 10101 | + if (!property_exists($obj, 'subscriptions_url')) { | |
| 10102 | + throw new Exception("Missing required property"); | |
| 10103 | + } | |
| 10104 | + if (!property_exists($obj, 'type')) { | |
| 10105 | + throw new Exception("Missing required property"); | |
| 10106 | + } | |
| 10107 | + if (!property_exists($obj, 'url')) { | |
| 10108 | + throw new Exception("Missing required property"); | |
| 10109 | + } | |
| 9657 | 10110 | return new MergedBy( |
| 9658 | 10111 | MergedBy::fromAvatarURL($obj->{'avatar_url'}) |
| 9659 | 10112 | ,MergedBy::fromEventsURL($obj->{'events_url'}) |
| @@ -10156,6 +10609,30 @@ class Links { | ||
| 10156 | 10609 | * @throws Exception |
| 10157 | 10610 | */ |
| 10158 | 10611 | public static function from(stdClass $obj): Links { |
| 10612 | + if (!property_exists($obj, 'comments')) { | |
| 10613 | + throw new Exception("Missing required property"); | |
| 10614 | + } | |
| 10615 | + if (!property_exists($obj, 'commits')) { | |
| 10616 | + throw new Exception("Missing required property"); | |
| 10617 | + } | |
| 10618 | + if (!property_exists($obj, 'html')) { | |
| 10619 | + throw new Exception("Missing required property"); | |
| 10620 | + } | |
| 10621 | + if (!property_exists($obj, 'issue')) { | |
| 10622 | + throw new Exception("Missing required property"); | |
| 10623 | + } | |
| 10624 | + if (!property_exists($obj, 'review_comment')) { | |
| 10625 | + throw new Exception("Missing required property"); | |
| 10626 | + } | |
| 10627 | + if (!property_exists($obj, 'review_comments')) { | |
| 10628 | + throw new Exception("Missing required property"); | |
| 10629 | + } | |
| 10630 | + if (!property_exists($obj, 'self')) { | |
| 10631 | + throw new Exception("Missing required property"); | |
| 10632 | + } | |
| 10633 | + if (!property_exists($obj, 'statuses')) { | |
| 10634 | + throw new Exception("Missing required property"); | |
| 10635 | + } | |
| 10159 | 10636 | return new Links( |
| 10160 | 10637 | Links::fromComments($obj->{'comments'}) |
| 10161 | 10638 | ,Links::fromCommits($obj->{'commits'}) |
| @@ -10268,6 +10745,9 @@ class Comments { | ||
| 10268 | 10745 | * @throws Exception |
| 10269 | 10746 | */ |
| 10270 | 10747 | public static function from(stdClass $obj): Comments { |
| 10748 | + if (!property_exists($obj, 'href')) { | |
| 10749 | + throw new Exception("Missing required property"); | |
| 10750 | + } | |
| 10271 | 10751 | return new Comments( |
| 10272 | 10752 | Comments::fromHref($obj->{'href'}) |
| 10273 | 10753 | ); |
| @@ -10470,6 +10950,15 @@ class TopLevelRepo { | ||
| 10470 | 10950 | * @throws Exception |
| 10471 | 10951 | */ |
| 10472 | 10952 | public static function from(stdClass $obj): TopLevelRepo { |
| 10953 | + if (!property_exists($obj, 'id')) { | |
| 10954 | + throw new Exception("Missing required property"); | |
| 10955 | + } | |
| 10956 | + if (!property_exists($obj, 'name')) { | |
| 10957 | + throw new Exception("Missing required property"); | |
| 10958 | + } | |
| 10959 | + if (!property_exists($obj, 'url')) { | |
| 10960 | + throw new Exception("Missing required property"); | |
| 10961 | + } | |
| 10473 | 10962 | return new TopLevelRepo( |
| 10474 | 10963 | TopLevelRepo::fromID($obj->{'id'}) |
| 10475 | 10964 | ,TopLevelRepo::fromName($obj->{'name'}) |
Test case
1 generated file · +78 −0test/inputs/json/misc/0b91a.json
Mphpdefault / TopLevel.php+78 −0
| @@ -149,6 +149,12 @@ class TopLevel { | ||
| 149 | 149 | * @throws Exception |
| 150 | 150 | */ |
| 151 | 151 | public static function from(stdClass $obj): TopLevel { |
| 152 | + if (!property_exists($obj, 'metadata')) { | |
| 153 | + throw new Exception("Missing required property"); | |
| 154 | + } | |
| 155 | + if (!property_exists($obj, 'results')) { | |
| 156 | + throw new Exception("Missing required property"); | |
| 157 | + } | |
| 152 | 158 | return new TopLevel( |
| 153 | 159 | TopLevel::fromMetadata($obj->{'metadata'}) |
| 154 | 160 | ,TopLevel::fromResults($obj->{'results'}) |
| @@ -355,6 +361,15 @@ class Metadata { | ||
| 355 | 361 | * @throws Exception |
| 356 | 362 | */ |
| 357 | 363 | public static function from(stdClass $obj): Metadata { |
| 364 | + if (!property_exists($obj, 'executionTime')) { | |
| 365 | + throw new Exception("Missing required property"); | |
| 366 | + } | |
| 367 | + if (!property_exists($obj, 'responseInfo')) { | |
| 368 | + throw new Exception("Missing required property"); | |
| 369 | + } | |
| 370 | + if (!property_exists($obj, 'resultset')) { | |
| 371 | + throw new Exception("Missing required property"); | |
| 372 | + } | |
| 358 | 373 | return new Metadata( |
| 359 | 374 | Metadata::fromExecutionTime($obj->{'executionTime'}) |
| 360 | 375 | ,Metadata::fromResponseInfo($obj->{'responseInfo'}) |
| @@ -509,6 +524,12 @@ class ResponseInfo { | ||
| 509 | 524 | * @throws Exception |
| 510 | 525 | */ |
| 511 | 526 | public static function from(stdClass $obj): ResponseInfo { |
| 527 | + if (!property_exists($obj, 'developerMessage')) { | |
| 528 | + throw new Exception("Missing required property"); | |
| 529 | + } | |
| 530 | + if (!property_exists($obj, 'status')) { | |
| 531 | + throw new Exception("Missing required property"); | |
| 532 | + } | |
| 512 | 533 | return new ResponseInfo( |
| 513 | 534 | ResponseInfo::fromDeveloperMessage($obj->{'developerMessage'}) |
| 514 | 535 | ,ResponseInfo::fromStatus($obj->{'status'}) |
| @@ -713,6 +734,15 @@ class Resultset { | ||
| 713 | 734 | * @throws Exception |
| 714 | 735 | */ |
| 715 | 736 | public static function from(stdClass $obj): Resultset { |
| 737 | + if (!property_exists($obj, 'count')) { | |
| 738 | + throw new Exception("Missing required property"); | |
| 739 | + } | |
| 740 | + if (!property_exists($obj, 'page')) { | |
| 741 | + throw new Exception("Missing required property"); | |
| 742 | + } | |
| 743 | + if (!property_exists($obj, 'pagesize')) { | |
| 744 | + throw new Exception("Missing required property"); | |
| 745 | + } | |
| 716 | 746 | return new Resultset( |
| 717 | 747 | Resultset::fromCount($obj->{'count'}) |
| 718 | 748 | ,Resultset::fromPage($obj->{'page'}) |
| @@ -1548,6 +1578,48 @@ class Result { | ||
| 1548 | 1578 | * @throws Exception |
| 1549 | 1579 | */ |
| 1550 | 1580 | public static function from(stdClass $obj): Result { |
| 1581 | + if (!property_exists($obj, 'attachment')) { | |
| 1582 | + throw new Exception("Missing required property"); | |
| 1583 | + } | |
| 1584 | + if (!property_exists($obj, 'body')) { | |
| 1585 | + throw new Exception("Missing required property"); | |
| 1586 | + } | |
| 1587 | + if (!property_exists($obj, 'changed')) { | |
| 1588 | + throw new Exception("Missing required property"); | |
| 1589 | + } | |
| 1590 | + if (!property_exists($obj, 'component')) { | |
| 1591 | + throw new Exception("Missing required property"); | |
| 1592 | + } | |
| 1593 | + if (!property_exists($obj, 'created')) { | |
| 1594 | + throw new Exception("Missing required property"); | |
| 1595 | + } | |
| 1596 | + if (!property_exists($obj, 'date')) { | |
| 1597 | + throw new Exception("Missing required property"); | |
| 1598 | + } | |
| 1599 | + if (!property_exists($obj, 'image')) { | |
| 1600 | + throw new Exception("Missing required property"); | |
| 1601 | + } | |
| 1602 | + if (!property_exists($obj, 'number')) { | |
| 1603 | + throw new Exception("Missing required property"); | |
| 1604 | + } | |
| 1605 | + if (!property_exists($obj, 'teaser')) { | |
| 1606 | + throw new Exception("Missing required property"); | |
| 1607 | + } | |
| 1608 | + if (!property_exists($obj, 'title')) { | |
| 1609 | + throw new Exception("Missing required property"); | |
| 1610 | + } | |
| 1611 | + if (!property_exists($obj, 'topic')) { | |
| 1612 | + throw new Exception("Missing required property"); | |
| 1613 | + } | |
| 1614 | + if (!property_exists($obj, 'url')) { | |
| 1615 | + throw new Exception("Missing required property"); | |
| 1616 | + } | |
| 1617 | + if (!property_exists($obj, 'uuid')) { | |
| 1618 | + throw new Exception("Missing required property"); | |
| 1619 | + } | |
| 1620 | + if (!property_exists($obj, 'vuuid')) { | |
| 1621 | + throw new Exception("Missing required property"); | |
| 1622 | + } | |
| 1551 | 1623 | return new Result( |
| 1552 | 1624 | Result::fromAttachment($obj->{'attachment'}) |
| 1553 | 1625 | ,Result::fromBody($obj->{'body'}) |
| @@ -1727,6 +1799,12 @@ class Component { | ||
| 1727 | 1799 | * @throws Exception |
| 1728 | 1800 | */ |
| 1729 | 1801 | public static function from(stdClass $obj): Component { |
| 1802 | + if (!property_exists($obj, 'name')) { | |
| 1803 | + throw new Exception("Missing required property"); | |
| 1804 | + } | |
| 1805 | + if (!property_exists($obj, 'uuid')) { | |
| 1806 | + throw new Exception("Missing required property"); | |
| 1807 | + } | |
| 1730 | 1808 | return new Component( |
| 1731 | 1809 | Component::fromName($obj->{'name'}) |
| 1732 | 1810 | ,Component::fromUUID($obj->{'uuid'}) |
Test case
1 generated file · +207 −0test/inputs/json/misc/0cffa.json
Mphpdefault / TopLevel.php+207 −0
| @@ -202,6 +202,15 @@ class TopLevel { | ||
| 202 | 202 | * @throws Exception |
| 203 | 203 | */ |
| 204 | 204 | public static function from(stdClass $obj): TopLevel { |
| 205 | + if (!property_exists($obj, 'data')) { | |
| 206 | + throw new Exception("Missing required property"); | |
| 207 | + } | |
| 208 | + if (!property_exists($obj, 'meta')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'pagination')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 205 | 214 | return new TopLevel( |
| 206 | 215 | TopLevel::fromData($obj->{'data'}) |
| 207 | 216 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -1203,6 +1212,57 @@ class Datum { | ||
| 1203 | 1212 | * @throws Exception |
| 1204 | 1213 | */ |
| 1205 | 1214 | public static function from(stdClass $obj): Datum { |
| 1215 | + if (!property_exists($obj, 'bitly_gif_url')) { | |
| 1216 | + throw new Exception("Missing required property"); | |
| 1217 | + } | |
| 1218 | + if (!property_exists($obj, 'bitly_url')) { | |
| 1219 | + throw new Exception("Missing required property"); | |
| 1220 | + } | |
| 1221 | + if (!property_exists($obj, 'content_url')) { | |
| 1222 | + throw new Exception("Missing required property"); | |
| 1223 | + } | |
| 1224 | + if (!property_exists($obj, 'embed_url')) { | |
| 1225 | + throw new Exception("Missing required property"); | |
| 1226 | + } | |
| 1227 | + if (!property_exists($obj, 'id')) { | |
| 1228 | + throw new Exception("Missing required property"); | |
| 1229 | + } | |
| 1230 | + if (!property_exists($obj, 'images')) { | |
| 1231 | + throw new Exception("Missing required property"); | |
| 1232 | + } | |
| 1233 | + if (!property_exists($obj, 'import_datetime')) { | |
| 1234 | + throw new Exception("Missing required property"); | |
| 1235 | + } | |
| 1236 | + if (!property_exists($obj, 'is_indexable')) { | |
| 1237 | + throw new Exception("Missing required property"); | |
| 1238 | + } | |
| 1239 | + if (!property_exists($obj, 'rating')) { | |
| 1240 | + throw new Exception("Missing required property"); | |
| 1241 | + } | |
| 1242 | + if (!property_exists($obj, 'slug')) { | |
| 1243 | + throw new Exception("Missing required property"); | |
| 1244 | + } | |
| 1245 | + if (!property_exists($obj, 'source')) { | |
| 1246 | + throw new Exception("Missing required property"); | |
| 1247 | + } | |
| 1248 | + if (!property_exists($obj, 'source_post_url')) { | |
| 1249 | + throw new Exception("Missing required property"); | |
| 1250 | + } | |
| 1251 | + if (!property_exists($obj, 'source_tld')) { | |
| 1252 | + throw new Exception("Missing required property"); | |
| 1253 | + } | |
| 1254 | + if (!property_exists($obj, 'trending_datetime')) { | |
| 1255 | + throw new Exception("Missing required property"); | |
| 1256 | + } | |
| 1257 | + if (!property_exists($obj, 'type')) { | |
| 1258 | + throw new Exception("Missing required property"); | |
| 1259 | + } | |
| 1260 | + if (!property_exists($obj, 'url')) { | |
| 1261 | + throw new Exception("Missing required property"); | |
| 1262 | + } | |
| 1263 | + if (!property_exists($obj, 'username')) { | |
| 1264 | + throw new Exception("Missing required property"); | |
| 1265 | + } | |
| 1206 | 1266 | return new Datum( |
| 1207 | 1267 | Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'}) |
| 1208 | 1268 | ,Datum::fromBitlyURL($obj->{'bitly_url'}) |
| @@ -2512,6 +2572,72 @@ class Images { | ||
| 2512 | 2572 | * @throws Exception |
| 2513 | 2573 | */ |
| 2514 | 2574 | public static function from(stdClass $obj): Images { |
| 2575 | + if (!property_exists($obj, 'downsized')) { | |
| 2576 | + throw new Exception("Missing required property"); | |
| 2577 | + } | |
| 2578 | + if (!property_exists($obj, 'downsized_large')) { | |
| 2579 | + throw new Exception("Missing required property"); | |
| 2580 | + } | |
| 2581 | + if (!property_exists($obj, 'downsized_medium')) { | |
| 2582 | + throw new Exception("Missing required property"); | |
| 2583 | + } | |
| 2584 | + if (!property_exists($obj, 'downsized_small')) { | |
| 2585 | + throw new Exception("Missing required property"); | |
| 2586 | + } | |
| 2587 | + if (!property_exists($obj, 'downsized_still')) { | |
| 2588 | + throw new Exception("Missing required property"); | |
| 2589 | + } | |
| 2590 | + if (!property_exists($obj, 'fixed_height')) { | |
| 2591 | + throw new Exception("Missing required property"); | |
| 2592 | + } | |
| 2593 | + if (!property_exists($obj, 'fixed_height_downsampled')) { | |
| 2594 | + throw new Exception("Missing required property"); | |
| 2595 | + } | |
| 2596 | + if (!property_exists($obj, 'fixed_height_small')) { | |
| 2597 | + throw new Exception("Missing required property"); | |
| 2598 | + } | |
| 2599 | + if (!property_exists($obj, 'fixed_height_small_still')) { | |
| 2600 | + throw new Exception("Missing required property"); | |
| 2601 | + } | |
| 2602 | + if (!property_exists($obj, 'fixed_height_still')) { | |
| 2603 | + throw new Exception("Missing required property"); | |
| 2604 | + } | |
| 2605 | + if (!property_exists($obj, 'fixed_width')) { | |
| 2606 | + throw new Exception("Missing required property"); | |
| 2607 | + } | |
| 2608 | + if (!property_exists($obj, 'fixed_width_downsampled')) { | |
| 2609 | + throw new Exception("Missing required property"); | |
| 2610 | + } | |
| 2611 | + if (!property_exists($obj, 'fixed_width_small')) { | |
| 2612 | + throw new Exception("Missing required property"); | |
| 2613 | + } | |
| 2614 | + if (!property_exists($obj, 'fixed_width_small_still')) { | |
| 2615 | + throw new Exception("Missing required property"); | |
| 2616 | + } | |
| 2617 | + if (!property_exists($obj, 'fixed_width_still')) { | |
| 2618 | + throw new Exception("Missing required property"); | |
| 2619 | + } | |
| 2620 | + if (!property_exists($obj, 'looping')) { | |
| 2621 | + throw new Exception("Missing required property"); | |
| 2622 | + } | |
| 2623 | + if (!property_exists($obj, 'original')) { | |
| 2624 | + throw new Exception("Missing required property"); | |
| 2625 | + } | |
| 2626 | + if (!property_exists($obj, 'original_mp4')) { | |
| 2627 | + throw new Exception("Missing required property"); | |
| 2628 | + } | |
| 2629 | + if (!property_exists($obj, 'original_still')) { | |
| 2630 | + throw new Exception("Missing required property"); | |
| 2631 | + } | |
| 2632 | + if (!property_exists($obj, 'preview')) { | |
| 2633 | + throw new Exception("Missing required property"); | |
| 2634 | + } | |
| 2635 | + if (!property_exists($obj, 'preview_gif')) { | |
| 2636 | + throw new Exception("Missing required property"); | |
| 2637 | + } | |
| 2638 | + if (!property_exists($obj, 'preview_webp')) { | |
| 2639 | + throw new Exception("Missing required property"); | |
| 2640 | + } | |
| 2515 | 2641 | return new Images( |
| 2516 | 2642 | Images::fromDownsized($obj->{'downsized'}) |
| 2517 | 2643 | ,Images::fromDownsizedLarge($obj->{'downsized_large'}) |
| @@ -2820,6 +2946,15 @@ class Downsized { | ||
| 2820 | 2946 | * @throws Exception |
| 2821 | 2947 | */ |
| 2822 | 2948 | public static function from(stdClass $obj): Downsized { |
| 2949 | + if (!property_exists($obj, 'height')) { | |
| 2950 | + throw new Exception("Missing required property"); | |
| 2951 | + } | |
| 2952 | + if (!property_exists($obj, 'url')) { | |
| 2953 | + throw new Exception("Missing required property"); | |
| 2954 | + } | |
| 2955 | + if (!property_exists($obj, 'width')) { | |
| 2956 | + throw new Exception("Missing required property"); | |
| 2957 | + } | |
| 2823 | 2958 | return new Downsized( |
| 2824 | 2959 | Downsized::fromHeight($obj->{'height'}) |
| 2825 | 2960 | ,Downsized::fromSize($obj->{'size'}) |
| @@ -3080,6 +3215,18 @@ class DownsizedSmall { | ||
| 3080 | 3215 | * @throws Exception |
| 3081 | 3216 | */ |
| 3082 | 3217 | public static function from(stdClass $obj): DownsizedSmall { |
| 3218 | + if (!property_exists($obj, 'height')) { | |
| 3219 | + throw new Exception("Missing required property"); | |
| 3220 | + } | |
| 3221 | + if (!property_exists($obj, 'mp4')) { | |
| 3222 | + throw new Exception("Missing required property"); | |
| 3223 | + } | |
| 3224 | + if (!property_exists($obj, 'mp4_size')) { | |
| 3225 | + throw new Exception("Missing required property"); | |
| 3226 | + } | |
| 3227 | + if (!property_exists($obj, 'width')) { | |
| 3228 | + throw new Exception("Missing required property"); | |
| 3229 | + } | |
| 3083 | 3230 | return new DownsizedSmall( |
| 3084 | 3231 | DownsizedSmall::fromHeight($obj->{'height'}) |
| 3085 | 3232 | ,DownsizedSmall::fromMp4($obj->{'mp4'}) |
| @@ -3692,6 +3839,24 @@ class FixedHeight { | ||
| 3692 | 3839 | * @throws Exception |
| 3693 | 3840 | */ |
| 3694 | 3841 | public static function from(stdClass $obj): FixedHeight { |
| 3842 | + if (!property_exists($obj, 'height')) { | |
| 3843 | + throw new Exception("Missing required property"); | |
| 3844 | + } | |
| 3845 | + if (!property_exists($obj, 'size')) { | |
| 3846 | + throw new Exception("Missing required property"); | |
| 3847 | + } | |
| 3848 | + if (!property_exists($obj, 'url')) { | |
| 3849 | + throw new Exception("Missing required property"); | |
| 3850 | + } | |
| 3851 | + if (!property_exists($obj, 'webp')) { | |
| 3852 | + throw new Exception("Missing required property"); | |
| 3853 | + } | |
| 3854 | + if (!property_exists($obj, 'webp_size')) { | |
| 3855 | + throw new Exception("Missing required property"); | |
| 3856 | + } | |
| 3857 | + if (!property_exists($obj, 'width')) { | |
| 3858 | + throw new Exception("Missing required property"); | |
| 3859 | + } | |
| 3695 | 3860 | return new FixedHeight( |
| 3696 | 3861 | FixedHeight::fromFrames($obj->{'frames'}) |
| 3697 | 3862 | ,FixedHeight::fromHash($obj->{'hash'}) |
| @@ -3860,6 +4025,12 @@ class Looping { | ||
| 3860 | 4025 | * @throws Exception |
| 3861 | 4026 | */ |
| 3862 | 4027 | public static function from(stdClass $obj): Looping { |
| 4028 | + if (!property_exists($obj, 'mp4')) { | |
| 4029 | + throw new Exception("Missing required property"); | |
| 4030 | + } | |
| 4031 | + if (!property_exists($obj, 'mp4_size')) { | |
| 4032 | + throw new Exception("Missing required property"); | |
| 4033 | + } | |
| 3863 | 4034 | return new Looping( |
| 3864 | 4035 | Looping::fromMp4($obj->{'mp4'}) |
| 3865 | 4036 | ,Looping::fromMp4Size($obj->{'mp4_size'}) |
| @@ -4315,6 +4486,24 @@ class User { | ||
| 4315 | 4486 | * @throws Exception |
| 4316 | 4487 | */ |
| 4317 | 4488 | public static function from(stdClass $obj): User { |
| 4489 | + if (!property_exists($obj, 'avatar_url')) { | |
| 4490 | + throw new Exception("Missing required property"); | |
| 4491 | + } | |
| 4492 | + if (!property_exists($obj, 'banner_url')) { | |
| 4493 | + throw new Exception("Missing required property"); | |
| 4494 | + } | |
| 4495 | + if (!property_exists($obj, 'display_name')) { | |
| 4496 | + throw new Exception("Missing required property"); | |
| 4497 | + } | |
| 4498 | + if (!property_exists($obj, 'profile_url')) { | |
| 4499 | + throw new Exception("Missing required property"); | |
| 4500 | + } | |
| 4501 | + if (!property_exists($obj, 'twitter')) { | |
| 4502 | + throw new Exception("Missing required property"); | |
| 4503 | + } | |
| 4504 | + if (!property_exists($obj, 'username')) { | |
| 4505 | + throw new Exception("Missing required property"); | |
| 4506 | + } | |
| 4318 | 4507 | return new User( |
| 4319 | 4508 | User::fromAvatarURL($obj->{'avatar_url'}) |
| 4320 | 4509 | ,User::fromBannerURL($obj->{'banner_url'}) |
| @@ -4584,6 +4773,15 @@ class Meta { | ||
| 4584 | 4773 | * @throws Exception |
| 4585 | 4774 | */ |
| 4586 | 4775 | public static function from(stdClass $obj): Meta { |
| 4776 | + if (!property_exists($obj, 'msg')) { | |
| 4777 | + throw new Exception("Missing required property"); | |
| 4778 | + } | |
| 4779 | + if (!property_exists($obj, 'response_id')) { | |
| 4780 | + throw new Exception("Missing required property"); | |
| 4781 | + } | |
| 4782 | + if (!property_exists($obj, 'status')) { | |
| 4783 | + throw new Exception("Missing required property"); | |
| 4784 | + } | |
| 4587 | 4785 | return new Meta( |
| 4588 | 4786 | Meta::fromMsg($obj->{'msg'}) |
| 4589 | 4787 | ,Meta::fromResponseID($obj->{'response_id'}) |
| @@ -4790,6 +4988,15 @@ class Pagination { | ||
| 4790 | 4988 | * @throws Exception |
| 4791 | 4989 | */ |
| 4792 | 4990 | public static function from(stdClass $obj): Pagination { |
| 4991 | + if (!property_exists($obj, 'count')) { | |
| 4992 | + throw new Exception("Missing required property"); | |
| 4993 | + } | |
| 4994 | + if (!property_exists($obj, 'offset')) { | |
| 4995 | + throw new Exception("Missing required property"); | |
| 4996 | + } | |
| 4997 | + if (!property_exists($obj, 'total_count')) { | |
| 4998 | + throw new Exception("Missing required property"); | |
| 4999 | + } | |
| 4793 | 5000 | return new Pagination( |
| 4794 | 5001 | Pagination::fromCount($obj->{'count'}) |
| 4795 | 5002 | ,Pagination::fromOffset($obj->{'offset'}) |
Test case
1 generated file · +135 −0test/inputs/json/misc/0e0c2.json
Mphpdefault / TopLevel.php+135 −0
| @@ -255,6 +255,18 @@ class TopLevel { | ||
| 255 | 255 | * @throws Exception |
| 256 | 256 | */ |
| 257 | 257 | public static function from(stdClass $obj): TopLevel { |
| 258 | + if (!property_exists($obj, 'count')) { | |
| 259 | + throw new Exception("Missing required property"); | |
| 260 | + } | |
| 261 | + if (!property_exists($obj, 'next')) { | |
| 262 | + throw new Exception("Missing required property"); | |
| 263 | + } | |
| 264 | + if (!property_exists($obj, 'previous')) { | |
| 265 | + throw new Exception("Missing required property"); | |
| 266 | + } | |
| 267 | + if (!property_exists($obj, 'results')) { | |
| 268 | + throw new Exception("Missing required property"); | |
| 269 | + } | |
| 258 | 270 | return new TopLevel( |
| 259 | 271 | TopLevel::fromCount($obj->{'count'}) |
| 260 | 272 | ,TopLevel::fromNext($obj->{'next'}) |
| @@ -1159,6 +1171,51 @@ class Result { | ||
| 1159 | 1171 | * @throws Exception |
| 1160 | 1172 | */ |
| 1161 | 1173 | public static function from(stdClass $obj): Result { |
| 1174 | + if (!property_exists($obj, 'active_screens')) { | |
| 1175 | + throw new Exception("Missing required property"); | |
| 1176 | + } | |
| 1177 | + if (!property_exists($obj, 'collections')) { | |
| 1178 | + throw new Exception("Missing required property"); | |
| 1179 | + } | |
| 1180 | + if (!property_exists($obj, 'details')) { | |
| 1181 | + throw new Exception("Missing required property"); | |
| 1182 | + } | |
| 1183 | + if (!property_exists($obj, 'duration')) { | |
| 1184 | + throw new Exception("Missing required property"); | |
| 1185 | + } | |
| 1186 | + if (!property_exists($obj, 'fav_movie')) { | |
| 1187 | + throw new Exception("Missing required property"); | |
| 1188 | + } | |
| 1189 | + if (!property_exists($obj, 'id')) { | |
| 1190 | + throw new Exception("Missing required property"); | |
| 1191 | + } | |
| 1192 | + if (!property_exists($obj, 'images')) { | |
| 1193 | + throw new Exception("Missing required property"); | |
| 1194 | + } | |
| 1195 | + if (!property_exists($obj, 'language')) { | |
| 1196 | + throw new Exception("Missing required property"); | |
| 1197 | + } | |
| 1198 | + if (!property_exists($obj, 'release_date')) { | |
| 1199 | + throw new Exception("Missing required property"); | |
| 1200 | + } | |
| 1201 | + if (!property_exists($obj, 'stars')) { | |
| 1202 | + throw new Exception("Missing required property"); | |
| 1203 | + } | |
| 1204 | + if (!property_exists($obj, 'tags')) { | |
| 1205 | + throw new Exception("Missing required property"); | |
| 1206 | + } | |
| 1207 | + if (!property_exists($obj, 'title')) { | |
| 1208 | + throw new Exception("Missing required property"); | |
| 1209 | + } | |
| 1210 | + if (!property_exists($obj, 'videos')) { | |
| 1211 | + throw new Exception("Missing required property"); | |
| 1212 | + } | |
| 1213 | + if (!property_exists($obj, 'vote_score')) { | |
| 1214 | + throw new Exception("Missing required property"); | |
| 1215 | + } | |
| 1216 | + if (!property_exists($obj, 'watches')) { | |
| 1217 | + throw new Exception("Missing required property"); | |
| 1218 | + } | |
| 1162 | 1219 | return new Result( |
| 1163 | 1220 | Result::fromActiveScreens($obj->{'active_screens'}) |
| 1164 | 1221 | ,Result::fromCollections($obj->{'collections'}) |
| @@ -1455,6 +1512,18 @@ class Collection { | ||
| 1455 | 1512 | * @throws Exception |
| 1456 | 1513 | */ |
| 1457 | 1514 | public static function from(stdClass $obj): Collection { |
| 1515 | + if (!property_exists($obj, 'id')) { | |
| 1516 | + throw new Exception("Missing required property"); | |
| 1517 | + } | |
| 1518 | + if (!property_exists($obj, 'movies')) { | |
| 1519 | + throw new Exception("Missing required property"); | |
| 1520 | + } | |
| 1521 | + if (!property_exists($obj, 'name')) { | |
| 1522 | + throw new Exception("Missing required property"); | |
| 1523 | + } | |
| 1524 | + if (!property_exists($obj, 'slug')) { | |
| 1525 | + throw new Exception("Missing required property"); | |
| 1526 | + } | |
| 1458 | 1527 | return new Collection( |
| 1459 | 1528 | Collection::fromID($obj->{'id'}) |
| 1460 | 1529 | ,Collection::fromMovies($obj->{'movies'}) |
| @@ -1872,6 +1941,27 @@ class Detail { | ||
| 1872 | 1941 | * @throws Exception |
| 1873 | 1942 | */ |
| 1874 | 1943 | public static function from(stdClass $obj): Detail { |
| 1944 | + if (!property_exists($obj, 'cast')) { | |
| 1945 | + throw new Exception("Missing required property"); | |
| 1946 | + } | |
| 1947 | + if (!property_exists($obj, 'director')) { | |
| 1948 | + throw new Exception("Missing required property"); | |
| 1949 | + } | |
| 1950 | + if (!property_exists($obj, 'id')) { | |
| 1951 | + throw new Exception("Missing required property"); | |
| 1952 | + } | |
| 1953 | + if (!property_exists($obj, 'language')) { | |
| 1954 | + throw new Exception("Missing required property"); | |
| 1955 | + } | |
| 1956 | + if (!property_exists($obj, 'storyline')) { | |
| 1957 | + throw new Exception("Missing required property"); | |
| 1958 | + } | |
| 1959 | + if (!property_exists($obj, 'tagline')) { | |
| 1960 | + throw new Exception("Missing required property"); | |
| 1961 | + } | |
| 1962 | + if (!property_exists($obj, 'title')) { | |
| 1963 | + throw new Exception("Missing required property"); | |
| 1964 | + } | |
| 1875 | 1965 | return new Detail( |
| 1876 | 1966 | Detail::fromCast($obj->{'cast'}) |
| 1877 | 1967 | ,Detail::fromDirector($obj->{'director'}) |
| @@ -2135,6 +2225,15 @@ class FavMovie { | ||
| 2135 | 2225 | * @throws Exception |
| 2136 | 2226 | */ |
| 2137 | 2227 | public static function from(stdClass $obj): FavMovie { |
| 2228 | + if (!property_exists($obj, 'follow')) { | |
| 2229 | + throw new Exception("Missing required property"); | |
| 2230 | + } | |
| 2231 | + if (!property_exists($obj, 'star')) { | |
| 2232 | + throw new Exception("Missing required property"); | |
| 2233 | + } | |
| 2234 | + if (!property_exists($obj, 'watched')) { | |
| 2235 | + throw new Exception("Missing required property"); | |
| 2236 | + } | |
| 2138 | 2237 | return new FavMovie( |
| 2139 | 2238 | FavMovie::fromFollow($obj->{'follow'}) |
| 2140 | 2239 | ,FavMovie::fromStar($obj->{'star'}) |
| @@ -2446,6 +2545,21 @@ class Image { | ||
| 2446 | 2545 | * @throws Exception |
| 2447 | 2546 | */ |
| 2448 | 2547 | public static function from(stdClass $obj): Image { |
| 2548 | + if (!property_exists($obj, 'favs')) { | |
| 2549 | + throw new Exception("Missing required property"); | |
| 2550 | + } | |
| 2551 | + if (!property_exists($obj, 'id')) { | |
| 2552 | + throw new Exception("Missing required property"); | |
| 2553 | + } | |
| 2554 | + if (!property_exists($obj, 'thumbnail')) { | |
| 2555 | + throw new Exception("Missing required property"); | |
| 2556 | + } | |
| 2557 | + if (!property_exists($obj, 'type')) { | |
| 2558 | + throw new Exception("Missing required property"); | |
| 2559 | + } | |
| 2560 | + if (!property_exists($obj, 'url')) { | |
| 2561 | + throw new Exception("Missing required property"); | |
| 2562 | + } | |
| 2449 | 2563 | return new Image( |
| 2450 | 2564 | Image::fromFavs($obj->{'favs'}) |
| 2451 | 2565 | ,Image::fromID($obj->{'id'}) |
| @@ -2807,6 +2921,18 @@ class Video { | ||
| 2807 | 2921 | * @throws Exception |
| 2808 | 2922 | */ |
| 2809 | 2923 | public static function from(stdClass $obj): Video { |
| 2924 | + if (!property_exists($obj, 'kind')) { | |
| 2925 | + throw new Exception("Missing required property"); | |
| 2926 | + } | |
| 2927 | + if (!property_exists($obj, 'language')) { | |
| 2928 | + throw new Exception("Missing required property"); | |
| 2929 | + } | |
| 2930 | + if (!property_exists($obj, 'source')) { | |
| 2931 | + throw new Exception("Missing required property"); | |
| 2932 | + } | |
| 2933 | + if (!property_exists($obj, 'url')) { | |
| 2934 | + throw new Exception("Missing required property"); | |
| 2935 | + } | |
| 2810 | 2936 | return new Video( |
| 2811 | 2937 | Video::fromKind($obj->{'kind'}) |
| 2812 | 2938 | ,Video::fromLanguage($obj->{'language'}) |
| @@ -3015,6 +3141,15 @@ class VoteScore { | ||
| 3015 | 3141 | * @throws Exception |
| 3016 | 3142 | */ |
| 3017 | 3143 | public static function from(stdClass $obj): VoteScore { |
| 3144 | + if (!property_exists($obj, 'avg')) { | |
| 3145 | + throw new Exception("Missing required property"); | |
| 3146 | + } | |
| 3147 | + if (!property_exists($obj, 'score')) { | |
| 3148 | + throw new Exception("Missing required property"); | |
| 3149 | + } | |
| 3150 | + if (!property_exists($obj, 'total')) { | |
| 3151 | + throw new Exception("Missing required property"); | |
| 3152 | + } | |
| 3018 | 3153 | return new VoteScore( |
| 3019 | 3154 | VoteScore::fromAvg($obj->{'avg'}) |
| 3020 | 3155 | ,VoteScore::fromScore($obj->{'score'}) |
Test case
1 generated file · +3 −0test/inputs/json/misc/0fecf.json
Mphpdefault / TopLevel.php+3 −0
| @@ -98,6 +98,9 @@ class TopLevel { | ||
| 98 | 98 | * @throws Exception |
| 99 | 99 | */ |
| 100 | 100 | public static function from(stdClass $obj): TopLevel { |
| 101 | + if (!property_exists($obj, 'countries')) { | |
| 102 | + throw new Exception("Missing required property"); | |
| 103 | + } | |
| 101 | 104 | return new TopLevel( |
| 102 | 105 | TopLevel::fromCountries($obj->{'countries'}) |
| 103 | 106 | ); |
Test case
1 generated file · +51 −0test/inputs/json/misc/10be4.json
Mphpdefault / TopLevel.php+51 −0
| @@ -518,6 +518,30 @@ class TopLevel { | ||
| 518 | 518 | * @throws Exception |
| 519 | 519 | */ |
| 520 | 520 | public static function from(stdClass $obj): TopLevel { |
| 521 | + if (!property_exists($obj, 'id')) { | |
| 522 | + throw new Exception("Missing required property"); | |
| 523 | + } | |
| 524 | + if (!property_exists($obj, 'identifiers')) { | |
| 525 | + throw new Exception("Missing required property"); | |
| 526 | + } | |
| 527 | + if (!property_exists($obj, 'keywords')) { | |
| 528 | + throw new Exception("Missing required property"); | |
| 529 | + } | |
| 530 | + if (!property_exists($obj, 'links')) { | |
| 531 | + throw new Exception("Missing required property"); | |
| 532 | + } | |
| 533 | + if (!property_exists($obj, 'name')) { | |
| 534 | + throw new Exception("Missing required property"); | |
| 535 | + } | |
| 536 | + if (!property_exists($obj, 'other_names')) { | |
| 537 | + throw new Exception("Missing required property"); | |
| 538 | + } | |
| 539 | + if (!property_exists($obj, 'superseded_by')) { | |
| 540 | + throw new Exception("Missing required property"); | |
| 541 | + } | |
| 542 | + if (!property_exists($obj, 'text')) { | |
| 543 | + throw new Exception("Missing required property"); | |
| 544 | + } | |
| 521 | 545 | return new TopLevel( |
| 522 | 546 | TopLevel::fromID($obj->{'id'}) |
| 523 | 547 | ,TopLevel::fromIdentifiers($obj->{'identifiers'}) |
| @@ -683,6 +707,12 @@ class Identifier { | ||
| 683 | 707 | * @throws Exception |
| 684 | 708 | */ |
| 685 | 709 | public static function from(stdClass $obj): Identifier { |
| 710 | + if (!property_exists($obj, 'identifier')) { | |
| 711 | + throw new Exception("Missing required property"); | |
| 712 | + } | |
| 713 | + if (!property_exists($obj, 'scheme')) { | |
| 714 | + throw new Exception("Missing required property"); | |
| 715 | + } | |
| 686 | 716 | return new Identifier( |
| 687 | 717 | Identifier::fromIdentifier($obj->{'identifier'}) |
| 688 | 718 | ,Identifier::fromScheme($obj->{'scheme'}) |
| @@ -978,6 +1008,12 @@ class Link { | ||
| 978 | 1008 | * @throws Exception |
| 979 | 1009 | */ |
| 980 | 1010 | public static function from(stdClass $obj): Link { |
| 1011 | + if (!property_exists($obj, 'note')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'url')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 981 | 1017 | return new Link( |
| 982 | 1018 | Link::fromNote($obj->{'note'}) |
| 983 | 1019 | ,Link::fromURL($obj->{'url'}) |
| @@ -1205,6 +1241,12 @@ class OtherName { | ||
| 1205 | 1241 | * @throws Exception |
| 1206 | 1242 | */ |
| 1207 | 1243 | public static function from(stdClass $obj): OtherName { |
| 1244 | + if (!property_exists($obj, 'name')) { | |
| 1245 | + throw new Exception("Missing required property"); | |
| 1246 | + } | |
| 1247 | + if (!property_exists($obj, 'note')) { | |
| 1248 | + throw new Exception("Missing required property"); | |
| 1249 | + } | |
| 1208 | 1250 | return new OtherName( |
| 1209 | 1251 | OtherName::fromName($obj->{'name'}) |
| 1210 | 1252 | ,OtherName::fromNote($obj->{'note'}) |
| @@ -1411,6 +1453,15 @@ class Text { | ||
| 1411 | 1453 | * @throws Exception |
| 1412 | 1454 | */ |
| 1413 | 1455 | public static function from(stdClass $obj): Text { |
| 1456 | + if (!property_exists($obj, 'media_type')) { | |
| 1457 | + throw new Exception("Missing required property"); | |
| 1458 | + } | |
| 1459 | + if (!property_exists($obj, 'title')) { | |
| 1460 | + throw new Exception("Missing required property"); | |
| 1461 | + } | |
| 1462 | + if (!property_exists($obj, 'url')) { | |
| 1463 | + throw new Exception("Missing required property"); | |
| 1464 | + } | |
| 1414 | 1465 | return new Text( |
| 1415 | 1466 | Text::fromMediaType($obj->{'media_type'}) |
| 1416 | 1467 | ,Text::fromTitle($obj->{'title'}) |
Test case
1 generated file · +24 −0test/inputs/json/misc/112b5.json
Mphpdefault / TopLevel.php+24 −0
| @@ -242,6 +242,18 @@ class TopLevel { | ||
| 242 | 242 | * @throws Exception |
| 243 | 243 | */ |
| 244 | 244 | public static function from(stdClass $obj): TopLevel { |
| 245 | + if (!property_exists($obj, 'args')) { | |
| 246 | + throw new Exception("Missing required property"); | |
| 247 | + } | |
| 248 | + if (!property_exists($obj, 'headers')) { | |
| 249 | + throw new Exception("Missing required property"); | |
| 250 | + } | |
| 251 | + if (!property_exists($obj, 'origin')) { | |
| 252 | + throw new Exception("Missing required property"); | |
| 253 | + } | |
| 254 | + if (!property_exists($obj, 'url')) { | |
| 255 | + throw new Exception("Missing required property"); | |
| 256 | + } | |
| 245 | 257 | return new TopLevel( |
| 246 | 258 | TopLevel::fromArgs($obj->{'args'}) |
| 247 | 259 | ,TopLevel::fromHeaders($obj->{'headers'}) |
| @@ -547,6 +559,18 @@ class Headers { | ||
| 547 | 559 | * @throws Exception |
| 548 | 560 | */ |
| 549 | 561 | public static function from(stdClass $obj): Headers { |
| 562 | + if (!property_exists($obj, 'Accept-Encoding')) { | |
| 563 | + throw new Exception("Missing required property"); | |
| 564 | + } | |
| 565 | + if (!property_exists($obj, 'Connection')) { | |
| 566 | + throw new Exception("Missing required property"); | |
| 567 | + } | |
| 568 | + if (!property_exists($obj, 'Host')) { | |
| 569 | + throw new Exception("Missing required property"); | |
| 570 | + } | |
| 571 | + if (!property_exists($obj, 'User-Agent')) { | |
| 572 | + throw new Exception("Missing required property"); | |
| 573 | + } | |
| 550 | 574 | return new Headers( |
| 551 | 575 | Headers::fromAcceptEncoding($obj->{'Accept-Encoding'}) |
| 552 | 576 | ,Headers::fromConnection($obj->{'Connection'}) |
Test case
1 generated file · +204 −0test/inputs/json/misc/127a1.json
Mphpdefault / TopLevel.php+204 −0
| @@ -202,6 +202,15 @@ class TopLevel { | ||
| 202 | 202 | * @throws Exception |
| 203 | 203 | */ |
| 204 | 204 | public static function from(stdClass $obj): TopLevel { |
| 205 | + if (!property_exists($obj, 'data')) { | |
| 206 | + throw new Exception("Missing required property"); | |
| 207 | + } | |
| 208 | + if (!property_exists($obj, 'meta')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'pagination')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 205 | 214 | return new TopLevel( |
| 206 | 215 | TopLevel::fromData($obj->{'data'}) |
| 207 | 216 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -1203,6 +1212,57 @@ class Datum { | ||
| 1203 | 1212 | * @throws Exception |
| 1204 | 1213 | */ |
| 1205 | 1214 | public static function from(stdClass $obj): Datum { |
| 1215 | + if (!property_exists($obj, 'bitly_gif_url')) { | |
| 1216 | + throw new Exception("Missing required property"); | |
| 1217 | + } | |
| 1218 | + if (!property_exists($obj, 'bitly_url')) { | |
| 1219 | + throw new Exception("Missing required property"); | |
| 1220 | + } | |
| 1221 | + if (!property_exists($obj, 'content_url')) { | |
| 1222 | + throw new Exception("Missing required property"); | |
| 1223 | + } | |
| 1224 | + if (!property_exists($obj, 'embed_url')) { | |
| 1225 | + throw new Exception("Missing required property"); | |
| 1226 | + } | |
| 1227 | + if (!property_exists($obj, 'id')) { | |
| 1228 | + throw new Exception("Missing required property"); | |
| 1229 | + } | |
| 1230 | + if (!property_exists($obj, 'images')) { | |
| 1231 | + throw new Exception("Missing required property"); | |
| 1232 | + } | |
| 1233 | + if (!property_exists($obj, 'import_datetime')) { | |
| 1234 | + throw new Exception("Missing required property"); | |
| 1235 | + } | |
| 1236 | + if (!property_exists($obj, 'is_indexable')) { | |
| 1237 | + throw new Exception("Missing required property"); | |
| 1238 | + } | |
| 1239 | + if (!property_exists($obj, 'rating')) { | |
| 1240 | + throw new Exception("Missing required property"); | |
| 1241 | + } | |
| 1242 | + if (!property_exists($obj, 'slug')) { | |
| 1243 | + throw new Exception("Missing required property"); | |
| 1244 | + } | |
| 1245 | + if (!property_exists($obj, 'source')) { | |
| 1246 | + throw new Exception("Missing required property"); | |
| 1247 | + } | |
| 1248 | + if (!property_exists($obj, 'source_post_url')) { | |
| 1249 | + throw new Exception("Missing required property"); | |
| 1250 | + } | |
| 1251 | + if (!property_exists($obj, 'source_tld')) { | |
| 1252 | + throw new Exception("Missing required property"); | |
| 1253 | + } | |
| 1254 | + if (!property_exists($obj, 'trending_datetime')) { | |
| 1255 | + throw new Exception("Missing required property"); | |
| 1256 | + } | |
| 1257 | + if (!property_exists($obj, 'type')) { | |
| 1258 | + throw new Exception("Missing required property"); | |
| 1259 | + } | |
| 1260 | + if (!property_exists($obj, 'url')) { | |
| 1261 | + throw new Exception("Missing required property"); | |
| 1262 | + } | |
| 1263 | + if (!property_exists($obj, 'username')) { | |
| 1264 | + throw new Exception("Missing required property"); | |
| 1265 | + } | |
| 1206 | 1266 | return new Datum( |
| 1207 | 1267 | Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'}) |
| 1208 | 1268 | ,Datum::fromBitlyURL($obj->{'bitly_url'}) |
| @@ -2512,6 +2572,72 @@ class Images { | ||
| 2512 | 2572 | * @throws Exception |
| 2513 | 2573 | */ |
| 2514 | 2574 | public static function from(stdClass $obj): Images { |
| 2575 | + if (!property_exists($obj, 'downsized')) { | |
| 2576 | + throw new Exception("Missing required property"); | |
| 2577 | + } | |
| 2578 | + if (!property_exists($obj, 'downsized_large')) { | |
| 2579 | + throw new Exception("Missing required property"); | |
| 2580 | + } | |
| 2581 | + if (!property_exists($obj, 'downsized_medium')) { | |
| 2582 | + throw new Exception("Missing required property"); | |
| 2583 | + } | |
| 2584 | + if (!property_exists($obj, 'downsized_small')) { | |
| 2585 | + throw new Exception("Missing required property"); | |
| 2586 | + } | |
| 2587 | + if (!property_exists($obj, 'downsized_still')) { | |
| 2588 | + throw new Exception("Missing required property"); | |
| 2589 | + } | |
| 2590 | + if (!property_exists($obj, 'fixed_height')) { | |
| 2591 | + throw new Exception("Missing required property"); | |
| 2592 | + } | |
| 2593 | + if (!property_exists($obj, 'fixed_height_downsampled')) { | |
| 2594 | + throw new Exception("Missing required property"); | |
| 2595 | + } | |
| 2596 | + if (!property_exists($obj, 'fixed_height_small')) { | |
| 2597 | + throw new Exception("Missing required property"); | |
| 2598 | + } | |
| 2599 | + if (!property_exists($obj, 'fixed_height_small_still')) { | |
| 2600 | + throw new Exception("Missing required property"); | |
| 2601 | + } | |
| 2602 | + if (!property_exists($obj, 'fixed_height_still')) { | |
| 2603 | + throw new Exception("Missing required property"); | |
| 2604 | + } | |
| 2605 | + if (!property_exists($obj, 'fixed_width')) { | |
| 2606 | + throw new Exception("Missing required property"); | |
| 2607 | + } | |
| 2608 | + if (!property_exists($obj, 'fixed_width_downsampled')) { | |
| 2609 | + throw new Exception("Missing required property"); | |
| 2610 | + } | |
| 2611 | + if (!property_exists($obj, 'fixed_width_small')) { | |
| 2612 | + throw new Exception("Missing required property"); | |
| 2613 | + } | |
| 2614 | + if (!property_exists($obj, 'fixed_width_small_still')) { | |
| 2615 | + throw new Exception("Missing required property"); | |
| 2616 | + } | |
| 2617 | + if (!property_exists($obj, 'fixed_width_still')) { | |
| 2618 | + throw new Exception("Missing required property"); | |
| 2619 | + } | |
| 2620 | + if (!property_exists($obj, 'looping')) { | |
| 2621 | + throw new Exception("Missing required property"); | |
| 2622 | + } | |
| 2623 | + if (!property_exists($obj, 'original')) { | |
| 2624 | + throw new Exception("Missing required property"); | |
| 2625 | + } | |
| 2626 | + if (!property_exists($obj, 'original_mp4')) { | |
| 2627 | + throw new Exception("Missing required property"); | |
| 2628 | + } | |
| 2629 | + if (!property_exists($obj, 'original_still')) { | |
| 2630 | + throw new Exception("Missing required property"); | |
| 2631 | + } | |
| 2632 | + if (!property_exists($obj, 'preview')) { | |
| 2633 | + throw new Exception("Missing required property"); | |
| 2634 | + } | |
| 2635 | + if (!property_exists($obj, 'preview_gif')) { | |
| 2636 | + throw new Exception("Missing required property"); | |
| 2637 | + } | |
| 2638 | + if (!property_exists($obj, 'preview_webp')) { | |
| 2639 | + throw new Exception("Missing required property"); | |
| 2640 | + } | |
| 2515 | 2641 | return new Images( |
| 2516 | 2642 | Images::fromDownsized($obj->{'downsized'}) |
| 2517 | 2643 | ,Images::fromDownsizedLarge($obj->{'downsized_large'}) |
| @@ -2820,6 +2946,15 @@ class Downsized { | ||
| 2820 | 2946 | * @throws Exception |
| 2821 | 2947 | */ |
| 2822 | 2948 | public static function from(stdClass $obj): Downsized { |
| 2949 | + if (!property_exists($obj, 'height')) { | |
| 2950 | + throw new Exception("Missing required property"); | |
| 2951 | + } | |
| 2952 | + if (!property_exists($obj, 'url')) { | |
| 2953 | + throw new Exception("Missing required property"); | |
| 2954 | + } | |
| 2955 | + if (!property_exists($obj, 'width')) { | |
| 2956 | + throw new Exception("Missing required property"); | |
| 2957 | + } | |
| 2823 | 2958 | return new Downsized( |
| 2824 | 2959 | Downsized::fromHeight($obj->{'height'}) |
| 2825 | 2960 | ,Downsized::fromSize($obj->{'size'}) |
| @@ -3080,6 +3215,18 @@ class DownsizedSmall { | ||
| 3080 | 3215 | * @throws Exception |
| 3081 | 3216 | */ |
| 3082 | 3217 | public static function from(stdClass $obj): DownsizedSmall { |
| 3218 | + if (!property_exists($obj, 'height')) { | |
| 3219 | + throw new Exception("Missing required property"); | |
| 3220 | + } | |
| 3221 | + if (!property_exists($obj, 'mp4')) { | |
| 3222 | + throw new Exception("Missing required property"); | |
| 3223 | + } | |
| 3224 | + if (!property_exists($obj, 'mp4_size')) { | |
| 3225 | + throw new Exception("Missing required property"); | |
| 3226 | + } | |
| 3227 | + if (!property_exists($obj, 'width')) { | |
| 3228 | + throw new Exception("Missing required property"); | |
| 3229 | + } | |
| 3083 | 3230 | return new DownsizedSmall( |
| 3084 | 3231 | DownsizedSmall::fromHeight($obj->{'height'}) |
| 3085 | 3232 | ,DownsizedSmall::fromMp4($obj->{'mp4'}) |
| @@ -3692,6 +3839,24 @@ class FixedHeight { | ||
| 3692 | 3839 | * @throws Exception |
| 3693 | 3840 | */ |
| 3694 | 3841 | public static function from(stdClass $obj): FixedHeight { |
| 3842 | + if (!property_exists($obj, 'height')) { | |
| 3843 | + throw new Exception("Missing required property"); | |
| 3844 | + } | |
| 3845 | + if (!property_exists($obj, 'size')) { | |
| 3846 | + throw new Exception("Missing required property"); | |
| 3847 | + } | |
| 3848 | + if (!property_exists($obj, 'url')) { | |
| 3849 | + throw new Exception("Missing required property"); | |
| 3850 | + } | |
| 3851 | + if (!property_exists($obj, 'webp')) { | |
| 3852 | + throw new Exception("Missing required property"); | |
| 3853 | + } | |
| 3854 | + if (!property_exists($obj, 'webp_size')) { | |
| 3855 | + throw new Exception("Missing required property"); | |
| 3856 | + } | |
| 3857 | + if (!property_exists($obj, 'width')) { | |
| 3858 | + throw new Exception("Missing required property"); | |
| 3859 | + } | |
| 3695 | 3860 | return new FixedHeight( |
| 3696 | 3861 | FixedHeight::fromFrames($obj->{'frames'}) |
| 3697 | 3862 | ,FixedHeight::fromHash($obj->{'hash'}) |
| @@ -3860,6 +4025,12 @@ class Looping { | ||
| 3860 | 4025 | * @throws Exception |
| 3861 | 4026 | */ |
| 3862 | 4027 | public static function from(stdClass $obj): Looping { |
| 4028 | + if (!property_exists($obj, 'mp4')) { | |
| 4029 | + throw new Exception("Missing required property"); | |
| 4030 | + } | |
| 4031 | + if (!property_exists($obj, 'mp4_size')) { | |
| 4032 | + throw new Exception("Missing required property"); | |
| 4033 | + } | |
| 3863 | 4034 | return new Looping( |
| 3864 | 4035 | Looping::fromMp4($obj->{'mp4'}) |
| 3865 | 4036 | ,Looping::fromMp4Size($obj->{'mp4_size'}) |
| @@ -4321,6 +4492,21 @@ class User { | ||
| 4321 | 4492 | * @throws Exception |
| 4322 | 4493 | */ |
| 4323 | 4494 | public static function from(stdClass $obj): User { |
| 4495 | + if (!property_exists($obj, 'avatar_url')) { | |
| 4496 | + throw new Exception("Missing required property"); | |
| 4497 | + } | |
| 4498 | + if (!property_exists($obj, 'banner_url')) { | |
| 4499 | + throw new Exception("Missing required property"); | |
| 4500 | + } | |
| 4501 | + if (!property_exists($obj, 'display_name')) { | |
| 4502 | + throw new Exception("Missing required property"); | |
| 4503 | + } | |
| 4504 | + if (!property_exists($obj, 'profile_url')) { | |
| 4505 | + throw new Exception("Missing required property"); | |
| 4506 | + } | |
| 4507 | + if (!property_exists($obj, 'username')) { | |
| 4508 | + throw new Exception("Missing required property"); | |
| 4509 | + } | |
| 4324 | 4510 | return new User( |
| 4325 | 4511 | User::fromAvatarURL($obj->{'avatar_url'}) |
| 4326 | 4512 | ,User::fromBannerURL($obj->{'banner_url'}) |
| @@ -4590,6 +4776,15 @@ class Meta { | ||
| 4590 | 4776 | * @throws Exception |
| 4591 | 4777 | */ |
| 4592 | 4778 | public static function from(stdClass $obj): Meta { |
| 4779 | + if (!property_exists($obj, 'msg')) { | |
| 4780 | + throw new Exception("Missing required property"); | |
| 4781 | + } | |
| 4782 | + if (!property_exists($obj, 'response_id')) { | |
| 4783 | + throw new Exception("Missing required property"); | |
| 4784 | + } | |
| 4785 | + if (!property_exists($obj, 'status')) { | |
| 4786 | + throw new Exception("Missing required property"); | |
| 4787 | + } | |
| 4593 | 4788 | return new Meta( |
| 4594 | 4789 | Meta::fromMsg($obj->{'msg'}) |
| 4595 | 4790 | ,Meta::fromResponseID($obj->{'response_id'}) |
| @@ -4796,6 +4991,15 @@ class Pagination { | ||
| 4796 | 4991 | * @throws Exception |
| 4797 | 4992 | */ |
| 4798 | 4993 | public static function from(stdClass $obj): Pagination { |
| 4994 | + if (!property_exists($obj, 'count')) { | |
| 4995 | + throw new Exception("Missing required property"); | |
| 4996 | + } | |
| 4997 | + if (!property_exists($obj, 'offset')) { | |
| 4998 | + throw new Exception("Missing required property"); | |
| 4999 | + } | |
| 5000 | + if (!property_exists($obj, 'total_count')) { | |
| 5001 | + throw new Exception("Missing required property"); | |
| 5002 | + } | |
| 4799 | 5003 | return new Pagination( |
| 4800 | 5004 | Pagination::fromCount($obj->{'count'}) |
| 4801 | 5005 | ,Pagination::fromOffset($obj->{'offset'}) |
Test case
1 generated file · +48 −0test/inputs/json/misc/13d8d.json
Mphpdefault / TopLevel.php+48 −0
| @@ -502,6 +502,33 @@ class TopLevel { | ||
| 502 | 502 | * @throws Exception |
| 503 | 503 | */ |
| 504 | 504 | public static function from(stdClass $obj): TopLevel { |
| 505 | + if (!property_exists($obj, 'category')) { | |
| 506 | + throw new Exception("Missing required property"); | |
| 507 | + } | |
| 508 | + if (!property_exists($obj, 'context')) { | |
| 509 | + throw new Exception("Missing required property"); | |
| 510 | + } | |
| 511 | + if (!property_exists($obj, 'id')) { | |
| 512 | + throw new Exception("Missing required property"); | |
| 513 | + } | |
| 514 | + if (!property_exists($obj, 'location')) { | |
| 515 | + throw new Exception("Missing required property"); | |
| 516 | + } | |
| 517 | + if (!property_exists($obj, 'location_subtype')) { | |
| 518 | + throw new Exception("Missing required property"); | |
| 519 | + } | |
| 520 | + if (!property_exists($obj, 'location_type')) { | |
| 521 | + throw new Exception("Missing required property"); | |
| 522 | + } | |
| 523 | + if (!property_exists($obj, 'month')) { | |
| 524 | + throw new Exception("Missing required property"); | |
| 525 | + } | |
| 526 | + if (!property_exists($obj, 'outcome_status')) { | |
| 527 | + throw new Exception("Missing required property"); | |
| 528 | + } | |
| 529 | + if (!property_exists($obj, 'persistent_id')) { | |
| 530 | + throw new Exception("Missing required property"); | |
| 531 | + } | |
| 505 | 532 | return new TopLevel( |
| 506 | 533 | TopLevel::fromCategory($obj->{'category'}) |
| 507 | 534 | ,TopLevel::fromContext($obj->{'context'}) |
| @@ -721,6 +748,15 @@ class Location { | ||
| 721 | 748 | * @throws Exception |
| 722 | 749 | */ |
| 723 | 750 | public static function from(stdClass $obj): Location { |
| 751 | + if (!property_exists($obj, 'latitude')) { | |
| 752 | + throw new Exception("Missing required property"); | |
| 753 | + } | |
| 754 | + if (!property_exists($obj, 'longitude')) { | |
| 755 | + throw new Exception("Missing required property"); | |
| 756 | + } | |
| 757 | + if (!property_exists($obj, 'street')) { | |
| 758 | + throw new Exception("Missing required property"); | |
| 759 | + } | |
| 724 | 760 | return new Location( |
| 725 | 761 | Location::fromLatitude($obj->{'latitude'}) |
| 726 | 762 | ,Location::fromLongitude($obj->{'longitude'}) |
| @@ -875,6 +911,12 @@ class Street { | ||
| 875 | 911 | * @throws Exception |
| 876 | 912 | */ |
| 877 | 913 | public static function from(stdClass $obj): Street { |
| 914 | + if (!property_exists($obj, 'id')) { | |
| 915 | + throw new Exception("Missing required property"); | |
| 916 | + } | |
| 917 | + if (!property_exists($obj, 'name')) { | |
| 918 | + throw new Exception("Missing required property"); | |
| 919 | + } | |
| 878 | 920 | return new Street( |
| 879 | 921 | Street::fromID($obj->{'id'}) |
| 880 | 922 | ,Street::fromName($obj->{'name'}) |
| @@ -1027,6 +1069,12 @@ class OutcomeStatus { | ||
| 1027 | 1069 | * @throws Exception |
| 1028 | 1070 | */ |
| 1029 | 1071 | public static function from(stdClass $obj): OutcomeStatus { |
| 1072 | + if (!property_exists($obj, 'category')) { | |
| 1073 | + throw new Exception("Missing required property"); | |
| 1074 | + } | |
| 1075 | + if (!property_exists($obj, 'date')) { | |
| 1076 | + throw new Exception("Missing required property"); | |
| 1077 | + } | |
| 1030 | 1078 | return new OutcomeStatus( |
| 1031 | 1079 | OutcomeStatus::fromCategory($obj->{'category'}) |
| 1032 | 1080 | ,OutcomeStatus::fromDate($obj->{'date'}) |
Test case
1 generated file · +15 −0test/inputs/json/misc/14d38.json
Mphpdefault / TopLevel.php+15 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'headers')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromHeaders($obj->{'headers'}) |
| 90 | 93 | ); |
| @@ -339,6 +342,18 @@ class Headers { | ||
| 339 | 342 | * @throws Exception |
| 340 | 343 | */ |
| 341 | 344 | public static function from(stdClass $obj): Headers { |
| 345 | + if (!property_exists($obj, 'Accept-Encoding')) { | |
| 346 | + throw new Exception("Missing required property"); | |
| 347 | + } | |
| 348 | + if (!property_exists($obj, 'Connection')) { | |
| 349 | + throw new Exception("Missing required property"); | |
| 350 | + } | |
| 351 | + if (!property_exists($obj, 'Host')) { | |
| 352 | + throw new Exception("Missing required property"); | |
| 353 | + } | |
| 354 | + if (!property_exists($obj, 'User-Agent')) { | |
| 355 | + throw new Exception("Missing required property"); | |
| 356 | + } | |
| 342 | 357 | return new Headers( |
| 343 | 358 | Headers::fromAcceptEncoding($obj->{'Accept-Encoding'}) |
| 344 | 359 | ,Headers::fromConnection($obj->{'Connection'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/167d6.json
Mphpdefault / TopLevel.php+9 −0
| @@ -205,6 +205,15 @@ class TopLevel { | ||
| 205 | 205 | * @throws Exception |
| 206 | 206 | */ |
| 207 | 207 | public static function from(stdClass $obj): TopLevel { |
| 208 | + if (!property_exists($obj, 'base')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'date')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 214 | + if (!property_exists($obj, 'rates')) { | |
| 215 | + throw new Exception("Missing required property"); | |
| 216 | + } | |
| 208 | 217 | return new TopLevel( |
| 209 | 218 | TopLevel::fromBase($obj->{'base'}) |
| 210 | 219 | ,TopLevel::fromDate($obj->{'date'}) |
Test case
1 generated file · +180 −0test/inputs/json/misc/16bc5.json
Mphpdefault / TopLevel.php+180 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'query')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromQuery($obj->{'query'}) |
| 90 | 93 | ); |
| @@ -347,6 +350,18 @@ class Query { | ||
| 347 | 350 | * @throws Exception |
| 348 | 351 | */ |
| 349 | 352 | public static function from(stdClass $obj): Query { |
| 353 | + if (!property_exists($obj, 'count')) { | |
| 354 | + throw new Exception("Missing required property"); | |
| 355 | + } | |
| 356 | + if (!property_exists($obj, 'created')) { | |
| 357 | + throw new Exception("Missing required property"); | |
| 358 | + } | |
| 359 | + if (!property_exists($obj, 'lang')) { | |
| 360 | + throw new Exception("Missing required property"); | |
| 361 | + } | |
| 362 | + if (!property_exists($obj, 'results')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 350 | 365 | return new Query( |
| 351 | 366 | Query::fromCount($obj->{'count'}) |
| 352 | 367 | ,Query::fromCreated($obj->{'created'}) |
| @@ -452,6 +467,9 @@ class Results { | ||
| 452 | 467 | * @throws Exception |
| 453 | 468 | */ |
| 454 | 469 | public static function from(stdClass $obj): Results { |
| 470 | + if (!property_exists($obj, 'channel')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 455 | 473 | return new Results( |
| 456 | 474 | Results::fromChannel($obj->{'channel'}) |
| 457 | 475 | ); |
| @@ -1181,6 +1199,45 @@ class Channel { | ||
| 1181 | 1199 | * @throws Exception |
| 1182 | 1200 | */ |
| 1183 | 1201 | public static function from(stdClass $obj): Channel { |
| 1202 | + if (!property_exists($obj, 'astronomy')) { | |
| 1203 | + throw new Exception("Missing required property"); | |
| 1204 | + } | |
| 1205 | + if (!property_exists($obj, 'atmosphere')) { | |
| 1206 | + throw new Exception("Missing required property"); | |
| 1207 | + } | |
| 1208 | + if (!property_exists($obj, 'description')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'image')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1214 | + if (!property_exists($obj, 'item')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'language')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'lastBuildDate')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'link')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'location')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'title')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'ttl')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'units')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'wind')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1184 | 1241 | return new Channel( |
| 1185 | 1242 | Channel::fromAstronomy($obj->{'astronomy'}) |
| 1186 | 1243 | ,Channel::fromAtmosphere($obj->{'atmosphere'}) |
| @@ -1355,6 +1412,12 @@ class Astronomy { | ||
| 1355 | 1412 | * @throws Exception |
| 1356 | 1413 | */ |
| 1357 | 1414 | public static function from(stdClass $obj): Astronomy { |
| 1415 | + if (!property_exists($obj, 'sunrise')) { | |
| 1416 | + throw new Exception("Missing required property"); | |
| 1417 | + } | |
| 1418 | + if (!property_exists($obj, 'sunset')) { | |
| 1419 | + throw new Exception("Missing required property"); | |
| 1420 | + } | |
| 1358 | 1421 | return new Astronomy( |
| 1359 | 1422 | Astronomy::fromSunrise($obj->{'sunrise'}) |
| 1360 | 1423 | ,Astronomy::fromSunset($obj->{'sunset'}) |
| @@ -1611,6 +1674,18 @@ class Atmosphere { | ||
| 1611 | 1674 | * @throws Exception |
| 1612 | 1675 | */ |
| 1613 | 1676 | public static function from(stdClass $obj): Atmosphere { |
| 1677 | + if (!property_exists($obj, 'humidity')) { | |
| 1678 | + throw new Exception("Missing required property"); | |
| 1679 | + } | |
| 1680 | + if (!property_exists($obj, 'pressure')) { | |
| 1681 | + throw new Exception("Missing required property"); | |
| 1682 | + } | |
| 1683 | + if (!property_exists($obj, 'rising')) { | |
| 1684 | + throw new Exception("Missing required property"); | |
| 1685 | + } | |
| 1686 | + if (!property_exists($obj, 'visibility')) { | |
| 1687 | + throw new Exception("Missing required property"); | |
| 1688 | + } | |
| 1614 | 1689 | return new Atmosphere( |
| 1615 | 1690 | Atmosphere::fromHumidity($obj->{'humidity'}) |
| 1616 | 1691 | ,Atmosphere::fromPressure($obj->{'pressure'}) |
| @@ -1923,6 +1998,21 @@ class Image { | ||
| 1923 | 1998 | * @throws Exception |
| 1924 | 1999 | */ |
| 1925 | 2000 | public static function from(stdClass $obj): Image { |
| 2001 | + if (!property_exists($obj, 'height')) { | |
| 2002 | + throw new Exception("Missing required property"); | |
| 2003 | + } | |
| 2004 | + if (!property_exists($obj, 'link')) { | |
| 2005 | + throw new Exception("Missing required property"); | |
| 2006 | + } | |
| 2007 | + if (!property_exists($obj, 'title')) { | |
| 2008 | + throw new Exception("Missing required property"); | |
| 2009 | + } | |
| 2010 | + if (!property_exists($obj, 'url')) { | |
| 2011 | + throw new Exception("Missing required property"); | |
| 2012 | + } | |
| 2013 | + if (!property_exists($obj, 'width')) { | |
| 2014 | + throw new Exception("Missing required property"); | |
| 2015 | + } | |
| 1926 | 2016 | return new Image( |
| 1927 | 2017 | Image::fromHeight($obj->{'height'}) |
| 1928 | 2018 | ,Image::fromLink($obj->{'link'}) |
| @@ -2459,6 +2549,33 @@ class Item { | ||
| 2459 | 2549 | * @throws Exception |
| 2460 | 2550 | */ |
| 2461 | 2551 | public static function from(stdClass $obj): Item { |
| 2552 | + if (!property_exists($obj, 'condition')) { | |
| 2553 | + throw new Exception("Missing required property"); | |
| 2554 | + } | |
| 2555 | + if (!property_exists($obj, 'description')) { | |
| 2556 | + throw new Exception("Missing required property"); | |
| 2557 | + } | |
| 2558 | + if (!property_exists($obj, 'forecast')) { | |
| 2559 | + throw new Exception("Missing required property"); | |
| 2560 | + } | |
| 2561 | + if (!property_exists($obj, 'guid')) { | |
| 2562 | + throw new Exception("Missing required property"); | |
| 2563 | + } | |
| 2564 | + if (!property_exists($obj, 'lat')) { | |
| 2565 | + throw new Exception("Missing required property"); | |
| 2566 | + } | |
| 2567 | + if (!property_exists($obj, 'link')) { | |
| 2568 | + throw new Exception("Missing required property"); | |
| 2569 | + } | |
| 2570 | + if (!property_exists($obj, 'long')) { | |
| 2571 | + throw new Exception("Missing required property"); | |
| 2572 | + } | |
| 2573 | + if (!property_exists($obj, 'pubDate')) { | |
| 2574 | + throw new Exception("Missing required property"); | |
| 2575 | + } | |
| 2576 | + if (!property_exists($obj, 'title')) { | |
| 2577 | + throw new Exception("Missing required property"); | |
| 2578 | + } | |
| 2462 | 2579 | return new Item( |
| 2463 | 2580 | Item::fromCondition($obj->{'condition'}) |
| 2464 | 2581 | ,Item::fromDescription($obj->{'description'}) |
| @@ -2729,6 +2846,18 @@ class Condition { | ||
| 2729 | 2846 | * @throws Exception |
| 2730 | 2847 | */ |
| 2731 | 2848 | public static function from(stdClass $obj): Condition { |
| 2849 | + if (!property_exists($obj, 'code')) { | |
| 2850 | + throw new Exception("Missing required property"); | |
| 2851 | + } | |
| 2852 | + if (!property_exists($obj, 'date')) { | |
| 2853 | + throw new Exception("Missing required property"); | |
| 2854 | + } | |
| 2855 | + if (!property_exists($obj, 'temp')) { | |
| 2856 | + throw new Exception("Missing required property"); | |
| 2857 | + } | |
| 2858 | + if (!property_exists($obj, 'text')) { | |
| 2859 | + throw new Exception("Missing required property"); | |
| 2860 | + } | |
| 2732 | 2861 | return new Condition( |
| 2733 | 2862 | Condition::fromCode($obj->{'code'}) |
| 2734 | 2863 | ,Condition::fromDate($obj->{'date'}) |
| @@ -3093,6 +3222,24 @@ class Forecast { | ||
| 3093 | 3222 | * @throws Exception |
| 3094 | 3223 | */ |
| 3095 | 3224 | public static function from(stdClass $obj): Forecast { |
| 3225 | + if (!property_exists($obj, 'code')) { | |
| 3226 | + throw new Exception("Missing required property"); | |
| 3227 | + } | |
| 3228 | + if (!property_exists($obj, 'date')) { | |
| 3229 | + throw new Exception("Missing required property"); | |
| 3230 | + } | |
| 3231 | + if (!property_exists($obj, 'day')) { | |
| 3232 | + throw new Exception("Missing required property"); | |
| 3233 | + } | |
| 3234 | + if (!property_exists($obj, 'high')) { | |
| 3235 | + throw new Exception("Missing required property"); | |
| 3236 | + } | |
| 3237 | + if (!property_exists($obj, 'low')) { | |
| 3238 | + throw new Exception("Missing required property"); | |
| 3239 | + } | |
| 3240 | + if (!property_exists($obj, 'text')) { | |
| 3241 | + throw new Exception("Missing required property"); | |
| 3242 | + } | |
| 3096 | 3243 | return new Forecast( |
| 3097 | 3244 | Forecast::fromCode($obj->{'code'}) |
| 3098 | 3245 | ,Forecast::fromDate($obj->{'date'}) |
| @@ -3201,6 +3348,9 @@ class GUID { | ||
| 3201 | 3348 | * @throws Exception |
| 3202 | 3349 | */ |
| 3203 | 3350 | public static function from(stdClass $obj): GUID { |
| 3351 | + if (!property_exists($obj, 'isPermaLink')) { | |
| 3352 | + throw new Exception("Missing required property"); | |
| 3353 | + } | |
| 3204 | 3354 | return new GUID( |
| 3205 | 3355 | GUID::fromIsPermaLink($obj->{'isPermaLink'}) |
| 3206 | 3356 | ); |
| @@ -3403,6 +3553,15 @@ class Location { | ||
| 3403 | 3553 | * @throws Exception |
| 3404 | 3554 | */ |
| 3405 | 3555 | public static function from(stdClass $obj): Location { |
| 3556 | + if (!property_exists($obj, 'city')) { | |
| 3557 | + throw new Exception("Missing required property"); | |
| 3558 | + } | |
| 3559 | + if (!property_exists($obj, 'country')) { | |
| 3560 | + throw new Exception("Missing required property"); | |
| 3561 | + } | |
| 3562 | + if (!property_exists($obj, 'region')) { | |
| 3563 | + throw new Exception("Missing required property"); | |
| 3564 | + } | |
| 3406 | 3565 | return new Location( |
| 3407 | 3566 | Location::fromCity($obj->{'city'}) |
| 3408 | 3567 | ,Location::fromCountry($obj->{'country'}) |
| @@ -3661,6 +3820,18 @@ class Units { | ||
| 3661 | 3820 | * @throws Exception |
| 3662 | 3821 | */ |
| 3663 | 3822 | public static function from(stdClass $obj): Units { |
| 3823 | + if (!property_exists($obj, 'distance')) { | |
| 3824 | + throw new Exception("Missing required property"); | |
| 3825 | + } | |
| 3826 | + if (!property_exists($obj, 'pressure')) { | |
| 3827 | + throw new Exception("Missing required property"); | |
| 3828 | + } | |
| 3829 | + if (!property_exists($obj, 'speed')) { | |
| 3830 | + throw new Exception("Missing required property"); | |
| 3831 | + } | |
| 3832 | + if (!property_exists($obj, 'temperature')) { | |
| 3833 | + throw new Exception("Missing required property"); | |
| 3834 | + } | |
| 3664 | 3835 | return new Units( |
| 3665 | 3836 | Units::fromDistance($obj->{'distance'}) |
| 3666 | 3837 | ,Units::fromPressure($obj->{'pressure'}) |
| @@ -3869,6 +4040,15 @@ class Wind { | ||
| 3869 | 4040 | * @throws Exception |
| 3870 | 4041 | */ |
| 3871 | 4042 | public static function from(stdClass $obj): Wind { |
| 4043 | + if (!property_exists($obj, 'chill')) { | |
| 4044 | + throw new Exception("Missing required property"); | |
| 4045 | + } | |
| 4046 | + if (!property_exists($obj, 'direction')) { | |
| 4047 | + throw new Exception("Missing required property"); | |
| 4048 | + } | |
| 4049 | + if (!property_exists($obj, 'speed')) { | |
| 4050 | + throw new Exception("Missing required property"); | |
| 4051 | + } | |
| 3872 | 4052 | return new Wind( |
| 3873 | 4053 | Wind::fromChill($obj->{'chill'}) |
| 3874 | 4054 | ,Wind::fromDirection($obj->{'direction'}) |
Test case
1 generated file · +36 −0test/inputs/json/misc/176f1.json
Mphpdefault / TopLevel.php+36 −0
| @@ -252,6 +252,18 @@ class TopLevel { | ||
| 252 | 252 | * @throws Exception |
| 253 | 253 | */ |
| 254 | 254 | public static function from(stdClass $obj): TopLevel { |
| 255 | + if (!property_exists($obj, 'message')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 258 | + if (!property_exists($obj, 'responseTime')) { | |
| 259 | + throw new Exception("Missing required property"); | |
| 260 | + } | |
| 261 | + if (!property_exists($obj, 'Results')) { | |
| 262 | + throw new Exception("Missing required property"); | |
| 263 | + } | |
| 264 | + if (!property_exists($obj, 'status')) { | |
| 265 | + throw new Exception("Missing required property"); | |
| 266 | + } | |
| 255 | 267 | return new TopLevel( |
| 256 | 268 | TopLevel::fromMessage($obj->{'message'}) |
| 257 | 269 | ,TopLevel::fromResponseTime($obj->{'responseTime'}) |
| @@ -368,6 +380,9 @@ class Results { | ||
| 368 | 380 | * @throws Exception |
| 369 | 381 | */ |
| 370 | 382 | public static function from(stdClass $obj): Results { |
| 383 | + if (!property_exists($obj, 'series')) { | |
| 384 | + throw new Exception("Missing required property"); | |
| 385 | + } | |
| 371 | 386 | return new Results( |
| 372 | 387 | Results::fromSeries($obj->{'series'}) |
| 373 | 388 | ); |
| @@ -530,6 +545,12 @@ class Series { | ||
| 530 | 545 | * @throws Exception |
| 531 | 546 | */ |
| 532 | 547 | public static function from(stdClass $obj): Series { |
| 548 | + if (!property_exists($obj, 'data')) { | |
| 549 | + throw new Exception("Missing required property"); | |
| 550 | + } | |
| 551 | + if (!property_exists($obj, 'seriesID')) { | |
| 552 | + throw new Exception("Missing required property"); | |
| 553 | + } | |
| 533 | 554 | return new Series( |
| 534 | 555 | Series::fromData($obj->{'data'}) |
| 535 | 556 | ,Series::fromSeriesID($obj->{'seriesID'}) |
| @@ -850,6 +871,21 @@ class Datum { | ||
| 850 | 871 | * @throws Exception |
| 851 | 872 | */ |
| 852 | 873 | public static function from(stdClass $obj): Datum { |
| 874 | + if (!property_exists($obj, 'footnotes')) { | |
| 875 | + throw new Exception("Missing required property"); | |
| 876 | + } | |
| 877 | + if (!property_exists($obj, 'period')) { | |
| 878 | + throw new Exception("Missing required property"); | |
| 879 | + } | |
| 880 | + if (!property_exists($obj, 'periodName')) { | |
| 881 | + throw new Exception("Missing required property"); | |
| 882 | + } | |
| 883 | + if (!property_exists($obj, 'value')) { | |
| 884 | + throw new Exception("Missing required property"); | |
| 885 | + } | |
| 886 | + if (!property_exists($obj, 'year')) { | |
| 887 | + throw new Exception("Missing required property"); | |
| 888 | + } | |
| 853 | 889 | return new Datum( |
| 854 | 890 | Datum::fromFootnotes($obj->{'footnotes'}) |
| 855 | 891 | ,Datum::fromPeriod($obj->{'period'}) |
Test case
1 generated file · +18 −0test/inputs/json/misc/1a7f5.json
Mphpdefault / TopLevel.php+18 −0
| @@ -345,6 +345,24 @@ class TopLevel { | ||
| 345 | 345 | * @throws Exception |
| 346 | 346 | */ |
| 347 | 347 | public static function from(stdClass $obj): TopLevel { |
| 348 | + if (!property_exists($obj, 'age')) { | |
| 349 | + throw new Exception("Missing required property"); | |
| 350 | + } | |
| 351 | + if (!property_exists($obj, 'country')) { | |
| 352 | + throw new Exception("Missing required property"); | |
| 353 | + } | |
| 354 | + if (!property_exists($obj, 'females')) { | |
| 355 | + throw new Exception("Missing required property"); | |
| 356 | + } | |
| 357 | + if (!property_exists($obj, 'males')) { | |
| 358 | + throw new Exception("Missing required property"); | |
| 359 | + } | |
| 360 | + if (!property_exists($obj, 'total')) { | |
| 361 | + throw new Exception("Missing required property"); | |
| 362 | + } | |
| 363 | + if (!property_exists($obj, 'year')) { | |
| 364 | + throw new Exception("Missing required property"); | |
| 365 | + } | |
| 348 | 366 | return new TopLevel( |
| 349 | 367 | TopLevel::fromAge($obj->{'age'}) |
| 350 | 368 | ,TopLevel::fromCountry($obj->{'country'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/1b28c.json
Mphpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'total_population')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromTotalPopulation($obj->{'total_population'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class TotalPopulation { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): TotalPopulation { |
| 252 | + if (!property_exists($obj, 'date')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'population')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new TotalPopulation( |
| 250 | 259 | TotalPopulation::fromDate($obj->{'date'}) |
| 251 | 260 | ,TotalPopulation::fromPopulation($obj->{'population'}) |
Test case
1 generated file · +138 −0test/inputs/json/misc/1b409.json
Mphpdefault / TopLevel.php+138 −0
| @@ -149,6 +149,12 @@ class TopLevel { | ||
| 149 | 149 | * @throws Exception |
| 150 | 150 | */ |
| 151 | 151 | public static function from(stdClass $obj): TopLevel { |
| 152 | + if (!property_exists($obj, 'meta')) { | |
| 153 | + throw new Exception("Missing required property"); | |
| 154 | + } | |
| 155 | + if (!property_exists($obj, 'objects')) { | |
| 156 | + throw new Exception("Missing required property"); | |
| 157 | + } | |
| 152 | 158 | return new TopLevel( |
| 153 | 159 | TopLevel::fromMeta($obj->{'meta'}) |
| 154 | 160 | ,TopLevel::fromObjects($obj->{'objects'}) |
| @@ -353,6 +359,15 @@ class Meta { | ||
| 353 | 359 | * @throws Exception |
| 354 | 360 | */ |
| 355 | 361 | public static function from(stdClass $obj): Meta { |
| 362 | + if (!property_exists($obj, 'limit')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 365 | + if (!property_exists($obj, 'offset')) { | |
| 366 | + throw new Exception("Missing required property"); | |
| 367 | + } | |
| 368 | + if (!property_exists($obj, 'total_count')) { | |
| 369 | + throw new Exception("Missing required property"); | |
| 370 | + } | |
| 356 | 371 | return new Meta( |
| 357 | 372 | Meta::fromLimit($obj->{'limit'}) |
| 358 | 373 | ,Meta::fromOffset($obj->{'offset'}) |
| @@ -1535,6 +1550,69 @@ class ObjectElement { | ||
| 1535 | 1550 | * @throws Exception |
| 1536 | 1551 | */ |
| 1537 | 1552 | public static function from(stdClass $obj): ObjectElement { |
| 1553 | + if (!property_exists($obj, 'caucus')) { | |
| 1554 | + throw new Exception("Missing required property"); | |
| 1555 | + } | |
| 1556 | + if (!property_exists($obj, 'congress_numbers')) { | |
| 1557 | + throw new Exception("Missing required property"); | |
| 1558 | + } | |
| 1559 | + if (!property_exists($obj, 'current')) { | |
| 1560 | + throw new Exception("Missing required property"); | |
| 1561 | + } | |
| 1562 | + if (!property_exists($obj, 'description')) { | |
| 1563 | + throw new Exception("Missing required property"); | |
| 1564 | + } | |
| 1565 | + if (!property_exists($obj, 'district')) { | |
| 1566 | + throw new Exception("Missing required property"); | |
| 1567 | + } | |
| 1568 | + if (!property_exists($obj, 'enddate')) { | |
| 1569 | + throw new Exception("Missing required property"); | |
| 1570 | + } | |
| 1571 | + if (!property_exists($obj, 'extra')) { | |
| 1572 | + throw new Exception("Missing required property"); | |
| 1573 | + } | |
| 1574 | + if (!property_exists($obj, 'id')) { | |
| 1575 | + throw new Exception("Missing required property"); | |
| 1576 | + } | |
| 1577 | + if (!property_exists($obj, 'leadership_title')) { | |
| 1578 | + throw new Exception("Missing required property"); | |
| 1579 | + } | |
| 1580 | + if (!property_exists($obj, 'party')) { | |
| 1581 | + throw new Exception("Missing required property"); | |
| 1582 | + } | |
| 1583 | + if (!property_exists($obj, 'person')) { | |
| 1584 | + throw new Exception("Missing required property"); | |
| 1585 | + } | |
| 1586 | + if (!property_exists($obj, 'phone')) { | |
| 1587 | + throw new Exception("Missing required property"); | |
| 1588 | + } | |
| 1589 | + if (!property_exists($obj, 'role_type')) { | |
| 1590 | + throw new Exception("Missing required property"); | |
| 1591 | + } | |
| 1592 | + if (!property_exists($obj, 'role_type_label')) { | |
| 1593 | + throw new Exception("Missing required property"); | |
| 1594 | + } | |
| 1595 | + if (!property_exists($obj, 'senator_class')) { | |
| 1596 | + throw new Exception("Missing required property"); | |
| 1597 | + } | |
| 1598 | + if (!property_exists($obj, 'senator_rank')) { | |
| 1599 | + throw new Exception("Missing required property"); | |
| 1600 | + } | |
| 1601 | + if (!property_exists($obj, 'startdate')) { | |
| 1602 | + throw new Exception("Missing required property"); | |
| 1603 | + } | |
| 1604 | + if (!property_exists($obj, 'state')) { | |
| 1605 | + throw new Exception("Missing required property"); | |
| 1606 | + } | |
| 1607 | + if (!property_exists($obj, 'title')) { | |
| 1608 | + throw new Exception("Missing required property"); | |
| 1609 | + } | |
| 1610 | + if (!property_exists($obj, 'title_long')) { | |
| 1611 | + throw new Exception("Missing required property"); | |
| 1612 | + } | |
| 1613 | + if (!property_exists($obj, 'website')) { | |
| 1614 | + throw new Exception("Missing required property"); | |
| 1615 | + } | |
| 1538 | 1616 | return new ObjectElement( |
| 1539 | 1617 | ObjectElement::fromCaucus($obj->{'caucus'}) |
| 1540 | 1618 | ,ObjectElement::fromCongressNumbers($obj->{'congress_numbers'}) |
| @@ -1911,6 +1989,12 @@ class Extra { | ||
| 1911 | 1989 | * @throws Exception |
| 1912 | 1990 | */ |
| 1913 | 1991 | public static function from(stdClass $obj): Extra { |
| 1992 | + if (!property_exists($obj, 'address')) { | |
| 1993 | + throw new Exception("Missing required property"); | |
| 1994 | + } | |
| 1995 | + if (!property_exists($obj, 'office')) { | |
| 1996 | + throw new Exception("Missing required property"); | |
| 1997 | + } | |
| 1914 | 1998 | return new Extra( |
| 1915 | 1999 | Extra::fromAddress($obj->{'address'}) |
| 1916 | 2000 | ,Extra::fromContactForm($obj->{'contact_form'}) |
| @@ -2983,6 +3067,60 @@ class Person { | ||
| 2983 | 3067 | * @throws Exception |
| 2984 | 3068 | */ |
| 2985 | 3069 | public static function from(stdClass $obj): Person { |
| 3070 | + if (!property_exists($obj, 'bioguideid')) { | |
| 3071 | + throw new Exception("Missing required property"); | |
| 3072 | + } | |
| 3073 | + if (!property_exists($obj, 'birthday')) { | |
| 3074 | + throw new Exception("Missing required property"); | |
| 3075 | + } | |
| 3076 | + if (!property_exists($obj, 'cspanid')) { | |
| 3077 | + throw new Exception("Missing required property"); | |
| 3078 | + } | |
| 3079 | + if (!property_exists($obj, 'firstname')) { | |
| 3080 | + throw new Exception("Missing required property"); | |
| 3081 | + } | |
| 3082 | + if (!property_exists($obj, 'gender')) { | |
| 3083 | + throw new Exception("Missing required property"); | |
| 3084 | + } | |
| 3085 | + if (!property_exists($obj, 'gender_label')) { | |
| 3086 | + throw new Exception("Missing required property"); | |
| 3087 | + } | |
| 3088 | + if (!property_exists($obj, 'id')) { | |
| 3089 | + throw new Exception("Missing required property"); | |
| 3090 | + } | |
| 3091 | + if (!property_exists($obj, 'lastname')) { | |
| 3092 | + throw new Exception("Missing required property"); | |
| 3093 | + } | |
| 3094 | + if (!property_exists($obj, 'link')) { | |
| 3095 | + throw new Exception("Missing required property"); | |
| 3096 | + } | |
| 3097 | + if (!property_exists($obj, 'middlename')) { | |
| 3098 | + throw new Exception("Missing required property"); | |
| 3099 | + } | |
| 3100 | + if (!property_exists($obj, 'name')) { | |
| 3101 | + throw new Exception("Missing required property"); | |
| 3102 | + } | |
| 3103 | + if (!property_exists($obj, 'namemod')) { | |
| 3104 | + throw new Exception("Missing required property"); | |
| 3105 | + } | |
| 3106 | + if (!property_exists($obj, 'nickname')) { | |
| 3107 | + throw new Exception("Missing required property"); | |
| 3108 | + } | |
| 3109 | + if (!property_exists($obj, 'osid')) { | |
| 3110 | + throw new Exception("Missing required property"); | |
| 3111 | + } | |
| 3112 | + if (!property_exists($obj, 'pvsid')) { | |
| 3113 | + throw new Exception("Missing required property"); | |
| 3114 | + } | |
| 3115 | + if (!property_exists($obj, 'sortname')) { | |
| 3116 | + throw new Exception("Missing required property"); | |
| 3117 | + } | |
| 3118 | + if (!property_exists($obj, 'twitterid')) { | |
| 3119 | + throw new Exception("Missing required property"); | |
| 3120 | + } | |
| 3121 | + if (!property_exists($obj, 'youtubeid')) { | |
| 3122 | + throw new Exception("Missing required property"); | |
| 3123 | + } | |
| 2986 | 3124 | return new Person( |
| 2987 | 3125 | Person::fromBioguideid($obj->{'bioguideid'}) |
| 2988 | 3126 | ,Person::fromBirthday($obj->{'birthday'}) |
Test case
1 generated file · +114 −0test/inputs/json/misc/2465e.json
Mphpdefault / TopLevel.php+114 −0
| @@ -479,6 +479,30 @@ class TopLevel { | ||
| 479 | 479 | * @throws Exception |
| 480 | 480 | */ |
| 481 | 481 | public static function from(stdClass $obj): TopLevel { |
| 482 | + if (!property_exists($obj, 'basePath')) { | |
| 483 | + throw new Exception("Missing required property"); | |
| 484 | + } | |
| 485 | + if (!property_exists($obj, 'definitions')) { | |
| 486 | + throw new Exception("Missing required property"); | |
| 487 | + } | |
| 488 | + if (!property_exists($obj, 'host')) { | |
| 489 | + throw new Exception("Missing required property"); | |
| 490 | + } | |
| 491 | + if (!property_exists($obj, 'info')) { | |
| 492 | + throw new Exception("Missing required property"); | |
| 493 | + } | |
| 494 | + if (!property_exists($obj, 'paths')) { | |
| 495 | + throw new Exception("Missing required property"); | |
| 496 | + } | |
| 497 | + if (!property_exists($obj, 'produces')) { | |
| 498 | + throw new Exception("Missing required property"); | |
| 499 | + } | |
| 500 | + if (!property_exists($obj, 'schemes')) { | |
| 501 | + throw new Exception("Missing required property"); | |
| 502 | + } | |
| 503 | + if (!property_exists($obj, 'swagger')) { | |
| 504 | + throw new Exception("Missing required property"); | |
| 505 | + } | |
| 482 | 506 | return new TopLevel( |
| 483 | 507 | TopLevel::fromBasePath($obj->{'basePath'}) |
| 484 | 508 | ,TopLevel::fromDefinitions($obj->{'definitions'}) |
| @@ -592,6 +616,9 @@ class Definitions { | ||
| 592 | 616 | * @throws Exception |
| 593 | 617 | */ |
| 594 | 618 | public static function from(stdClass $obj): Definitions { |
| 619 | + if (!property_exists($obj, 'Taxonomy')) { | |
| 620 | + throw new Exception("Missing required property"); | |
| 621 | + } | |
| 595 | 622 | return new Definitions( |
| 596 | 623 | Definitions::fromTaxonomy($obj->{'Taxonomy'}) |
| 597 | 624 | ); |
| @@ -691,6 +718,9 @@ class Taxonomy { | ||
| 691 | 718 | * @throws Exception |
| 692 | 719 | */ |
| 693 | 720 | public static function from(stdClass $obj): Taxonomy { |
| 721 | + if (!property_exists($obj, 'properties')) { | |
| 722 | + throw new Exception("Missing required property"); | |
| 723 | + } | |
| 694 | 724 | return new Taxonomy( |
| 695 | 725 | Taxonomy::fromProperties($obj->{'properties'}) |
| 696 | 726 | ); |
| @@ -1055,6 +1085,24 @@ class Properties { | ||
| 1055 | 1085 | * @throws Exception |
| 1056 | 1086 | */ |
| 1057 | 1087 | public static function from(stdClass $obj): Properties { |
| 1088 | + if (!property_exists($obj, 'annotations')) { | |
| 1089 | + throw new Exception("Missing required property"); | |
| 1090 | + } | |
| 1091 | + if (!property_exists($obj, 'datatype_properties')) { | |
| 1092 | + throw new Exception("Missing required property"); | |
| 1093 | + } | |
| 1094 | + if (!property_exists($obj, 'id')) { | |
| 1095 | + throw new Exception("Missing required property"); | |
| 1096 | + } | |
| 1097 | + if (!property_exists($obj, 'label')) { | |
| 1098 | + throw new Exception("Missing required property"); | |
| 1099 | + } | |
| 1100 | + if (!property_exists($obj, 'sub_class_of')) { | |
| 1101 | + throw new Exception("Missing required property"); | |
| 1102 | + } | |
| 1103 | + if (!property_exists($obj, 'type')) { | |
| 1104 | + throw new Exception("Missing required property"); | |
| 1105 | + } | |
| 1058 | 1106 | return new Properties( |
| 1059 | 1107 | Properties::fromAnnotations($obj->{'annotations'}) |
| 1060 | 1108 | ,Properties::fromDatatypeProperties($obj->{'datatype_properties'}) |
| @@ -1215,6 +1263,12 @@ class Annotations { | ||
| 1215 | 1263 | * @throws Exception |
| 1216 | 1264 | */ |
| 1217 | 1265 | public static function from(stdClass $obj): Annotations { |
| 1266 | + if (!property_exists($obj, 'description')) { | |
| 1267 | + throw new Exception("Missing required property"); | |
| 1268 | + } | |
| 1269 | + if (!property_exists($obj, 'type')) { | |
| 1270 | + throw new Exception("Missing required property"); | |
| 1271 | + } | |
| 1218 | 1272 | return new Annotations( |
| 1219 | 1273 | Annotations::fromDescription($obj->{'description'}) |
| 1220 | 1274 | ,Annotations::fromType($obj->{'type'}) |
| @@ -1419,6 +1473,15 @@ class Info { | ||
| 1419 | 1473 | * @throws Exception |
| 1420 | 1474 | */ |
| 1421 | 1475 | public static function from(stdClass $obj): Info { |
| 1476 | + if (!property_exists($obj, 'description')) { | |
| 1477 | + throw new Exception("Missing required property"); | |
| 1478 | + } | |
| 1479 | + if (!property_exists($obj, 'title')) { | |
| 1480 | + throw new Exception("Missing required property"); | |
| 1481 | + } | |
| 1482 | + if (!property_exists($obj, 'version')) { | |
| 1483 | + throw new Exception("Missing required property"); | |
| 1484 | + } | |
| 1422 | 1485 | return new Info( |
| 1423 | 1486 | Info::fromDescription($obj->{'description'}) |
| 1424 | 1487 | ,Info::fromTitle($obj->{'title'}) |
| @@ -1522,6 +1585,9 @@ class Paths { | ||
| 1522 | 1585 | * @throws Exception |
| 1523 | 1586 | */ |
| 1524 | 1587 | public static function from(stdClass $obj): Paths { |
| 1588 | + if (!property_exists($obj, '/ita_taxonomies/search')) { | |
| 1589 | + throw new Exception("Missing required property"); | |
| 1590 | + } | |
| 1525 | 1591 | return new Paths( |
| 1526 | 1592 | Paths::fromItaTaxonomiesSearch($obj->{'/ita_taxonomies/search'}) |
| 1527 | 1593 | ); |
| @@ -1621,6 +1687,9 @@ class ItaTaxonomiesSearch { | ||
| 1621 | 1687 | * @throws Exception |
| 1622 | 1688 | */ |
| 1623 | 1689 | public static function from(stdClass $obj): ItaTaxonomiesSearch { |
| 1690 | + if (!property_exists($obj, 'get')) { | |
| 1691 | + throw new Exception("Missing required property"); | |
| 1692 | + } | |
| 1624 | 1693 | return new ItaTaxonomiesSearch( |
| 1625 | 1694 | ItaTaxonomiesSearch::fromGet($obj->{'get'}) |
| 1626 | 1695 | ); |
| @@ -1954,6 +2023,21 @@ class Get { | ||
| 1954 | 2023 | * @throws Exception |
| 1955 | 2024 | */ |
| 1956 | 2025 | public static function from(stdClass $obj): Get { |
| 2026 | + if (!property_exists($obj, 'description')) { | |
| 2027 | + throw new Exception("Missing required property"); | |
| 2028 | + } | |
| 2029 | + if (!property_exists($obj, 'parameters')) { | |
| 2030 | + throw new Exception("Missing required property"); | |
| 2031 | + } | |
| 2032 | + if (!property_exists($obj, 'responses')) { | |
| 2033 | + throw new Exception("Missing required property"); | |
| 2034 | + } | |
| 2035 | + if (!property_exists($obj, 'summary')) { | |
| 2036 | + throw new Exception("Missing required property"); | |
| 2037 | + } | |
| 2038 | + if (!property_exists($obj, 'tags')) { | |
| 2039 | + throw new Exception("Missing required property"); | |
| 2040 | + } | |
| 1957 | 2041 | return new Get( |
| 1958 | 2042 | Get::fromDescription($obj->{'description'}) |
| 1959 | 2043 | ,Get::fromParameters($obj->{'parameters'}) |
| @@ -2320,6 +2404,24 @@ class Parameter { | ||
| 2320 | 2404 | * @throws Exception |
| 2321 | 2405 | */ |
| 2322 | 2406 | public static function from(stdClass $obj): Parameter { |
| 2407 | + if (!property_exists($obj, 'description')) { | |
| 2408 | + throw new Exception("Missing required property"); | |
| 2409 | + } | |
| 2410 | + if (!property_exists($obj, 'format')) { | |
| 2411 | + throw new Exception("Missing required property"); | |
| 2412 | + } | |
| 2413 | + if (!property_exists($obj, 'in')) { | |
| 2414 | + throw new Exception("Missing required property"); | |
| 2415 | + } | |
| 2416 | + if (!property_exists($obj, 'name')) { | |
| 2417 | + throw new Exception("Missing required property"); | |
| 2418 | + } | |
| 2419 | + if (!property_exists($obj, 'required')) { | |
| 2420 | + throw new Exception("Missing required property"); | |
| 2421 | + } | |
| 2422 | + if (!property_exists($obj, 'type')) { | |
| 2423 | + throw new Exception("Missing required property"); | |
| 2424 | + } | |
| 2323 | 2425 | return new Parameter( |
| 2324 | 2426 | Parameter::fromDescription($obj->{'description'}) |
| 2325 | 2427 | ,Parameter::fromFormat($obj->{'format'}) |
| @@ -2429,6 +2531,9 @@ class Responses { | ||
| 2429 | 2531 | * @throws Exception |
| 2430 | 2532 | */ |
| 2431 | 2533 | public static function from(stdClass $obj): Responses { |
| 2534 | + if (!property_exists($obj, '200')) { | |
| 2535 | + throw new Exception("Missing required property"); | |
| 2536 | + } | |
| 2432 | 2537 | return new Responses( |
| 2433 | 2538 | Responses::fromThe200($obj->{'200'}) |
| 2434 | 2539 | ); |
| @@ -2580,6 +2685,12 @@ class The200 { | ||
| 2580 | 2685 | * @throws Exception |
| 2581 | 2686 | */ |
| 2582 | 2687 | public static function from(stdClass $obj): The200 { |
| 2688 | + if (!property_exists($obj, 'description')) { | |
| 2689 | + throw new Exception("Missing required property"); | |
| 2690 | + } | |
| 2691 | + if (!property_exists($obj, 'schema')) { | |
| 2692 | + throw new Exception("Missing required property"); | |
| 2693 | + } | |
| 2583 | 2694 | return new The200( |
| 2584 | 2695 | The200::fromDescription($obj->{'description'}) |
| 2585 | 2696 | ,The200::fromSchema($obj->{'schema'}) |
| @@ -2680,6 +2791,9 @@ class Schema { | ||
| 2680 | 2791 | * @throws Exception |
| 2681 | 2792 | */ |
| 2682 | 2793 | public static function from(stdClass $obj): Schema { |
| 2794 | + if (!property_exists($obj, '$ref')) { | |
| 2795 | + throw new Exception("Missing required property"); | |
| 2796 | + } | |
| 2683 | 2797 | return new Schema( |
| 2684 | 2798 | Schema::fromRef($obj->{'$ref'}) |
| 2685 | 2799 | ); |
Test case
1 generated file · +75 −0test/inputs/json/misc/24f52.json
Mphpdefault / TopLevel.php+75 −0
| @@ -450,6 +450,30 @@ class TopLevel { | ||
| 450 | 450 | * @throws Exception |
| 451 | 451 | */ |
| 452 | 452 | public static function from(stdClass $obj): TopLevel { |
| 453 | + if (!property_exists($obj, 'city')) { | |
| 454 | + throw new Exception("Missing required property"); | |
| 455 | + } | |
| 456 | + if (!property_exists($obj, 'delay')) { | |
| 457 | + throw new Exception("Missing required property"); | |
| 458 | + } | |
| 459 | + if (!property_exists($obj, 'IATA')) { | |
| 460 | + throw new Exception("Missing required property"); | |
| 461 | + } | |
| 462 | + if (!property_exists($obj, 'ICAO')) { | |
| 463 | + throw new Exception("Missing required property"); | |
| 464 | + } | |
| 465 | + if (!property_exists($obj, 'name')) { | |
| 466 | + throw new Exception("Missing required property"); | |
| 467 | + } | |
| 468 | + if (!property_exists($obj, 'state')) { | |
| 469 | + throw new Exception("Missing required property"); | |
| 470 | + } | |
| 471 | + if (!property_exists($obj, 'status')) { | |
| 472 | + throw new Exception("Missing required property"); | |
| 473 | + } | |
| 474 | + if (!property_exists($obj, 'weather')) { | |
| 475 | + throw new Exception("Missing required property"); | |
| 476 | + } | |
| 453 | 477 | return new TopLevel( |
| 454 | 478 | TopLevel::fromCity($obj->{'city'}) |
| 455 | 479 | ,TopLevel::fromDelay($obj->{'delay'}) |
| @@ -978,6 +1002,33 @@ class Status { | ||
| 978 | 1002 | * @throws Exception |
| 979 | 1003 | */ |
| 980 | 1004 | public static function from(stdClass $obj): Status { |
| 1005 | + if (!property_exists($obj, 'avgDelay')) { | |
| 1006 | + throw new Exception("Missing required property"); | |
| 1007 | + } | |
| 1008 | + if (!property_exists($obj, 'closureBegin')) { | |
| 1009 | + throw new Exception("Missing required property"); | |
| 1010 | + } | |
| 1011 | + if (!property_exists($obj, 'closureEnd')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'endTime')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 1017 | + if (!property_exists($obj, 'maxDelay')) { | |
| 1018 | + throw new Exception("Missing required property"); | |
| 1019 | + } | |
| 1020 | + if (!property_exists($obj, 'minDelay')) { | |
| 1021 | + throw new Exception("Missing required property"); | |
| 1022 | + } | |
| 1023 | + if (!property_exists($obj, 'reason')) { | |
| 1024 | + throw new Exception("Missing required property"); | |
| 1025 | + } | |
| 1026 | + if (!property_exists($obj, 'trend')) { | |
| 1027 | + throw new Exception("Missing required property"); | |
| 1028 | + } | |
| 1029 | + if (!property_exists($obj, 'type')) { | |
| 1030 | + throw new Exception("Missing required property"); | |
| 1031 | + } | |
| 981 | 1032 | return new Status( |
| 982 | 1033 | Status::fromAvgDelay($obj->{'avgDelay'}) |
| 983 | 1034 | ,Status::fromClosureBegin($obj->{'closureBegin'}) |
| @@ -1301,6 +1352,21 @@ class Weather { | ||
| 1301 | 1352 | * @throws Exception |
| 1302 | 1353 | */ |
| 1303 | 1354 | public static function from(stdClass $obj): Weather { |
| 1355 | + if (!property_exists($obj, 'meta')) { | |
| 1356 | + throw new Exception("Missing required property"); | |
| 1357 | + } | |
| 1358 | + if (!property_exists($obj, 'temp')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1361 | + if (!property_exists($obj, 'visibility')) { | |
| 1362 | + throw new Exception("Missing required property"); | |
| 1363 | + } | |
| 1364 | + if (!property_exists($obj, 'weather')) { | |
| 1365 | + throw new Exception("Missing required property"); | |
| 1366 | + } | |
| 1367 | + if (!property_exists($obj, 'wind')) { | |
| 1368 | + throw new Exception("Missing required property"); | |
| 1369 | + } | |
| 1304 | 1370 | return new Weather( |
| 1305 | 1371 | Weather::fromMeta($obj->{'meta'}) |
| 1306 | 1372 | ,Weather::fromTemp($obj->{'temp'}) |
| @@ -1511,6 +1577,15 @@ class Meta { | ||
| 1511 | 1577 | * @throws Exception |
| 1512 | 1578 | */ |
| 1513 | 1579 | public static function from(stdClass $obj): Meta { |
| 1580 | + if (!property_exists($obj, 'credit')) { | |
| 1581 | + throw new Exception("Missing required property"); | |
| 1582 | + } | |
| 1583 | + if (!property_exists($obj, 'updated')) { | |
| 1584 | + throw new Exception("Missing required property"); | |
| 1585 | + } | |
| 1586 | + if (!property_exists($obj, 'url')) { | |
| 1587 | + throw new Exception("Missing required property"); | |
| 1588 | + } | |
| 1514 | 1589 | return new Meta( |
| 1515 | 1590 | Meta::fromCredit($obj->{'credit'}) |
| 1516 | 1591 | ,Meta::fromUpdated($obj->{'updated'}) |
Test case
1 generated file · +180 −0test/inputs/json/misc/262f0.json
Mphpdefault / TopLevel.php+180 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'query')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromQuery($obj->{'query'}) |
| 90 | 93 | ); |
| @@ -347,6 +350,18 @@ class Query { | ||
| 347 | 350 | * @throws Exception |
| 348 | 351 | */ |
| 349 | 352 | public static function from(stdClass $obj): Query { |
| 353 | + if (!property_exists($obj, 'count')) { | |
| 354 | + throw new Exception("Missing required property"); | |
| 355 | + } | |
| 356 | + if (!property_exists($obj, 'created')) { | |
| 357 | + throw new Exception("Missing required property"); | |
| 358 | + } | |
| 359 | + if (!property_exists($obj, 'lang')) { | |
| 360 | + throw new Exception("Missing required property"); | |
| 361 | + } | |
| 362 | + if (!property_exists($obj, 'results')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 350 | 365 | return new Query( |
| 351 | 366 | Query::fromCount($obj->{'count'}) |
| 352 | 367 | ,Query::fromCreated($obj->{'created'}) |
| @@ -452,6 +467,9 @@ class Results { | ||
| 452 | 467 | * @throws Exception |
| 453 | 468 | */ |
| 454 | 469 | public static function from(stdClass $obj): Results { |
| 470 | + if (!property_exists($obj, 'channel')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 455 | 473 | return new Results( |
| 456 | 474 | Results::fromChannel($obj->{'channel'}) |
| 457 | 475 | ); |
| @@ -1181,6 +1199,45 @@ class Channel { | ||
| 1181 | 1199 | * @throws Exception |
| 1182 | 1200 | */ |
| 1183 | 1201 | public static function from(stdClass $obj): Channel { |
| 1202 | + if (!property_exists($obj, 'astronomy')) { | |
| 1203 | + throw new Exception("Missing required property"); | |
| 1204 | + } | |
| 1205 | + if (!property_exists($obj, 'atmosphere')) { | |
| 1206 | + throw new Exception("Missing required property"); | |
| 1207 | + } | |
| 1208 | + if (!property_exists($obj, 'description')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'image')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1214 | + if (!property_exists($obj, 'item')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'language')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'lastBuildDate')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'link')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'location')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'title')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'ttl')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'units')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'wind')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1184 | 1241 | return new Channel( |
| 1185 | 1242 | Channel::fromAstronomy($obj->{'astronomy'}) |
| 1186 | 1243 | ,Channel::fromAtmosphere($obj->{'atmosphere'}) |
| @@ -1355,6 +1412,12 @@ class Astronomy { | ||
| 1355 | 1412 | * @throws Exception |
| 1356 | 1413 | */ |
| 1357 | 1414 | public static function from(stdClass $obj): Astronomy { |
| 1415 | + if (!property_exists($obj, 'sunrise')) { | |
| 1416 | + throw new Exception("Missing required property"); | |
| 1417 | + } | |
| 1418 | + if (!property_exists($obj, 'sunset')) { | |
| 1419 | + throw new Exception("Missing required property"); | |
| 1420 | + } | |
| 1358 | 1421 | return new Astronomy( |
| 1359 | 1422 | Astronomy::fromSunrise($obj->{'sunrise'}) |
| 1360 | 1423 | ,Astronomy::fromSunset($obj->{'sunset'}) |
| @@ -1611,6 +1674,18 @@ class Atmosphere { | ||
| 1611 | 1674 | * @throws Exception |
| 1612 | 1675 | */ |
| 1613 | 1676 | public static function from(stdClass $obj): Atmosphere { |
| 1677 | + if (!property_exists($obj, 'humidity')) { | |
| 1678 | + throw new Exception("Missing required property"); | |
| 1679 | + } | |
| 1680 | + if (!property_exists($obj, 'pressure')) { | |
| 1681 | + throw new Exception("Missing required property"); | |
| 1682 | + } | |
| 1683 | + if (!property_exists($obj, 'rising')) { | |
| 1684 | + throw new Exception("Missing required property"); | |
| 1685 | + } | |
| 1686 | + if (!property_exists($obj, 'visibility')) { | |
| 1687 | + throw new Exception("Missing required property"); | |
| 1688 | + } | |
| 1614 | 1689 | return new Atmosphere( |
| 1615 | 1690 | Atmosphere::fromHumidity($obj->{'humidity'}) |
| 1616 | 1691 | ,Atmosphere::fromPressure($obj->{'pressure'}) |
| @@ -1923,6 +1998,21 @@ class Image { | ||
| 1923 | 1998 | * @throws Exception |
| 1924 | 1999 | */ |
| 1925 | 2000 | public static function from(stdClass $obj): Image { |
| 2001 | + if (!property_exists($obj, 'height')) { | |
| 2002 | + throw new Exception("Missing required property"); | |
| 2003 | + } | |
| 2004 | + if (!property_exists($obj, 'link')) { | |
| 2005 | + throw new Exception("Missing required property"); | |
| 2006 | + } | |
| 2007 | + if (!property_exists($obj, 'title')) { | |
| 2008 | + throw new Exception("Missing required property"); | |
| 2009 | + } | |
| 2010 | + if (!property_exists($obj, 'url')) { | |
| 2011 | + throw new Exception("Missing required property"); | |
| 2012 | + } | |
| 2013 | + if (!property_exists($obj, 'width')) { | |
| 2014 | + throw new Exception("Missing required property"); | |
| 2015 | + } | |
| 1926 | 2016 | return new Image( |
| 1927 | 2017 | Image::fromHeight($obj->{'height'}) |
| 1928 | 2018 | ,Image::fromLink($obj->{'link'}) |
| @@ -2459,6 +2549,33 @@ class Item { | ||
| 2459 | 2549 | * @throws Exception |
| 2460 | 2550 | */ |
| 2461 | 2551 | public static function from(stdClass $obj): Item { |
| 2552 | + if (!property_exists($obj, 'condition')) { | |
| 2553 | + throw new Exception("Missing required property"); | |
| 2554 | + } | |
| 2555 | + if (!property_exists($obj, 'description')) { | |
| 2556 | + throw new Exception("Missing required property"); | |
| 2557 | + } | |
| 2558 | + if (!property_exists($obj, 'forecast')) { | |
| 2559 | + throw new Exception("Missing required property"); | |
| 2560 | + } | |
| 2561 | + if (!property_exists($obj, 'guid')) { | |
| 2562 | + throw new Exception("Missing required property"); | |
| 2563 | + } | |
| 2564 | + if (!property_exists($obj, 'lat')) { | |
| 2565 | + throw new Exception("Missing required property"); | |
| 2566 | + } | |
| 2567 | + if (!property_exists($obj, 'link')) { | |
| 2568 | + throw new Exception("Missing required property"); | |
| 2569 | + } | |
| 2570 | + if (!property_exists($obj, 'long')) { | |
| 2571 | + throw new Exception("Missing required property"); | |
| 2572 | + } | |
| 2573 | + if (!property_exists($obj, 'pubDate')) { | |
| 2574 | + throw new Exception("Missing required property"); | |
| 2575 | + } | |
| 2576 | + if (!property_exists($obj, 'title')) { | |
| 2577 | + throw new Exception("Missing required property"); | |
| 2578 | + } | |
| 2462 | 2579 | return new Item( |
| 2463 | 2580 | Item::fromCondition($obj->{'condition'}) |
| 2464 | 2581 | ,Item::fromDescription($obj->{'description'}) |
| @@ -2730,6 +2847,18 @@ class Condition { | ||
| 2730 | 2847 | * @throws Exception |
| 2731 | 2848 | */ |
| 2732 | 2849 | public static function from(stdClass $obj): Condition { |
| 2850 | + if (!property_exists($obj, 'code')) { | |
| 2851 | + throw new Exception("Missing required property"); | |
| 2852 | + } | |
| 2853 | + if (!property_exists($obj, 'date')) { | |
| 2854 | + throw new Exception("Missing required property"); | |
| 2855 | + } | |
| 2856 | + if (!property_exists($obj, 'temp')) { | |
| 2857 | + throw new Exception("Missing required property"); | |
| 2858 | + } | |
| 2859 | + if (!property_exists($obj, 'text')) { | |
| 2860 | + throw new Exception("Missing required property"); | |
| 2861 | + } | |
| 2733 | 2862 | return new Condition( |
| 2734 | 2863 | Condition::fromCode($obj->{'code'}) |
| 2735 | 2864 | ,Condition::fromDate($obj->{'date'}) |
| @@ -3148,6 +3277,24 @@ class Forecast { | ||
| 3148 | 3277 | * @throws Exception |
| 3149 | 3278 | */ |
| 3150 | 3279 | public static function from(stdClass $obj): Forecast { |
| 3280 | + if (!property_exists($obj, 'code')) { | |
| 3281 | + throw new Exception("Missing required property"); | |
| 3282 | + } | |
| 3283 | + if (!property_exists($obj, 'date')) { | |
| 3284 | + throw new Exception("Missing required property"); | |
| 3285 | + } | |
| 3286 | + if (!property_exists($obj, 'day')) { | |
| 3287 | + throw new Exception("Missing required property"); | |
| 3288 | + } | |
| 3289 | + if (!property_exists($obj, 'high')) { | |
| 3290 | + throw new Exception("Missing required property"); | |
| 3291 | + } | |
| 3292 | + if (!property_exists($obj, 'low')) { | |
| 3293 | + throw new Exception("Missing required property"); | |
| 3294 | + } | |
| 3295 | + if (!property_exists($obj, 'text')) { | |
| 3296 | + throw new Exception("Missing required property"); | |
| 3297 | + } | |
| 3151 | 3298 | return new Forecast( |
| 3152 | 3299 | Forecast::fromCode($obj->{'code'}) |
| 3153 | 3300 | ,Forecast::fromDate($obj->{'date'}) |
| @@ -3256,6 +3403,9 @@ class GUID { | ||
| 3256 | 3403 | * @throws Exception |
| 3257 | 3404 | */ |
| 3258 | 3405 | public static function from(stdClass $obj): GUID { |
| 3406 | + if (!property_exists($obj, 'isPermaLink')) { | |
| 3407 | + throw new Exception("Missing required property"); | |
| 3408 | + } | |
| 3259 | 3409 | return new GUID( |
| 3260 | 3410 | GUID::fromIsPermaLink($obj->{'isPermaLink'}) |
| 3261 | 3411 | ); |
| @@ -3458,6 +3608,15 @@ class Location { | ||
| 3458 | 3608 | * @throws Exception |
| 3459 | 3609 | */ |
| 3460 | 3610 | public static function from(stdClass $obj): Location { |
| 3611 | + if (!property_exists($obj, 'city')) { | |
| 3612 | + throw new Exception("Missing required property"); | |
| 3613 | + } | |
| 3614 | + if (!property_exists($obj, 'country')) { | |
| 3615 | + throw new Exception("Missing required property"); | |
| 3616 | + } | |
| 3617 | + if (!property_exists($obj, 'region')) { | |
| 3618 | + throw new Exception("Missing required property"); | |
| 3619 | + } | |
| 3461 | 3620 | return new Location( |
| 3462 | 3621 | Location::fromCity($obj->{'city'}) |
| 3463 | 3622 | ,Location::fromCountry($obj->{'country'}) |
| @@ -3716,6 +3875,18 @@ class Units { | ||
| 3716 | 3875 | * @throws Exception |
| 3717 | 3876 | */ |
| 3718 | 3877 | public static function from(stdClass $obj): Units { |
| 3878 | + if (!property_exists($obj, 'distance')) { | |
| 3879 | + throw new Exception("Missing required property"); | |
| 3880 | + } | |
| 3881 | + if (!property_exists($obj, 'pressure')) { | |
| 3882 | + throw new Exception("Missing required property"); | |
| 3883 | + } | |
| 3884 | + if (!property_exists($obj, 'speed')) { | |
| 3885 | + throw new Exception("Missing required property"); | |
| 3886 | + } | |
| 3887 | + if (!property_exists($obj, 'temperature')) { | |
| 3888 | + throw new Exception("Missing required property"); | |
| 3889 | + } | |
| 3719 | 3890 | return new Units( |
| 3720 | 3891 | Units::fromDistance($obj->{'distance'}) |
| 3721 | 3892 | ,Units::fromPressure($obj->{'pressure'}) |
| @@ -3924,6 +4095,15 @@ class Wind { | ||
| 3924 | 4095 | * @throws Exception |
| 3925 | 4096 | */ |
| 3926 | 4097 | public static function from(stdClass $obj): Wind { |
| 4098 | + if (!property_exists($obj, 'chill')) { | |
| 4099 | + throw new Exception("Missing required property"); | |
| 4100 | + } | |
| 4101 | + if (!property_exists($obj, 'direction')) { | |
| 4102 | + throw new Exception("Missing required property"); | |
| 4103 | + } | |
| 4104 | + if (!property_exists($obj, 'speed')) { | |
| 4105 | + throw new Exception("Missing required property"); | |
| 4106 | + } | |
| 3927 | 4107 | return new Wind( |
| 3928 | 4108 | Wind::fromChill($obj->{'chill'}) |
| 3929 | 4109 | ,Wind::fromDirection($obj->{'direction'}) |
Test case
1 generated file · +204 −0test/inputs/json/misc/26b49.json
Mphpdefault / TopLevel.php+204 −0
| @@ -202,6 +202,15 @@ class TopLevel { | ||
| 202 | 202 | * @throws Exception |
| 203 | 203 | */ |
| 204 | 204 | public static function from(stdClass $obj): TopLevel { |
| 205 | + if (!property_exists($obj, 'data')) { | |
| 206 | + throw new Exception("Missing required property"); | |
| 207 | + } | |
| 208 | + if (!property_exists($obj, 'meta')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'pagination')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 205 | 214 | return new TopLevel( |
| 206 | 215 | TopLevel::fromData($obj->{'data'}) |
| 207 | 216 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -1202,6 +1211,57 @@ class Datum { | ||
| 1202 | 1211 | * @throws Exception |
| 1203 | 1212 | */ |
| 1204 | 1213 | public static function from(stdClass $obj): Datum { |
| 1214 | + if (!property_exists($obj, 'bitly_gif_url')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'bitly_url')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'content_url')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'embed_url')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'id')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'images')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'import_datetime')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'is_indexable')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'rating')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1241 | + if (!property_exists($obj, 'slug')) { | |
| 1242 | + throw new Exception("Missing required property"); | |
| 1243 | + } | |
| 1244 | + if (!property_exists($obj, 'source')) { | |
| 1245 | + throw new Exception("Missing required property"); | |
| 1246 | + } | |
| 1247 | + if (!property_exists($obj, 'source_post_url')) { | |
| 1248 | + throw new Exception("Missing required property"); | |
| 1249 | + } | |
| 1250 | + if (!property_exists($obj, 'source_tld')) { | |
| 1251 | + throw new Exception("Missing required property"); | |
| 1252 | + } | |
| 1253 | + if (!property_exists($obj, 'trending_datetime')) { | |
| 1254 | + throw new Exception("Missing required property"); | |
| 1255 | + } | |
| 1256 | + if (!property_exists($obj, 'type')) { | |
| 1257 | + throw new Exception("Missing required property"); | |
| 1258 | + } | |
| 1259 | + if (!property_exists($obj, 'url')) { | |
| 1260 | + throw new Exception("Missing required property"); | |
| 1261 | + } | |
| 1262 | + if (!property_exists($obj, 'username')) { | |
| 1263 | + throw new Exception("Missing required property"); | |
| 1264 | + } | |
| 1205 | 1265 | return new Datum( |
| 1206 | 1266 | Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'}) |
| 1207 | 1267 | ,Datum::fromBitlyURL($obj->{'bitly_url'}) |
| @@ -2574,6 +2634,72 @@ class Images { | ||
| 2574 | 2634 | * @throws Exception |
| 2575 | 2635 | */ |
| 2576 | 2636 | public static function from(stdClass $obj): Images { |
| 2637 | + if (!property_exists($obj, 'downsized')) { | |
| 2638 | + throw new Exception("Missing required property"); | |
| 2639 | + } | |
| 2640 | + if (!property_exists($obj, 'downsized_large')) { | |
| 2641 | + throw new Exception("Missing required property"); | |
| 2642 | + } | |
| 2643 | + if (!property_exists($obj, 'downsized_medium')) { | |
| 2644 | + throw new Exception("Missing required property"); | |
| 2645 | + } | |
| 2646 | + if (!property_exists($obj, 'downsized_small')) { | |
| 2647 | + throw new Exception("Missing required property"); | |
| 2648 | + } | |
| 2649 | + if (!property_exists($obj, 'downsized_still')) { | |
| 2650 | + throw new Exception("Missing required property"); | |
| 2651 | + } | |
| 2652 | + if (!property_exists($obj, 'fixed_height')) { | |
| 2653 | + throw new Exception("Missing required property"); | |
| 2654 | + } | |
| 2655 | + if (!property_exists($obj, 'fixed_height_downsampled')) { | |
| 2656 | + throw new Exception("Missing required property"); | |
| 2657 | + } | |
| 2658 | + if (!property_exists($obj, 'fixed_height_small')) { | |
| 2659 | + throw new Exception("Missing required property"); | |
| 2660 | + } | |
| 2661 | + if (!property_exists($obj, 'fixed_height_small_still')) { | |
| 2662 | + throw new Exception("Missing required property"); | |
| 2663 | + } | |
| 2664 | + if (!property_exists($obj, 'fixed_height_still')) { | |
| 2665 | + throw new Exception("Missing required property"); | |
| 2666 | + } | |
| 2667 | + if (!property_exists($obj, 'fixed_width')) { | |
| 2668 | + throw new Exception("Missing required property"); | |
| 2669 | + } | |
| 2670 | + if (!property_exists($obj, 'fixed_width_downsampled')) { | |
| 2671 | + throw new Exception("Missing required property"); | |
| 2672 | + } | |
| 2673 | + if (!property_exists($obj, 'fixed_width_small')) { | |
| 2674 | + throw new Exception("Missing required property"); | |
| 2675 | + } | |
| 2676 | + if (!property_exists($obj, 'fixed_width_small_still')) { | |
| 2677 | + throw new Exception("Missing required property"); | |
| 2678 | + } | |
| 2679 | + if (!property_exists($obj, 'fixed_width_still')) { | |
| 2680 | + throw new Exception("Missing required property"); | |
| 2681 | + } | |
| 2682 | + if (!property_exists($obj, 'looping')) { | |
| 2683 | + throw new Exception("Missing required property"); | |
| 2684 | + } | |
| 2685 | + if (!property_exists($obj, 'original')) { | |
| 2686 | + throw new Exception("Missing required property"); | |
| 2687 | + } | |
| 2688 | + if (!property_exists($obj, 'original_mp4')) { | |
| 2689 | + throw new Exception("Missing required property"); | |
| 2690 | + } | |
| 2691 | + if (!property_exists($obj, 'original_still')) { | |
| 2692 | + throw new Exception("Missing required property"); | |
| 2693 | + } | |
| 2694 | + if (!property_exists($obj, 'preview')) { | |
| 2695 | + throw new Exception("Missing required property"); | |
| 2696 | + } | |
| 2697 | + if (!property_exists($obj, 'preview_gif')) { | |
| 2698 | + throw new Exception("Missing required property"); | |
| 2699 | + } | |
| 2700 | + if (!property_exists($obj, 'preview_webp')) { | |
| 2701 | + throw new Exception("Missing required property"); | |
| 2702 | + } | |
| 2577 | 2703 | return new Images( |
| 2578 | 2704 | Images::fromDownsized($obj->{'downsized'}) |
| 2579 | 2705 | ,Images::fromDownsizedLarge($obj->{'downsized_large'}) |
| @@ -2884,6 +3010,15 @@ class Downsized { | ||
| 2884 | 3010 | * @throws Exception |
| 2885 | 3011 | */ |
| 2886 | 3012 | public static function from(stdClass $obj): Downsized { |
| 3013 | + if (!property_exists($obj, 'height')) { | |
| 3014 | + throw new Exception("Missing required property"); | |
| 3015 | + } | |
| 3016 | + if (!property_exists($obj, 'url')) { | |
| 3017 | + throw new Exception("Missing required property"); | |
| 3018 | + } | |
| 3019 | + if (!property_exists($obj, 'width')) { | |
| 3020 | + throw new Exception("Missing required property"); | |
| 3021 | + } | |
| 2887 | 3022 | return new Downsized( |
| 2888 | 3023 | Downsized::fromHeight($obj->{'height'}) |
| 2889 | 3024 | ,Downsized::fromSize($obj->{'size'}) |
| @@ -3144,6 +3279,18 @@ class DownsizedSmall { | ||
| 3144 | 3279 | * @throws Exception |
| 3145 | 3280 | */ |
| 3146 | 3281 | public static function from(stdClass $obj): DownsizedSmall { |
| 3282 | + if (!property_exists($obj, 'height')) { | |
| 3283 | + throw new Exception("Missing required property"); | |
| 3284 | + } | |
| 3285 | + if (!property_exists($obj, 'mp4')) { | |
| 3286 | + throw new Exception("Missing required property"); | |
| 3287 | + } | |
| 3288 | + if (!property_exists($obj, 'mp4_size')) { | |
| 3289 | + throw new Exception("Missing required property"); | |
| 3290 | + } | |
| 3291 | + if (!property_exists($obj, 'width')) { | |
| 3292 | + throw new Exception("Missing required property"); | |
| 3293 | + } | |
| 3147 | 3294 | return new DownsizedSmall( |
| 3148 | 3295 | DownsizedSmall::fromHeight($obj->{'height'}) |
| 3149 | 3296 | ,DownsizedSmall::fromMp4($obj->{'mp4'}) |
| @@ -3756,6 +3903,24 @@ class FixedHeight { | ||
| 3756 | 3903 | * @throws Exception |
| 3757 | 3904 | */ |
| 3758 | 3905 | public static function from(stdClass $obj): FixedHeight { |
| 3906 | + if (!property_exists($obj, 'height')) { | |
| 3907 | + throw new Exception("Missing required property"); | |
| 3908 | + } | |
| 3909 | + if (!property_exists($obj, 'size')) { | |
| 3910 | + throw new Exception("Missing required property"); | |
| 3911 | + } | |
| 3912 | + if (!property_exists($obj, 'url')) { | |
| 3913 | + throw new Exception("Missing required property"); | |
| 3914 | + } | |
| 3915 | + if (!property_exists($obj, 'webp')) { | |
| 3916 | + throw new Exception("Missing required property"); | |
| 3917 | + } | |
| 3918 | + if (!property_exists($obj, 'webp_size')) { | |
| 3919 | + throw new Exception("Missing required property"); | |
| 3920 | + } | |
| 3921 | + if (!property_exists($obj, 'width')) { | |
| 3922 | + throw new Exception("Missing required property"); | |
| 3923 | + } | |
| 3759 | 3924 | return new FixedHeight( |
| 3760 | 3925 | FixedHeight::fromFrames($obj->{'frames'}) |
| 3761 | 3926 | ,FixedHeight::fromHash($obj->{'hash'}) |
| @@ -3924,6 +4089,12 @@ class Looping { | ||
| 3924 | 4089 | * @throws Exception |
| 3925 | 4090 | */ |
| 3926 | 4091 | public static function from(stdClass $obj): Looping { |
| 4092 | + if (!property_exists($obj, 'mp4')) { | |
| 4093 | + throw new Exception("Missing required property"); | |
| 4094 | + } | |
| 4095 | + if (!property_exists($obj, 'mp4_size')) { | |
| 4096 | + throw new Exception("Missing required property"); | |
| 4097 | + } | |
| 3927 | 4098 | return new Looping( |
| 3928 | 4099 | Looping::fromMp4($obj->{'mp4'}) |
| 3929 | 4100 | ,Looping::fromMp4Size($obj->{'mp4_size'}) |
| @@ -4396,6 +4567,21 @@ class User { | ||
| 4396 | 4567 | * @throws Exception |
| 4397 | 4568 | */ |
| 4398 | 4569 | public static function from(stdClass $obj): User { |
| 4570 | + if (!property_exists($obj, 'avatar_url')) { | |
| 4571 | + throw new Exception("Missing required property"); | |
| 4572 | + } | |
| 4573 | + if (!property_exists($obj, 'banner_url')) { | |
| 4574 | + throw new Exception("Missing required property"); | |
| 4575 | + } | |
| 4576 | + if (!property_exists($obj, 'display_name')) { | |
| 4577 | + throw new Exception("Missing required property"); | |
| 4578 | + } | |
| 4579 | + if (!property_exists($obj, 'profile_url')) { | |
| 4580 | + throw new Exception("Missing required property"); | |
| 4581 | + } | |
| 4582 | + if (!property_exists($obj, 'username')) { | |
| 4583 | + throw new Exception("Missing required property"); | |
| 4584 | + } | |
| 4399 | 4585 | return new User( |
| 4400 | 4586 | User::fromAvatarURL($obj->{'avatar_url'}) |
| 4401 | 4587 | ,User::fromBannerURL($obj->{'banner_url'}) |
| @@ -4608,6 +4794,15 @@ class Meta { | ||
| 4608 | 4794 | * @throws Exception |
| 4609 | 4795 | */ |
| 4610 | 4796 | public static function from(stdClass $obj): Meta { |
| 4797 | + if (!property_exists($obj, 'msg')) { | |
| 4798 | + throw new Exception("Missing required property"); | |
| 4799 | + } | |
| 4800 | + if (!property_exists($obj, 'response_id')) { | |
| 4801 | + throw new Exception("Missing required property"); | |
| 4802 | + } | |
| 4803 | + if (!property_exists($obj, 'status')) { | |
| 4804 | + throw new Exception("Missing required property"); | |
| 4805 | + } | |
| 4611 | 4806 | return new Meta( |
| 4612 | 4807 | Meta::fromMsg($obj->{'msg'}) |
| 4613 | 4808 | ,Meta::fromResponseID($obj->{'response_id'}) |
| @@ -4814,6 +5009,15 @@ class Pagination { | ||
| 4814 | 5009 | * @throws Exception |
| 4815 | 5010 | */ |
| 4816 | 5011 | public static function from(stdClass $obj): Pagination { |
| 5012 | + if (!property_exists($obj, 'count')) { | |
| 5013 | + throw new Exception("Missing required property"); | |
| 5014 | + } | |
| 5015 | + if (!property_exists($obj, 'offset')) { | |
| 5016 | + throw new Exception("Missing required property"); | |
| 5017 | + } | |
| 5018 | + if (!property_exists($obj, 'total_count')) { | |
| 5019 | + throw new Exception("Missing required property"); | |
| 5020 | + } | |
| 4817 | 5021 | return new Pagination( |
| 4818 | 5022 | Pagination::fromCount($obj->{'count'}) |
| 4819 | 5023 | ,Pagination::fromOffset($obj->{'offset'}) |
Test case
1 generated file · +321 −0test/inputs/json/misc/26c9c.json
Mphpdefault / TopLevel.php+321 −0
| @@ -190,6 +190,12 @@ class TopLevel { | ||
| 190 | 190 | * @throws Exception |
| 191 | 191 | */ |
| 192 | 192 | public static function from(stdClass $obj): TopLevel { |
| 193 | + if (!property_exists($obj, 'data')) { | |
| 194 | + throw new Exception("Missing required property"); | |
| 195 | + } | |
| 196 | + if (!property_exists($obj, 'meta')) { | |
| 197 | + throw new Exception("Missing required property"); | |
| 198 | + } | |
| 193 | 199 | return new TopLevel( |
| 194 | 200 | TopLevel::fromData($obj->{'data'}) |
| 195 | 201 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -291,6 +297,9 @@ class Meta { | ||
| 291 | 297 | * @throws Exception |
| 292 | 298 | */ |
| 293 | 299 | public static function from(stdClass $obj): Meta { |
| 300 | + if (!property_exists($obj, 'view')) { | |
| 301 | + throw new Exception("Missing required property"); | |
| 302 | + } | |
| 294 | 303 | return new Meta( |
| 295 | 304 | Meta::fromView($obj->{'view'}) |
| 296 | 305 | ); |
| @@ -2383,6 +2392,120 @@ class View { | ||
| 2383 | 2392 | * @throws Exception |
| 2384 | 2393 | */ |
| 2385 | 2394 | public static function from(stdClass $obj): View { |
| 2395 | + if (!property_exists($obj, 'attribution')) { | |
| 2396 | + throw new Exception("Missing required property"); | |
| 2397 | + } | |
| 2398 | + if (!property_exists($obj, 'attributionLink')) { | |
| 2399 | + throw new Exception("Missing required property"); | |
| 2400 | + } | |
| 2401 | + if (!property_exists($obj, 'averageRating')) { | |
| 2402 | + throw new Exception("Missing required property"); | |
| 2403 | + } | |
| 2404 | + if (!property_exists($obj, 'category')) { | |
| 2405 | + throw new Exception("Missing required property"); | |
| 2406 | + } | |
| 2407 | + if (!property_exists($obj, 'columns')) { | |
| 2408 | + throw new Exception("Missing required property"); | |
| 2409 | + } | |
| 2410 | + if (!property_exists($obj, 'createdAt')) { | |
| 2411 | + throw new Exception("Missing required property"); | |
| 2412 | + } | |
| 2413 | + if (!property_exists($obj, 'description')) { | |
| 2414 | + throw new Exception("Missing required property"); | |
| 2415 | + } | |
| 2416 | + if (!property_exists($obj, 'displayType')) { | |
| 2417 | + throw new Exception("Missing required property"); | |
| 2418 | + } | |
| 2419 | + if (!property_exists($obj, 'downloadCount')) { | |
| 2420 | + throw new Exception("Missing required property"); | |
| 2421 | + } | |
| 2422 | + if (!property_exists($obj, 'flags')) { | |
| 2423 | + throw new Exception("Missing required property"); | |
| 2424 | + } | |
| 2425 | + if (!property_exists($obj, 'grants')) { | |
| 2426 | + throw new Exception("Missing required property"); | |
| 2427 | + } | |
| 2428 | + if (!property_exists($obj, 'hideFromCatalog')) { | |
| 2429 | + throw new Exception("Missing required property"); | |
| 2430 | + } | |
| 2431 | + if (!property_exists($obj, 'hideFromDataJson')) { | |
| 2432 | + throw new Exception("Missing required property"); | |
| 2433 | + } | |
| 2434 | + if (!property_exists($obj, 'id')) { | |
| 2435 | + throw new Exception("Missing required property"); | |
| 2436 | + } | |
| 2437 | + if (!property_exists($obj, 'indexUpdatedAt')) { | |
| 2438 | + throw new Exception("Missing required property"); | |
| 2439 | + } | |
| 2440 | + if (!property_exists($obj, 'locale')) { | |
| 2441 | + throw new Exception("Missing required property"); | |
| 2442 | + } | |
| 2443 | + if (!property_exists($obj, 'metadata')) { | |
| 2444 | + throw new Exception("Missing required property"); | |
| 2445 | + } | |
| 2446 | + if (!property_exists($obj, 'name')) { | |
| 2447 | + throw new Exception("Missing required property"); | |
| 2448 | + } | |
| 2449 | + if (!property_exists($obj, 'newBackend')) { | |
| 2450 | + throw new Exception("Missing required property"); | |
| 2451 | + } | |
| 2452 | + if (!property_exists($obj, 'numberOfComments')) { | |
| 2453 | + throw new Exception("Missing required property"); | |
| 2454 | + } | |
| 2455 | + if (!property_exists($obj, 'oid')) { | |
| 2456 | + throw new Exception("Missing required property"); | |
| 2457 | + } | |
| 2458 | + if (!property_exists($obj, 'owner')) { | |
| 2459 | + throw new Exception("Missing required property"); | |
| 2460 | + } | |
| 2461 | + if (!property_exists($obj, 'provenance')) { | |
| 2462 | + throw new Exception("Missing required property"); | |
| 2463 | + } | |
| 2464 | + if (!property_exists($obj, 'publicationAppendEnabled')) { | |
| 2465 | + throw new Exception("Missing required property"); | |
| 2466 | + } | |
| 2467 | + if (!property_exists($obj, 'publicationDate')) { | |
| 2468 | + throw new Exception("Missing required property"); | |
| 2469 | + } | |
| 2470 | + if (!property_exists($obj, 'publicationGroup')) { | |
| 2471 | + throw new Exception("Missing required property"); | |
| 2472 | + } | |
| 2473 | + if (!property_exists($obj, 'publicationStage')) { | |
| 2474 | + throw new Exception("Missing required property"); | |
| 2475 | + } | |
| 2476 | + if (!property_exists($obj, 'query')) { | |
| 2477 | + throw new Exception("Missing required property"); | |
| 2478 | + } | |
| 2479 | + if (!property_exists($obj, 'rights')) { | |
| 2480 | + throw new Exception("Missing required property"); | |
| 2481 | + } | |
| 2482 | + if (!property_exists($obj, 'rowsUpdatedAt')) { | |
| 2483 | + throw new Exception("Missing required property"); | |
| 2484 | + } | |
| 2485 | + if (!property_exists($obj, 'rowsUpdatedBy')) { | |
| 2486 | + throw new Exception("Missing required property"); | |
| 2487 | + } | |
| 2488 | + if (!property_exists($obj, 'tableAuthor')) { | |
| 2489 | + throw new Exception("Missing required property"); | |
| 2490 | + } | |
| 2491 | + if (!property_exists($obj, 'tableId')) { | |
| 2492 | + throw new Exception("Missing required property"); | |
| 2493 | + } | |
| 2494 | + if (!property_exists($obj, 'tags')) { | |
| 2495 | + throw new Exception("Missing required property"); | |
| 2496 | + } | |
| 2497 | + if (!property_exists($obj, 'totalTimesRated')) { | |
| 2498 | + throw new Exception("Missing required property"); | |
| 2499 | + } | |
| 2500 | + if (!property_exists($obj, 'viewCount')) { | |
| 2501 | + throw new Exception("Missing required property"); | |
| 2502 | + } | |
| 2503 | + if (!property_exists($obj, 'viewLastModified')) { | |
| 2504 | + throw new Exception("Missing required property"); | |
| 2505 | + } | |
| 2506 | + if (!property_exists($obj, 'viewType')) { | |
| 2507 | + throw new Exception("Missing required property"); | |
| 2508 | + } | |
| 2386 | 2509 | return new View( |
| 2387 | 2510 | View::fromAttribution($obj->{'attribution'}) |
| 2388 | 2511 | ,View::fromAttributionLink($obj->{'attributionLink'}) |
| @@ -3131,6 +3254,27 @@ class Column { | ||
| 3131 | 3254 | * @throws Exception |
| 3132 | 3255 | */ |
| 3133 | 3256 | public static function from(stdClass $obj): Column { |
| 3257 | + if (!property_exists($obj, 'dataTypeName')) { | |
| 3258 | + throw new Exception("Missing required property"); | |
| 3259 | + } | |
| 3260 | + if (!property_exists($obj, 'fieldName')) { | |
| 3261 | + throw new Exception("Missing required property"); | |
| 3262 | + } | |
| 3263 | + if (!property_exists($obj, 'format')) { | |
| 3264 | + throw new Exception("Missing required property"); | |
| 3265 | + } | |
| 3266 | + if (!property_exists($obj, 'id')) { | |
| 3267 | + throw new Exception("Missing required property"); | |
| 3268 | + } | |
| 3269 | + if (!property_exists($obj, 'name')) { | |
| 3270 | + throw new Exception("Missing required property"); | |
| 3271 | + } | |
| 3272 | + if (!property_exists($obj, 'position')) { | |
| 3273 | + throw new Exception("Missing required property"); | |
| 3274 | + } | |
| 3275 | + if (!property_exists($obj, 'renderTypeName')) { | |
| 3276 | + throw new Exception("Missing required property"); | |
| 3277 | + } | |
| 3134 | 3278 | return new Column( |
| 3135 | 3279 | Column::fromCachedContents($obj->{'cachedContents'}) |
| 3136 | 3280 | ,Column::fromDataTypeName($obj->{'dataTypeName'}) |
| @@ -3593,6 +3737,21 @@ class CachedContents { | ||
| 3593 | 3737 | * @throws Exception |
| 3594 | 3738 | */ |
| 3595 | 3739 | public static function from(stdClass $obj): CachedContents { |
| 3740 | + if (!property_exists($obj, 'largest')) { | |
| 3741 | + throw new Exception("Missing required property"); | |
| 3742 | + } | |
| 3743 | + if (!property_exists($obj, 'non_null')) { | |
| 3744 | + throw new Exception("Missing required property"); | |
| 3745 | + } | |
| 3746 | + if (!property_exists($obj, 'null')) { | |
| 3747 | + throw new Exception("Missing required property"); | |
| 3748 | + } | |
| 3749 | + if (!property_exists($obj, 'smallest')) { | |
| 3750 | + throw new Exception("Missing required property"); | |
| 3751 | + } | |
| 3752 | + if (!property_exists($obj, 'top')) { | |
| 3753 | + throw new Exception("Missing required property"); | |
| 3754 | + } | |
| 3596 | 3755 | return new CachedContents( |
| 3597 | 3756 | CachedContents::fromAverage($obj->{'average'}) |
| 3598 | 3757 | ,CachedContents::fromLargest($obj->{'largest'}) |
| @@ -3755,6 +3914,12 @@ class Top { | ||
| 3755 | 3914 | * @throws Exception |
| 3756 | 3915 | */ |
| 3757 | 3916 | public static function from(stdClass $obj): Top { |
| 3917 | + if (!property_exists($obj, 'count')) { | |
| 3918 | + throw new Exception("Missing required property"); | |
| 3919 | + } | |
| 3920 | + if (!property_exists($obj, 'item')) { | |
| 3921 | + throw new Exception("Missing required property"); | |
| 3922 | + } | |
| 3758 | 3923 | return new Top( |
| 3759 | 3924 | Top::fromCount($obj->{'count'}) |
| 3760 | 3925 | ,Top::fromItem($obj->{'item'}) |
| @@ -4273,6 +4438,15 @@ class Grant { | ||
| 4273 | 4438 | * @throws Exception |
| 4274 | 4439 | */ |
| 4275 | 4440 | public static function from(stdClass $obj): Grant { |
| 4441 | + if (!property_exists($obj, 'flags')) { | |
| 4442 | + throw new Exception("Missing required property"); | |
| 4443 | + } | |
| 4444 | + if (!property_exists($obj, 'inherited')) { | |
| 4445 | + throw new Exception("Missing required property"); | |
| 4446 | + } | |
| 4447 | + if (!property_exists($obj, 'type')) { | |
| 4448 | + throw new Exception("Missing required property"); | |
| 4449 | + } | |
| 4276 | 4450 | return new Grant( |
| 4277 | 4451 | Grant::fromFlags($obj->{'flags'}) |
| 4278 | 4452 | ,Grant::fromInherited($obj->{'inherited'}) |
| @@ -4664,6 +4838,24 @@ class Metadata { | ||
| 4664 | 4838 | * @throws Exception |
| 4665 | 4839 | */ |
| 4666 | 4840 | public static function from(stdClass $obj): Metadata { |
| 4841 | + if (!property_exists($obj, 'attachments')) { | |
| 4842 | + throw new Exception("Missing required property"); | |
| 4843 | + } | |
| 4844 | + if (!property_exists($obj, 'availableDisplayTypes')) { | |
| 4845 | + throw new Exception("Missing required property"); | |
| 4846 | + } | |
| 4847 | + if (!property_exists($obj, 'custom_fields')) { | |
| 4848 | + throw new Exception("Missing required property"); | |
| 4849 | + } | |
| 4850 | + if (!property_exists($obj, 'jsonQuery')) { | |
| 4851 | + throw new Exception("Missing required property"); | |
| 4852 | + } | |
| 4853 | + if (!property_exists($obj, 'rdfSubject')) { | |
| 4854 | + throw new Exception("Missing required property"); | |
| 4855 | + } | |
| 4856 | + if (!property_exists($obj, 'renderTypeConfig')) { | |
| 4857 | + throw new Exception("Missing required property"); | |
| 4858 | + } | |
| 4667 | 4859 | return new Metadata( |
| 4668 | 4860 | Metadata::fromAttachments($obj->{'attachments'}) |
| 4669 | 4861 | ,Metadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'}) |
| @@ -4928,6 +5120,18 @@ class Attachment { | ||
| 4928 | 5120 | * @throws Exception |
| 4929 | 5121 | */ |
| 4930 | 5122 | public static function from(stdClass $obj): Attachment { |
| 5123 | + if (!property_exists($obj, 'assetId')) { | |
| 5124 | + throw new Exception("Missing required property"); | |
| 5125 | + } | |
| 5126 | + if (!property_exists($obj, 'blobId')) { | |
| 5127 | + throw new Exception("Missing required property"); | |
| 5128 | + } | |
| 5129 | + if (!property_exists($obj, 'filename')) { | |
| 5130 | + throw new Exception("Missing required property"); | |
| 5131 | + } | |
| 5132 | + if (!property_exists($obj, 'name')) { | |
| 5133 | + throw new Exception("Missing required property"); | |
| 5134 | + } | |
| 4931 | 5135 | return new Attachment( |
| 4932 | 5136 | Attachment::fromAssetID($obj->{'assetId'}) |
| 4933 | 5137 | ,Attachment::fromBlobID($obj->{'blobId'}) |
| @@ -5245,6 +5449,21 @@ class CustomFields { | ||
| 5245 | 5449 | * @throws Exception |
| 5246 | 5450 | */ |
| 5247 | 5451 | public static function from(stdClass $obj): CustomFields { |
| 5452 | + if (!property_exists($obj, 'Additional Resources')) { | |
| 5453 | + throw new Exception("Missing required property"); | |
| 5454 | + } | |
| 5455 | + if (!property_exists($obj, 'Common Core')) { | |
| 5456 | + throw new Exception("Missing required property"); | |
| 5457 | + } | |
| 5458 | + if (!property_exists($obj, 'Dataset Information')) { | |
| 5459 | + throw new Exception("Missing required property"); | |
| 5460 | + } | |
| 5461 | + if (!property_exists($obj, 'Dataset Summary')) { | |
| 5462 | + throw new Exception("Missing required property"); | |
| 5463 | + } | |
| 5464 | + if (!property_exists($obj, 'Notes')) { | |
| 5465 | + throw new Exception("Missing required property"); | |
| 5466 | + } | |
| 5248 | 5467 | return new CustomFields( |
| 5249 | 5468 | CustomFields::fromAdditionalResources($obj->{'Additional Resources'}) |
| 5250 | 5469 | ,CustomFields::fromCommonCore($obj->{'Common Core'}) |
| @@ -5403,6 +5622,12 @@ class AdditionalResources { | ||
| 5403 | 5622 | * @throws Exception |
| 5404 | 5623 | */ |
| 5405 | 5624 | public static function from(stdClass $obj): AdditionalResources { |
| 5625 | + if (!property_exists($obj, 'See Also ')) { | |
| 5626 | + throw new Exception("Missing required property"); | |
| 5627 | + } | |
| 5628 | + if (!property_exists($obj, 'See Also')) { | |
| 5629 | + throw new Exception("Missing required property"); | |
| 5630 | + } | |
| 5406 | 5631 | return new AdditionalResources( |
| 5407 | 5632 | AdditionalResources::fromAdditionalResourcesSeeAlso($obj->{'See Also '}) |
| 5408 | 5633 | ,AdditionalResources::fromSeeAlso($obj->{'See Also'}) |
| @@ -5607,6 +5832,15 @@ class CommonCore { | ||
| 5607 | 5832 | * @throws Exception |
| 5608 | 5833 | */ |
| 5609 | 5834 | public static function from(stdClass $obj): CommonCore { |
| 5835 | + if (!property_exists($obj, 'Contact Email')) { | |
| 5836 | + throw new Exception("Missing required property"); | |
| 5837 | + } | |
| 5838 | + if (!property_exists($obj, 'Contact Name')) { | |
| 5839 | + throw new Exception("Missing required property"); | |
| 5840 | + } | |
| 5841 | + if (!property_exists($obj, 'Publisher')) { | |
| 5842 | + throw new Exception("Missing required property"); | |
| 5843 | + } | |
| 5610 | 5844 | return new CommonCore( |
| 5611 | 5845 | CommonCore::fromContactEmail($obj->{'Contact Email'}) |
| 5612 | 5846 | ,CommonCore::fromContactName($obj->{'Contact Name'}) |
| @@ -5709,6 +5943,9 @@ class DatasetInformation { | ||
| 5709 | 5943 | * @throws Exception |
| 5710 | 5944 | */ |
| 5711 | 5945 | public static function from(stdClass $obj): DatasetInformation { |
| 5946 | + if (!property_exists($obj, 'Agency')) { | |
| 5947 | + throw new Exception("Missing required property"); | |
| 5948 | + } | |
| 5712 | 5949 | return new DatasetInformation( |
| 5713 | 5950 | DatasetInformation::fromAgency($obj->{'Agency'}) |
| 5714 | 5951 | ); |
| @@ -6223,6 +6460,33 @@ class DatasetSummary { | ||
| 6223 | 6460 | * @throws Exception |
| 6224 | 6461 | */ |
| 6225 | 6462 | public static function from(stdClass $obj): DatasetSummary { |
| 6463 | + if (!property_exists($obj, 'Contact Information')) { | |
| 6464 | + throw new Exception("Missing required property"); | |
| 6465 | + } | |
| 6466 | + if (!property_exists($obj, 'Coverage')) { | |
| 6467 | + throw new Exception("Missing required property"); | |
| 6468 | + } | |
| 6469 | + if (!property_exists($obj, 'Data Frequency')) { | |
| 6470 | + throw new Exception("Missing required property"); | |
| 6471 | + } | |
| 6472 | + if (!property_exists($obj, 'Dataset Owner')) { | |
| 6473 | + throw new Exception("Missing required property"); | |
| 6474 | + } | |
| 6475 | + if (!property_exists($obj, 'Granularity')) { | |
| 6476 | + throw new Exception("Missing required property"); | |
| 6477 | + } | |
| 6478 | + if (!property_exists($obj, 'Organization')) { | |
| 6479 | + throw new Exception("Missing required property"); | |
| 6480 | + } | |
| 6481 | + if (!property_exists($obj, 'Posting Frequency')) { | |
| 6482 | + throw new Exception("Missing required property"); | |
| 6483 | + } | |
| 6484 | + if (!property_exists($obj, 'Time Period')) { | |
| 6485 | + throw new Exception("Missing required property"); | |
| 6486 | + } | |
| 6487 | + if (!property_exists($obj, 'Units')) { | |
| 6488 | + throw new Exception("Missing required property"); | |
| 6489 | + } | |
| 6226 | 6490 | return new DatasetSummary( |
| 6227 | 6491 | DatasetSummary::fromContactInformation($obj->{'Contact Information'}) |
| 6228 | 6492 | ,DatasetSummary::fromCoverage($obj->{'Coverage'}) |
| @@ -6337,6 +6601,9 @@ class Notes { | ||
| 6337 | 6601 | * @throws Exception |
| 6338 | 6602 | */ |
| 6339 | 6603 | public static function from(stdClass $obj): Notes { |
| 6604 | + if (!property_exists($obj, 'Notes')) { | |
| 6605 | + throw new Exception("Missing required property"); | |
| 6606 | + } | |
| 6340 | 6607 | return new Notes( |
| 6341 | 6608 | Notes::fromNotes($obj->{'Notes'}) |
| 6342 | 6609 | ); |
| @@ -6447,6 +6714,9 @@ class JSONQuery { | ||
| 6447 | 6714 | * @throws Exception |
| 6448 | 6715 | */ |
| 6449 | 6716 | public static function from(stdClass $obj): JSONQuery { |
| 6717 | + if (!property_exists($obj, 'order')) { | |
| 6718 | + throw new Exception("Missing required property"); | |
| 6719 | + } | |
| 6450 | 6720 | return new JSONQuery( |
| 6451 | 6721 | JSONQuery::fromOrder($obj->{'order'}) |
| 6452 | 6722 | ); |
| @@ -6597,6 +6867,12 @@ class Order { | ||
| 6597 | 6867 | * @throws Exception |
| 6598 | 6868 | */ |
| 6599 | 6869 | public static function from(stdClass $obj): Order { |
| 6870 | + if (!property_exists($obj, 'ascending')) { | |
| 6871 | + throw new Exception("Missing required property"); | |
| 6872 | + } | |
| 6873 | + if (!property_exists($obj, 'columnFieldName')) { | |
| 6874 | + throw new Exception("Missing required property"); | |
| 6875 | + } | |
| 6600 | 6876 | return new Order( |
| 6601 | 6877 | Order::fromAscending($obj->{'ascending'}) |
| 6602 | 6878 | ,Order::fromColumnFieldName($obj->{'columnFieldName'}) |
| @@ -6698,6 +6974,9 @@ class RenderTypeConfig { | ||
| 6698 | 6974 | * @throws Exception |
| 6699 | 6975 | */ |
| 6700 | 6976 | public static function from(stdClass $obj): RenderTypeConfig { |
| 6977 | + if (!property_exists($obj, 'visible')) { | |
| 6978 | + throw new Exception("Missing required property"); | |
| 6979 | + } | |
| 6701 | 6980 | return new RenderTypeConfig( |
| 6702 | 6981 | RenderTypeConfig::fromVisible($obj->{'visible'}) |
| 6703 | 6982 | ); |
| @@ -6796,6 +7075,9 @@ class Visible { | ||
| 6796 | 7075 | * @throws Exception |
| 6797 | 7076 | */ |
| 6798 | 7077 | public static function from(stdClass $obj): Visible { |
| 7078 | + if (!property_exists($obj, 'table')) { | |
| 7079 | + throw new Exception("Missing required property"); | |
| 7080 | + } | |
| 6799 | 7081 | return new Visible( |
| 6800 | 7082 | Visible::fromTable($obj->{'table'}) |
| 6801 | 7083 | ); |
| @@ -7272,6 +7554,30 @@ class Owner { | ||
| 7272 | 7554 | * @throws Exception |
| 7273 | 7555 | */ |
| 7274 | 7556 | public static function from(stdClass $obj): Owner { |
| 7557 | + if (!property_exists($obj, 'displayName')) { | |
| 7558 | + throw new Exception("Missing required property"); | |
| 7559 | + } | |
| 7560 | + if (!property_exists($obj, 'id')) { | |
| 7561 | + throw new Exception("Missing required property"); | |
| 7562 | + } | |
| 7563 | + if (!property_exists($obj, 'profileImageUrlLarge')) { | |
| 7564 | + throw new Exception("Missing required property"); | |
| 7565 | + } | |
| 7566 | + if (!property_exists($obj, 'profileImageUrlMedium')) { | |
| 7567 | + throw new Exception("Missing required property"); | |
| 7568 | + } | |
| 7569 | + if (!property_exists($obj, 'profileImageUrlSmall')) { | |
| 7570 | + throw new Exception("Missing required property"); | |
| 7571 | + } | |
| 7572 | + if (!property_exists($obj, 'rights')) { | |
| 7573 | + throw new Exception("Missing required property"); | |
| 7574 | + } | |
| 7575 | + if (!property_exists($obj, 'roleName')) { | |
| 7576 | + throw new Exception("Missing required property"); | |
| 7577 | + } | |
| 7578 | + if (!property_exists($obj, 'screenName')) { | |
| 7579 | + throw new Exception("Missing required property"); | |
| 7580 | + } | |
| 7275 | 7581 | return new Owner( |
| 7276 | 7582 | Owner::fromDisplayName($obj->{'displayName'}) |
| 7277 | 7583 | ,Owner::fromID($obj->{'id'}) |
| @@ -7396,6 +7702,9 @@ class Query { | ||
| 7396 | 7702 | * @throws Exception |
| 7397 | 7703 | */ |
| 7398 | 7704 | public static function from(stdClass $obj): Query { |
| 7705 | + if (!property_exists($obj, 'orderBys')) { | |
| 7706 | + throw new Exception("Missing required property"); | |
| 7707 | + } | |
| 7399 | 7708 | return new Query( |
| 7400 | 7709 | Query::fromOrderBys($obj->{'orderBys'}) |
| 7401 | 7710 | ); |
| @@ -7547,6 +7856,12 @@ class OrderBy { | ||
| 7547 | 7856 | * @throws Exception |
| 7548 | 7857 | */ |
| 7549 | 7858 | public static function from(stdClass $obj): OrderBy { |
| 7859 | + if (!property_exists($obj, 'ascending')) { | |
| 7860 | + throw new Exception("Missing required property"); | |
| 7861 | + } | |
| 7862 | + if (!property_exists($obj, 'expression')) { | |
| 7863 | + throw new Exception("Missing required property"); | |
| 7864 | + } | |
| 7550 | 7865 | return new OrderBy( |
| 7551 | 7866 | OrderBy::fromAscending($obj->{'ascending'}) |
| 7552 | 7867 | ,OrderBy::fromExpression($obj->{'expression'}) |
| @@ -7699,6 +8014,12 @@ class Expression { | ||
| 7699 | 8014 | * @throws Exception |
| 7700 | 8015 | */ |
| 7701 | 8016 | public static function from(stdClass $obj): Expression { |
| 8017 | + if (!property_exists($obj, 'columnId')) { | |
| 8018 | + throw new Exception("Missing required property"); | |
| 8019 | + } | |
| 8020 | + if (!property_exists($obj, 'type')) { | |
| 8021 | + throw new Exception("Missing required property"); | |
| 8022 | + } | |
| 7702 | 8023 | return new Expression( |
| 7703 | 8024 | Expression::fromColumnID($obj->{'columnId'}) |
| 7704 | 8025 | ,Expression::fromType($obj->{'type'}) |
Test case
1 generated file · +279 −0test/inputs/json/misc/27332.json
Mphpdefault / TopLevel.php+279 −0
| @@ -137,6 +137,12 @@ class TopLevel { | ||
| 137 | 137 | * @throws Exception |
| 138 | 138 | */ |
| 139 | 139 | public static function from(stdClass $obj): TopLevel { |
| 140 | + if (!property_exists($obj, 'data')) { | |
| 141 | + throw new Exception("Missing required property"); | |
| 142 | + } | |
| 143 | + if (!property_exists($obj, 'kind')) { | |
| 144 | + throw new Exception("Missing required property"); | |
| 145 | + } | |
| 140 | 146 | return new TopLevel( |
| 141 | 147 | TopLevel::fromData($obj->{'data'}) |
| 142 | 148 | ,TopLevel::fromKind($obj->{'kind'}) |
| @@ -408,6 +414,18 @@ class TopLevelData { | ||
| 408 | 414 | * @throws Exception |
| 409 | 415 | */ |
| 410 | 416 | public static function from(stdClass $obj): TopLevelData { |
| 417 | + if (!property_exists($obj, 'after')) { | |
| 418 | + throw new Exception("Missing required property"); | |
| 419 | + } | |
| 420 | + if (!property_exists($obj, 'before')) { | |
| 421 | + throw new Exception("Missing required property"); | |
| 422 | + } | |
| 423 | + if (!property_exists($obj, 'children')) { | |
| 424 | + throw new Exception("Missing required property"); | |
| 425 | + } | |
| 426 | + if (!property_exists($obj, 'modhash')) { | |
| 427 | + throw new Exception("Missing required property"); | |
| 428 | + } | |
| 411 | 429 | return new TopLevelData( |
| 412 | 430 | TopLevelData::fromAfter($obj->{'after'}) |
| 413 | 431 | ,TopLevelData::fromBefore($obj->{'before'}) |
| @@ -566,6 +584,12 @@ class Child { | ||
| 566 | 584 | * @throws Exception |
| 567 | 585 | */ |
| 568 | 586 | public static function from(stdClass $obj): Child { |
| 587 | + if (!property_exists($obj, 'data')) { | |
| 588 | + throw new Exception("Missing required property"); | |
| 589 | + } | |
| 590 | + if (!property_exists($obj, 'kind')) { | |
| 591 | + throw new Exception("Missing required property"); | |
| 592 | + } | |
| 569 | 593 | return new Child( |
| 570 | 594 | Child::fromData($obj->{'data'}) |
| 571 | 595 | ,Child::fromKind($obj->{'kind'}) |
| @@ -4125,6 +4149,192 @@ class ChildData { | ||
| 4125 | 4149 | * @throws Exception |
| 4126 | 4150 | */ |
| 4127 | 4151 | public static function from(stdClass $obj): ChildData { |
| 4152 | + if (!property_exists($obj, 'approved_at_utc')) { | |
| 4153 | + throw new Exception("Missing required property"); | |
| 4154 | + } | |
| 4155 | + if (!property_exists($obj, 'approved_by')) { | |
| 4156 | + throw new Exception("Missing required property"); | |
| 4157 | + } | |
| 4158 | + if (!property_exists($obj, 'archived')) { | |
| 4159 | + throw new Exception("Missing required property"); | |
| 4160 | + } | |
| 4161 | + if (!property_exists($obj, 'author')) { | |
| 4162 | + throw new Exception("Missing required property"); | |
| 4163 | + } | |
| 4164 | + if (!property_exists($obj, 'author_flair_css_class')) { | |
| 4165 | + throw new Exception("Missing required property"); | |
| 4166 | + } | |
| 4167 | + if (!property_exists($obj, 'author_flair_text')) { | |
| 4168 | + throw new Exception("Missing required property"); | |
| 4169 | + } | |
| 4170 | + if (!property_exists($obj, 'banned_at_utc')) { | |
| 4171 | + throw new Exception("Missing required property"); | |
| 4172 | + } | |
| 4173 | + if (!property_exists($obj, 'banned_by')) { | |
| 4174 | + throw new Exception("Missing required property"); | |
| 4175 | + } | |
| 4176 | + if (!property_exists($obj, 'brand_safe')) { | |
| 4177 | + throw new Exception("Missing required property"); | |
| 4178 | + } | |
| 4179 | + if (!property_exists($obj, 'can_gild')) { | |
| 4180 | + throw new Exception("Missing required property"); | |
| 4181 | + } | |
| 4182 | + if (!property_exists($obj, 'can_mod_post')) { | |
| 4183 | + throw new Exception("Missing required property"); | |
| 4184 | + } | |
| 4185 | + if (!property_exists($obj, 'clicked')) { | |
| 4186 | + throw new Exception("Missing required property"); | |
| 4187 | + } | |
| 4188 | + if (!property_exists($obj, 'contest_mode')) { | |
| 4189 | + throw new Exception("Missing required property"); | |
| 4190 | + } | |
| 4191 | + if (!property_exists($obj, 'created')) { | |
| 4192 | + throw new Exception("Missing required property"); | |
| 4193 | + } | |
| 4194 | + if (!property_exists($obj, 'created_utc')) { | |
| 4195 | + throw new Exception("Missing required property"); | |
| 4196 | + } | |
| 4197 | + if (!property_exists($obj, 'distinguished')) { | |
| 4198 | + throw new Exception("Missing required property"); | |
| 4199 | + } | |
| 4200 | + if (!property_exists($obj, 'domain')) { | |
| 4201 | + throw new Exception("Missing required property"); | |
| 4202 | + } | |
| 4203 | + if (!property_exists($obj, 'downs')) { | |
| 4204 | + throw new Exception("Missing required property"); | |
| 4205 | + } | |
| 4206 | + if (!property_exists($obj, 'edited')) { | |
| 4207 | + throw new Exception("Missing required property"); | |
| 4208 | + } | |
| 4209 | + if (!property_exists($obj, 'gilded')) { | |
| 4210 | + throw new Exception("Missing required property"); | |
| 4211 | + } | |
| 4212 | + if (!property_exists($obj, 'hidden')) { | |
| 4213 | + throw new Exception("Missing required property"); | |
| 4214 | + } | |
| 4215 | + if (!property_exists($obj, 'hide_score')) { | |
| 4216 | + throw new Exception("Missing required property"); | |
| 4217 | + } | |
| 4218 | + if (!property_exists($obj, 'id')) { | |
| 4219 | + throw new Exception("Missing required property"); | |
| 4220 | + } | |
| 4221 | + if (!property_exists($obj, 'is_self')) { | |
| 4222 | + throw new Exception("Missing required property"); | |
| 4223 | + } | |
| 4224 | + if (!property_exists($obj, 'is_video')) { | |
| 4225 | + throw new Exception("Missing required property"); | |
| 4226 | + } | |
| 4227 | + if (!property_exists($obj, 'likes')) { | |
| 4228 | + throw new Exception("Missing required property"); | |
| 4229 | + } | |
| 4230 | + if (!property_exists($obj, 'link_flair_css_class')) { | |
| 4231 | + throw new Exception("Missing required property"); | |
| 4232 | + } | |
| 4233 | + if (!property_exists($obj, 'link_flair_text')) { | |
| 4234 | + throw new Exception("Missing required property"); | |
| 4235 | + } | |
| 4236 | + if (!property_exists($obj, 'locked')) { | |
| 4237 | + throw new Exception("Missing required property"); | |
| 4238 | + } | |
| 4239 | + if (!property_exists($obj, 'media')) { | |
| 4240 | + throw new Exception("Missing required property"); | |
| 4241 | + } | |
| 4242 | + if (!property_exists($obj, 'media_embed')) { | |
| 4243 | + throw new Exception("Missing required property"); | |
| 4244 | + } | |
| 4245 | + if (!property_exists($obj, 'mod_reports')) { | |
| 4246 | + throw new Exception("Missing required property"); | |
| 4247 | + } | |
| 4248 | + if (!property_exists($obj, 'name')) { | |
| 4249 | + throw new Exception("Missing required property"); | |
| 4250 | + } | |
| 4251 | + if (!property_exists($obj, 'num_comments')) { | |
| 4252 | + throw new Exception("Missing required property"); | |
| 4253 | + } | |
| 4254 | + if (!property_exists($obj, 'num_reports')) { | |
| 4255 | + throw new Exception("Missing required property"); | |
| 4256 | + } | |
| 4257 | + if (!property_exists($obj, 'over_18')) { | |
| 4258 | + throw new Exception("Missing required property"); | |
| 4259 | + } | |
| 4260 | + if (!property_exists($obj, 'permalink')) { | |
| 4261 | + throw new Exception("Missing required property"); | |
| 4262 | + } | |
| 4263 | + if (!property_exists($obj, 'quarantine')) { | |
| 4264 | + throw new Exception("Missing required property"); | |
| 4265 | + } | |
| 4266 | + if (!property_exists($obj, 'removal_reason')) { | |
| 4267 | + throw new Exception("Missing required property"); | |
| 4268 | + } | |
| 4269 | + if (!property_exists($obj, 'report_reasons')) { | |
| 4270 | + throw new Exception("Missing required property"); | |
| 4271 | + } | |
| 4272 | + if (!property_exists($obj, 'saved')) { | |
| 4273 | + throw new Exception("Missing required property"); | |
| 4274 | + } | |
| 4275 | + if (!property_exists($obj, 'score')) { | |
| 4276 | + throw new Exception("Missing required property"); | |
| 4277 | + } | |
| 4278 | + if (!property_exists($obj, 'secure_media')) { | |
| 4279 | + throw new Exception("Missing required property"); | |
| 4280 | + } | |
| 4281 | + if (!property_exists($obj, 'secure_media_embed')) { | |
| 4282 | + throw new Exception("Missing required property"); | |
| 4283 | + } | |
| 4284 | + if (!property_exists($obj, 'selftext')) { | |
| 4285 | + throw new Exception("Missing required property"); | |
| 4286 | + } | |
| 4287 | + if (!property_exists($obj, 'selftext_html')) { | |
| 4288 | + throw new Exception("Missing required property"); | |
| 4289 | + } | |
| 4290 | + if (!property_exists($obj, 'spoiler')) { | |
| 4291 | + throw new Exception("Missing required property"); | |
| 4292 | + } | |
| 4293 | + if (!property_exists($obj, 'stickied')) { | |
| 4294 | + throw new Exception("Missing required property"); | |
| 4295 | + } | |
| 4296 | + if (!property_exists($obj, 'subreddit')) { | |
| 4297 | + throw new Exception("Missing required property"); | |
| 4298 | + } | |
| 4299 | + if (!property_exists($obj, 'subreddit_id')) { | |
| 4300 | + throw new Exception("Missing required property"); | |
| 4301 | + } | |
| 4302 | + if (!property_exists($obj, 'subreddit_name_prefixed')) { | |
| 4303 | + throw new Exception("Missing required property"); | |
| 4304 | + } | |
| 4305 | + if (!property_exists($obj, 'subreddit_type')) { | |
| 4306 | + throw new Exception("Missing required property"); | |
| 4307 | + } | |
| 4308 | + if (!property_exists($obj, 'suggested_sort')) { | |
| 4309 | + throw new Exception("Missing required property"); | |
| 4310 | + } | |
| 4311 | + if (!property_exists($obj, 'thumbnail')) { | |
| 4312 | + throw new Exception("Missing required property"); | |
| 4313 | + } | |
| 4314 | + if (!property_exists($obj, 'thumbnail_height')) { | |
| 4315 | + throw new Exception("Missing required property"); | |
| 4316 | + } | |
| 4317 | + if (!property_exists($obj, 'thumbnail_width')) { | |
| 4318 | + throw new Exception("Missing required property"); | |
| 4319 | + } | |
| 4320 | + if (!property_exists($obj, 'title')) { | |
| 4321 | + throw new Exception("Missing required property"); | |
| 4322 | + } | |
| 4323 | + if (!property_exists($obj, 'ups')) { | |
| 4324 | + throw new Exception("Missing required property"); | |
| 4325 | + } | |
| 4326 | + if (!property_exists($obj, 'url')) { | |
| 4327 | + throw new Exception("Missing required property"); | |
| 4328 | + } | |
| 4329 | + if (!property_exists($obj, 'user_reports')) { | |
| 4330 | + throw new Exception("Missing required property"); | |
| 4331 | + } | |
| 4332 | + if (!property_exists($obj, 'view_count')) { | |
| 4333 | + throw new Exception("Missing required property"); | |
| 4334 | + } | |
| 4335 | + if (!property_exists($obj, 'visited')) { | |
| 4336 | + throw new Exception("Missing required property"); | |
| 4337 | + } | |
| 4128 | 4338 | return new ChildData( |
| 4129 | 4339 | ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'}) |
| 4130 | 4340 | ,ChildData::fromApprovedBy($obj->{'approved_by'}) |
| @@ -4460,6 +4670,12 @@ class Media { | ||
| 4460 | 4670 | * @throws Exception |
| 4461 | 4671 | */ |
| 4462 | 4672 | public static function from(stdClass $obj): Media { |
| 4673 | + if (!property_exists($obj, 'oembed')) { | |
| 4674 | + throw new Exception("Missing required property"); | |
| 4675 | + } | |
| 4676 | + if (!property_exists($obj, 'type')) { | |
| 4677 | + throw new Exception("Missing required property"); | |
| 4678 | + } | |
| 4463 | 4679 | return new Media( |
| 4464 | 4680 | Media::fromOembed($obj->{'oembed'}) |
| 4465 | 4681 | ,Media::fromType($obj->{'type'}) |
| @@ -5132,6 +5348,42 @@ class Oembed { | ||
| 5132 | 5348 | * @throws Exception |
| 5133 | 5349 | */ |
| 5134 | 5350 | public static function from(stdClass $obj): Oembed { |
| 5351 | + if (!property_exists($obj, 'description')) { | |
| 5352 | + throw new Exception("Missing required property"); | |
| 5353 | + } | |
| 5354 | + if (!property_exists($obj, 'height')) { | |
| 5355 | + throw new Exception("Missing required property"); | |
| 5356 | + } | |
| 5357 | + if (!property_exists($obj, 'html')) { | |
| 5358 | + throw new Exception("Missing required property"); | |
| 5359 | + } | |
| 5360 | + if (!property_exists($obj, 'provider_name')) { | |
| 5361 | + throw new Exception("Missing required property"); | |
| 5362 | + } | |
| 5363 | + if (!property_exists($obj, 'provider_url')) { | |
| 5364 | + throw new Exception("Missing required property"); | |
| 5365 | + } | |
| 5366 | + if (!property_exists($obj, 'thumbnail_height')) { | |
| 5367 | + throw new Exception("Missing required property"); | |
| 5368 | + } | |
| 5369 | + if (!property_exists($obj, 'thumbnail_url')) { | |
| 5370 | + throw new Exception("Missing required property"); | |
| 5371 | + } | |
| 5372 | + if (!property_exists($obj, 'thumbnail_width')) { | |
| 5373 | + throw new Exception("Missing required property"); | |
| 5374 | + } | |
| 5375 | + if (!property_exists($obj, 'title')) { | |
| 5376 | + throw new Exception("Missing required property"); | |
| 5377 | + } | |
| 5378 | + if (!property_exists($obj, 'type')) { | |
| 5379 | + throw new Exception("Missing required property"); | |
| 5380 | + } | |
| 5381 | + if (!property_exists($obj, 'version')) { | |
| 5382 | + throw new Exception("Missing required property"); | |
| 5383 | + } | |
| 5384 | + if (!property_exists($obj, 'width')) { | |
| 5385 | + throw new Exception("Missing required property"); | |
| 5386 | + } | |
| 5135 | 5387 | return new Oembed( |
| 5136 | 5388 | Oembed::fromDescription($obj->{'description'}) |
| 5137 | 5389 | ,Oembed::fromHeight($obj->{'height'}) |
| @@ -5665,6 +5917,12 @@ class Preview { | ||
| 5665 | 5917 | * @throws Exception |
| 5666 | 5918 | */ |
| 5667 | 5919 | public static function from(stdClass $obj): Preview { |
| 5920 | + if (!property_exists($obj, 'enabled')) { | |
| 5921 | + throw new Exception("Missing required property"); | |
| 5922 | + } | |
| 5923 | + if (!property_exists($obj, 'images')) { | |
| 5924 | + throw new Exception("Missing required property"); | |
| 5925 | + } | |
| 5668 | 5926 | return new Preview( |
| 5669 | 5927 | Preview::fromEnabled($obj->{'enabled'}) |
| 5670 | 5928 | ,Preview::fromImages($obj->{'images'}) |
| @@ -5935,6 +6193,18 @@ class Image { | ||
| 5935 | 6193 | * @throws Exception |
| 5936 | 6194 | */ |
| 5937 | 6195 | public static function from(stdClass $obj): Image { |
| 6196 | + if (!property_exists($obj, 'id')) { | |
| 6197 | + throw new Exception("Missing required property"); | |
| 6198 | + } | |
| 6199 | + if (!property_exists($obj, 'resolutions')) { | |
| 6200 | + throw new Exception("Missing required property"); | |
| 6201 | + } | |
| 6202 | + if (!property_exists($obj, 'source')) { | |
| 6203 | + throw new Exception("Missing required property"); | |
| 6204 | + } | |
| 6205 | + if (!property_exists($obj, 'variants')) { | |
| 6206 | + throw new Exception("Missing required property"); | |
| 6207 | + } | |
| 5938 | 6208 | return new Image( |
| 5939 | 6209 | Image::fromID($obj->{'id'}) |
| 5940 | 6210 | ,Image::fromResolutions($obj->{'resolutions'}) |
| @@ -6143,6 +6413,15 @@ class Source { | ||
| 6143 | 6413 | * @throws Exception |
| 6144 | 6414 | */ |
| 6145 | 6415 | public static function from(stdClass $obj): Source { |
| 6416 | + if (!property_exists($obj, 'height')) { | |
| 6417 | + throw new Exception("Missing required property"); | |
| 6418 | + } | |
| 6419 | + if (!property_exists($obj, 'url')) { | |
| 6420 | + throw new Exception("Missing required property"); | |
| 6421 | + } | |
| 6422 | + if (!property_exists($obj, 'width')) { | |
| 6423 | + throw new Exception("Missing required property"); | |
| 6424 | + } | |
| 6146 | 6425 | return new Source( |
| 6147 | 6426 | Source::fromHeight($obj->{'height'}) |
| 6148 | 6427 | ,Source::fromURL($obj->{'url'}) |
Test case
1 generated file · +243 −0test/inputs/json/misc/29f47.json
Mphpdefault / TopLevel.php+243 −0
| @@ -137,6 +137,12 @@ class TopLevel { | ||
| 137 | 137 | * @throws Exception |
| 138 | 138 | */ |
| 139 | 139 | public static function from(stdClass $obj): TopLevel { |
| 140 | + if (!property_exists($obj, 'data')) { | |
| 141 | + throw new Exception("Missing required property"); | |
| 142 | + } | |
| 143 | + if (!property_exists($obj, 'kind')) { | |
| 144 | + throw new Exception("Missing required property"); | |
| 145 | + } | |
| 140 | 146 | return new TopLevel( |
| 141 | 147 | TopLevel::fromData($obj->{'data'}) |
| 142 | 148 | ,TopLevel::fromKind($obj->{'kind'}) |
| @@ -408,6 +414,18 @@ class TopLevelData { | ||
| 408 | 414 | * @throws Exception |
| 409 | 415 | */ |
| 410 | 416 | public static function from(stdClass $obj): TopLevelData { |
| 417 | + if (!property_exists($obj, 'after')) { | |
| 418 | + throw new Exception("Missing required property"); | |
| 419 | + } | |
| 420 | + if (!property_exists($obj, 'before')) { | |
| 421 | + throw new Exception("Missing required property"); | |
| 422 | + } | |
| 423 | + if (!property_exists($obj, 'children')) { | |
| 424 | + throw new Exception("Missing required property"); | |
| 425 | + } | |
| 426 | + if (!property_exists($obj, 'modhash')) { | |
| 427 | + throw new Exception("Missing required property"); | |
| 428 | + } | |
| 411 | 429 | return new TopLevelData( |
| 412 | 430 | TopLevelData::fromAfter($obj->{'after'}) |
| 413 | 431 | ,TopLevelData::fromBefore($obj->{'before'}) |
| @@ -566,6 +584,12 @@ class Child { | ||
| 566 | 584 | * @throws Exception |
| 567 | 585 | */ |
| 568 | 586 | public static function from(stdClass $obj): Child { |
| 587 | + if (!property_exists($obj, 'data')) { | |
| 588 | + throw new Exception("Missing required property"); | |
| 589 | + } | |
| 590 | + if (!property_exists($obj, 'kind')) { | |
| 591 | + throw new Exception("Missing required property"); | |
| 592 | + } | |
| 569 | 593 | return new Child( |
| 570 | 594 | Child::fromData($obj->{'data'}) |
| 571 | 595 | ,Child::fromKind($obj->{'kind'}) |
| @@ -4102,6 +4126,192 @@ class ChildData { | ||
| 4102 | 4126 | * @throws Exception |
| 4103 | 4127 | */ |
| 4104 | 4128 | public static function from(stdClass $obj): ChildData { |
| 4129 | + if (!property_exists($obj, 'approved_at_utc')) { | |
| 4130 | + throw new Exception("Missing required property"); | |
| 4131 | + } | |
| 4132 | + if (!property_exists($obj, 'approved_by')) { | |
| 4133 | + throw new Exception("Missing required property"); | |
| 4134 | + } | |
| 4135 | + if (!property_exists($obj, 'archived')) { | |
| 4136 | + throw new Exception("Missing required property"); | |
| 4137 | + } | |
| 4138 | + if (!property_exists($obj, 'author')) { | |
| 4139 | + throw new Exception("Missing required property"); | |
| 4140 | + } | |
| 4141 | + if (!property_exists($obj, 'author_flair_css_class')) { | |
| 4142 | + throw new Exception("Missing required property"); | |
| 4143 | + } | |
| 4144 | + if (!property_exists($obj, 'author_flair_text')) { | |
| 4145 | + throw new Exception("Missing required property"); | |
| 4146 | + } | |
| 4147 | + if (!property_exists($obj, 'banned_at_utc')) { | |
| 4148 | + throw new Exception("Missing required property"); | |
| 4149 | + } | |
| 4150 | + if (!property_exists($obj, 'banned_by')) { | |
| 4151 | + throw new Exception("Missing required property"); | |
| 4152 | + } | |
| 4153 | + if (!property_exists($obj, 'brand_safe')) { | |
| 4154 | + throw new Exception("Missing required property"); | |
| 4155 | + } | |
| 4156 | + if (!property_exists($obj, 'can_gild')) { | |
| 4157 | + throw new Exception("Missing required property"); | |
| 4158 | + } | |
| 4159 | + if (!property_exists($obj, 'can_mod_post')) { | |
| 4160 | + throw new Exception("Missing required property"); | |
| 4161 | + } | |
| 4162 | + if (!property_exists($obj, 'clicked')) { | |
| 4163 | + throw new Exception("Missing required property"); | |
| 4164 | + } | |
| 4165 | + if (!property_exists($obj, 'contest_mode')) { | |
| 4166 | + throw new Exception("Missing required property"); | |
| 4167 | + } | |
| 4168 | + if (!property_exists($obj, 'created')) { | |
| 4169 | + throw new Exception("Missing required property"); | |
| 4170 | + } | |
| 4171 | + if (!property_exists($obj, 'created_utc')) { | |
| 4172 | + throw new Exception("Missing required property"); | |
| 4173 | + } | |
| 4174 | + if (!property_exists($obj, 'distinguished')) { | |
| 4175 | + throw new Exception("Missing required property"); | |
| 4176 | + } | |
| 4177 | + if (!property_exists($obj, 'domain')) { | |
| 4178 | + throw new Exception("Missing required property"); | |
| 4179 | + } | |
| 4180 | + if (!property_exists($obj, 'downs')) { | |
| 4181 | + throw new Exception("Missing required property"); | |
| 4182 | + } | |
| 4183 | + if (!property_exists($obj, 'edited')) { | |
| 4184 | + throw new Exception("Missing required property"); | |
| 4185 | + } | |
| 4186 | + if (!property_exists($obj, 'gilded')) { | |
| 4187 | + throw new Exception("Missing required property"); | |
| 4188 | + } | |
| 4189 | + if (!property_exists($obj, 'hidden')) { | |
| 4190 | + throw new Exception("Missing required property"); | |
| 4191 | + } | |
| 4192 | + if (!property_exists($obj, 'hide_score')) { | |
| 4193 | + throw new Exception("Missing required property"); | |
| 4194 | + } | |
| 4195 | + if (!property_exists($obj, 'id')) { | |
| 4196 | + throw new Exception("Missing required property"); | |
| 4197 | + } | |
| 4198 | + if (!property_exists($obj, 'is_self')) { | |
| 4199 | + throw new Exception("Missing required property"); | |
| 4200 | + } | |
| 4201 | + if (!property_exists($obj, 'is_video')) { | |
| 4202 | + throw new Exception("Missing required property"); | |
| 4203 | + } | |
| 4204 | + if (!property_exists($obj, 'likes')) { | |
| 4205 | + throw new Exception("Missing required property"); | |
| 4206 | + } | |
| 4207 | + if (!property_exists($obj, 'link_flair_css_class')) { | |
| 4208 | + throw new Exception("Missing required property"); | |
| 4209 | + } | |
| 4210 | + if (!property_exists($obj, 'link_flair_text')) { | |
| 4211 | + throw new Exception("Missing required property"); | |
| 4212 | + } | |
| 4213 | + if (!property_exists($obj, 'locked')) { | |
| 4214 | + throw new Exception("Missing required property"); | |
| 4215 | + } | |
| 4216 | + if (!property_exists($obj, 'media')) { | |
| 4217 | + throw new Exception("Missing required property"); | |
| 4218 | + } | |
| 4219 | + if (!property_exists($obj, 'media_embed')) { | |
| 4220 | + throw new Exception("Missing required property"); | |
| 4221 | + } | |
| 4222 | + if (!property_exists($obj, 'mod_reports')) { | |
| 4223 | + throw new Exception("Missing required property"); | |
| 4224 | + } | |
| 4225 | + if (!property_exists($obj, 'name')) { | |
| 4226 | + throw new Exception("Missing required property"); | |
| 4227 | + } | |
| 4228 | + if (!property_exists($obj, 'num_comments')) { | |
| 4229 | + throw new Exception("Missing required property"); | |
| 4230 | + } | |
| 4231 | + if (!property_exists($obj, 'num_reports')) { | |
| 4232 | + throw new Exception("Missing required property"); | |
| 4233 | + } | |
| 4234 | + if (!property_exists($obj, 'over_18')) { | |
| 4235 | + throw new Exception("Missing required property"); | |
| 4236 | + } | |
| 4237 | + if (!property_exists($obj, 'permalink')) { | |
| 4238 | + throw new Exception("Missing required property"); | |
| 4239 | + } | |
| 4240 | + if (!property_exists($obj, 'quarantine')) { | |
| 4241 | + throw new Exception("Missing required property"); | |
| 4242 | + } | |
| 4243 | + if (!property_exists($obj, 'removal_reason')) { | |
| 4244 | + throw new Exception("Missing required property"); | |
| 4245 | + } | |
| 4246 | + if (!property_exists($obj, 'report_reasons')) { | |
| 4247 | + throw new Exception("Missing required property"); | |
| 4248 | + } | |
| 4249 | + if (!property_exists($obj, 'saved')) { | |
| 4250 | + throw new Exception("Missing required property"); | |
| 4251 | + } | |
| 4252 | + if (!property_exists($obj, 'score')) { | |
| 4253 | + throw new Exception("Missing required property"); | |
| 4254 | + } | |
| 4255 | + if (!property_exists($obj, 'secure_media')) { | |
| 4256 | + throw new Exception("Missing required property"); | |
| 4257 | + } | |
| 4258 | + if (!property_exists($obj, 'secure_media_embed')) { | |
| 4259 | + throw new Exception("Missing required property"); | |
| 4260 | + } | |
| 4261 | + if (!property_exists($obj, 'selftext')) { | |
| 4262 | + throw new Exception("Missing required property"); | |
| 4263 | + } | |
| 4264 | + if (!property_exists($obj, 'selftext_html')) { | |
| 4265 | + throw new Exception("Missing required property"); | |
| 4266 | + } | |
| 4267 | + if (!property_exists($obj, 'spoiler')) { | |
| 4268 | + throw new Exception("Missing required property"); | |
| 4269 | + } | |
| 4270 | + if (!property_exists($obj, 'stickied')) { | |
| 4271 | + throw new Exception("Missing required property"); | |
| 4272 | + } | |
| 4273 | + if (!property_exists($obj, 'subreddit')) { | |
| 4274 | + throw new Exception("Missing required property"); | |
| 4275 | + } | |
| 4276 | + if (!property_exists($obj, 'subreddit_id')) { | |
| 4277 | + throw new Exception("Missing required property"); | |
| 4278 | + } | |
| 4279 | + if (!property_exists($obj, 'subreddit_name_prefixed')) { | |
| 4280 | + throw new Exception("Missing required property"); | |
| 4281 | + } | |
| 4282 | + if (!property_exists($obj, 'subreddit_type')) { | |
| 4283 | + throw new Exception("Missing required property"); | |
| 4284 | + } | |
| 4285 | + if (!property_exists($obj, 'suggested_sort')) { | |
| 4286 | + throw new Exception("Missing required property"); | |
| 4287 | + } | |
| 4288 | + if (!property_exists($obj, 'thumbnail')) { | |
| 4289 | + throw new Exception("Missing required property"); | |
| 4290 | + } | |
| 4291 | + if (!property_exists($obj, 'thumbnail_height')) { | |
| 4292 | + throw new Exception("Missing required property"); | |
| 4293 | + } | |
| 4294 | + if (!property_exists($obj, 'thumbnail_width')) { | |
| 4295 | + throw new Exception("Missing required property"); | |
| 4296 | + } | |
| 4297 | + if (!property_exists($obj, 'title')) { | |
| 4298 | + throw new Exception("Missing required property"); | |
| 4299 | + } | |
| 4300 | + if (!property_exists($obj, 'ups')) { | |
| 4301 | + throw new Exception("Missing required property"); | |
| 4302 | + } | |
| 4303 | + if (!property_exists($obj, 'url')) { | |
| 4304 | + throw new Exception("Missing required property"); | |
| 4305 | + } | |
| 4306 | + if (!property_exists($obj, 'user_reports')) { | |
| 4307 | + throw new Exception("Missing required property"); | |
| 4308 | + } | |
| 4309 | + if (!property_exists($obj, 'view_count')) { | |
| 4310 | + throw new Exception("Missing required property"); | |
| 4311 | + } | |
| 4312 | + if (!property_exists($obj, 'visited')) { | |
| 4313 | + throw new Exception("Missing required property"); | |
| 4314 | + } | |
| 4105 | 4315 | return new ChildData( |
| 4106 | 4316 | ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'}) |
| 4107 | 4317 | ,ChildData::fromApprovedBy($obj->{'approved_by'}) |
| @@ -4578,6 +4788,12 @@ class Preview { | ||
| 4578 | 4788 | * @throws Exception |
| 4579 | 4789 | */ |
| 4580 | 4790 | public static function from(stdClass $obj): Preview { |
| 4791 | + if (!property_exists($obj, 'enabled')) { | |
| 4792 | + throw new Exception("Missing required property"); | |
| 4793 | + } | |
| 4794 | + if (!property_exists($obj, 'images')) { | |
| 4795 | + throw new Exception("Missing required property"); | |
| 4796 | + } | |
| 4581 | 4797 | return new Preview( |
| 4582 | 4798 | Preview::fromEnabled($obj->{'enabled'}) |
| 4583 | 4799 | ,Preview::fromImages($obj->{'images'}) |
| @@ -4848,6 +5064,18 @@ class Image { | ||
| 4848 | 5064 | * @throws Exception |
| 4849 | 5065 | */ |
| 4850 | 5066 | public static function from(stdClass $obj): Image { |
| 5067 | + if (!property_exists($obj, 'id')) { | |
| 5068 | + throw new Exception("Missing required property"); | |
| 5069 | + } | |
| 5070 | + if (!property_exists($obj, 'resolutions')) { | |
| 5071 | + throw new Exception("Missing required property"); | |
| 5072 | + } | |
| 5073 | + if (!property_exists($obj, 'source')) { | |
| 5074 | + throw new Exception("Missing required property"); | |
| 5075 | + } | |
| 5076 | + if (!property_exists($obj, 'variants')) { | |
| 5077 | + throw new Exception("Missing required property"); | |
| 5078 | + } | |
| 4851 | 5079 | return new Image( |
| 4852 | 5080 | Image::fromID($obj->{'id'}) |
| 4853 | 5081 | ,Image::fromResolutions($obj->{'resolutions'}) |
| @@ -5056,6 +5284,15 @@ class Source { | ||
| 5056 | 5284 | * @throws Exception |
| 5057 | 5285 | */ |
| 5058 | 5286 | public static function from(stdClass $obj): Source { |
| 5287 | + if (!property_exists($obj, 'height')) { | |
| 5288 | + throw new Exception("Missing required property"); | |
| 5289 | + } | |
| 5290 | + if (!property_exists($obj, 'url')) { | |
| 5291 | + throw new Exception("Missing required property"); | |
| 5292 | + } | |
| 5293 | + if (!property_exists($obj, 'width')) { | |
| 5294 | + throw new Exception("Missing required property"); | |
| 5295 | + } | |
| 5059 | 5296 | return new Source( |
| 5060 | 5297 | Source::fromHeight($obj->{'height'}) |
| 5061 | 5298 | ,Source::fromURL($obj->{'url'}) |
| @@ -5397,6 +5634,12 @@ class GIF { | ||
| 5397 | 5634 | * @throws Exception |
| 5398 | 5635 | */ |
| 5399 | 5636 | public static function from(stdClass $obj): GIF { |
| 5637 | + if (!property_exists($obj, 'resolutions')) { | |
| 5638 | + throw new Exception("Missing required property"); | |
| 5639 | + } | |
| 5640 | + if (!property_exists($obj, 'source')) { | |
| 5641 | + throw new Exception("Missing required property"); | |
| 5642 | + } | |
| 5400 | 5643 | return new GIF( |
| 5401 | 5644 | GIF::fromResolutions($obj->{'resolutions'}) |
| 5402 | 5645 | ,GIF::fromSource($obj->{'source'}) |
Test case
1 generated file · +147 −0test/inputs/json/misc/2d4e2.json
Mphpdefault / TopLevel.php+147 −0
| @@ -149,6 +149,12 @@ class TopLevel { | ||
| 149 | 149 | * @throws Exception |
| 150 | 150 | */ |
| 151 | 151 | public static function from(stdClass $obj): TopLevel { |
| 152 | + if (!property_exists($obj, 'meta')) { | |
| 153 | + throw new Exception("Missing required property"); | |
| 154 | + } | |
| 155 | + if (!property_exists($obj, 'objects')) { | |
| 156 | + throw new Exception("Missing required property"); | |
| 157 | + } | |
| 152 | 158 | return new TopLevel( |
| 153 | 159 | TopLevel::fromMeta($obj->{'meta'}) |
| 154 | 160 | ,TopLevel::fromObjects($obj->{'objects'}) |
| @@ -353,6 +359,15 @@ class Meta { | ||
| 353 | 359 | * @throws Exception |
| 354 | 360 | */ |
| 355 | 361 | public static function from(stdClass $obj): Meta { |
| 362 | + if (!property_exists($obj, 'limit')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 365 | + if (!property_exists($obj, 'offset')) { | |
| 366 | + throw new Exception("Missing required property"); | |
| 367 | + } | |
| 368 | + if (!property_exists($obj, 'total_count')) { | |
| 369 | + throw new Exception("Missing required property"); | |
| 370 | + } | |
| 356 | 371 | return new Meta( |
| 357 | 372 | Meta::fromLimit($obj->{'limit'}) |
| 358 | 373 | ,Meta::fromOffset($obj->{'offset'}) |
| @@ -1648,6 +1663,75 @@ class ObjectElement { | ||
| 1648 | 1663 | * @throws Exception |
| 1649 | 1664 | */ |
| 1650 | 1665 | public static function from(stdClass $obj): ObjectElement { |
| 1666 | + if (!property_exists($obj, 'caucus')) { | |
| 1667 | + throw new Exception("Missing required property"); | |
| 1668 | + } | |
| 1669 | + if (!property_exists($obj, 'congress_numbers')) { | |
| 1670 | + throw new Exception("Missing required property"); | |
| 1671 | + } | |
| 1672 | + if (!property_exists($obj, 'current')) { | |
| 1673 | + throw new Exception("Missing required property"); | |
| 1674 | + } | |
| 1675 | + if (!property_exists($obj, 'description')) { | |
| 1676 | + throw new Exception("Missing required property"); | |
| 1677 | + } | |
| 1678 | + if (!property_exists($obj, 'district')) { | |
| 1679 | + throw new Exception("Missing required property"); | |
| 1680 | + } | |
| 1681 | + if (!property_exists($obj, 'enddate')) { | |
| 1682 | + throw new Exception("Missing required property"); | |
| 1683 | + } | |
| 1684 | + if (!property_exists($obj, 'extra')) { | |
| 1685 | + throw new Exception("Missing required property"); | |
| 1686 | + } | |
| 1687 | + if (!property_exists($obj, 'id')) { | |
| 1688 | + throw new Exception("Missing required property"); | |
| 1689 | + } | |
| 1690 | + if (!property_exists($obj, 'leadership_title')) { | |
| 1691 | + throw new Exception("Missing required property"); | |
| 1692 | + } | |
| 1693 | + if (!property_exists($obj, 'party')) { | |
| 1694 | + throw new Exception("Missing required property"); | |
| 1695 | + } | |
| 1696 | + if (!property_exists($obj, 'person')) { | |
| 1697 | + throw new Exception("Missing required property"); | |
| 1698 | + } | |
| 1699 | + if (!property_exists($obj, 'phone')) { | |
| 1700 | + throw new Exception("Missing required property"); | |
| 1701 | + } | |
| 1702 | + if (!property_exists($obj, 'role_type')) { | |
| 1703 | + throw new Exception("Missing required property"); | |
| 1704 | + } | |
| 1705 | + if (!property_exists($obj, 'role_type_label')) { | |
| 1706 | + throw new Exception("Missing required property"); | |
| 1707 | + } | |
| 1708 | + if (!property_exists($obj, 'senator_class')) { | |
| 1709 | + throw new Exception("Missing required property"); | |
| 1710 | + } | |
| 1711 | + if (!property_exists($obj, 'senator_class_label')) { | |
| 1712 | + throw new Exception("Missing required property"); | |
| 1713 | + } | |
| 1714 | + if (!property_exists($obj, 'senator_rank')) { | |
| 1715 | + throw new Exception("Missing required property"); | |
| 1716 | + } | |
| 1717 | + if (!property_exists($obj, 'senator_rank_label')) { | |
| 1718 | + throw new Exception("Missing required property"); | |
| 1719 | + } | |
| 1720 | + if (!property_exists($obj, 'startdate')) { | |
| 1721 | + throw new Exception("Missing required property"); | |
| 1722 | + } | |
| 1723 | + if (!property_exists($obj, 'state')) { | |
| 1724 | + throw new Exception("Missing required property"); | |
| 1725 | + } | |
| 1726 | + if (!property_exists($obj, 'title')) { | |
| 1727 | + throw new Exception("Missing required property"); | |
| 1728 | + } | |
| 1729 | + if (!property_exists($obj, 'title_long')) { | |
| 1730 | + throw new Exception("Missing required property"); | |
| 1731 | + } | |
| 1732 | + if (!property_exists($obj, 'website')) { | |
| 1733 | + throw new Exception("Missing required property"); | |
| 1734 | + } | |
| 1651 | 1735 | return new ObjectElement( |
| 1652 | 1736 | ObjectElement::fromCaucus($obj->{'caucus'}) |
| 1653 | 1737 | ,ObjectElement::fromCongressNumbers($obj->{'congress_numbers'}) |
| @@ -2071,6 +2155,15 @@ class Extra { | ||
| 2071 | 2155 | * @throws Exception |
| 2072 | 2156 | */ |
| 2073 | 2157 | public static function from(stdClass $obj): Extra { |
| 2158 | + if (!property_exists($obj, 'address')) { | |
| 2159 | + throw new Exception("Missing required property"); | |
| 2160 | + } | |
| 2161 | + if (!property_exists($obj, 'contact_form')) { | |
| 2162 | + throw new Exception("Missing required property"); | |
| 2163 | + } | |
| 2164 | + if (!property_exists($obj, 'office')) { | |
| 2165 | + throw new Exception("Missing required property"); | |
| 2166 | + } | |
| 2074 | 2167 | return new Extra( |
| 2075 | 2168 | Extra::fromAddress($obj->{'address'}) |
| 2076 | 2169 | ,Extra::fromContactForm($obj->{'contact_form'}) |
| @@ -3084,6 +3177,60 @@ class Person { | ||
| 3084 | 3177 | * @throws Exception |
| 3085 | 3178 | */ |
| 3086 | 3179 | public static function from(stdClass $obj): Person { |
| 3180 | + if (!property_exists($obj, 'bioguideid')) { | |
| 3181 | + throw new Exception("Missing required property"); | |
| 3182 | + } | |
| 3183 | + if (!property_exists($obj, 'birthday')) { | |
| 3184 | + throw new Exception("Missing required property"); | |
| 3185 | + } | |
| 3186 | + if (!property_exists($obj, 'cspanid')) { | |
| 3187 | + throw new Exception("Missing required property"); | |
| 3188 | + } | |
| 3189 | + if (!property_exists($obj, 'firstname')) { | |
| 3190 | + throw new Exception("Missing required property"); | |
| 3191 | + } | |
| 3192 | + if (!property_exists($obj, 'gender')) { | |
| 3193 | + throw new Exception("Missing required property"); | |
| 3194 | + } | |
| 3195 | + if (!property_exists($obj, 'gender_label')) { | |
| 3196 | + throw new Exception("Missing required property"); | |
| 3197 | + } | |
| 3198 | + if (!property_exists($obj, 'id')) { | |
| 3199 | + throw new Exception("Missing required property"); | |
| 3200 | + } | |
| 3201 | + if (!property_exists($obj, 'lastname')) { | |
| 3202 | + throw new Exception("Missing required property"); | |
| 3203 | + } | |
| 3204 | + if (!property_exists($obj, 'link')) { | |
| 3205 | + throw new Exception("Missing required property"); | |
| 3206 | + } | |
| 3207 | + if (!property_exists($obj, 'middlename')) { | |
| 3208 | + throw new Exception("Missing required property"); | |
| 3209 | + } | |
| 3210 | + if (!property_exists($obj, 'name')) { | |
| 3211 | + throw new Exception("Missing required property"); | |
| 3212 | + } | |
| 3213 | + if (!property_exists($obj, 'namemod')) { | |
| 3214 | + throw new Exception("Missing required property"); | |
| 3215 | + } | |
| 3216 | + if (!property_exists($obj, 'nickname')) { | |
| 3217 | + throw new Exception("Missing required property"); | |
| 3218 | + } | |
| 3219 | + if (!property_exists($obj, 'osid')) { | |
| 3220 | + throw new Exception("Missing required property"); | |
| 3221 | + } | |
| 3222 | + if (!property_exists($obj, 'pvsid')) { | |
| 3223 | + throw new Exception("Missing required property"); | |
| 3224 | + } | |
| 3225 | + if (!property_exists($obj, 'sortname')) { | |
| 3226 | + throw new Exception("Missing required property"); | |
| 3227 | + } | |
| 3228 | + if (!property_exists($obj, 'twitterid')) { | |
| 3229 | + throw new Exception("Missing required property"); | |
| 3230 | + } | |
| 3231 | + if (!property_exists($obj, 'youtubeid')) { | |
| 3232 | + throw new Exception("Missing required property"); | |
| 3233 | + } | |
| 3087 | 3234 | return new Person( |
| 3088 | 3235 | Person::fromBioguideid($obj->{'bioguideid'}) |
| 3089 | 3236 | ,Person::fromBirthday($obj->{'birthday'}) |
Test case
1 generated file · +30 −0test/inputs/json/misc/31189.json
Mphpdefault / TopLevel.php+30 −0
| @@ -203,6 +203,15 @@ class TopLevel { | ||
| 203 | 203 | * @throws Exception |
| 204 | 204 | */ |
| 205 | 205 | public static function from(stdClass $obj): TopLevel { |
| 206 | + if (!property_exists($obj, 'details')) { | |
| 207 | + throw new Exception("Missing required property"); | |
| 208 | + } | |
| 209 | + if (!property_exists($obj, 'rates')) { | |
| 210 | + throw new Exception("Missing required property"); | |
| 211 | + } | |
| 212 | + if (!property_exists($obj, 'version')) { | |
| 213 | + throw new Exception("Missing required property"); | |
| 214 | + } | |
| 206 | 215 | return new TopLevel( |
| 207 | 216 | TopLevel::fromDetails($obj->{'details'}) |
| 208 | 217 | ,TopLevel::fromRates($obj->{'rates'}) |
| @@ -473,6 +482,18 @@ class Rate { | ||
| 473 | 482 | * @throws Exception |
| 474 | 483 | */ |
| 475 | 484 | public static function from(stdClass $obj): Rate { |
| 485 | + if (!property_exists($obj, 'code')) { | |
| 486 | + throw new Exception("Missing required property"); | |
| 487 | + } | |
| 488 | + if (!property_exists($obj, 'country_code')) { | |
| 489 | + throw new Exception("Missing required property"); | |
| 490 | + } | |
| 491 | + if (!property_exists($obj, 'name')) { | |
| 492 | + throw new Exception("Missing required property"); | |
| 493 | + } | |
| 494 | + if (!property_exists($obj, 'periods')) { | |
| 495 | + throw new Exception("Missing required property"); | |
| 496 | + } | |
| 476 | 497 | return new Rate( |
| 477 | 498 | Rate::fromCode($obj->{'code'}) |
| 478 | 499 | ,Rate::fromCountryCode($obj->{'country_code'}) |
| @@ -630,6 +651,12 @@ class Period { | ||
| 630 | 651 | * @throws Exception |
| 631 | 652 | */ |
| 632 | 653 | public static function from(stdClass $obj): Period { |
| 654 | + if (!property_exists($obj, 'effective_from')) { | |
| 655 | + throw new Exception("Missing required property"); | |
| 656 | + } | |
| 657 | + if (!property_exists($obj, 'rates')) { | |
| 658 | + throw new Exception("Missing required property"); | |
| 659 | + } | |
| 633 | 660 | return new Period( |
| 634 | 661 | Period::fromEffectiveFrom($obj->{'effective_from'}) |
| 635 | 662 | ,Period::fromRates($obj->{'rates'}) |
| @@ -1040,6 +1067,9 @@ class Rates { | ||
| 1040 | 1067 | * @throws Exception |
| 1041 | 1068 | */ |
| 1042 | 1069 | public static function from(stdClass $obj): Rates { |
| 1070 | + if (!property_exists($obj, 'standard')) { | |
| 1071 | + throw new Exception("Missing required property"); | |
| 1072 | + } | |
| 1043 | 1073 | return new Rates( |
| 1044 | 1074 | Rates::fromParking($obj->{'parking'}) |
| 1045 | 1075 | ,Rates::fromReduced($obj->{'reduced'}) |
Test case
1 generated file · +126 −0test/inputs/json/misc/32431.json
Mphpdefault / TopLevel.php+126 −0
| @@ -267,6 +267,18 @@ class TopLevel { | ||
| 267 | 267 | * @throws Exception |
| 268 | 268 | */ |
| 269 | 269 | public static function from(stdClass $obj): TopLevel { |
| 270 | + if (!property_exists($obj, 'bbox')) { | |
| 271 | + throw new Exception("Missing required property"); | |
| 272 | + } | |
| 273 | + if (!property_exists($obj, 'features')) { | |
| 274 | + throw new Exception("Missing required property"); | |
| 275 | + } | |
| 276 | + if (!property_exists($obj, 'metadata')) { | |
| 277 | + throw new Exception("Missing required property"); | |
| 278 | + } | |
| 279 | + if (!property_exists($obj, 'type')) { | |
| 280 | + throw new Exception("Missing required property"); | |
| 281 | + } | |
| 270 | 282 | return new TopLevel( |
| 271 | 283 | TopLevel::fromBbox($obj->{'bbox'}) |
| 272 | 284 | ,TopLevel::fromFeatures($obj->{'features'}) |
| @@ -530,6 +542,18 @@ class Feature { | ||
| 530 | 542 | * @throws Exception |
| 531 | 543 | */ |
| 532 | 544 | public static function from(stdClass $obj): Feature { |
| 545 | + if (!property_exists($obj, 'geometry')) { | |
| 546 | + throw new Exception("Missing required property"); | |
| 547 | + } | |
| 548 | + if (!property_exists($obj, 'id')) { | |
| 549 | + throw new Exception("Missing required property"); | |
| 550 | + } | |
| 551 | + if (!property_exists($obj, 'properties')) { | |
| 552 | + throw new Exception("Missing required property"); | |
| 553 | + } | |
| 554 | + if (!property_exists($obj, 'type')) { | |
| 555 | + throw new Exception("Missing required property"); | |
| 556 | + } | |
| 533 | 557 | return new Feature( |
| 534 | 558 | Feature::fromGeometry($obj->{'geometry'}) |
| 535 | 559 | ,Feature::fromID($obj->{'id'}) |
| @@ -701,6 +725,12 @@ class Geometry { | ||
| 701 | 725 | * @throws Exception |
| 702 | 726 | */ |
| 703 | 727 | public static function from(stdClass $obj): Geometry { |
| 728 | + if (!property_exists($obj, 'coordinates')) { | |
| 729 | + throw new Exception("Missing required property"); | |
| 730 | + } | |
| 731 | + if (!property_exists($obj, 'type')) { | |
| 732 | + throw new Exception("Missing required property"); | |
| 733 | + } | |
| 704 | 734 | return new Geometry( |
| 705 | 735 | Geometry::fromCoordinates($obj->{'coordinates'}) |
| 706 | 736 | ,Geometry::fromType($obj->{'type'}) |
| @@ -2191,6 +2221,84 @@ class Properties { | ||
| 2191 | 2221 | * @throws Exception |
| 2192 | 2222 | */ |
| 2193 | 2223 | public static function from(stdClass $obj): Properties { |
| 2224 | + if (!property_exists($obj, 'alert')) { | |
| 2225 | + throw new Exception("Missing required property"); | |
| 2226 | + } | |
| 2227 | + if (!property_exists($obj, 'cdi')) { | |
| 2228 | + throw new Exception("Missing required property"); | |
| 2229 | + } | |
| 2230 | + if (!property_exists($obj, 'code')) { | |
| 2231 | + throw new Exception("Missing required property"); | |
| 2232 | + } | |
| 2233 | + if (!property_exists($obj, 'detail')) { | |
| 2234 | + throw new Exception("Missing required property"); | |
| 2235 | + } | |
| 2236 | + if (!property_exists($obj, 'dmin')) { | |
| 2237 | + throw new Exception("Missing required property"); | |
| 2238 | + } | |
| 2239 | + if (!property_exists($obj, 'felt')) { | |
| 2240 | + throw new Exception("Missing required property"); | |
| 2241 | + } | |
| 2242 | + if (!property_exists($obj, 'gap')) { | |
| 2243 | + throw new Exception("Missing required property"); | |
| 2244 | + } | |
| 2245 | + if (!property_exists($obj, 'ids')) { | |
| 2246 | + throw new Exception("Missing required property"); | |
| 2247 | + } | |
| 2248 | + if (!property_exists($obj, 'mag')) { | |
| 2249 | + throw new Exception("Missing required property"); | |
| 2250 | + } | |
| 2251 | + if (!property_exists($obj, 'magType')) { | |
| 2252 | + throw new Exception("Missing required property"); | |
| 2253 | + } | |
| 2254 | + if (!property_exists($obj, 'mmi')) { | |
| 2255 | + throw new Exception("Missing required property"); | |
| 2256 | + } | |
| 2257 | + if (!property_exists($obj, 'net')) { | |
| 2258 | + throw new Exception("Missing required property"); | |
| 2259 | + } | |
| 2260 | + if (!property_exists($obj, 'nst')) { | |
| 2261 | + throw new Exception("Missing required property"); | |
| 2262 | + } | |
| 2263 | + if (!property_exists($obj, 'place')) { | |
| 2264 | + throw new Exception("Missing required property"); | |
| 2265 | + } | |
| 2266 | + if (!property_exists($obj, 'rms')) { | |
| 2267 | + throw new Exception("Missing required property"); | |
| 2268 | + } | |
| 2269 | + if (!property_exists($obj, 'sig')) { | |
| 2270 | + throw new Exception("Missing required property"); | |
| 2271 | + } | |
| 2272 | + if (!property_exists($obj, 'sources')) { | |
| 2273 | + throw new Exception("Missing required property"); | |
| 2274 | + } | |
| 2275 | + if (!property_exists($obj, 'status')) { | |
| 2276 | + throw new Exception("Missing required property"); | |
| 2277 | + } | |
| 2278 | + if (!property_exists($obj, 'time')) { | |
| 2279 | + throw new Exception("Missing required property"); | |
| 2280 | + } | |
| 2281 | + if (!property_exists($obj, 'title')) { | |
| 2282 | + throw new Exception("Missing required property"); | |
| 2283 | + } | |
| 2284 | + if (!property_exists($obj, 'tsunami')) { | |
| 2285 | + throw new Exception("Missing required property"); | |
| 2286 | + } | |
| 2287 | + if (!property_exists($obj, 'type')) { | |
| 2288 | + throw new Exception("Missing required property"); | |
| 2289 | + } | |
| 2290 | + if (!property_exists($obj, 'types')) { | |
| 2291 | + throw new Exception("Missing required property"); | |
| 2292 | + } | |
| 2293 | + if (!property_exists($obj, 'tz')) { | |
| 2294 | + throw new Exception("Missing required property"); | |
| 2295 | + } | |
| 2296 | + if (!property_exists($obj, 'updated')) { | |
| 2297 | + throw new Exception("Missing required property"); | |
| 2298 | + } | |
| 2299 | + if (!property_exists($obj, 'url')) { | |
| 2300 | + throw new Exception("Missing required property"); | |
| 2301 | + } | |
| 2194 | 2302 | return new Properties( |
| 2195 | 2303 | Properties::fromAlert($obj->{'alert'}) |
| 2196 | 2304 | ,Properties::fromCdi($obj->{'cdi'}) |
| @@ -2791,6 +2899,24 @@ class Metadata { | ||
| 2791 | 2899 | * @throws Exception |
| 2792 | 2900 | */ |
| 2793 | 2901 | public static function from(stdClass $obj): Metadata { |
| 2902 | + if (!property_exists($obj, 'api')) { | |
| 2903 | + throw new Exception("Missing required property"); | |
| 2904 | + } | |
| 2905 | + if (!property_exists($obj, 'count')) { | |
| 2906 | + throw new Exception("Missing required property"); | |
| 2907 | + } | |
| 2908 | + if (!property_exists($obj, 'generated')) { | |
| 2909 | + throw new Exception("Missing required property"); | |
| 2910 | + } | |
| 2911 | + if (!property_exists($obj, 'status')) { | |
| 2912 | + throw new Exception("Missing required property"); | |
| 2913 | + } | |
| 2914 | + if (!property_exists($obj, 'title')) { | |
| 2915 | + throw new Exception("Missing required property"); | |
| 2916 | + } | |
| 2917 | + if (!property_exists($obj, 'url')) { | |
| 2918 | + throw new Exception("Missing required property"); | |
| 2919 | + } | |
| 2794 | 2920 | return new Metadata( |
| 2795 | 2921 | Metadata::fromAPI($obj->{'api'}) |
| 2796 | 2922 | ,Metadata::fromCount($obj->{'count'}) |
Test case
1 generated file · +24 −0test/inputs/json/misc/32d5c.json
Mphpdefault / TopLevel.php+24 −0
| @@ -465,6 +465,30 @@ class TopLevel { | ||
| 465 | 465 | * @throws Exception |
| 466 | 466 | */ |
| 467 | 467 | public static function from(stdClass $obj): TopLevel { |
| 468 | + if (!property_exists($obj, 'BirthDate')) { | |
| 469 | + throw new Exception("Missing required property"); | |
| 470 | + } | |
| 471 | + if (!property_exists($obj, 'BirthDateIsProtected')) { | |
| 472 | + throw new Exception("Missing required property"); | |
| 473 | + } | |
| 474 | + if (!property_exists($obj, 'GenderTypeID')) { | |
| 475 | + throw new Exception("Missing required property"); | |
| 476 | + } | |
| 477 | + if (!property_exists($obj, 'Notes')) { | |
| 478 | + throw new Exception("Missing required property"); | |
| 479 | + } | |
| 480 | + if (!property_exists($obj, 'ParliamentaryName')) { | |
| 481 | + throw new Exception("Missing required property"); | |
| 482 | + } | |
| 483 | + if (!property_exists($obj, 'PersonID')) { | |
| 484 | + throw new Exception("Missing required property"); | |
| 485 | + } | |
| 486 | + if (!property_exists($obj, 'PhotoURL')) { | |
| 487 | + throw new Exception("Missing required property"); | |
| 488 | + } | |
| 489 | + if (!property_exists($obj, 'PreferredName')) { | |
| 490 | + throw new Exception("Missing required property"); | |
| 491 | + } | |
| 468 | 492 | return new TopLevel( |
| 469 | 493 | TopLevel::fromBirthDate($obj->{'BirthDate'}) |
| 470 | 494 | ,TopLevel::fromBirthDateIsProtected($obj->{'BirthDateIsProtected'}) |
Test case
1 generated file · +141 −0test/inputs/json/misc/337ed.json
Mphpdefault / TopLevel.php+141 −0
| @@ -409,6 +409,27 @@ class TopLevel { | ||
| 409 | 409 | * @throws Exception |
| 410 | 410 | */ |
| 411 | 411 | public static function from(stdClass $obj): TopLevel { |
| 412 | + if (!property_exists($obj, 'count')) { | |
| 413 | + throw new Exception("Missing required property"); | |
| 414 | + } | |
| 415 | + if (!property_exists($obj, 'facets')) { | |
| 416 | + throw new Exception("Missing required property"); | |
| 417 | + } | |
| 418 | + if (!property_exists($obj, 'limit')) { | |
| 419 | + throw new Exception("Missing required property"); | |
| 420 | + } | |
| 421 | + if (!property_exists($obj, 'next')) { | |
| 422 | + throw new Exception("Missing required property"); | |
| 423 | + } | |
| 424 | + if (!property_exists($obj, 'offset')) { | |
| 425 | + throw new Exception("Missing required property"); | |
| 426 | + } | |
| 427 | + if (!property_exists($obj, 'previous')) { | |
| 428 | + throw new Exception("Missing required property"); | |
| 429 | + } | |
| 430 | + if (!property_exists($obj, 'results')) { | |
| 431 | + throw new Exception("Missing required property"); | |
| 432 | + } | |
| 412 | 433 | return new TopLevel( |
| 413 | 434 | TopLevel::fromCount($obj->{'count'}) |
| 414 | 435 | ,TopLevel::fromFacets($obj->{'facets'}) |
| @@ -2397,6 +2418,102 @@ class Result { | ||
| 2397 | 2418 | * @throws Exception |
| 2398 | 2419 | */ |
| 2399 | 2420 | public static function from(stdClass $obj): Result { |
| 2421 | + if (!property_exists($obj, 'cost_absolute')) { | |
| 2422 | + throw new Exception("Missing required property"); | |
| 2423 | + } | |
| 2424 | + if (!property_exists($obj, 'cost_max')) { | |
| 2425 | + throw new Exception("Missing required property"); | |
| 2426 | + } | |
| 2427 | + if (!property_exists($obj, 'cost_min')) { | |
| 2428 | + throw new Exception("Missing required property"); | |
| 2429 | + } | |
| 2430 | + if (!property_exists($obj, 'created_at')) { | |
| 2431 | + throw new Exception("Missing required property"); | |
| 2432 | + } | |
| 2433 | + if (!property_exists($obj, 'customIncomes')) { | |
| 2434 | + throw new Exception("Missing required property"); | |
| 2435 | + } | |
| 2436 | + if (!property_exists($obj, 'direct_rep_costs_max')) { | |
| 2437 | + throw new Exception("Missing required property"); | |
| 2438 | + } | |
| 2439 | + if (!property_exists($obj, 'direct_rep_costs_min')) { | |
| 2440 | + throw new Exception("Missing required property"); | |
| 2441 | + } | |
| 2442 | + if (!property_exists($obj, 'end_date')) { | |
| 2443 | + throw new Exception("Missing required property"); | |
| 2444 | + } | |
| 2445 | + if (!property_exists($obj, 'eur_sources_grants')) { | |
| 2446 | + throw new Exception("Missing required property"); | |
| 2447 | + } | |
| 2448 | + if (!property_exists($obj, 'eur_sources_grants_src')) { | |
| 2449 | + throw new Exception("Missing required property"); | |
| 2450 | + } | |
| 2451 | + if (!property_exists($obj, 'eur_sources_procurement')) { | |
| 2452 | + throw new Exception("Missing required property"); | |
| 2453 | + } | |
| 2454 | + if (!property_exists($obj, 'eur_sources_procurement_src')) { | |
| 2455 | + throw new Exception("Missing required property"); | |
| 2456 | + } | |
| 2457 | + if (!property_exists($obj, 'id')) { | |
| 2458 | + throw new Exception("Missing required property"); | |
| 2459 | + } | |
| 2460 | + if (!property_exists($obj, 'new_organisation')) { | |
| 2461 | + throw new Exception("Missing required property"); | |
| 2462 | + } | |
| 2463 | + if (!property_exists($obj, 'no_clients')) { | |
| 2464 | + throw new Exception("Missing required property"); | |
| 2465 | + } | |
| 2466 | + if (!property_exists($obj, 'other_financial_information')) { | |
| 2467 | + throw new Exception("Missing required property"); | |
| 2468 | + } | |
| 2469 | + if (!property_exists($obj, 'other_sources_contributions')) { | |
| 2470 | + throw new Exception("Missing required property"); | |
| 2471 | + } | |
| 2472 | + if (!property_exists($obj, 'other_sources_donation')) { | |
| 2473 | + throw new Exception("Missing required property"); | |
| 2474 | + } | |
| 2475 | + if (!property_exists($obj, 'other_sources_total')) { | |
| 2476 | + throw new Exception("Missing required property"); | |
| 2477 | + } | |
| 2478 | + if (!property_exists($obj, 'public_financing_infranational')) { | |
| 2479 | + throw new Exception("Missing required property"); | |
| 2480 | + } | |
| 2481 | + if (!property_exists($obj, 'public_financing_national')) { | |
| 2482 | + throw new Exception("Missing required property"); | |
| 2483 | + } | |
| 2484 | + if (!property_exists($obj, 'public_financing_total')) { | |
| 2485 | + throw new Exception("Missing required property"); | |
| 2486 | + } | |
| 2487 | + if (!property_exists($obj, 'representative')) { | |
| 2488 | + throw new Exception("Missing required property"); | |
| 2489 | + } | |
| 2490 | + if (!property_exists($obj, 'start_date')) { | |
| 2491 | + throw new Exception("Missing required property"); | |
| 2492 | + } | |
| 2493 | + if (!property_exists($obj, 'status')) { | |
| 2494 | + throw new Exception("Missing required property"); | |
| 2495 | + } | |
| 2496 | + if (!property_exists($obj, 'total_budget')) { | |
| 2497 | + throw new Exception("Missing required property"); | |
| 2498 | + } | |
| 2499 | + if (!property_exists($obj, 'turnover_absolute')) { | |
| 2500 | + throw new Exception("Missing required property"); | |
| 2501 | + } | |
| 2502 | + if (!property_exists($obj, 'turnover_max')) { | |
| 2503 | + throw new Exception("Missing required property"); | |
| 2504 | + } | |
| 2505 | + if (!property_exists($obj, 'turnover_min')) { | |
| 2506 | + throw new Exception("Missing required property"); | |
| 2507 | + } | |
| 2508 | + if (!property_exists($obj, 'type')) { | |
| 2509 | + throw new Exception("Missing required property"); | |
| 2510 | + } | |
| 2511 | + if (!property_exists($obj, 'updated_at')) { | |
| 2512 | + throw new Exception("Missing required property"); | |
| 2513 | + } | |
| 2514 | + if (!property_exists($obj, 'uri')) { | |
| 2515 | + throw new Exception("Missing required property"); | |
| 2516 | + } | |
| 2400 | 2517 | return new Result( |
| 2401 | 2518 | Result::fromCostAbsolute($obj->{'cost_absolute'}) |
| 2402 | 2519 | ,Result::fromCostMax($obj->{'cost_max'}) |
| @@ -2937,6 +3054,30 @@ class CustomIncome { | ||
| 2937 | 3054 | * @throws Exception |
| 2938 | 3055 | */ |
| 2939 | 3056 | public static function from(stdClass $obj): CustomIncome { |
| 3057 | + if (!property_exists($obj, 'amount')) { | |
| 3058 | + throw new Exception("Missing required property"); | |
| 3059 | + } | |
| 3060 | + if (!property_exists($obj, 'created_at')) { | |
| 3061 | + throw new Exception("Missing required property"); | |
| 3062 | + } | |
| 3063 | + if (!property_exists($obj, 'id')) { | |
| 3064 | + throw new Exception("Missing required property"); | |
| 3065 | + } | |
| 3066 | + if (!property_exists($obj, 'name')) { | |
| 3067 | + throw new Exception("Missing required property"); | |
| 3068 | + } | |
| 3069 | + if (!property_exists($obj, 'status')) { | |
| 3070 | + throw new Exception("Missing required property"); | |
| 3071 | + } | |
| 3072 | + if (!property_exists($obj, 'type')) { | |
| 3073 | + throw new Exception("Missing required property"); | |
| 3074 | + } | |
| 3075 | + if (!property_exists($obj, 'updated_at')) { | |
| 3076 | + throw new Exception("Missing required property"); | |
| 3077 | + } | |
| 3078 | + if (!property_exists($obj, 'uri')) { | |
| 3079 | + throw new Exception("Missing required property"); | |
| 3080 | + } | |
| 2940 | 3081 | return new CustomIncome( |
| 2941 | 3082 | CustomIncome::fromAmount($obj->{'amount'}) |
| 2942 | 3083 | ,CustomIncome::fromCreatedAt($obj->{'created_at'}) |
Test case
1 generated file · +21 −0test/inputs/json/misc/33d2e.json
Mphpdefault / TopLevel.php+21 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'laureates')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromLaureates($obj->{'laureates'}) |
| 101 | 104 | ); |
| @@ -911,6 +914,21 @@ class Laureate { | ||
| 911 | 914 | * @throws Exception |
| 912 | 915 | */ |
| 913 | 916 | public static function from(stdClass $obj): Laureate { |
| 917 | + if (!property_exists($obj, 'born')) { | |
| 918 | + throw new Exception("Missing required property"); | |
| 919 | + } | |
| 920 | + if (!property_exists($obj, 'died')) { | |
| 921 | + throw new Exception("Missing required property"); | |
| 922 | + } | |
| 923 | + if (!property_exists($obj, 'gender')) { | |
| 924 | + throw new Exception("Missing required property"); | |
| 925 | + } | |
| 926 | + if (!property_exists($obj, 'id')) { | |
| 927 | + throw new Exception("Missing required property"); | |
| 928 | + } | |
| 929 | + if (!property_exists($obj, 'prizes')) { | |
| 930 | + throw new Exception("Missing required property"); | |
| 931 | + } | |
| 914 | 932 | return new Laureate( |
| 915 | 933 | Laureate::fromBorn($obj->{'born'}) |
| 916 | 934 | ,Laureate::fromBornCity($obj->{'bornCity'}) |
| @@ -1435,6 +1453,9 @@ class Prize { | ||
| 1435 | 1453 | * @throws Exception |
| 1436 | 1454 | */ |
| 1437 | 1455 | public static function from(stdClass $obj): Prize { |
| 1456 | + if (!property_exists($obj, 'affiliations')) { | |
| 1457 | + throw new Exception("Missing required property"); | |
| 1458 | + } | |
| 1438 | 1459 | return new Prize( |
| 1439 | 1460 | Prize::fromAffiliations($obj->{'affiliations'}) |
| 1440 | 1461 | ,Prize::fromCategory($obj->{'category'}) |
Test case
1 generated file · +87 −0test/inputs/json/misc/34702.json
Mphpdefault / TopLevel.php+87 −0
| @@ -253,6 +253,18 @@ class TopLevel { | ||
| 253 | 253 | * @throws Exception |
| 254 | 254 | */ |
| 255 | 255 | public static function from(stdClass $obj): TopLevel { |
| 256 | + if (!property_exists($obj, 'crs')) { | |
| 257 | + throw new Exception("Missing required property"); | |
| 258 | + } | |
| 259 | + if (!property_exists($obj, 'features')) { | |
| 260 | + throw new Exception("Missing required property"); | |
| 261 | + } | |
| 262 | + if (!property_exists($obj, 'totalFeatures')) { | |
| 263 | + throw new Exception("Missing required property"); | |
| 264 | + } | |
| 265 | + if (!property_exists($obj, 'type')) { | |
| 266 | + throw new Exception("Missing required property"); | |
| 267 | + } | |
| 256 | 268 | return new TopLevel( |
| 257 | 269 | TopLevel::fromCRS($obj->{'crs'}) |
| 258 | 270 | ,TopLevel::fromFeatures($obj->{'features'}) |
| @@ -410,6 +422,12 @@ class CRS { | ||
| 410 | 422 | * @throws Exception |
| 411 | 423 | */ |
| 412 | 424 | public static function from(stdClass $obj): CRS { |
| 425 | + if (!property_exists($obj, 'properties')) { | |
| 426 | + throw new Exception("Missing required property"); | |
| 427 | + } | |
| 428 | + if (!property_exists($obj, 'type')) { | |
| 429 | + throw new Exception("Missing required property"); | |
| 430 | + } | |
| 413 | 431 | return new CRS( |
| 414 | 432 | CRS::fromProperties($obj->{'properties'}) |
| 415 | 433 | ,CRS::fromType($obj->{'type'}) |
| @@ -510,6 +528,9 @@ class CRSProperties { | ||
| 510 | 528 | * @throws Exception |
| 511 | 529 | */ |
| 512 | 530 | public static function from(stdClass $obj): CRSProperties { |
| 531 | + if (!property_exists($obj, 'name')) { | |
| 532 | + throw new Exception("Missing required property"); | |
| 533 | + } | |
| 513 | 534 | return new CRSProperties( |
| 514 | 535 | CRSProperties::fromName($obj->{'name'}) |
| 515 | 536 | ); |
| @@ -820,6 +841,21 @@ class Feature { | ||
| 820 | 841 | * @throws Exception |
| 821 | 842 | */ |
| 822 | 843 | public static function from(stdClass $obj): Feature { |
| 844 | + if (!property_exists($obj, 'geometry')) { | |
| 845 | + throw new Exception("Missing required property"); | |
| 846 | + } | |
| 847 | + if (!property_exists($obj, 'geometry_name')) { | |
| 848 | + throw new Exception("Missing required property"); | |
| 849 | + } | |
| 850 | + if (!property_exists($obj, 'id')) { | |
| 851 | + throw new Exception("Missing required property"); | |
| 852 | + } | |
| 853 | + if (!property_exists($obj, 'properties')) { | |
| 854 | + throw new Exception("Missing required property"); | |
| 855 | + } | |
| 856 | + if (!property_exists($obj, 'type')) { | |
| 857 | + throw new Exception("Missing required property"); | |
| 858 | + } | |
| 823 | 859 | return new Feature( |
| 824 | 860 | Feature::fromGeometry($obj->{'geometry'}) |
| 825 | 861 | ,Feature::fromGeometryName($obj->{'geometry_name'}) |
| @@ -993,6 +1029,12 @@ class Geometry { | ||
| 993 | 1029 | * @throws Exception |
| 994 | 1030 | */ |
| 995 | 1031 | public static function from(stdClass $obj): Geometry { |
| 1032 | + if (!property_exists($obj, 'coordinates')) { | |
| 1033 | + throw new Exception("Missing required property"); | |
| 1034 | + } | |
| 1035 | + if (!property_exists($obj, 'type')) { | |
| 1036 | + throw new Exception("Missing required property"); | |
| 1037 | + } | |
| 996 | 1038 | return new Geometry( |
| 997 | 1039 | Geometry::fromCoordinates($obj->{'coordinates'}) |
| 998 | 1040 | ,Geometry::fromType($obj->{'type'}) |
| @@ -1944,6 +1986,51 @@ class FeatureProperties { | ||
| 1944 | 1986 | * @throws Exception |
| 1945 | 1987 | */ |
| 1946 | 1988 | public static function from(stdClass $obj): FeatureProperties { |
| 1989 | + if (!property_exists($obj, 'division')) { | |
| 1990 | + throw new Exception("Missing required property"); | |
| 1991 | + } | |
| 1992 | + if (!property_exists($obj, 'fax')) { | |
| 1993 | + throw new Exception("Missing required property"); | |
| 1994 | + } | |
| 1995 | + if (!property_exists($obj, 'fire_ban_r')) { | |
| 1996 | + throw new Exception("Missing required property"); | |
| 1997 | + } | |
| 1998 | + if (!property_exists($obj, 'latitude')) { | |
| 1999 | + throw new Exception("Missing required property"); | |
| 2000 | + } | |
| 2001 | + if (!property_exists($obj, 'local_govt')) { | |
| 2002 | + throw new Exception("Missing required property"); | |
| 2003 | + } | |
| 2004 | + if (!property_exists($obj, 'longitude')) { | |
| 2005 | + throw new Exception("Missing required property"); | |
| 2006 | + } | |
| 2007 | + if (!property_exists($obj, 'no')) { | |
| 2008 | + throw new Exception("Missing required property"); | |
| 2009 | + } | |
| 2010 | + if (!property_exists($obj, 'phone')) { | |
| 2011 | + throw new Exception("Missing required property"); | |
| 2012 | + } | |
| 2013 | + if (!property_exists($obj, 'postcode')) { | |
| 2014 | + throw new Exception("Missing required property"); | |
| 2015 | + } | |
| 2016 | + if (!property_exists($obj, 'psa')) { | |
| 2017 | + throw new Exception("Missing required property"); | |
| 2018 | + } | |
| 2019 | + if (!property_exists($obj, 'region')) { | |
| 2020 | + throw new Exception("Missing required property"); | |
| 2021 | + } | |
| 2022 | + if (!property_exists($obj, 'station')) { | |
| 2023 | + throw new Exception("Missing required property"); | |
| 2024 | + } | |
| 2025 | + if (!property_exists($obj, 'street')) { | |
| 2026 | + throw new Exception("Missing required property"); | |
| 2027 | + } | |
| 2028 | + if (!property_exists($obj, 'suburb')) { | |
| 2029 | + throw new Exception("Missing required property"); | |
| 2030 | + } | |
| 2031 | + if (!property_exists($obj, 'type')) { | |
| 2032 | + throw new Exception("Missing required property"); | |
| 2033 | + } | |
| 1947 | 2034 | return new FeatureProperties( |
| 1948 | 2035 | FeatureProperties::fromDivision($obj->{'division'}) |
| 1949 | 2036 | ,FeatureProperties::fromFax($obj->{'fax'}) |
Test case
1 generated file · +45 −0test/inputs/json/misc/3536b.json
Mphpdefault / TopLevel.php+45 −0
| @@ -507,6 +507,30 @@ class TopLevel { | ||
| 507 | 507 | * @throws Exception |
| 508 | 508 | */ |
| 509 | 509 | public static function from(stdClass $obj): TopLevel { |
| 510 | + if (!property_exists($obj, 'id')) { | |
| 511 | + throw new Exception("Missing required property"); | |
| 512 | + } | |
| 513 | + if (!property_exists($obj, 'identifiers')) { | |
| 514 | + throw new Exception("Missing required property"); | |
| 515 | + } | |
| 516 | + if (!property_exists($obj, 'keywords')) { | |
| 517 | + throw new Exception("Missing required property"); | |
| 518 | + } | |
| 519 | + if (!property_exists($obj, 'links')) { | |
| 520 | + throw new Exception("Missing required property"); | |
| 521 | + } | |
| 522 | + if (!property_exists($obj, 'name')) { | |
| 523 | + throw new Exception("Missing required property"); | |
| 524 | + } | |
| 525 | + if (!property_exists($obj, 'other_names')) { | |
| 526 | + throw new Exception("Missing required property"); | |
| 527 | + } | |
| 528 | + if (!property_exists($obj, 'superseded_by')) { | |
| 529 | + throw new Exception("Missing required property"); | |
| 530 | + } | |
| 531 | + if (!property_exists($obj, 'text')) { | |
| 532 | + throw new Exception("Missing required property"); | |
| 533 | + } | |
| 510 | 534 | return new TopLevel( |
| 511 | 535 | TopLevel::fromID($obj->{'id'}) |
| 512 | 536 | ,TopLevel::fromIdentifiers($obj->{'identifiers'}) |
| @@ -672,6 +696,12 @@ class Identifier { | ||
| 672 | 696 | * @throws Exception |
| 673 | 697 | */ |
| 674 | 698 | public static function from(stdClass $obj): Identifier { |
| 699 | + if (!property_exists($obj, 'identifier')) { | |
| 700 | + throw new Exception("Missing required property"); | |
| 701 | + } | |
| 702 | + if (!property_exists($obj, 'scheme')) { | |
| 703 | + throw new Exception("Missing required property"); | |
| 704 | + } | |
| 675 | 705 | return new Identifier( |
| 676 | 706 | Identifier::fromIdentifier($obj->{'identifier'}) |
| 677 | 707 | ,Identifier::fromScheme($obj->{'scheme'}) |
| @@ -930,6 +960,12 @@ class Link { | ||
| 930 | 960 | * @throws Exception |
| 931 | 961 | */ |
| 932 | 962 | public static function from(stdClass $obj): Link { |
| 963 | + if (!property_exists($obj, 'note')) { | |
| 964 | + throw new Exception("Missing required property"); | |
| 965 | + } | |
| 966 | + if (!property_exists($obj, 'url')) { | |
| 967 | + throw new Exception("Missing required property"); | |
| 968 | + } | |
| 933 | 969 | return new Link( |
| 934 | 970 | Link::fromNote($obj->{'note'}) |
| 935 | 971 | ,Link::fromURL($obj->{'url'}) |
| @@ -1134,6 +1170,15 @@ class Text { | ||
| 1134 | 1170 | * @throws Exception |
| 1135 | 1171 | */ |
| 1136 | 1172 | public static function from(stdClass $obj): Text { |
| 1173 | + if (!property_exists($obj, 'media_type')) { | |
| 1174 | + throw new Exception("Missing required property"); | |
| 1175 | + } | |
| 1176 | + if (!property_exists($obj, 'title')) { | |
| 1177 | + throw new Exception("Missing required property"); | |
| 1178 | + } | |
| 1179 | + if (!property_exists($obj, 'url')) { | |
| 1180 | + throw new Exception("Missing required property"); | |
| 1181 | + } | |
| 1137 | 1182 | return new Text( |
| 1138 | 1183 | Text::fromMediaType($obj->{'media_type'}) |
| 1139 | 1184 | ,Text::fromTitle($obj->{'title'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/3659d.json
Mphpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'total_population')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromTotalPopulation($obj->{'total_population'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class TotalPopulation { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): TotalPopulation { |
| 252 | + if (!property_exists($obj, 'date')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'population')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new TotalPopulation( |
| 250 | 259 | TotalPopulation::fromDate($obj->{'date'}) |
| 251 | 260 | ,TotalPopulation::fromPopulation($obj->{'population'}) |
Test case
1 generated file · +75 −0test/inputs/json/misc/36d5d.json
Mphpdefault / TopLevel.php+75 −0
| @@ -450,6 +450,30 @@ class TopLevel { | ||
| 450 | 450 | * @throws Exception |
| 451 | 451 | */ |
| 452 | 452 | public static function from(stdClass $obj): TopLevel { |
| 453 | + if (!property_exists($obj, 'city')) { | |
| 454 | + throw new Exception("Missing required property"); | |
| 455 | + } | |
| 456 | + if (!property_exists($obj, 'delay')) { | |
| 457 | + throw new Exception("Missing required property"); | |
| 458 | + } | |
| 459 | + if (!property_exists($obj, 'IATA')) { | |
| 460 | + throw new Exception("Missing required property"); | |
| 461 | + } | |
| 462 | + if (!property_exists($obj, 'ICAO')) { | |
| 463 | + throw new Exception("Missing required property"); | |
| 464 | + } | |
| 465 | + if (!property_exists($obj, 'name')) { | |
| 466 | + throw new Exception("Missing required property"); | |
| 467 | + } | |
| 468 | + if (!property_exists($obj, 'state')) { | |
| 469 | + throw new Exception("Missing required property"); | |
| 470 | + } | |
| 471 | + if (!property_exists($obj, 'status')) { | |
| 472 | + throw new Exception("Missing required property"); | |
| 473 | + } | |
| 474 | + if (!property_exists($obj, 'weather')) { | |
| 475 | + throw new Exception("Missing required property"); | |
| 476 | + } | |
| 453 | 477 | return new TopLevel( |
| 454 | 478 | TopLevel::fromCity($obj->{'city'}) |
| 455 | 479 | ,TopLevel::fromDelay($obj->{'delay'}) |
| @@ -978,6 +1002,33 @@ class Status { | ||
| 978 | 1002 | * @throws Exception |
| 979 | 1003 | */ |
| 980 | 1004 | public static function from(stdClass $obj): Status { |
| 1005 | + if (!property_exists($obj, 'avgDelay')) { | |
| 1006 | + throw new Exception("Missing required property"); | |
| 1007 | + } | |
| 1008 | + if (!property_exists($obj, 'closureBegin')) { | |
| 1009 | + throw new Exception("Missing required property"); | |
| 1010 | + } | |
| 1011 | + if (!property_exists($obj, 'closureEnd')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'endTime')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 1017 | + if (!property_exists($obj, 'maxDelay')) { | |
| 1018 | + throw new Exception("Missing required property"); | |
| 1019 | + } | |
| 1020 | + if (!property_exists($obj, 'minDelay')) { | |
| 1021 | + throw new Exception("Missing required property"); | |
| 1022 | + } | |
| 1023 | + if (!property_exists($obj, 'reason')) { | |
| 1024 | + throw new Exception("Missing required property"); | |
| 1025 | + } | |
| 1026 | + if (!property_exists($obj, 'trend')) { | |
| 1027 | + throw new Exception("Missing required property"); | |
| 1028 | + } | |
| 1029 | + if (!property_exists($obj, 'type')) { | |
| 1030 | + throw new Exception("Missing required property"); | |
| 1031 | + } | |
| 981 | 1032 | return new Status( |
| 982 | 1033 | Status::fromAvgDelay($obj->{'avgDelay'}) |
| 983 | 1034 | ,Status::fromClosureBegin($obj->{'closureBegin'}) |
| @@ -1301,6 +1352,21 @@ class Weather { | ||
| 1301 | 1352 | * @throws Exception |
| 1302 | 1353 | */ |
| 1303 | 1354 | public static function from(stdClass $obj): Weather { |
| 1355 | + if (!property_exists($obj, 'meta')) { | |
| 1356 | + throw new Exception("Missing required property"); | |
| 1357 | + } | |
| 1358 | + if (!property_exists($obj, 'temp')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1361 | + if (!property_exists($obj, 'visibility')) { | |
| 1362 | + throw new Exception("Missing required property"); | |
| 1363 | + } | |
| 1364 | + if (!property_exists($obj, 'weather')) { | |
| 1365 | + throw new Exception("Missing required property"); | |
| 1366 | + } | |
| 1367 | + if (!property_exists($obj, 'wind')) { | |
| 1368 | + throw new Exception("Missing required property"); | |
| 1369 | + } | |
| 1304 | 1370 | return new Weather( |
| 1305 | 1371 | Weather::fromMeta($obj->{'meta'}) |
| 1306 | 1372 | ,Weather::fromTemp($obj->{'temp'}) |
| @@ -1511,6 +1577,15 @@ class Meta { | ||
| 1511 | 1577 | * @throws Exception |
| 1512 | 1578 | */ |
| 1513 | 1579 | public static function from(stdClass $obj): Meta { |
| 1580 | + if (!property_exists($obj, 'credit')) { | |
| 1581 | + throw new Exception("Missing required property"); | |
| 1582 | + } | |
| 1583 | + if (!property_exists($obj, 'updated')) { | |
| 1584 | + throw new Exception("Missing required property"); | |
| 1585 | + } | |
| 1586 | + if (!property_exists($obj, 'url')) { | |
| 1587 | + throw new Exception("Missing required property"); | |
| 1588 | + } | |
| 1514 | 1589 | return new Meta( |
| 1515 | 1590 | Meta::fromCredit($obj->{'credit'}) |
| 1516 | 1591 | ,Meta::fromUpdated($obj->{'updated'}) |
Test case
1 generated file · +75 −0test/inputs/json/misc/3a6b3.json
Mphpdefault / TopLevel.php+75 −0
| @@ -450,6 +450,30 @@ class TopLevel { | ||
| 450 | 450 | * @throws Exception |
| 451 | 451 | */ |
| 452 | 452 | public static function from(stdClass $obj): TopLevel { |
| 453 | + if (!property_exists($obj, 'city')) { | |
| 454 | + throw new Exception("Missing required property"); | |
| 455 | + } | |
| 456 | + if (!property_exists($obj, 'delay')) { | |
| 457 | + throw new Exception("Missing required property"); | |
| 458 | + } | |
| 459 | + if (!property_exists($obj, 'IATA')) { | |
| 460 | + throw new Exception("Missing required property"); | |
| 461 | + } | |
| 462 | + if (!property_exists($obj, 'ICAO')) { | |
| 463 | + throw new Exception("Missing required property"); | |
| 464 | + } | |
| 465 | + if (!property_exists($obj, 'name')) { | |
| 466 | + throw new Exception("Missing required property"); | |
| 467 | + } | |
| 468 | + if (!property_exists($obj, 'state')) { | |
| 469 | + throw new Exception("Missing required property"); | |
| 470 | + } | |
| 471 | + if (!property_exists($obj, 'status')) { | |
| 472 | + throw new Exception("Missing required property"); | |
| 473 | + } | |
| 474 | + if (!property_exists($obj, 'weather')) { | |
| 475 | + throw new Exception("Missing required property"); | |
| 476 | + } | |
| 453 | 477 | return new TopLevel( |
| 454 | 478 | TopLevel::fromCity($obj->{'city'}) |
| 455 | 479 | ,TopLevel::fromDelay($obj->{'delay'}) |
| @@ -978,6 +1002,33 @@ class Status { | ||
| 978 | 1002 | * @throws Exception |
| 979 | 1003 | */ |
| 980 | 1004 | public static function from(stdClass $obj): Status { |
| 1005 | + if (!property_exists($obj, 'avgDelay')) { | |
| 1006 | + throw new Exception("Missing required property"); | |
| 1007 | + } | |
| 1008 | + if (!property_exists($obj, 'closureBegin')) { | |
| 1009 | + throw new Exception("Missing required property"); | |
| 1010 | + } | |
| 1011 | + if (!property_exists($obj, 'closureEnd')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'endTime')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 1017 | + if (!property_exists($obj, 'maxDelay')) { | |
| 1018 | + throw new Exception("Missing required property"); | |
| 1019 | + } | |
| 1020 | + if (!property_exists($obj, 'minDelay')) { | |
| 1021 | + throw new Exception("Missing required property"); | |
| 1022 | + } | |
| 1023 | + if (!property_exists($obj, 'reason')) { | |
| 1024 | + throw new Exception("Missing required property"); | |
| 1025 | + } | |
| 1026 | + if (!property_exists($obj, 'trend')) { | |
| 1027 | + throw new Exception("Missing required property"); | |
| 1028 | + } | |
| 1029 | + if (!property_exists($obj, 'type')) { | |
| 1030 | + throw new Exception("Missing required property"); | |
| 1031 | + } | |
| 981 | 1032 | return new Status( |
| 982 | 1033 | Status::fromAvgDelay($obj->{'avgDelay'}) |
| 983 | 1034 | ,Status::fromClosureBegin($obj->{'closureBegin'}) |
| @@ -1301,6 +1352,21 @@ class Weather { | ||
| 1301 | 1352 | * @throws Exception |
| 1302 | 1353 | */ |
| 1303 | 1354 | public static function from(stdClass $obj): Weather { |
| 1355 | + if (!property_exists($obj, 'meta')) { | |
| 1356 | + throw new Exception("Missing required property"); | |
| 1357 | + } | |
| 1358 | + if (!property_exists($obj, 'temp')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1361 | + if (!property_exists($obj, 'visibility')) { | |
| 1362 | + throw new Exception("Missing required property"); | |
| 1363 | + } | |
| 1364 | + if (!property_exists($obj, 'weather')) { | |
| 1365 | + throw new Exception("Missing required property"); | |
| 1366 | + } | |
| 1367 | + if (!property_exists($obj, 'wind')) { | |
| 1368 | + throw new Exception("Missing required property"); | |
| 1369 | + } | |
| 1304 | 1370 | return new Weather( |
| 1305 | 1371 | Weather::fromMeta($obj->{'meta'}) |
| 1306 | 1372 | ,Weather::fromTemp($obj->{'temp'}) |
| @@ -1511,6 +1577,15 @@ class Meta { | ||
| 1511 | 1577 | * @throws Exception |
| 1512 | 1578 | */ |
| 1513 | 1579 | public static function from(stdClass $obj): Meta { |
| 1580 | + if (!property_exists($obj, 'credit')) { | |
| 1581 | + throw new Exception("Missing required property"); | |
| 1582 | + } | |
| 1583 | + if (!property_exists($obj, 'updated')) { | |
| 1584 | + throw new Exception("Missing required property"); | |
| 1585 | + } | |
| 1586 | + if (!property_exists($obj, 'url')) { | |
| 1587 | + throw new Exception("Missing required property"); | |
| 1588 | + } | |
| 1514 | 1589 | return new Meta( |
| 1515 | 1590 | Meta::fromCredit($obj->{'credit'}) |
| 1516 | 1591 | ,Meta::fromUpdated($obj->{'updated'}) |
Test case
1 generated file · +36 −0test/inputs/json/misc/3e9a3.json
Mphpdefault / TopLevel.php+36 −0
| @@ -252,6 +252,18 @@ class TopLevel { | ||
| 252 | 252 | * @throws Exception |
| 253 | 253 | */ |
| 254 | 254 | public static function from(stdClass $obj): TopLevel { |
| 255 | + if (!property_exists($obj, 'message')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 258 | + if (!property_exists($obj, 'responseTime')) { | |
| 259 | + throw new Exception("Missing required property"); | |
| 260 | + } | |
| 261 | + if (!property_exists($obj, 'Results')) { | |
| 262 | + throw new Exception("Missing required property"); | |
| 263 | + } | |
| 264 | + if (!property_exists($obj, 'status')) { | |
| 265 | + throw new Exception("Missing required property"); | |
| 266 | + } | |
| 255 | 267 | return new TopLevel( |
| 256 | 268 | TopLevel::fromMessage($obj->{'message'}) |
| 257 | 269 | ,TopLevel::fromResponseTime($obj->{'responseTime'}) |
| @@ -368,6 +380,9 @@ class Results { | ||
| 368 | 380 | * @throws Exception |
| 369 | 381 | */ |
| 370 | 382 | public static function from(stdClass $obj): Results { |
| 383 | + if (!property_exists($obj, 'series')) { | |
| 384 | + throw new Exception("Missing required property"); | |
| 385 | + } | |
| 371 | 386 | return new Results( |
| 372 | 387 | Results::fromSeries($obj->{'series'}) |
| 373 | 388 | ); |
| @@ -530,6 +545,12 @@ class Series { | ||
| 530 | 545 | * @throws Exception |
| 531 | 546 | */ |
| 532 | 547 | public static function from(stdClass $obj): Series { |
| 548 | + if (!property_exists($obj, 'data')) { | |
| 549 | + throw new Exception("Missing required property"); | |
| 550 | + } | |
| 551 | + if (!property_exists($obj, 'seriesID')) { | |
| 552 | + throw new Exception("Missing required property"); | |
| 553 | + } | |
| 533 | 554 | return new Series( |
| 534 | 555 | Series::fromData($obj->{'data'}) |
| 535 | 556 | ,Series::fromSeriesID($obj->{'seriesID'}) |
| @@ -850,6 +871,21 @@ class Datum { | ||
| 850 | 871 | * @throws Exception |
| 851 | 872 | */ |
| 852 | 873 | public static function from(stdClass $obj): Datum { |
| 874 | + if (!property_exists($obj, 'footnotes')) { | |
| 875 | + throw new Exception("Missing required property"); | |
| 876 | + } | |
| 877 | + if (!property_exists($obj, 'period')) { | |
| 878 | + throw new Exception("Missing required property"); | |
| 879 | + } | |
| 880 | + if (!property_exists($obj, 'periodName')) { | |
| 881 | + throw new Exception("Missing required property"); | |
| 882 | + } | |
| 883 | + if (!property_exists($obj, 'value')) { | |
| 884 | + throw new Exception("Missing required property"); | |
| 885 | + } | |
| 886 | + if (!property_exists($obj, 'year')) { | |
| 887 | + throw new Exception("Missing required property"); | |
| 888 | + } | |
| 853 | 889 | return new Datum( |
| 854 | 890 | Datum::fromFootnotes($obj->{'footnotes'}) |
| 855 | 891 | ,Datum::fromPeriod($obj->{'period'}) |
Test case
1 generated file · +180 −0test/inputs/json/misc/3f1ce.json
Mphpdefault / TopLevel.php+180 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'query')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromQuery($obj->{'query'}) |
| 90 | 93 | ); |
| @@ -347,6 +350,18 @@ class Query { | ||
| 347 | 350 | * @throws Exception |
| 348 | 351 | */ |
| 349 | 352 | public static function from(stdClass $obj): Query { |
| 353 | + if (!property_exists($obj, 'count')) { | |
| 354 | + throw new Exception("Missing required property"); | |
| 355 | + } | |
| 356 | + if (!property_exists($obj, 'created')) { | |
| 357 | + throw new Exception("Missing required property"); | |
| 358 | + } | |
| 359 | + if (!property_exists($obj, 'lang')) { | |
| 360 | + throw new Exception("Missing required property"); | |
| 361 | + } | |
| 362 | + if (!property_exists($obj, 'results')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 350 | 365 | return new Query( |
| 351 | 366 | Query::fromCount($obj->{'count'}) |
| 352 | 367 | ,Query::fromCreated($obj->{'created'}) |
| @@ -452,6 +467,9 @@ class Results { | ||
| 452 | 467 | * @throws Exception |
| 453 | 468 | */ |
| 454 | 469 | public static function from(stdClass $obj): Results { |
| 470 | + if (!property_exists($obj, 'channel')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 455 | 473 | return new Results( |
| 456 | 474 | Results::fromChannel($obj->{'channel'}) |
| 457 | 475 | ); |
| @@ -1181,6 +1199,45 @@ class Channel { | ||
| 1181 | 1199 | * @throws Exception |
| 1182 | 1200 | */ |
| 1183 | 1201 | public static function from(stdClass $obj): Channel { |
| 1202 | + if (!property_exists($obj, 'astronomy')) { | |
| 1203 | + throw new Exception("Missing required property"); | |
| 1204 | + } | |
| 1205 | + if (!property_exists($obj, 'atmosphere')) { | |
| 1206 | + throw new Exception("Missing required property"); | |
| 1207 | + } | |
| 1208 | + if (!property_exists($obj, 'description')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'image')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1214 | + if (!property_exists($obj, 'item')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'language')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'lastBuildDate')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'link')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'location')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'title')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'ttl')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'units')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'wind')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1184 | 1241 | return new Channel( |
| 1185 | 1242 | Channel::fromAstronomy($obj->{'astronomy'}) |
| 1186 | 1243 | ,Channel::fromAtmosphere($obj->{'atmosphere'}) |
| @@ -1355,6 +1412,12 @@ class Astronomy { | ||
| 1355 | 1412 | * @throws Exception |
| 1356 | 1413 | */ |
| 1357 | 1414 | public static function from(stdClass $obj): Astronomy { |
| 1415 | + if (!property_exists($obj, 'sunrise')) { | |
| 1416 | + throw new Exception("Missing required property"); | |
| 1417 | + } | |
| 1418 | + if (!property_exists($obj, 'sunset')) { | |
| 1419 | + throw new Exception("Missing required property"); | |
| 1420 | + } | |
| 1358 | 1421 | return new Astronomy( |
| 1359 | 1422 | Astronomy::fromSunrise($obj->{'sunrise'}) |
| 1360 | 1423 | ,Astronomy::fromSunset($obj->{'sunset'}) |
| @@ -1611,6 +1674,18 @@ class Atmosphere { | ||
| 1611 | 1674 | * @throws Exception |
| 1612 | 1675 | */ |
| 1613 | 1676 | public static function from(stdClass $obj): Atmosphere { |
| 1677 | + if (!property_exists($obj, 'humidity')) { | |
| 1678 | + throw new Exception("Missing required property"); | |
| 1679 | + } | |
| 1680 | + if (!property_exists($obj, 'pressure')) { | |
| 1681 | + throw new Exception("Missing required property"); | |
| 1682 | + } | |
| 1683 | + if (!property_exists($obj, 'rising')) { | |
| 1684 | + throw new Exception("Missing required property"); | |
| 1685 | + } | |
| 1686 | + if (!property_exists($obj, 'visibility')) { | |
| 1687 | + throw new Exception("Missing required property"); | |
| 1688 | + } | |
| 1614 | 1689 | return new Atmosphere( |
| 1615 | 1690 | Atmosphere::fromHumidity($obj->{'humidity'}) |
| 1616 | 1691 | ,Atmosphere::fromPressure($obj->{'pressure'}) |
| @@ -1923,6 +1998,21 @@ class Image { | ||
| 1923 | 1998 | * @throws Exception |
| 1924 | 1999 | */ |
| 1925 | 2000 | public static function from(stdClass $obj): Image { |
| 2001 | + if (!property_exists($obj, 'height')) { | |
| 2002 | + throw new Exception("Missing required property"); | |
| 2003 | + } | |
| 2004 | + if (!property_exists($obj, 'link')) { | |
| 2005 | + throw new Exception("Missing required property"); | |
| 2006 | + } | |
| 2007 | + if (!property_exists($obj, 'title')) { | |
| 2008 | + throw new Exception("Missing required property"); | |
| 2009 | + } | |
| 2010 | + if (!property_exists($obj, 'url')) { | |
| 2011 | + throw new Exception("Missing required property"); | |
| 2012 | + } | |
| 2013 | + if (!property_exists($obj, 'width')) { | |
| 2014 | + throw new Exception("Missing required property"); | |
| 2015 | + } | |
| 1926 | 2016 | return new Image( |
| 1927 | 2017 | Image::fromHeight($obj->{'height'}) |
| 1928 | 2018 | ,Image::fromLink($obj->{'link'}) |
| @@ -2459,6 +2549,33 @@ class Item { | ||
| 2459 | 2549 | * @throws Exception |
| 2460 | 2550 | */ |
| 2461 | 2551 | public static function from(stdClass $obj): Item { |
| 2552 | + if (!property_exists($obj, 'condition')) { | |
| 2553 | + throw new Exception("Missing required property"); | |
| 2554 | + } | |
| 2555 | + if (!property_exists($obj, 'description')) { | |
| 2556 | + throw new Exception("Missing required property"); | |
| 2557 | + } | |
| 2558 | + if (!property_exists($obj, 'forecast')) { | |
| 2559 | + throw new Exception("Missing required property"); | |
| 2560 | + } | |
| 2561 | + if (!property_exists($obj, 'guid')) { | |
| 2562 | + throw new Exception("Missing required property"); | |
| 2563 | + } | |
| 2564 | + if (!property_exists($obj, 'lat')) { | |
| 2565 | + throw new Exception("Missing required property"); | |
| 2566 | + } | |
| 2567 | + if (!property_exists($obj, 'link')) { | |
| 2568 | + throw new Exception("Missing required property"); | |
| 2569 | + } | |
| 2570 | + if (!property_exists($obj, 'long')) { | |
| 2571 | + throw new Exception("Missing required property"); | |
| 2572 | + } | |
| 2573 | + if (!property_exists($obj, 'pubDate')) { | |
| 2574 | + throw new Exception("Missing required property"); | |
| 2575 | + } | |
| 2576 | + if (!property_exists($obj, 'title')) { | |
| 2577 | + throw new Exception("Missing required property"); | |
| 2578 | + } | |
| 2462 | 2579 | return new Item( |
| 2463 | 2580 | Item::fromCondition($obj->{'condition'}) |
| 2464 | 2581 | ,Item::fromDescription($obj->{'description'}) |
| @@ -2729,6 +2846,18 @@ class Condition { | ||
| 2729 | 2846 | * @throws Exception |
| 2730 | 2847 | */ |
| 2731 | 2848 | public static function from(stdClass $obj): Condition { |
| 2849 | + if (!property_exists($obj, 'code')) { | |
| 2850 | + throw new Exception("Missing required property"); | |
| 2851 | + } | |
| 2852 | + if (!property_exists($obj, 'date')) { | |
| 2853 | + throw new Exception("Missing required property"); | |
| 2854 | + } | |
| 2855 | + if (!property_exists($obj, 'temp')) { | |
| 2856 | + throw new Exception("Missing required property"); | |
| 2857 | + } | |
| 2858 | + if (!property_exists($obj, 'text')) { | |
| 2859 | + throw new Exception("Missing required property"); | |
| 2860 | + } | |
| 2732 | 2861 | return new Condition( |
| 2733 | 2862 | Condition::fromCode($obj->{'code'}) |
| 2734 | 2863 | ,Condition::fromDate($obj->{'date'}) |
| @@ -3094,6 +3223,24 @@ class Forecast { | ||
| 3094 | 3223 | * @throws Exception |
| 3095 | 3224 | */ |
| 3096 | 3225 | public static function from(stdClass $obj): Forecast { |
| 3226 | + if (!property_exists($obj, 'code')) { | |
| 3227 | + throw new Exception("Missing required property"); | |
| 3228 | + } | |
| 3229 | + if (!property_exists($obj, 'date')) { | |
| 3230 | + throw new Exception("Missing required property"); | |
| 3231 | + } | |
| 3232 | + if (!property_exists($obj, 'day')) { | |
| 3233 | + throw new Exception("Missing required property"); | |
| 3234 | + } | |
| 3235 | + if (!property_exists($obj, 'high')) { | |
| 3236 | + throw new Exception("Missing required property"); | |
| 3237 | + } | |
| 3238 | + if (!property_exists($obj, 'low')) { | |
| 3239 | + throw new Exception("Missing required property"); | |
| 3240 | + } | |
| 3241 | + if (!property_exists($obj, 'text')) { | |
| 3242 | + throw new Exception("Missing required property"); | |
| 3243 | + } | |
| 3097 | 3244 | return new Forecast( |
| 3098 | 3245 | Forecast::fromCode($obj->{'code'}) |
| 3099 | 3246 | ,Forecast::fromDate($obj->{'date'}) |
| @@ -3247,6 +3394,9 @@ class GUID { | ||
| 3247 | 3394 | * @throws Exception |
| 3248 | 3395 | */ |
| 3249 | 3396 | public static function from(stdClass $obj): GUID { |
| 3397 | + if (!property_exists($obj, 'isPermaLink')) { | |
| 3398 | + throw new Exception("Missing required property"); | |
| 3399 | + } | |
| 3250 | 3400 | return new GUID( |
| 3251 | 3401 | GUID::fromIsPermaLink($obj->{'isPermaLink'}) |
| 3252 | 3402 | ); |
| @@ -3449,6 +3599,15 @@ class Location { | ||
| 3449 | 3599 | * @throws Exception |
| 3450 | 3600 | */ |
| 3451 | 3601 | public static function from(stdClass $obj): Location { |
| 3602 | + if (!property_exists($obj, 'city')) { | |
| 3603 | + throw new Exception("Missing required property"); | |
| 3604 | + } | |
| 3605 | + if (!property_exists($obj, 'country')) { | |
| 3606 | + throw new Exception("Missing required property"); | |
| 3607 | + } | |
| 3608 | + if (!property_exists($obj, 'region')) { | |
| 3609 | + throw new Exception("Missing required property"); | |
| 3610 | + } | |
| 3452 | 3611 | return new Location( |
| 3453 | 3612 | Location::fromCity($obj->{'city'}) |
| 3454 | 3613 | ,Location::fromCountry($obj->{'country'}) |
| @@ -3707,6 +3866,18 @@ class Units { | ||
| 3707 | 3866 | * @throws Exception |
| 3708 | 3867 | */ |
| 3709 | 3868 | public static function from(stdClass $obj): Units { |
| 3869 | + if (!property_exists($obj, 'distance')) { | |
| 3870 | + throw new Exception("Missing required property"); | |
| 3871 | + } | |
| 3872 | + if (!property_exists($obj, 'pressure')) { | |
| 3873 | + throw new Exception("Missing required property"); | |
| 3874 | + } | |
| 3875 | + if (!property_exists($obj, 'speed')) { | |
| 3876 | + throw new Exception("Missing required property"); | |
| 3877 | + } | |
| 3878 | + if (!property_exists($obj, 'temperature')) { | |
| 3879 | + throw new Exception("Missing required property"); | |
| 3880 | + } | |
| 3710 | 3881 | return new Units( |
| 3711 | 3882 | Units::fromDistance($obj->{'distance'}) |
| 3712 | 3883 | ,Units::fromPressure($obj->{'pressure'}) |
| @@ -3915,6 +4086,15 @@ class Wind { | ||
| 3915 | 4086 | * @throws Exception |
| 3916 | 4087 | */ |
| 3917 | 4088 | public static function from(stdClass $obj): Wind { |
| 4089 | + if (!property_exists($obj, 'chill')) { | |
| 4090 | + throw new Exception("Missing required property"); | |
| 4091 | + } | |
| 4092 | + if (!property_exists($obj, 'direction')) { | |
| 4093 | + throw new Exception("Missing required property"); | |
| 4094 | + } | |
| 4095 | + if (!property_exists($obj, 'speed')) { | |
| 4096 | + throw new Exception("Missing required property"); | |
| 4097 | + } | |
| 3918 | 4098 | return new Wind( |
| 3919 | 4099 | Wind::fromChill($obj->{'chill'}) |
| 3920 | 4100 | ,Wind::fromDirection($obj->{'direction'}) |
Test case
1 generated file · +204 −0test/inputs/json/misc/421d4.json
Mphpdefault / TopLevel.php+204 −0
| @@ -190,6 +190,12 @@ class TopLevel { | ||
| 190 | 190 | * @throws Exception |
| 191 | 191 | */ |
| 192 | 192 | public static function from(stdClass $obj): TopLevel { |
| 193 | + if (!property_exists($obj, 'data')) { | |
| 194 | + throw new Exception("Missing required property"); | |
| 195 | + } | |
| 196 | + if (!property_exists($obj, 'meta')) { | |
| 197 | + throw new Exception("Missing required property"); | |
| 198 | + } | |
| 193 | 199 | return new TopLevel( |
| 194 | 200 | TopLevel::fromData($obj->{'data'}) |
| 195 | 201 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -291,6 +297,9 @@ class Meta { | ||
| 291 | 297 | * @throws Exception |
| 292 | 298 | */ |
| 293 | 299 | public static function from(stdClass $obj): Meta { |
| 300 | + if (!property_exists($obj, 'view')) { | |
| 301 | + throw new Exception("Missing required property"); | |
| 302 | + } | |
| 294 | 303 | return new Meta( |
| 295 | 304 | Meta::fromView($obj->{'view'}) |
| 296 | 305 | ); |
| @@ -2488,6 +2497,126 @@ class View { | ||
| 2488 | 2497 | * @throws Exception |
| 2489 | 2498 | */ |
| 2490 | 2499 | public static function from(stdClass $obj): View { |
| 2500 | + if (!property_exists($obj, 'attribution')) { | |
| 2501 | + throw new Exception("Missing required property"); | |
| 2502 | + } | |
| 2503 | + if (!property_exists($obj, 'averageRating')) { | |
| 2504 | + throw new Exception("Missing required property"); | |
| 2505 | + } | |
| 2506 | + if (!property_exists($obj, 'category')) { | |
| 2507 | + throw new Exception("Missing required property"); | |
| 2508 | + } | |
| 2509 | + if (!property_exists($obj, 'columns')) { | |
| 2510 | + throw new Exception("Missing required property"); | |
| 2511 | + } | |
| 2512 | + if (!property_exists($obj, 'createdAt')) { | |
| 2513 | + throw new Exception("Missing required property"); | |
| 2514 | + } | |
| 2515 | + if (!property_exists($obj, 'description')) { | |
| 2516 | + throw new Exception("Missing required property"); | |
| 2517 | + } | |
| 2518 | + if (!property_exists($obj, 'displayType')) { | |
| 2519 | + throw new Exception("Missing required property"); | |
| 2520 | + } | |
| 2521 | + if (!property_exists($obj, 'downloadCount')) { | |
| 2522 | + throw new Exception("Missing required property"); | |
| 2523 | + } | |
| 2524 | + if (!property_exists($obj, 'flags')) { | |
| 2525 | + throw new Exception("Missing required property"); | |
| 2526 | + } | |
| 2527 | + if (!property_exists($obj, 'grants')) { | |
| 2528 | + throw new Exception("Missing required property"); | |
| 2529 | + } | |
| 2530 | + if (!property_exists($obj, 'hideFromCatalog')) { | |
| 2531 | + throw new Exception("Missing required property"); | |
| 2532 | + } | |
| 2533 | + if (!property_exists($obj, 'hideFromDataJson')) { | |
| 2534 | + throw new Exception("Missing required property"); | |
| 2535 | + } | |
| 2536 | + if (!property_exists($obj, 'id')) { | |
| 2537 | + throw new Exception("Missing required property"); | |
| 2538 | + } | |
| 2539 | + if (!property_exists($obj, 'indexUpdatedAt')) { | |
| 2540 | + throw new Exception("Missing required property"); | |
| 2541 | + } | |
| 2542 | + if (!property_exists($obj, 'license')) { | |
| 2543 | + throw new Exception("Missing required property"); | |
| 2544 | + } | |
| 2545 | + if (!property_exists($obj, 'licenseId')) { | |
| 2546 | + throw new Exception("Missing required property"); | |
| 2547 | + } | |
| 2548 | + if (!property_exists($obj, 'locale')) { | |
| 2549 | + throw new Exception("Missing required property"); | |
| 2550 | + } | |
| 2551 | + if (!property_exists($obj, 'metadata')) { | |
| 2552 | + throw new Exception("Missing required property"); | |
| 2553 | + } | |
| 2554 | + if (!property_exists($obj, 'name')) { | |
| 2555 | + throw new Exception("Missing required property"); | |
| 2556 | + } | |
| 2557 | + if (!property_exists($obj, 'newBackend')) { | |
| 2558 | + throw new Exception("Missing required property"); | |
| 2559 | + } | |
| 2560 | + if (!property_exists($obj, 'numberOfComments')) { | |
| 2561 | + throw new Exception("Missing required property"); | |
| 2562 | + } | |
| 2563 | + if (!property_exists($obj, 'oid')) { | |
| 2564 | + throw new Exception("Missing required property"); | |
| 2565 | + } | |
| 2566 | + if (!property_exists($obj, 'owner')) { | |
| 2567 | + throw new Exception("Missing required property"); | |
| 2568 | + } | |
| 2569 | + if (!property_exists($obj, 'provenance')) { | |
| 2570 | + throw new Exception("Missing required property"); | |
| 2571 | + } | |
| 2572 | + if (!property_exists($obj, 'publicationAppendEnabled')) { | |
| 2573 | + throw new Exception("Missing required property"); | |
| 2574 | + } | |
| 2575 | + if (!property_exists($obj, 'publicationDate')) { | |
| 2576 | + throw new Exception("Missing required property"); | |
| 2577 | + } | |
| 2578 | + if (!property_exists($obj, 'publicationGroup')) { | |
| 2579 | + throw new Exception("Missing required property"); | |
| 2580 | + } | |
| 2581 | + if (!property_exists($obj, 'publicationStage')) { | |
| 2582 | + throw new Exception("Missing required property"); | |
| 2583 | + } | |
| 2584 | + if (!property_exists($obj, 'query')) { | |
| 2585 | + throw new Exception("Missing required property"); | |
| 2586 | + } | |
| 2587 | + if (!property_exists($obj, 'rights')) { | |
| 2588 | + throw new Exception("Missing required property"); | |
| 2589 | + } | |
| 2590 | + if (!property_exists($obj, 'rowClass')) { | |
| 2591 | + throw new Exception("Missing required property"); | |
| 2592 | + } | |
| 2593 | + if (!property_exists($obj, 'rowsUpdatedAt')) { | |
| 2594 | + throw new Exception("Missing required property"); | |
| 2595 | + } | |
| 2596 | + if (!property_exists($obj, 'rowsUpdatedBy')) { | |
| 2597 | + throw new Exception("Missing required property"); | |
| 2598 | + } | |
| 2599 | + if (!property_exists($obj, 'tableAuthor')) { | |
| 2600 | + throw new Exception("Missing required property"); | |
| 2601 | + } | |
| 2602 | + if (!property_exists($obj, 'tableId')) { | |
| 2603 | + throw new Exception("Missing required property"); | |
| 2604 | + } | |
| 2605 | + if (!property_exists($obj, 'tags')) { | |
| 2606 | + throw new Exception("Missing required property"); | |
| 2607 | + } | |
| 2608 | + if (!property_exists($obj, 'totalTimesRated')) { | |
| 2609 | + throw new Exception("Missing required property"); | |
| 2610 | + } | |
| 2611 | + if (!property_exists($obj, 'viewCount')) { | |
| 2612 | + throw new Exception("Missing required property"); | |
| 2613 | + } | |
| 2614 | + if (!property_exists($obj, 'viewLastModified')) { | |
| 2615 | + throw new Exception("Missing required property"); | |
| 2616 | + } | |
| 2617 | + if (!property_exists($obj, 'viewType')) { | |
| 2618 | + throw new Exception("Missing required property"); | |
| 2619 | + } | |
| 2491 | 2620 | return new View( |
| 2492 | 2621 | View::fromAttribution($obj->{'attribution'}) |
| 2493 | 2622 | ,View::fromAverageRating($obj->{'averageRating'}) |
| @@ -3240,6 +3369,27 @@ class Column { | ||
| 3240 | 3369 | * @throws Exception |
| 3241 | 3370 | */ |
| 3242 | 3371 | public static function from(stdClass $obj): Column { |
| 3372 | + if (!property_exists($obj, 'dataTypeName')) { | |
| 3373 | + throw new Exception("Missing required property"); | |
| 3374 | + } | |
| 3375 | + if (!property_exists($obj, 'fieldName')) { | |
| 3376 | + throw new Exception("Missing required property"); | |
| 3377 | + } | |
| 3378 | + if (!property_exists($obj, 'format')) { | |
| 3379 | + throw new Exception("Missing required property"); | |
| 3380 | + } | |
| 3381 | + if (!property_exists($obj, 'id')) { | |
| 3382 | + throw new Exception("Missing required property"); | |
| 3383 | + } | |
| 3384 | + if (!property_exists($obj, 'name')) { | |
| 3385 | + throw new Exception("Missing required property"); | |
| 3386 | + } | |
| 3387 | + if (!property_exists($obj, 'position')) { | |
| 3388 | + throw new Exception("Missing required property"); | |
| 3389 | + } | |
| 3390 | + if (!property_exists($obj, 'renderTypeName')) { | |
| 3391 | + throw new Exception("Missing required property"); | |
| 3392 | + } | |
| 3243 | 3393 | return new Column( |
| 3244 | 3394 | Column::fromCachedContents($obj->{'cachedContents'}) |
| 3245 | 3395 | ,Column::fromDataTypeName($obj->{'dataTypeName'}) |
| @@ -3732,6 +3882,12 @@ class CachedContents { | ||
| 3732 | 3882 | * @throws Exception |
| 3733 | 3883 | */ |
| 3734 | 3884 | public static function from(stdClass $obj): CachedContents { |
| 3885 | + if (!property_exists($obj, 'non_null')) { | |
| 3886 | + throw new Exception("Missing required property"); | |
| 3887 | + } | |
| 3888 | + if (!property_exists($obj, 'null')) { | |
| 3889 | + throw new Exception("Missing required property"); | |
| 3890 | + } | |
| 3735 | 3891 | return new CachedContents( |
| 3736 | 3892 | CachedContents::fromAverage($obj->{'average'}) |
| 3737 | 3893 | ,CachedContents::fromLargest($obj->{'largest'}) |
| @@ -3894,6 +4050,12 @@ class Top { | ||
| 3894 | 4050 | * @throws Exception |
| 3895 | 4051 | */ |
| 3896 | 4052 | public static function from(stdClass $obj): Top { |
| 4053 | + if (!property_exists($obj, 'count')) { | |
| 4054 | + throw new Exception("Missing required property"); | |
| 4055 | + } | |
| 4056 | + if (!property_exists($obj, 'item')) { | |
| 4057 | + throw new Exception("Missing required property"); | |
| 4058 | + } | |
| 3897 | 4059 | return new Top( |
| 3898 | 4060 | Top::fromCount($obj->{'count'}) |
| 3899 | 4061 | ,Top::fromItem($obj->{'item'}) |
| @@ -4157,6 +4319,15 @@ class Grant { | ||
| 4157 | 4319 | * @throws Exception |
| 4158 | 4320 | */ |
| 4159 | 4321 | public static function from(stdClass $obj): Grant { |
| 4322 | + if (!property_exists($obj, 'flags')) { | |
| 4323 | + throw new Exception("Missing required property"); | |
| 4324 | + } | |
| 4325 | + if (!property_exists($obj, 'inherited')) { | |
| 4326 | + throw new Exception("Missing required property"); | |
| 4327 | + } | |
| 4328 | + if (!property_exists($obj, 'type')) { | |
| 4329 | + throw new Exception("Missing required property"); | |
| 4330 | + } | |
| 4160 | 4331 | return new Grant( |
| 4161 | 4332 | Grant::fromFlags($obj->{'flags'}) |
| 4162 | 4333 | ,Grant::fromInherited($obj->{'inherited'}) |
| @@ -4259,6 +4430,9 @@ class License { | ||
| 4259 | 4430 | * @throws Exception |
| 4260 | 4431 | */ |
| 4261 | 4432 | public static function from(stdClass $obj): License { |
| 4433 | + if (!property_exists($obj, 'name')) { | |
| 4434 | + throw new Exception("Missing required property"); | |
| 4435 | + } | |
| 4262 | 4436 | return new License( |
| 4263 | 4437 | License::fromName($obj->{'name'}) |
| 4264 | 4438 | ); |
| @@ -4580,6 +4754,21 @@ class Metadata { | ||
| 4580 | 4754 | * @throws Exception |
| 4581 | 4755 | */ |
| 4582 | 4756 | public static function from(stdClass $obj): Metadata { |
| 4757 | + if (!property_exists($obj, 'availableDisplayTypes')) { | |
| 4758 | + throw new Exception("Missing required property"); | |
| 4759 | + } | |
| 4760 | + if (!property_exists($obj, 'rdfClass')) { | |
| 4761 | + throw new Exception("Missing required property"); | |
| 4762 | + } | |
| 4763 | + if (!property_exists($obj, 'rdfSubject')) { | |
| 4764 | + throw new Exception("Missing required property"); | |
| 4765 | + } | |
| 4766 | + if (!property_exists($obj, 'renderTypeConfig')) { | |
| 4767 | + throw new Exception("Missing required property"); | |
| 4768 | + } | |
| 4769 | + if (!property_exists($obj, 'rowIdentifier')) { | |
| 4770 | + throw new Exception("Missing required property"); | |
| 4771 | + } | |
| 4583 | 4772 | return new Metadata( |
| 4584 | 4773 | Metadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'}) |
| 4585 | 4774 | ,Metadata::fromRDFClass($obj->{'rdfClass'}) |
| @@ -4687,6 +4876,9 @@ class RenderTypeConfig { | ||
| 4687 | 4876 | * @throws Exception |
| 4688 | 4877 | */ |
| 4689 | 4878 | public static function from(stdClass $obj): RenderTypeConfig { |
| 4879 | + if (!property_exists($obj, 'visible')) { | |
| 4880 | + throw new Exception("Missing required property"); | |
| 4881 | + } | |
| 4690 | 4882 | return new RenderTypeConfig( |
| 4691 | 4883 | RenderTypeConfig::fromVisible($obj->{'visible'}) |
| 4692 | 4884 | ); |
| @@ -4785,6 +4977,9 @@ class Visible { | ||
| 4785 | 4977 | * @throws Exception |
| 4786 | 4978 | */ |
| 4787 | 4979 | public static function from(stdClass $obj): Visible { |
| 4980 | + if (!property_exists($obj, 'table')) { | |
| 4981 | + throw new Exception("Missing required property"); | |
| 4982 | + } | |
| 4788 | 4983 | return new Visible( |
| 4789 | 4984 | Visible::fromTable($obj->{'table'}) |
| 4790 | 4985 | ); |
| @@ -4987,6 +5182,15 @@ class Owner { | ||
| 4987 | 5182 | * @throws Exception |
| 4988 | 5183 | */ |
| 4989 | 5184 | public static function from(stdClass $obj): Owner { |
| 5185 | + if (!property_exists($obj, 'displayName')) { | |
| 5186 | + throw new Exception("Missing required property"); | |
| 5187 | + } | |
| 5188 | + if (!property_exists($obj, 'id')) { | |
| 5189 | + throw new Exception("Missing required property"); | |
| 5190 | + } | |
| 5191 | + if (!property_exists($obj, 'screenName')) { | |
| 5192 | + throw new Exception("Missing required property"); | |
| 5193 | + } | |
| 4990 | 5194 | return new Owner( |
| 4991 | 5195 | Owner::fromDisplayName($obj->{'displayName'}) |
| 4992 | 5196 | ,Owner::fromID($obj->{'id'}) |
Test case
1 generated file · +207 −0test/inputs/json/misc/437e7.json
Mphpdefault / TopLevel.php+207 −0
| @@ -202,6 +202,15 @@ class TopLevel { | ||
| 202 | 202 | * @throws Exception |
| 203 | 203 | */ |
| 204 | 204 | public static function from(stdClass $obj): TopLevel { |
| 205 | + if (!property_exists($obj, 'data')) { | |
| 206 | + throw new Exception("Missing required property"); | |
| 207 | + } | |
| 208 | + if (!property_exists($obj, 'meta')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'pagination')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 205 | 214 | return new TopLevel( |
| 206 | 215 | TopLevel::fromData($obj->{'data'}) |
| 207 | 216 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -1202,6 +1211,57 @@ class Datum { | ||
| 1202 | 1211 | * @throws Exception |
| 1203 | 1212 | */ |
| 1204 | 1213 | public static function from(stdClass $obj): Datum { |
| 1214 | + if (!property_exists($obj, 'bitly_gif_url')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'bitly_url')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'content_url')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'embed_url')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'id')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'images')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'import_datetime')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'is_indexable')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'rating')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1241 | + if (!property_exists($obj, 'slug')) { | |
| 1242 | + throw new Exception("Missing required property"); | |
| 1243 | + } | |
| 1244 | + if (!property_exists($obj, 'source')) { | |
| 1245 | + throw new Exception("Missing required property"); | |
| 1246 | + } | |
| 1247 | + if (!property_exists($obj, 'source_post_url')) { | |
| 1248 | + throw new Exception("Missing required property"); | |
| 1249 | + } | |
| 1250 | + if (!property_exists($obj, 'source_tld')) { | |
| 1251 | + throw new Exception("Missing required property"); | |
| 1252 | + } | |
| 1253 | + if (!property_exists($obj, 'trending_datetime')) { | |
| 1254 | + throw new Exception("Missing required property"); | |
| 1255 | + } | |
| 1256 | + if (!property_exists($obj, 'type')) { | |
| 1257 | + throw new Exception("Missing required property"); | |
| 1258 | + } | |
| 1259 | + if (!property_exists($obj, 'url')) { | |
| 1260 | + throw new Exception("Missing required property"); | |
| 1261 | + } | |
| 1262 | + if (!property_exists($obj, 'username')) { | |
| 1263 | + throw new Exception("Missing required property"); | |
| 1264 | + } | |
| 1205 | 1265 | return new Datum( |
| 1206 | 1266 | Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'}) |
| 1207 | 1267 | ,Datum::fromBitlyURL($obj->{'bitly_url'}) |
| @@ -2448,6 +2508,72 @@ class Images { | ||
| 2448 | 2508 | * @throws Exception |
| 2449 | 2509 | */ |
| 2450 | 2510 | public static function from(stdClass $obj): Images { |
| 2511 | + if (!property_exists($obj, 'downsized')) { | |
| 2512 | + throw new Exception("Missing required property"); | |
| 2513 | + } | |
| 2514 | + if (!property_exists($obj, 'downsized_large')) { | |
| 2515 | + throw new Exception("Missing required property"); | |
| 2516 | + } | |
| 2517 | + if (!property_exists($obj, 'downsized_medium')) { | |
| 2518 | + throw new Exception("Missing required property"); | |
| 2519 | + } | |
| 2520 | + if (!property_exists($obj, 'downsized_small')) { | |
| 2521 | + throw new Exception("Missing required property"); | |
| 2522 | + } | |
| 2523 | + if (!property_exists($obj, 'downsized_still')) { | |
| 2524 | + throw new Exception("Missing required property"); | |
| 2525 | + } | |
| 2526 | + if (!property_exists($obj, 'fixed_height')) { | |
| 2527 | + throw new Exception("Missing required property"); | |
| 2528 | + } | |
| 2529 | + if (!property_exists($obj, 'fixed_height_downsampled')) { | |
| 2530 | + throw new Exception("Missing required property"); | |
| 2531 | + } | |
| 2532 | + if (!property_exists($obj, 'fixed_height_small')) { | |
| 2533 | + throw new Exception("Missing required property"); | |
| 2534 | + } | |
| 2535 | + if (!property_exists($obj, 'fixed_height_small_still')) { | |
| 2536 | + throw new Exception("Missing required property"); | |
| 2537 | + } | |
| 2538 | + if (!property_exists($obj, 'fixed_height_still')) { | |
| 2539 | + throw new Exception("Missing required property"); | |
| 2540 | + } | |
| 2541 | + if (!property_exists($obj, 'fixed_width')) { | |
| 2542 | + throw new Exception("Missing required property"); | |
| 2543 | + } | |
| 2544 | + if (!property_exists($obj, 'fixed_width_downsampled')) { | |
| 2545 | + throw new Exception("Missing required property"); | |
| 2546 | + } | |
| 2547 | + if (!property_exists($obj, 'fixed_width_small')) { | |
| 2548 | + throw new Exception("Missing required property"); | |
| 2549 | + } | |
| 2550 | + if (!property_exists($obj, 'fixed_width_small_still')) { | |
| 2551 | + throw new Exception("Missing required property"); | |
| 2552 | + } | |
| 2553 | + if (!property_exists($obj, 'fixed_width_still')) { | |
| 2554 | + throw new Exception("Missing required property"); | |
| 2555 | + } | |
| 2556 | + if (!property_exists($obj, 'looping')) { | |
| 2557 | + throw new Exception("Missing required property"); | |
| 2558 | + } | |
| 2559 | + if (!property_exists($obj, 'original')) { | |
| 2560 | + throw new Exception("Missing required property"); | |
| 2561 | + } | |
| 2562 | + if (!property_exists($obj, 'original_mp4')) { | |
| 2563 | + throw new Exception("Missing required property"); | |
| 2564 | + } | |
| 2565 | + if (!property_exists($obj, 'original_still')) { | |
| 2566 | + throw new Exception("Missing required property"); | |
| 2567 | + } | |
| 2568 | + if (!property_exists($obj, 'preview')) { | |
| 2569 | + throw new Exception("Missing required property"); | |
| 2570 | + } | |
| 2571 | + if (!property_exists($obj, 'preview_gif')) { | |
| 2572 | + throw new Exception("Missing required property"); | |
| 2573 | + } | |
| 2574 | + if (!property_exists($obj, 'preview_webp')) { | |
| 2575 | + throw new Exception("Missing required property"); | |
| 2576 | + } | |
| 2451 | 2577 | return new Images( |
| 2452 | 2578 | Images::fromDownsized($obj->{'downsized'}) |
| 2453 | 2579 | ,Images::fromDownsizedLarge($obj->{'downsized_large'}) |
| @@ -2754,6 +2880,15 @@ class Downsized { | ||
| 2754 | 2880 | * @throws Exception |
| 2755 | 2881 | */ |
| 2756 | 2882 | public static function from(stdClass $obj): Downsized { |
| 2883 | + if (!property_exists($obj, 'height')) { | |
| 2884 | + throw new Exception("Missing required property"); | |
| 2885 | + } | |
| 2886 | + if (!property_exists($obj, 'url')) { | |
| 2887 | + throw new Exception("Missing required property"); | |
| 2888 | + } | |
| 2889 | + if (!property_exists($obj, 'width')) { | |
| 2890 | + throw new Exception("Missing required property"); | |
| 2891 | + } | |
| 2757 | 2892 | return new Downsized( |
| 2758 | 2893 | Downsized::fromHeight($obj->{'height'}) |
| 2759 | 2894 | ,Downsized::fromSize($obj->{'size'}) |
| @@ -3014,6 +3149,18 @@ class DownsizedSmall { | ||
| 3014 | 3149 | * @throws Exception |
| 3015 | 3150 | */ |
| 3016 | 3151 | public static function from(stdClass $obj): DownsizedSmall { |
| 3152 | + if (!property_exists($obj, 'height')) { | |
| 3153 | + throw new Exception("Missing required property"); | |
| 3154 | + } | |
| 3155 | + if (!property_exists($obj, 'mp4')) { | |
| 3156 | + throw new Exception("Missing required property"); | |
| 3157 | + } | |
| 3158 | + if (!property_exists($obj, 'mp4_size')) { | |
| 3159 | + throw new Exception("Missing required property"); | |
| 3160 | + } | |
| 3161 | + if (!property_exists($obj, 'width')) { | |
| 3162 | + throw new Exception("Missing required property"); | |
| 3163 | + } | |
| 3017 | 3164 | return new DownsizedSmall( |
| 3018 | 3165 | DownsizedSmall::fromHeight($obj->{'height'}) |
| 3019 | 3166 | ,DownsizedSmall::fromMp4($obj->{'mp4'}) |
| @@ -3564,6 +3711,24 @@ class FixedHeight { | ||
| 3564 | 3711 | * @throws Exception |
| 3565 | 3712 | */ |
| 3566 | 3713 | public static function from(stdClass $obj): FixedHeight { |
| 3714 | + if (!property_exists($obj, 'height')) { | |
| 3715 | + throw new Exception("Missing required property"); | |
| 3716 | + } | |
| 3717 | + if (!property_exists($obj, 'size')) { | |
| 3718 | + throw new Exception("Missing required property"); | |
| 3719 | + } | |
| 3720 | + if (!property_exists($obj, 'url')) { | |
| 3721 | + throw new Exception("Missing required property"); | |
| 3722 | + } | |
| 3723 | + if (!property_exists($obj, 'webp')) { | |
| 3724 | + throw new Exception("Missing required property"); | |
| 3725 | + } | |
| 3726 | + if (!property_exists($obj, 'webp_size')) { | |
| 3727 | + throw new Exception("Missing required property"); | |
| 3728 | + } | |
| 3729 | + if (!property_exists($obj, 'width')) { | |
| 3730 | + throw new Exception("Missing required property"); | |
| 3731 | + } | |
| 3567 | 3732 | return new FixedHeight( |
| 3568 | 3733 | FixedHeight::fromFrames($obj->{'frames'}) |
| 3569 | 3734 | ,FixedHeight::fromHeight($obj->{'height'}) |
| @@ -3730,6 +3895,12 @@ class Looping { | ||
| 3730 | 3895 | * @throws Exception |
| 3731 | 3896 | */ |
| 3732 | 3897 | public static function from(stdClass $obj): Looping { |
| 3898 | + if (!property_exists($obj, 'mp4')) { | |
| 3899 | + throw new Exception("Missing required property"); | |
| 3900 | + } | |
| 3901 | + if (!property_exists($obj, 'mp4_size')) { | |
| 3902 | + throw new Exception("Missing required property"); | |
| 3903 | + } | |
| 3733 | 3904 | return new Looping( |
| 3734 | 3905 | Looping::fromMp4($obj->{'mp4'}) |
| 3735 | 3906 | ,Looping::fromMp4Size($obj->{'mp4_size'}) |
| @@ -4192,6 +4363,24 @@ class User { | ||
| 4192 | 4363 | * @throws Exception |
| 4193 | 4364 | */ |
| 4194 | 4365 | public static function from(stdClass $obj): User { |
| 4366 | + if (!property_exists($obj, 'avatar_url')) { | |
| 4367 | + throw new Exception("Missing required property"); | |
| 4368 | + } | |
| 4369 | + if (!property_exists($obj, 'banner_url')) { | |
| 4370 | + throw new Exception("Missing required property"); | |
| 4371 | + } | |
| 4372 | + if (!property_exists($obj, 'display_name')) { | |
| 4373 | + throw new Exception("Missing required property"); | |
| 4374 | + } | |
| 4375 | + if (!property_exists($obj, 'profile_url')) { | |
| 4376 | + throw new Exception("Missing required property"); | |
| 4377 | + } | |
| 4378 | + if (!property_exists($obj, 'twitter')) { | |
| 4379 | + throw new Exception("Missing required property"); | |
| 4380 | + } | |
| 4381 | + if (!property_exists($obj, 'username')) { | |
| 4382 | + throw new Exception("Missing required property"); | |
| 4383 | + } | |
| 4195 | 4384 | return new User( |
| 4196 | 4385 | User::fromAvatarURL($obj->{'avatar_url'}) |
| 4197 | 4386 | ,User::fromBannerURL($obj->{'banner_url'}) |
| @@ -4404,6 +4593,15 @@ class Meta { | ||
| 4404 | 4593 | * @throws Exception |
| 4405 | 4594 | */ |
| 4406 | 4595 | public static function from(stdClass $obj): Meta { |
| 4596 | + if (!property_exists($obj, 'msg')) { | |
| 4597 | + throw new Exception("Missing required property"); | |
| 4598 | + } | |
| 4599 | + if (!property_exists($obj, 'response_id')) { | |
| 4600 | + throw new Exception("Missing required property"); | |
| 4601 | + } | |
| 4602 | + if (!property_exists($obj, 'status')) { | |
| 4603 | + throw new Exception("Missing required property"); | |
| 4604 | + } | |
| 4407 | 4605 | return new Meta( |
| 4408 | 4606 | Meta::fromMsg($obj->{'msg'}) |
| 4409 | 4607 | ,Meta::fromResponseID($obj->{'response_id'}) |
| @@ -4610,6 +4808,15 @@ class Pagination { | ||
| 4610 | 4808 | * @throws Exception |
| 4611 | 4809 | */ |
| 4612 | 4810 | public static function from(stdClass $obj): Pagination { |
| 4811 | + if (!property_exists($obj, 'count')) { | |
| 4812 | + throw new Exception("Missing required property"); | |
| 4813 | + } | |
| 4814 | + if (!property_exists($obj, 'offset')) { | |
| 4815 | + throw new Exception("Missing required property"); | |
| 4816 | + } | |
| 4817 | + if (!property_exists($obj, 'total_count')) { | |
| 4818 | + throw new Exception("Missing required property"); | |
| 4819 | + } | |
| 4613 | 4820 | return new Pagination( |
| 4614 | 4821 | Pagination::fromCount($obj->{'count'}) |
| 4615 | 4822 | ,Pagination::fromOffset($obj->{'offset'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/43970.json
Mphpdefault / TopLevel.php+9 −0
| @@ -188,6 +188,15 @@ class TopLevel { | ||
| 188 | 188 | * @throws Exception |
| 189 | 189 | */ |
| 190 | 190 | public static function from(stdClass $obj): TopLevel { |
| 191 | + if (!property_exists($obj, 'ID')) { | |
| 192 | + throw new Exception("Missing required property"); | |
| 193 | + } | |
| 194 | + if (!property_exists($obj, 'Name')) { | |
| 195 | + throw new Exception("Missing required property"); | |
| 196 | + } | |
| 197 | + if (!property_exists($obj, 'Notes')) { | |
| 198 | + throw new Exception("Missing required property"); | |
| 199 | + } | |
| 191 | 200 | return new TopLevel( |
| 192 | 201 | TopLevel::fromID($obj->{'ID'}) |
| 193 | 202 | ,TopLevel::fromName($obj->{'Name'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/43eaf.json
Mphpdefault / TopLevel.php+9 −0
| @@ -205,6 +205,15 @@ class TopLevel { | ||
| 205 | 205 | * @throws Exception |
| 206 | 206 | */ |
| 207 | 207 | public static function from(stdClass $obj): TopLevel { |
| 208 | + if (!property_exists($obj, 'base')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'date')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 214 | + if (!property_exists($obj, 'rates')) { | |
| 215 | + throw new Exception("Missing required property"); | |
| 216 | + } | |
| 208 | 217 | return new TopLevel( |
| 209 | 218 | TopLevel::fromBase($obj->{'base'}) |
| 210 | 219 | ,TopLevel::fromDate($obj->{'date'}) |
Test case
1 generated file · +75 −0test/inputs/json/misc/458db.json
Mphpdefault / TopLevel.php+75 −0
| @@ -149,6 +149,12 @@ class TopLevel { | ||
| 149 | 149 | * @throws Exception |
| 150 | 150 | */ |
| 151 | 151 | public static function from(stdClass $obj): TopLevel { |
| 152 | + if (!property_exists($obj, 'metadata')) { | |
| 153 | + throw new Exception("Missing required property"); | |
| 154 | + } | |
| 155 | + if (!property_exists($obj, 'results')) { | |
| 156 | + throw new Exception("Missing required property"); | |
| 157 | + } | |
| 152 | 158 | return new TopLevel( |
| 153 | 159 | TopLevel::fromMetadata($obj->{'metadata'}) |
| 154 | 160 | ,TopLevel::fromResults($obj->{'results'}) |
| @@ -355,6 +361,15 @@ class Metadata { | ||
| 355 | 361 | * @throws Exception |
| 356 | 362 | */ |
| 357 | 363 | public static function from(stdClass $obj): Metadata { |
| 364 | + if (!property_exists($obj, 'executionTime')) { | |
| 365 | + throw new Exception("Missing required property"); | |
| 366 | + } | |
| 367 | + if (!property_exists($obj, 'responseInfo')) { | |
| 368 | + throw new Exception("Missing required property"); | |
| 369 | + } | |
| 370 | + if (!property_exists($obj, 'resultset')) { | |
| 371 | + throw new Exception("Missing required property"); | |
| 372 | + } | |
| 358 | 373 | return new Metadata( |
| 359 | 374 | Metadata::fromExecutionTime($obj->{'executionTime'}) |
| 360 | 375 | ,Metadata::fromResponseInfo($obj->{'responseInfo'}) |
| @@ -509,6 +524,12 @@ class ResponseInfo { | ||
| 509 | 524 | * @throws Exception |
| 510 | 525 | */ |
| 511 | 526 | public static function from(stdClass $obj): ResponseInfo { |
| 527 | + if (!property_exists($obj, 'developerMessage')) { | |
| 528 | + throw new Exception("Missing required property"); | |
| 529 | + } | |
| 530 | + if (!property_exists($obj, 'status')) { | |
| 531 | + throw new Exception("Missing required property"); | |
| 532 | + } | |
| 512 | 533 | return new ResponseInfo( |
| 513 | 534 | ResponseInfo::fromDeveloperMessage($obj->{'developerMessage'}) |
| 514 | 535 | ,ResponseInfo::fromStatus($obj->{'status'}) |
| @@ -713,6 +734,15 @@ class Resultset { | ||
| 713 | 734 | * @throws Exception |
| 714 | 735 | */ |
| 715 | 736 | public static function from(stdClass $obj): Resultset { |
| 737 | + if (!property_exists($obj, 'count')) { | |
| 738 | + throw new Exception("Missing required property"); | |
| 739 | + } | |
| 740 | + if (!property_exists($obj, 'page')) { | |
| 741 | + throw new Exception("Missing required property"); | |
| 742 | + } | |
| 743 | + if (!property_exists($obj, 'pagesize')) { | |
| 744 | + throw new Exception("Missing required property"); | |
| 745 | + } | |
| 716 | 746 | return new Resultset( |
| 717 | 747 | Resultset::fromCount($obj->{'count'}) |
| 718 | 748 | ,Resultset::fromPage($obj->{'page'}) |
| @@ -1501,6 +1531,45 @@ class Result { | ||
| 1501 | 1531 | * @throws Exception |
| 1502 | 1532 | */ |
| 1503 | 1533 | public static function from(stdClass $obj): Result { |
| 1534 | + if (!property_exists($obj, 'attachments')) { | |
| 1535 | + throw new Exception("Missing required property"); | |
| 1536 | + } | |
| 1537 | + if (!property_exists($obj, 'body')) { | |
| 1538 | + throw new Exception("Missing required property"); | |
| 1539 | + } | |
| 1540 | + if (!property_exists($obj, 'changed')) { | |
| 1541 | + throw new Exception("Missing required property"); | |
| 1542 | + } | |
| 1543 | + if (!property_exists($obj, 'component')) { | |
| 1544 | + throw new Exception("Missing required property"); | |
| 1545 | + } | |
| 1546 | + if (!property_exists($obj, 'created')) { | |
| 1547 | + throw new Exception("Missing required property"); | |
| 1548 | + } | |
| 1549 | + if (!property_exists($obj, 'date')) { | |
| 1550 | + throw new Exception("Missing required property"); | |
| 1551 | + } | |
| 1552 | + if (!property_exists($obj, 'image')) { | |
| 1553 | + throw new Exception("Missing required property"); | |
| 1554 | + } | |
| 1555 | + if (!property_exists($obj, 'teaser')) { | |
| 1556 | + throw new Exception("Missing required property"); | |
| 1557 | + } | |
| 1558 | + if (!property_exists($obj, 'title')) { | |
| 1559 | + throw new Exception("Missing required property"); | |
| 1560 | + } | |
| 1561 | + if (!property_exists($obj, 'topic')) { | |
| 1562 | + throw new Exception("Missing required property"); | |
| 1563 | + } | |
| 1564 | + if (!property_exists($obj, 'url')) { | |
| 1565 | + throw new Exception("Missing required property"); | |
| 1566 | + } | |
| 1567 | + if (!property_exists($obj, 'uuid')) { | |
| 1568 | + throw new Exception("Missing required property"); | |
| 1569 | + } | |
| 1570 | + if (!property_exists($obj, 'vuuid')) { | |
| 1571 | + throw new Exception("Missing required property"); | |
| 1572 | + } | |
| 1504 | 1573 | return new Result( |
| 1505 | 1574 | Result::fromAttachments($obj->{'attachments'}) |
| 1506 | 1575 | ,Result::fromBody($obj->{'body'}) |
| @@ -1679,6 +1748,12 @@ class Component { | ||
| 1679 | 1748 | * @throws Exception |
| 1680 | 1749 | */ |
| 1681 | 1750 | public static function from(stdClass $obj): Component { |
| 1751 | + if (!property_exists($obj, 'name')) { | |
| 1752 | + throw new Exception("Missing required property"); | |
| 1753 | + } | |
| 1754 | + if (!property_exists($obj, 'uuid')) { | |
| 1755 | + throw new Exception("Missing required property"); | |
| 1756 | + } | |
| 1682 | 1757 | return new Component( |
| 1683 | 1758 | Component::fromName($obj->{'name'}) |
| 1684 | 1759 | ,Component::fromUUID($obj->{'uuid'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/4961a.json
Mphpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'total_population')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromTotalPopulation($obj->{'total_population'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class TotalPopulation { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): TotalPopulation { |
| 252 | + if (!property_exists($obj, 'date')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'population')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new TotalPopulation( |
| 250 | 259 | TotalPopulation::fromDate($obj->{'date'}) |
| 251 | 260 | ,TotalPopulation::fromPopulation($obj->{'population'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/4a0d7.json
Mphpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'total_population')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromTotalPopulation($obj->{'total_population'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class TotalPopulation { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): TotalPopulation { |
| 252 | + if (!property_exists($obj, 'date')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'population')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new TotalPopulation( |
| 250 | 259 | TotalPopulation::fromDate($obj->{'date'}) |
| 251 | 260 | ,TotalPopulation::fromPopulation($obj->{'population'}) |
Test case
1 generated file · +60 −0test/inputs/json/misc/4a455.json
Mphpdefault / TopLevel.php+60 −0
| @@ -253,6 +253,18 @@ class TopLevel { | ||
| 253 | 253 | * @throws Exception |
| 254 | 254 | */ |
| 255 | 255 | public static function from(stdClass $obj): TopLevel { |
| 256 | + if (!property_exists($obj, 'crs')) { | |
| 257 | + throw new Exception("Missing required property"); | |
| 258 | + } | |
| 259 | + if (!property_exists($obj, 'features')) { | |
| 260 | + throw new Exception("Missing required property"); | |
| 261 | + } | |
| 262 | + if (!property_exists($obj, 'totalFeatures')) { | |
| 263 | + throw new Exception("Missing required property"); | |
| 264 | + } | |
| 265 | + if (!property_exists($obj, 'type')) { | |
| 266 | + throw new Exception("Missing required property"); | |
| 267 | + } | |
| 256 | 268 | return new TopLevel( |
| 257 | 269 | TopLevel::fromCRS($obj->{'crs'}) |
| 258 | 270 | ,TopLevel::fromFeatures($obj->{'features'}) |
| @@ -410,6 +422,12 @@ class CRS { | ||
| 410 | 422 | * @throws Exception |
| 411 | 423 | */ |
| 412 | 424 | public static function from(stdClass $obj): CRS { |
| 425 | + if (!property_exists($obj, 'properties')) { | |
| 426 | + throw new Exception("Missing required property"); | |
| 427 | + } | |
| 428 | + if (!property_exists($obj, 'type')) { | |
| 429 | + throw new Exception("Missing required property"); | |
| 430 | + } | |
| 413 | 431 | return new CRS( |
| 414 | 432 | CRS::fromProperties($obj->{'properties'}) |
| 415 | 433 | ,CRS::fromType($obj->{'type'}) |
| @@ -510,6 +528,9 @@ class CRSProperties { | ||
| 510 | 528 | * @throws Exception |
| 511 | 529 | */ |
| 512 | 530 | public static function from(stdClass $obj): CRSProperties { |
| 531 | + if (!property_exists($obj, 'name')) { | |
| 532 | + throw new Exception("Missing required property"); | |
| 533 | + } | |
| 513 | 534 | return new CRSProperties( |
| 514 | 535 | CRSProperties::fromName($obj->{'name'}) |
| 515 | 536 | ); |
| @@ -820,6 +841,21 @@ class Feature { | ||
| 820 | 841 | * @throws Exception |
| 821 | 842 | */ |
| 822 | 843 | public static function from(stdClass $obj): Feature { |
| 844 | + if (!property_exists($obj, 'geometry')) { | |
| 845 | + throw new Exception("Missing required property"); | |
| 846 | + } | |
| 847 | + if (!property_exists($obj, 'geometry_name')) { | |
| 848 | + throw new Exception("Missing required property"); | |
| 849 | + } | |
| 850 | + if (!property_exists($obj, 'id')) { | |
| 851 | + throw new Exception("Missing required property"); | |
| 852 | + } | |
| 853 | + if (!property_exists($obj, 'properties')) { | |
| 854 | + throw new Exception("Missing required property"); | |
| 855 | + } | |
| 856 | + if (!property_exists($obj, 'type')) { | |
| 857 | + throw new Exception("Missing required property"); | |
| 858 | + } | |
| 823 | 859 | return new Feature( |
| 824 | 860 | Feature::fromGeometry($obj->{'geometry'}) |
| 825 | 861 | ,Feature::fromGeometryName($obj->{'geometry_name'}) |
| @@ -1004,6 +1040,12 @@ class Geometry { | ||
| 1004 | 1040 | * @throws Exception |
| 1005 | 1041 | */ |
| 1006 | 1042 | public static function from(stdClass $obj): Geometry { |
| 1043 | + if (!property_exists($obj, 'coordinates')) { | |
| 1044 | + throw new Exception("Missing required property"); | |
| 1045 | + } | |
| 1046 | + if (!property_exists($obj, 'type')) { | |
| 1047 | + throw new Exception("Missing required property"); | |
| 1048 | + } | |
| 1007 | 1049 | return new Geometry( |
| 1008 | 1050 | Geometry::fromCoordinates($obj->{'coordinates'}) |
| 1009 | 1051 | ,Geometry::fromType($obj->{'type'}) |
| @@ -1454,6 +1496,24 @@ class FeatureProperties { | ||
| 1454 | 1496 | * @throws Exception |
| 1455 | 1497 | */ |
| 1456 | 1498 | public static function from(stdClass $obj): FeatureProperties { |
| 1499 | + if (!property_exists($obj, 'facebookaccount')) { | |
| 1500 | + throw new Exception("Missing required property"); | |
| 1501 | + } | |
| 1502 | + if (!property_exists($obj, 'frequencyfinderurl')) { | |
| 1503 | + throw new Exception("Missing required property"); | |
| 1504 | + } | |
| 1505 | + if (!property_exists($obj, 'name')) { | |
| 1506 | + throw new Exception("Missing required property"); | |
| 1507 | + } | |
| 1508 | + if (!property_exists($obj, 'siteurl')) { | |
| 1509 | + throw new Exception("Missing required property"); | |
| 1510 | + } | |
| 1511 | + if (!property_exists($obj, 'streetaddress')) { | |
| 1512 | + throw new Exception("Missing required property"); | |
| 1513 | + } | |
| 1514 | + if (!property_exists($obj, 'twitteraccount')) { | |
| 1515 | + throw new Exception("Missing required property"); | |
| 1516 | + } | |
| 1457 | 1517 | return new FeatureProperties( |
| 1458 | 1518 | FeatureProperties::fromFacebookaccount($obj->{'facebookaccount'}) |
| 1459 | 1519 | ,FeatureProperties::fromFrequencyfinderurl($obj->{'frequencyfinderurl'}) |
Test case
1 generated file · +180 −0test/inputs/json/misc/4c547.json
Mphpdefault / TopLevel.php+180 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'query')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromQuery($obj->{'query'}) |
| 90 | 93 | ); |
| @@ -347,6 +350,18 @@ class Query { | ||
| 347 | 350 | * @throws Exception |
| 348 | 351 | */ |
| 349 | 352 | public static function from(stdClass $obj): Query { |
| 353 | + if (!property_exists($obj, 'count')) { | |
| 354 | + throw new Exception("Missing required property"); | |
| 355 | + } | |
| 356 | + if (!property_exists($obj, 'created')) { | |
| 357 | + throw new Exception("Missing required property"); | |
| 358 | + } | |
| 359 | + if (!property_exists($obj, 'lang')) { | |
| 360 | + throw new Exception("Missing required property"); | |
| 361 | + } | |
| 362 | + if (!property_exists($obj, 'results')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 350 | 365 | return new Query( |
| 351 | 366 | Query::fromCount($obj->{'count'}) |
| 352 | 367 | ,Query::fromCreated($obj->{'created'}) |
| @@ -452,6 +467,9 @@ class Results { | ||
| 452 | 467 | * @throws Exception |
| 453 | 468 | */ |
| 454 | 469 | public static function from(stdClass $obj): Results { |
| 470 | + if (!property_exists($obj, 'channel')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 455 | 473 | return new Results( |
| 456 | 474 | Results::fromChannel($obj->{'channel'}) |
| 457 | 475 | ); |
| @@ -1181,6 +1199,45 @@ class Channel { | ||
| 1181 | 1199 | * @throws Exception |
| 1182 | 1200 | */ |
| 1183 | 1201 | public static function from(stdClass $obj): Channel { |
| 1202 | + if (!property_exists($obj, 'astronomy')) { | |
| 1203 | + throw new Exception("Missing required property"); | |
| 1204 | + } | |
| 1205 | + if (!property_exists($obj, 'atmosphere')) { | |
| 1206 | + throw new Exception("Missing required property"); | |
| 1207 | + } | |
| 1208 | + if (!property_exists($obj, 'description')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'image')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1214 | + if (!property_exists($obj, 'item')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'language')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'lastBuildDate')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'link')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'location')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'title')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'ttl')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'units')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'wind')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1184 | 1241 | return new Channel( |
| 1185 | 1242 | Channel::fromAstronomy($obj->{'astronomy'}) |
| 1186 | 1243 | ,Channel::fromAtmosphere($obj->{'atmosphere'}) |
| @@ -1355,6 +1412,12 @@ class Astronomy { | ||
| 1355 | 1412 | * @throws Exception |
| 1356 | 1413 | */ |
| 1357 | 1414 | public static function from(stdClass $obj): Astronomy { |
| 1415 | + if (!property_exists($obj, 'sunrise')) { | |
| 1416 | + throw new Exception("Missing required property"); | |
| 1417 | + } | |
| 1418 | + if (!property_exists($obj, 'sunset')) { | |
| 1419 | + throw new Exception("Missing required property"); | |
| 1420 | + } | |
| 1358 | 1421 | return new Astronomy( |
| 1359 | 1422 | Astronomy::fromSunrise($obj->{'sunrise'}) |
| 1360 | 1423 | ,Astronomy::fromSunset($obj->{'sunset'}) |
| @@ -1611,6 +1674,18 @@ class Atmosphere { | ||
| 1611 | 1674 | * @throws Exception |
| 1612 | 1675 | */ |
| 1613 | 1676 | public static function from(stdClass $obj): Atmosphere { |
| 1677 | + if (!property_exists($obj, 'humidity')) { | |
| 1678 | + throw new Exception("Missing required property"); | |
| 1679 | + } | |
| 1680 | + if (!property_exists($obj, 'pressure')) { | |
| 1681 | + throw new Exception("Missing required property"); | |
| 1682 | + } | |
| 1683 | + if (!property_exists($obj, 'rising')) { | |
| 1684 | + throw new Exception("Missing required property"); | |
| 1685 | + } | |
| 1686 | + if (!property_exists($obj, 'visibility')) { | |
| 1687 | + throw new Exception("Missing required property"); | |
| 1688 | + } | |
| 1614 | 1689 | return new Atmosphere( |
| 1615 | 1690 | Atmosphere::fromHumidity($obj->{'humidity'}) |
| 1616 | 1691 | ,Atmosphere::fromPressure($obj->{'pressure'}) |
| @@ -1923,6 +1998,21 @@ class Image { | ||
| 1923 | 1998 | * @throws Exception |
| 1924 | 1999 | */ |
| 1925 | 2000 | public static function from(stdClass $obj): Image { |
| 2001 | + if (!property_exists($obj, 'height')) { | |
| 2002 | + throw new Exception("Missing required property"); | |
| 2003 | + } | |
| 2004 | + if (!property_exists($obj, 'link')) { | |
| 2005 | + throw new Exception("Missing required property"); | |
| 2006 | + } | |
| 2007 | + if (!property_exists($obj, 'title')) { | |
| 2008 | + throw new Exception("Missing required property"); | |
| 2009 | + } | |
| 2010 | + if (!property_exists($obj, 'url')) { | |
| 2011 | + throw new Exception("Missing required property"); | |
| 2012 | + } | |
| 2013 | + if (!property_exists($obj, 'width')) { | |
| 2014 | + throw new Exception("Missing required property"); | |
| 2015 | + } | |
| 1926 | 2016 | return new Image( |
| 1927 | 2017 | Image::fromHeight($obj->{'height'}) |
| 1928 | 2018 | ,Image::fromLink($obj->{'link'}) |
| @@ -2459,6 +2549,33 @@ class Item { | ||
| 2459 | 2549 | * @throws Exception |
| 2460 | 2550 | */ |
| 2461 | 2551 | public static function from(stdClass $obj): Item { |
| 2552 | + if (!property_exists($obj, 'condition')) { | |
| 2553 | + throw new Exception("Missing required property"); | |
| 2554 | + } | |
| 2555 | + if (!property_exists($obj, 'description')) { | |
| 2556 | + throw new Exception("Missing required property"); | |
| 2557 | + } | |
| 2558 | + if (!property_exists($obj, 'forecast')) { | |
| 2559 | + throw new Exception("Missing required property"); | |
| 2560 | + } | |
| 2561 | + if (!property_exists($obj, 'guid')) { | |
| 2562 | + throw new Exception("Missing required property"); | |
| 2563 | + } | |
| 2564 | + if (!property_exists($obj, 'lat')) { | |
| 2565 | + throw new Exception("Missing required property"); | |
| 2566 | + } | |
| 2567 | + if (!property_exists($obj, 'link')) { | |
| 2568 | + throw new Exception("Missing required property"); | |
| 2569 | + } | |
| 2570 | + if (!property_exists($obj, 'long')) { | |
| 2571 | + throw new Exception("Missing required property"); | |
| 2572 | + } | |
| 2573 | + if (!property_exists($obj, 'pubDate')) { | |
| 2574 | + throw new Exception("Missing required property"); | |
| 2575 | + } | |
| 2576 | + if (!property_exists($obj, 'title')) { | |
| 2577 | + throw new Exception("Missing required property"); | |
| 2578 | + } | |
| 2462 | 2579 | return new Item( |
| 2463 | 2580 | Item::fromCondition($obj->{'condition'}) |
| 2464 | 2581 | ,Item::fromDescription($obj->{'description'}) |
| @@ -2729,6 +2846,18 @@ class Condition { | ||
| 2729 | 2846 | * @throws Exception |
| 2730 | 2847 | */ |
| 2731 | 2848 | public static function from(stdClass $obj): Condition { |
| 2849 | + if (!property_exists($obj, 'code')) { | |
| 2850 | + throw new Exception("Missing required property"); | |
| 2851 | + } | |
| 2852 | + if (!property_exists($obj, 'date')) { | |
| 2853 | + throw new Exception("Missing required property"); | |
| 2854 | + } | |
| 2855 | + if (!property_exists($obj, 'temp')) { | |
| 2856 | + throw new Exception("Missing required property"); | |
| 2857 | + } | |
| 2858 | + if (!property_exists($obj, 'text')) { | |
| 2859 | + throw new Exception("Missing required property"); | |
| 2860 | + } | |
| 2732 | 2861 | return new Condition( |
| 2733 | 2862 | Condition::fromCode($obj->{'code'}) |
| 2734 | 2863 | ,Condition::fromDate($obj->{'date'}) |
| @@ -3093,6 +3222,24 @@ class Forecast { | ||
| 3093 | 3222 | * @throws Exception |
| 3094 | 3223 | */ |
| 3095 | 3224 | public static function from(stdClass $obj): Forecast { |
| 3225 | + if (!property_exists($obj, 'code')) { | |
| 3226 | + throw new Exception("Missing required property"); | |
| 3227 | + } | |
| 3228 | + if (!property_exists($obj, 'date')) { | |
| 3229 | + throw new Exception("Missing required property"); | |
| 3230 | + } | |
| 3231 | + if (!property_exists($obj, 'day')) { | |
| 3232 | + throw new Exception("Missing required property"); | |
| 3233 | + } | |
| 3234 | + if (!property_exists($obj, 'high')) { | |
| 3235 | + throw new Exception("Missing required property"); | |
| 3236 | + } | |
| 3237 | + if (!property_exists($obj, 'low')) { | |
| 3238 | + throw new Exception("Missing required property"); | |
| 3239 | + } | |
| 3240 | + if (!property_exists($obj, 'text')) { | |
| 3241 | + throw new Exception("Missing required property"); | |
| 3242 | + } | |
| 3096 | 3243 | return new Forecast( |
| 3097 | 3244 | Forecast::fromCode($obj->{'code'}) |
| 3098 | 3245 | ,Forecast::fromDate($obj->{'date'}) |
| @@ -3201,6 +3348,9 @@ class GUID { | ||
| 3201 | 3348 | * @throws Exception |
| 3202 | 3349 | */ |
| 3203 | 3350 | public static function from(stdClass $obj): GUID { |
| 3351 | + if (!property_exists($obj, 'isPermaLink')) { | |
| 3352 | + throw new Exception("Missing required property"); | |
| 3353 | + } | |
| 3204 | 3354 | return new GUID( |
| 3205 | 3355 | GUID::fromIsPermaLink($obj->{'isPermaLink'}) |
| 3206 | 3356 | ); |
| @@ -3403,6 +3553,15 @@ class Location { | ||
| 3403 | 3553 | * @throws Exception |
| 3404 | 3554 | */ |
| 3405 | 3555 | public static function from(stdClass $obj): Location { |
| 3556 | + if (!property_exists($obj, 'city')) { | |
| 3557 | + throw new Exception("Missing required property"); | |
| 3558 | + } | |
| 3559 | + if (!property_exists($obj, 'country')) { | |
| 3560 | + throw new Exception("Missing required property"); | |
| 3561 | + } | |
| 3562 | + if (!property_exists($obj, 'region')) { | |
| 3563 | + throw new Exception("Missing required property"); | |
| 3564 | + } | |
| 3406 | 3565 | return new Location( |
| 3407 | 3566 | Location::fromCity($obj->{'city'}) |
| 3408 | 3567 | ,Location::fromCountry($obj->{'country'}) |
| @@ -3661,6 +3820,18 @@ class Units { | ||
| 3661 | 3820 | * @throws Exception |
| 3662 | 3821 | */ |
| 3663 | 3822 | public static function from(stdClass $obj): Units { |
| 3823 | + if (!property_exists($obj, 'distance')) { | |
| 3824 | + throw new Exception("Missing required property"); | |
| 3825 | + } | |
| 3826 | + if (!property_exists($obj, 'pressure')) { | |
| 3827 | + throw new Exception("Missing required property"); | |
| 3828 | + } | |
| 3829 | + if (!property_exists($obj, 'speed')) { | |
| 3830 | + throw new Exception("Missing required property"); | |
| 3831 | + } | |
| 3832 | + if (!property_exists($obj, 'temperature')) { | |
| 3833 | + throw new Exception("Missing required property"); | |
| 3834 | + } | |
| 3664 | 3835 | return new Units( |
| 3665 | 3836 | Units::fromDistance($obj->{'distance'}) |
| 3666 | 3837 | ,Units::fromPressure($obj->{'pressure'}) |
| @@ -3869,6 +4040,15 @@ class Wind { | ||
| 3869 | 4040 | * @throws Exception |
| 3870 | 4041 | */ |
| 3871 | 4042 | public static function from(stdClass $obj): Wind { |
| 4043 | + if (!property_exists($obj, 'chill')) { | |
| 4044 | + throw new Exception("Missing required property"); | |
| 4045 | + } | |
| 4046 | + if (!property_exists($obj, 'direction')) { | |
| 4047 | + throw new Exception("Missing required property"); | |
| 4048 | + } | |
| 4049 | + if (!property_exists($obj, 'speed')) { | |
| 4050 | + throw new Exception("Missing required property"); | |
| 4051 | + } | |
| 3872 | 4052 | return new Wind( |
| 3873 | 4053 | Wind::fromChill($obj->{'chill'}) |
| 3874 | 4054 | ,Wind::fromDirection($obj->{'direction'}) |
Test case
1 generated file · +282 −0test/inputs/json/misc/4d6fb.json
Mphpdefault / TopLevel.php+282 −0
| @@ -137,6 +137,12 @@ class TopLevel { | ||
| 137 | 137 | * @throws Exception |
| 138 | 138 | */ |
| 139 | 139 | public static function from(stdClass $obj): TopLevel { |
| 140 | + if (!property_exists($obj, 'data')) { | |
| 141 | + throw new Exception("Missing required property"); | |
| 142 | + } | |
| 143 | + if (!property_exists($obj, 'kind')) { | |
| 144 | + throw new Exception("Missing required property"); | |
| 145 | + } | |
| 140 | 146 | return new TopLevel( |
| 141 | 147 | TopLevel::fromData($obj->{'data'}) |
| 142 | 148 | ,TopLevel::fromKind($obj->{'kind'}) |
| @@ -408,6 +414,18 @@ class TopLevelData { | ||
| 408 | 414 | * @throws Exception |
| 409 | 415 | */ |
| 410 | 416 | public static function from(stdClass $obj): TopLevelData { |
| 417 | + if (!property_exists($obj, 'after')) { | |
| 418 | + throw new Exception("Missing required property"); | |
| 419 | + } | |
| 420 | + if (!property_exists($obj, 'before')) { | |
| 421 | + throw new Exception("Missing required property"); | |
| 422 | + } | |
| 423 | + if (!property_exists($obj, 'children')) { | |
| 424 | + throw new Exception("Missing required property"); | |
| 425 | + } | |
| 426 | + if (!property_exists($obj, 'modhash')) { | |
| 427 | + throw new Exception("Missing required property"); | |
| 428 | + } | |
| 411 | 429 | return new TopLevelData( |
| 412 | 430 | TopLevelData::fromAfter($obj->{'after'}) |
| 413 | 431 | ,TopLevelData::fromBefore($obj->{'before'}) |
| @@ -566,6 +584,12 @@ class Child { | ||
| 566 | 584 | * @throws Exception |
| 567 | 585 | */ |
| 568 | 586 | public static function from(stdClass $obj): Child { |
| 587 | + if (!property_exists($obj, 'data')) { | |
| 588 | + throw new Exception("Missing required property"); | |
| 589 | + } | |
| 590 | + if (!property_exists($obj, 'kind')) { | |
| 591 | + throw new Exception("Missing required property"); | |
| 592 | + } | |
| 569 | 593 | return new Child( |
| 570 | 594 | Child::fromData($obj->{'data'}) |
| 571 | 595 | ,Child::fromKind($obj->{'kind'}) |
| @@ -4082,6 +4106,192 @@ class ChildData { | ||
| 4082 | 4106 | * @throws Exception |
| 4083 | 4107 | */ |
| 4084 | 4108 | public static function from(stdClass $obj): ChildData { |
| 4109 | + if (!property_exists($obj, 'approved_at_utc')) { | |
| 4110 | + throw new Exception("Missing required property"); | |
| 4111 | + } | |
| 4112 | + if (!property_exists($obj, 'approved_by')) { | |
| 4113 | + throw new Exception("Missing required property"); | |
| 4114 | + } | |
| 4115 | + if (!property_exists($obj, 'archived')) { | |
| 4116 | + throw new Exception("Missing required property"); | |
| 4117 | + } | |
| 4118 | + if (!property_exists($obj, 'author')) { | |
| 4119 | + throw new Exception("Missing required property"); | |
| 4120 | + } | |
| 4121 | + if (!property_exists($obj, 'author_flair_css_class')) { | |
| 4122 | + throw new Exception("Missing required property"); | |
| 4123 | + } | |
| 4124 | + if (!property_exists($obj, 'author_flair_text')) { | |
| 4125 | + throw new Exception("Missing required property"); | |
| 4126 | + } | |
| 4127 | + if (!property_exists($obj, 'banned_at_utc')) { | |
| 4128 | + throw new Exception("Missing required property"); | |
| 4129 | + } | |
| 4130 | + if (!property_exists($obj, 'banned_by')) { | |
| 4131 | + throw new Exception("Missing required property"); | |
| 4132 | + } | |
| 4133 | + if (!property_exists($obj, 'brand_safe')) { | |
| 4134 | + throw new Exception("Missing required property"); | |
| 4135 | + } | |
| 4136 | + if (!property_exists($obj, 'can_gild')) { | |
| 4137 | + throw new Exception("Missing required property"); | |
| 4138 | + } | |
| 4139 | + if (!property_exists($obj, 'can_mod_post')) { | |
| 4140 | + throw new Exception("Missing required property"); | |
| 4141 | + } | |
| 4142 | + if (!property_exists($obj, 'clicked')) { | |
| 4143 | + throw new Exception("Missing required property"); | |
| 4144 | + } | |
| 4145 | + if (!property_exists($obj, 'contest_mode')) { | |
| 4146 | + throw new Exception("Missing required property"); | |
| 4147 | + } | |
| 4148 | + if (!property_exists($obj, 'created')) { | |
| 4149 | + throw new Exception("Missing required property"); | |
| 4150 | + } | |
| 4151 | + if (!property_exists($obj, 'created_utc')) { | |
| 4152 | + throw new Exception("Missing required property"); | |
| 4153 | + } | |
| 4154 | + if (!property_exists($obj, 'distinguished')) { | |
| 4155 | + throw new Exception("Missing required property"); | |
| 4156 | + } | |
| 4157 | + if (!property_exists($obj, 'domain')) { | |
| 4158 | + throw new Exception("Missing required property"); | |
| 4159 | + } | |
| 4160 | + if (!property_exists($obj, 'downs')) { | |
| 4161 | + throw new Exception("Missing required property"); | |
| 4162 | + } | |
| 4163 | + if (!property_exists($obj, 'edited')) { | |
| 4164 | + throw new Exception("Missing required property"); | |
| 4165 | + } | |
| 4166 | + if (!property_exists($obj, 'gilded')) { | |
| 4167 | + throw new Exception("Missing required property"); | |
| 4168 | + } | |
| 4169 | + if (!property_exists($obj, 'hidden')) { | |
| 4170 | + throw new Exception("Missing required property"); | |
| 4171 | + } | |
| 4172 | + if (!property_exists($obj, 'hide_score')) { | |
| 4173 | + throw new Exception("Missing required property"); | |
| 4174 | + } | |
| 4175 | + if (!property_exists($obj, 'id')) { | |
| 4176 | + throw new Exception("Missing required property"); | |
| 4177 | + } | |
| 4178 | + if (!property_exists($obj, 'is_self')) { | |
| 4179 | + throw new Exception("Missing required property"); | |
| 4180 | + } | |
| 4181 | + if (!property_exists($obj, 'is_video')) { | |
| 4182 | + throw new Exception("Missing required property"); | |
| 4183 | + } | |
| 4184 | + if (!property_exists($obj, 'likes')) { | |
| 4185 | + throw new Exception("Missing required property"); | |
| 4186 | + } | |
| 4187 | + if (!property_exists($obj, 'link_flair_css_class')) { | |
| 4188 | + throw new Exception("Missing required property"); | |
| 4189 | + } | |
| 4190 | + if (!property_exists($obj, 'link_flair_text')) { | |
| 4191 | + throw new Exception("Missing required property"); | |
| 4192 | + } | |
| 4193 | + if (!property_exists($obj, 'locked')) { | |
| 4194 | + throw new Exception("Missing required property"); | |
| 4195 | + } | |
| 4196 | + if (!property_exists($obj, 'media')) { | |
| 4197 | + throw new Exception("Missing required property"); | |
| 4198 | + } | |
| 4199 | + if (!property_exists($obj, 'media_embed')) { | |
| 4200 | + throw new Exception("Missing required property"); | |
| 4201 | + } | |
| 4202 | + if (!property_exists($obj, 'mod_reports')) { | |
| 4203 | + throw new Exception("Missing required property"); | |
| 4204 | + } | |
| 4205 | + if (!property_exists($obj, 'name')) { | |
| 4206 | + throw new Exception("Missing required property"); | |
| 4207 | + } | |
| 4208 | + if (!property_exists($obj, 'num_comments')) { | |
| 4209 | + throw new Exception("Missing required property"); | |
| 4210 | + } | |
| 4211 | + if (!property_exists($obj, 'num_reports')) { | |
| 4212 | + throw new Exception("Missing required property"); | |
| 4213 | + } | |
| 4214 | + if (!property_exists($obj, 'over_18')) { | |
| 4215 | + throw new Exception("Missing required property"); | |
| 4216 | + } | |
| 4217 | + if (!property_exists($obj, 'permalink')) { | |
| 4218 | + throw new Exception("Missing required property"); | |
| 4219 | + } | |
| 4220 | + if (!property_exists($obj, 'quarantine')) { | |
| 4221 | + throw new Exception("Missing required property"); | |
| 4222 | + } | |
| 4223 | + if (!property_exists($obj, 'removal_reason')) { | |
| 4224 | + throw new Exception("Missing required property"); | |
| 4225 | + } | |
| 4226 | + if (!property_exists($obj, 'report_reasons')) { | |
| 4227 | + throw new Exception("Missing required property"); | |
| 4228 | + } | |
| 4229 | + if (!property_exists($obj, 'saved')) { | |
| 4230 | + throw new Exception("Missing required property"); | |
| 4231 | + } | |
| 4232 | + if (!property_exists($obj, 'score')) { | |
| 4233 | + throw new Exception("Missing required property"); | |
| 4234 | + } | |
| 4235 | + if (!property_exists($obj, 'secure_media')) { | |
| 4236 | + throw new Exception("Missing required property"); | |
| 4237 | + } | |
| 4238 | + if (!property_exists($obj, 'secure_media_embed')) { | |
| 4239 | + throw new Exception("Missing required property"); | |
| 4240 | + } | |
| 4241 | + if (!property_exists($obj, 'selftext')) { | |
| 4242 | + throw new Exception("Missing required property"); | |
| 4243 | + } | |
| 4244 | + if (!property_exists($obj, 'selftext_html')) { | |
| 4245 | + throw new Exception("Missing required property"); | |
| 4246 | + } | |
| 4247 | + if (!property_exists($obj, 'spoiler')) { | |
| 4248 | + throw new Exception("Missing required property"); | |
| 4249 | + } | |
| 4250 | + if (!property_exists($obj, 'stickied')) { | |
| 4251 | + throw new Exception("Missing required property"); | |
| 4252 | + } | |
| 4253 | + if (!property_exists($obj, 'subreddit')) { | |
| 4254 | + throw new Exception("Missing required property"); | |
| 4255 | + } | |
| 4256 | + if (!property_exists($obj, 'subreddit_id')) { | |
| 4257 | + throw new Exception("Missing required property"); | |
| 4258 | + } | |
| 4259 | + if (!property_exists($obj, 'subreddit_name_prefixed')) { | |
| 4260 | + throw new Exception("Missing required property"); | |
| 4261 | + } | |
| 4262 | + if (!property_exists($obj, 'subreddit_type')) { | |
| 4263 | + throw new Exception("Missing required property"); | |
| 4264 | + } | |
| 4265 | + if (!property_exists($obj, 'suggested_sort')) { | |
| 4266 | + throw new Exception("Missing required property"); | |
| 4267 | + } | |
| 4268 | + if (!property_exists($obj, 'thumbnail')) { | |
| 4269 | + throw new Exception("Missing required property"); | |
| 4270 | + } | |
| 4271 | + if (!property_exists($obj, 'thumbnail_height')) { | |
| 4272 | + throw new Exception("Missing required property"); | |
| 4273 | + } | |
| 4274 | + if (!property_exists($obj, 'thumbnail_width')) { | |
| 4275 | + throw new Exception("Missing required property"); | |
| 4276 | + } | |
| 4277 | + if (!property_exists($obj, 'title')) { | |
| 4278 | + throw new Exception("Missing required property"); | |
| 4279 | + } | |
| 4280 | + if (!property_exists($obj, 'ups')) { | |
| 4281 | + throw new Exception("Missing required property"); | |
| 4282 | + } | |
| 4283 | + if (!property_exists($obj, 'url')) { | |
| 4284 | + throw new Exception("Missing required property"); | |
| 4285 | + } | |
| 4286 | + if (!property_exists($obj, 'user_reports')) { | |
| 4287 | + throw new Exception("Missing required property"); | |
| 4288 | + } | |
| 4289 | + if (!property_exists($obj, 'view_count')) { | |
| 4290 | + throw new Exception("Missing required property"); | |
| 4291 | + } | |
| 4292 | + if (!property_exists($obj, 'visited')) { | |
| 4293 | + throw new Exception("Missing required property"); | |
| 4294 | + } | |
| 4085 | 4295 | return new ChildData( |
| 4086 | 4296 | ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'}) |
| 4087 | 4297 | ,ChildData::fromApprovedBy($obj->{'approved_by'}) |
| @@ -4359,6 +4569,12 @@ class Media { | ||
| 4359 | 4569 | * @throws Exception |
| 4360 | 4570 | */ |
| 4361 | 4571 | public static function from(stdClass $obj): Media { |
| 4572 | + if (!property_exists($obj, 'oembed')) { | |
| 4573 | + throw new Exception("Missing required property"); | |
| 4574 | + } | |
| 4575 | + if (!property_exists($obj, 'type')) { | |
| 4576 | + throw new Exception("Missing required property"); | |
| 4577 | + } | |
| 4362 | 4578 | return new Media( |
| 4363 | 4579 | Media::fromOembed($obj->{'oembed'}) |
| 4364 | 4580 | ,Media::fromType($obj->{'type'}) |
| @@ -5083,6 +5299,45 @@ class Oembed { | ||
| 5083 | 5299 | * @throws Exception |
| 5084 | 5300 | */ |
| 5085 | 5301 | public static function from(stdClass $obj): Oembed { |
| 5302 | + if (!property_exists($obj, 'author_name')) { | |
| 5303 | + throw new Exception("Missing required property"); | |
| 5304 | + } | |
| 5305 | + if (!property_exists($obj, 'author_url')) { | |
| 5306 | + throw new Exception("Missing required property"); | |
| 5307 | + } | |
| 5308 | + if (!property_exists($obj, 'height')) { | |
| 5309 | + throw new Exception("Missing required property"); | |
| 5310 | + } | |
| 5311 | + if (!property_exists($obj, 'html')) { | |
| 5312 | + throw new Exception("Missing required property"); | |
| 5313 | + } | |
| 5314 | + if (!property_exists($obj, 'provider_name')) { | |
| 5315 | + throw new Exception("Missing required property"); | |
| 5316 | + } | |
| 5317 | + if (!property_exists($obj, 'provider_url')) { | |
| 5318 | + throw new Exception("Missing required property"); | |
| 5319 | + } | |
| 5320 | + if (!property_exists($obj, 'thumbnail_height')) { | |
| 5321 | + throw new Exception("Missing required property"); | |
| 5322 | + } | |
| 5323 | + if (!property_exists($obj, 'thumbnail_url')) { | |
| 5324 | + throw new Exception("Missing required property"); | |
| 5325 | + } | |
| 5326 | + if (!property_exists($obj, 'thumbnail_width')) { | |
| 5327 | + throw new Exception("Missing required property"); | |
| 5328 | + } | |
| 5329 | + if (!property_exists($obj, 'title')) { | |
| 5330 | + throw new Exception("Missing required property"); | |
| 5331 | + } | |
| 5332 | + if (!property_exists($obj, 'type')) { | |
| 5333 | + throw new Exception("Missing required property"); | |
| 5334 | + } | |
| 5335 | + if (!property_exists($obj, 'version')) { | |
| 5336 | + throw new Exception("Missing required property"); | |
| 5337 | + } | |
| 5338 | + if (!property_exists($obj, 'width')) { | |
| 5339 | + throw new Exception("Missing required property"); | |
| 5340 | + } | |
| 5086 | 5341 | return new Oembed( |
| 5087 | 5342 | Oembed::fromAuthorName($obj->{'author_name'}) |
| 5088 | 5343 | ,Oembed::fromAuthorURL($obj->{'author_url'}) |
| @@ -5618,6 +5873,12 @@ class Preview { | ||
| 5618 | 5873 | * @throws Exception |
| 5619 | 5874 | */ |
| 5620 | 5875 | public static function from(stdClass $obj): Preview { |
| 5876 | + if (!property_exists($obj, 'enabled')) { | |
| 5877 | + throw new Exception("Missing required property"); | |
| 5878 | + } | |
| 5879 | + if (!property_exists($obj, 'images')) { | |
| 5880 | + throw new Exception("Missing required property"); | |
| 5881 | + } | |
| 5621 | 5882 | return new Preview( |
| 5622 | 5883 | Preview::fromEnabled($obj->{'enabled'}) |
| 5623 | 5884 | ,Preview::fromImages($obj->{'images'}) |
| @@ -5888,6 +6149,18 @@ class Image { | ||
| 5888 | 6149 | * @throws Exception |
| 5889 | 6150 | */ |
| 5890 | 6151 | public static function from(stdClass $obj): Image { |
| 6152 | + if (!property_exists($obj, 'id')) { | |
| 6153 | + throw new Exception("Missing required property"); | |
| 6154 | + } | |
| 6155 | + if (!property_exists($obj, 'resolutions')) { | |
| 6156 | + throw new Exception("Missing required property"); | |
| 6157 | + } | |
| 6158 | + if (!property_exists($obj, 'source')) { | |
| 6159 | + throw new Exception("Missing required property"); | |
| 6160 | + } | |
| 6161 | + if (!property_exists($obj, 'variants')) { | |
| 6162 | + throw new Exception("Missing required property"); | |
| 6163 | + } | |
| 5891 | 6164 | return new Image( |
| 5892 | 6165 | Image::fromID($obj->{'id'}) |
| 5893 | 6166 | ,Image::fromResolutions($obj->{'resolutions'}) |
| @@ -6096,6 +6369,15 @@ class Source { | ||
| 6096 | 6369 | * @throws Exception |
| 6097 | 6370 | */ |
| 6098 | 6371 | public static function from(stdClass $obj): Source { |
| 6372 | + if (!property_exists($obj, 'height')) { | |
| 6373 | + throw new Exception("Missing required property"); | |
| 6374 | + } | |
| 6375 | + if (!property_exists($obj, 'url')) { | |
| 6376 | + throw new Exception("Missing required property"); | |
| 6377 | + } | |
| 6378 | + if (!property_exists($obj, 'width')) { | |
| 6379 | + throw new Exception("Missing required property"); | |
| 6380 | + } | |
| 6099 | 6381 | return new Source( |
| 6100 | 6382 | Source::fromHeight($obj->{'height'}) |
| 6101 | 6383 | ,Source::fromURL($obj->{'url'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/4e336.json
Mphpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'total_population')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromTotalPopulation($obj->{'total_population'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class TotalPopulation { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): TotalPopulation { |
| 252 | + if (!property_exists($obj, 'date')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'population')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new TotalPopulation( |
| 250 | 259 | TotalPopulation::fromDate($obj->{'date'}) |
| 251 | 260 | ,TotalPopulation::fromPopulation($obj->{'population'}) |
Test case
1 generated file · +33 −0test/inputs/json/misc/54147.json
Mphpdefault / TopLevel.php+33 −0
| @@ -400,6 +400,27 @@ class TopLevel { | ||
| 400 | 400 | * @throws Exception |
| 401 | 401 | */ |
| 402 | 402 | public static function from(stdClass $obj): TopLevel { |
| 403 | + if (!property_exists($obj, 'args')) { | |
| 404 | + throw new Exception("Missing required property"); | |
| 405 | + } | |
| 406 | + if (!property_exists($obj, 'data')) { | |
| 407 | + throw new Exception("Missing required property"); | |
| 408 | + } | |
| 409 | + if (!property_exists($obj, 'files')) { | |
| 410 | + throw new Exception("Missing required property"); | |
| 411 | + } | |
| 412 | + if (!property_exists($obj, 'form')) { | |
| 413 | + throw new Exception("Missing required property"); | |
| 414 | + } | |
| 415 | + if (!property_exists($obj, 'headers')) { | |
| 416 | + throw new Exception("Missing required property"); | |
| 417 | + } | |
| 418 | + if (!property_exists($obj, 'origin')) { | |
| 419 | + throw new Exception("Missing required property"); | |
| 420 | + } | |
| 421 | + if (!property_exists($obj, 'url')) { | |
| 422 | + throw new Exception("Missing required property"); | |
| 423 | + } | |
| 403 | 424 | return new TopLevel( |
| 404 | 425 | TopLevel::fromArgs($obj->{'args'}) |
| 405 | 426 | ,TopLevel::fromData($obj->{'data'}) |
| @@ -711,6 +732,18 @@ class Headers { | ||
| 711 | 732 | * @throws Exception |
| 712 | 733 | */ |
| 713 | 734 | public static function from(stdClass $obj): Headers { |
| 735 | + if (!property_exists($obj, 'Accept-Encoding')) { | |
| 736 | + throw new Exception("Missing required property"); | |
| 737 | + } | |
| 738 | + if (!property_exists($obj, 'Connection')) { | |
| 739 | + throw new Exception("Missing required property"); | |
| 740 | + } | |
| 741 | + if (!property_exists($obj, 'Host')) { | |
| 742 | + throw new Exception("Missing required property"); | |
| 743 | + } | |
| 744 | + if (!property_exists($obj, 'User-Agent')) { | |
| 745 | + throw new Exception("Missing required property"); | |
| 746 | + } | |
| 714 | 747 | return new Headers( |
| 715 | 748 | Headers::fromAcceptEncoding($obj->{'Accept-Encoding'}) |
| 716 | 749 | ,Headers::fromConnection($obj->{'Connection'}) |
Test case
1 generated file · +39 −0test/inputs/json/misc/54d32.json
Mphpdefault / TopLevel.php+39 −0
| @@ -409,6 +409,27 @@ class TopLevel { | ||
| 409 | 409 | * @throws Exception |
| 410 | 410 | */ |
| 411 | 411 | public static function from(stdClass $obj): TopLevel { |
| 412 | + if (!property_exists($obj, 'count')) { | |
| 413 | + throw new Exception("Missing required property"); | |
| 414 | + } | |
| 415 | + if (!property_exists($obj, 'facets')) { | |
| 416 | + throw new Exception("Missing required property"); | |
| 417 | + } | |
| 418 | + if (!property_exists($obj, 'limit')) { | |
| 419 | + throw new Exception("Missing required property"); | |
| 420 | + } | |
| 421 | + if (!property_exists($obj, 'next')) { | |
| 422 | + throw new Exception("Missing required property"); | |
| 423 | + } | |
| 424 | + if (!property_exists($obj, 'offset')) { | |
| 425 | + throw new Exception("Missing required property"); | |
| 426 | + } | |
| 427 | + if (!property_exists($obj, 'previous')) { | |
| 428 | + throw new Exception("Missing required property"); | |
| 429 | + } | |
| 430 | + if (!property_exists($obj, 'results')) { | |
| 431 | + throw new Exception("Missing required property"); | |
| 432 | + } | |
| 412 | 433 | return new TopLevel( |
| 413 | 434 | TopLevel::fromCount($obj->{'count'}) |
| 414 | 435 | ,TopLevel::fromFacets($obj->{'facets'}) |
| @@ -839,6 +860,24 @@ class Result { | ||
| 839 | 860 | * @throws Exception |
| 840 | 861 | */ |
| 841 | 862 | public static function from(stdClass $obj): Result { |
| 863 | + if (!property_exists($obj, 'created_at')) { | |
| 864 | + throw new Exception("Missing required property"); | |
| 865 | + } | |
| 866 | + if (!property_exists($obj, 'id')) { | |
| 867 | + throw new Exception("Missing required property"); | |
| 868 | + } | |
| 869 | + if (!property_exists($obj, 'person_id')) { | |
| 870 | + throw new Exception("Missing required property"); | |
| 871 | + } | |
| 872 | + if (!property_exists($obj, 'representative_id')) { | |
| 873 | + throw new Exception("Missing required property"); | |
| 874 | + } | |
| 875 | + if (!property_exists($obj, 'status')) { | |
| 876 | + throw new Exception("Missing required property"); | |
| 877 | + } | |
| 878 | + if (!property_exists($obj, 'updated_at')) { | |
| 879 | + throw new Exception("Missing required property"); | |
| 880 | + } | |
| 842 | 881 | return new Result( |
| 843 | 882 | Result::fromCreatedAt($obj->{'created_at'}) |
| 844 | 883 | ,Result::fromID($obj->{'id'}) |
Test case
1 generated file · +51 −0test/inputs/json/misc/570ec.json
Mphpdefault / TopLevel.php+51 −0
| @@ -513,6 +513,30 @@ class TopLevel { | ||
| 513 | 513 | * @throws Exception |
| 514 | 514 | */ |
| 515 | 515 | public static function from(stdClass $obj): TopLevel { |
| 516 | + if (!property_exists($obj, 'id')) { | |
| 517 | + throw new Exception("Missing required property"); | |
| 518 | + } | |
| 519 | + if (!property_exists($obj, 'identifiers')) { | |
| 520 | + throw new Exception("Missing required property"); | |
| 521 | + } | |
| 522 | + if (!property_exists($obj, 'keywords')) { | |
| 523 | + throw new Exception("Missing required property"); | |
| 524 | + } | |
| 525 | + if (!property_exists($obj, 'links')) { | |
| 526 | + throw new Exception("Missing required property"); | |
| 527 | + } | |
| 528 | + if (!property_exists($obj, 'name')) { | |
| 529 | + throw new Exception("Missing required property"); | |
| 530 | + } | |
| 531 | + if (!property_exists($obj, 'other_names')) { | |
| 532 | + throw new Exception("Missing required property"); | |
| 533 | + } | |
| 534 | + if (!property_exists($obj, 'superseded_by')) { | |
| 535 | + throw new Exception("Missing required property"); | |
| 536 | + } | |
| 537 | + if (!property_exists($obj, 'text')) { | |
| 538 | + throw new Exception("Missing required property"); | |
| 539 | + } | |
| 516 | 540 | return new TopLevel( |
| 517 | 541 | TopLevel::fromID($obj->{'id'}) |
| 518 | 542 | ,TopLevel::fromIdentifiers($obj->{'identifiers'}) |
| @@ -678,6 +702,12 @@ class Identifier { | ||
| 678 | 702 | * @throws Exception |
| 679 | 703 | */ |
| 680 | 704 | public static function from(stdClass $obj): Identifier { |
| 705 | + if (!property_exists($obj, 'identifier')) { | |
| 706 | + throw new Exception("Missing required property"); | |
| 707 | + } | |
| 708 | + if (!property_exists($obj, 'scheme')) { | |
| 709 | + throw new Exception("Missing required property"); | |
| 710 | + } | |
| 681 | 711 | return new Identifier( |
| 682 | 712 | Identifier::fromIdentifier($obj->{'identifier'}) |
| 683 | 713 | ,Identifier::fromScheme($obj->{'scheme'}) |
| @@ -883,6 +913,12 @@ class Link { | ||
| 883 | 913 | * @throws Exception |
| 884 | 914 | */ |
| 885 | 915 | public static function from(stdClass $obj): Link { |
| 916 | + if (!property_exists($obj, 'note')) { | |
| 917 | + throw new Exception("Missing required property"); | |
| 918 | + } | |
| 919 | + if (!property_exists($obj, 'url')) { | |
| 920 | + throw new Exception("Missing required property"); | |
| 921 | + } | |
| 886 | 922 | return new Link( |
| 887 | 923 | Link::fromNote($obj->{'note'}) |
| 888 | 924 | ,Link::fromURL($obj->{'url'}) |
| @@ -1045,6 +1081,12 @@ class OtherName { | ||
| 1045 | 1081 | * @throws Exception |
| 1046 | 1082 | */ |
| 1047 | 1083 | public static function from(stdClass $obj): OtherName { |
| 1084 | + if (!property_exists($obj, 'name')) { | |
| 1085 | + throw new Exception("Missing required property"); | |
| 1086 | + } | |
| 1087 | + if (!property_exists($obj, 'note')) { | |
| 1088 | + throw new Exception("Missing required property"); | |
| 1089 | + } | |
| 1048 | 1090 | return new OtherName( |
| 1049 | 1091 | OtherName::fromName($obj->{'name'}) |
| 1050 | 1092 | ,OtherName::fromNote($obj->{'note'}) |
| @@ -1249,6 +1291,15 @@ class Text { | ||
| 1249 | 1291 | * @throws Exception |
| 1250 | 1292 | */ |
| 1251 | 1293 | public static function from(stdClass $obj): Text { |
| 1294 | + if (!property_exists($obj, 'media_type')) { | |
| 1295 | + throw new Exception("Missing required property"); | |
| 1296 | + } | |
| 1297 | + if (!property_exists($obj, 'title')) { | |
| 1298 | + throw new Exception("Missing required property"); | |
| 1299 | + } | |
| 1300 | + if (!property_exists($obj, 'url')) { | |
| 1301 | + throw new Exception("Missing required property"); | |
| 1302 | + } | |
| 1252 | 1303 | return new Text( |
| 1253 | 1304 | Text::fromMediaType($obj->{'media_type'}) |
| 1254 | 1305 | ,Text::fromTitle($obj->{'title'}) |
Test case
1 generated file · +75 −0test/inputs/json/misc/5dd0d.json
Mphpdefault / TopLevel.php+75 −0
| @@ -450,6 +450,30 @@ class TopLevel { | ||
| 450 | 450 | * @throws Exception |
| 451 | 451 | */ |
| 452 | 452 | public static function from(stdClass $obj): TopLevel { |
| 453 | + if (!property_exists($obj, 'city')) { | |
| 454 | + throw new Exception("Missing required property"); | |
| 455 | + } | |
| 456 | + if (!property_exists($obj, 'delay')) { | |
| 457 | + throw new Exception("Missing required property"); | |
| 458 | + } | |
| 459 | + if (!property_exists($obj, 'IATA')) { | |
| 460 | + throw new Exception("Missing required property"); | |
| 461 | + } | |
| 462 | + if (!property_exists($obj, 'ICAO')) { | |
| 463 | + throw new Exception("Missing required property"); | |
| 464 | + } | |
| 465 | + if (!property_exists($obj, 'name')) { | |
| 466 | + throw new Exception("Missing required property"); | |
| 467 | + } | |
| 468 | + if (!property_exists($obj, 'state')) { | |
| 469 | + throw new Exception("Missing required property"); | |
| 470 | + } | |
| 471 | + if (!property_exists($obj, 'status')) { | |
| 472 | + throw new Exception("Missing required property"); | |
| 473 | + } | |
| 474 | + if (!property_exists($obj, 'weather')) { | |
| 475 | + throw new Exception("Missing required property"); | |
| 476 | + } | |
| 453 | 477 | return new TopLevel( |
| 454 | 478 | TopLevel::fromCity($obj->{'city'}) |
| 455 | 479 | ,TopLevel::fromDelay($obj->{'delay'}) |
| @@ -978,6 +1002,33 @@ class Status { | ||
| 978 | 1002 | * @throws Exception |
| 979 | 1003 | */ |
| 980 | 1004 | public static function from(stdClass $obj): Status { |
| 1005 | + if (!property_exists($obj, 'avgDelay')) { | |
| 1006 | + throw new Exception("Missing required property"); | |
| 1007 | + } | |
| 1008 | + if (!property_exists($obj, 'closureBegin')) { | |
| 1009 | + throw new Exception("Missing required property"); | |
| 1010 | + } | |
| 1011 | + if (!property_exists($obj, 'closureEnd')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'endTime')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 1017 | + if (!property_exists($obj, 'maxDelay')) { | |
| 1018 | + throw new Exception("Missing required property"); | |
| 1019 | + } | |
| 1020 | + if (!property_exists($obj, 'minDelay')) { | |
| 1021 | + throw new Exception("Missing required property"); | |
| 1022 | + } | |
| 1023 | + if (!property_exists($obj, 'reason')) { | |
| 1024 | + throw new Exception("Missing required property"); | |
| 1025 | + } | |
| 1026 | + if (!property_exists($obj, 'trend')) { | |
| 1027 | + throw new Exception("Missing required property"); | |
| 1028 | + } | |
| 1029 | + if (!property_exists($obj, 'type')) { | |
| 1030 | + throw new Exception("Missing required property"); | |
| 1031 | + } | |
| 981 | 1032 | return new Status( |
| 982 | 1033 | Status::fromAvgDelay($obj->{'avgDelay'}) |
| 983 | 1034 | ,Status::fromClosureBegin($obj->{'closureBegin'}) |
| @@ -1301,6 +1352,21 @@ class Weather { | ||
| 1301 | 1352 | * @throws Exception |
| 1302 | 1353 | */ |
| 1303 | 1354 | public static function from(stdClass $obj): Weather { |
| 1355 | + if (!property_exists($obj, 'meta')) { | |
| 1356 | + throw new Exception("Missing required property"); | |
| 1357 | + } | |
| 1358 | + if (!property_exists($obj, 'temp')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1361 | + if (!property_exists($obj, 'visibility')) { | |
| 1362 | + throw new Exception("Missing required property"); | |
| 1363 | + } | |
| 1364 | + if (!property_exists($obj, 'weather')) { | |
| 1365 | + throw new Exception("Missing required property"); | |
| 1366 | + } | |
| 1367 | + if (!property_exists($obj, 'wind')) { | |
| 1368 | + throw new Exception("Missing required property"); | |
| 1369 | + } | |
| 1304 | 1370 | return new Weather( |
| 1305 | 1371 | Weather::fromMeta($obj->{'meta'}) |
| 1306 | 1372 | ,Weather::fromTemp($obj->{'temp'}) |
| @@ -1511,6 +1577,15 @@ class Meta { | ||
| 1511 | 1577 | * @throws Exception |
| 1512 | 1578 | */ |
| 1513 | 1579 | public static function from(stdClass $obj): Meta { |
| 1580 | + if (!property_exists($obj, 'credit')) { | |
| 1581 | + throw new Exception("Missing required property"); | |
| 1582 | + } | |
| 1583 | + if (!property_exists($obj, 'updated')) { | |
| 1584 | + throw new Exception("Missing required property"); | |
| 1585 | + } | |
| 1586 | + if (!property_exists($obj, 'url')) { | |
| 1587 | + throw new Exception("Missing required property"); | |
| 1588 | + } | |
| 1514 | 1589 | return new Meta( |
| 1515 | 1590 | Meta::fromCredit($obj->{'credit'}) |
| 1516 | 1591 | ,Meta::fromUpdated($obj->{'updated'}) |
Test case
1 generated file · +12 −0test/inputs/json/misc/5eae5.json
Mphpdefault / TopLevel.php+12 −0
| @@ -247,6 +247,18 @@ class TopLevel { | ||
| 247 | 247 | * @throws Exception |
| 248 | 248 | */ |
| 249 | 249 | public static function from(stdClass $obj): TopLevel { |
| 250 | + if (!property_exists($obj, 'Date')) { | |
| 251 | + throw new Exception("Missing required property"); | |
| 252 | + } | |
| 253 | + if (!property_exists($obj, 'ID')) { | |
| 254 | + throw new Exception("Missing required property"); | |
| 255 | + } | |
| 256 | + if (!property_exists($obj, 'Sponsor')) { | |
| 257 | + throw new Exception("Missing required property"); | |
| 258 | + } | |
| 259 | + if (!property_exists($obj, 'Title')) { | |
| 260 | + throw new Exception("Missing required property"); | |
| 261 | + } | |
| 250 | 262 | return new TopLevel( |
| 251 | 263 | TopLevel::fromDate($obj->{'Date'}) |
| 252 | 264 | ,TopLevel::fromID($obj->{'ID'}) |
Test case
1 generated file · +75 −0test/inputs/json/misc/5eb20.json
Mphpdefault / TopLevel.php+75 −0
| @@ -450,6 +450,30 @@ class TopLevel { | ||
| 450 | 450 | * @throws Exception |
| 451 | 451 | */ |
| 452 | 452 | public static function from(stdClass $obj): TopLevel { |
| 453 | + if (!property_exists($obj, 'city')) { | |
| 454 | + throw new Exception("Missing required property"); | |
| 455 | + } | |
| 456 | + if (!property_exists($obj, 'delay')) { | |
| 457 | + throw new Exception("Missing required property"); | |
| 458 | + } | |
| 459 | + if (!property_exists($obj, 'IATA')) { | |
| 460 | + throw new Exception("Missing required property"); | |
| 461 | + } | |
| 462 | + if (!property_exists($obj, 'ICAO')) { | |
| 463 | + throw new Exception("Missing required property"); | |
| 464 | + } | |
| 465 | + if (!property_exists($obj, 'name')) { | |
| 466 | + throw new Exception("Missing required property"); | |
| 467 | + } | |
| 468 | + if (!property_exists($obj, 'state')) { | |
| 469 | + throw new Exception("Missing required property"); | |
| 470 | + } | |
| 471 | + if (!property_exists($obj, 'status')) { | |
| 472 | + throw new Exception("Missing required property"); | |
| 473 | + } | |
| 474 | + if (!property_exists($obj, 'weather')) { | |
| 475 | + throw new Exception("Missing required property"); | |
| 476 | + } | |
| 453 | 477 | return new TopLevel( |
| 454 | 478 | TopLevel::fromCity($obj->{'city'}) |
| 455 | 479 | ,TopLevel::fromDelay($obj->{'delay'}) |
| @@ -978,6 +1002,33 @@ class Status { | ||
| 978 | 1002 | * @throws Exception |
| 979 | 1003 | */ |
| 980 | 1004 | public static function from(stdClass $obj): Status { |
| 1005 | + if (!property_exists($obj, 'avgDelay')) { | |
| 1006 | + throw new Exception("Missing required property"); | |
| 1007 | + } | |
| 1008 | + if (!property_exists($obj, 'closureBegin')) { | |
| 1009 | + throw new Exception("Missing required property"); | |
| 1010 | + } | |
| 1011 | + if (!property_exists($obj, 'closureEnd')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'endTime')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 1017 | + if (!property_exists($obj, 'maxDelay')) { | |
| 1018 | + throw new Exception("Missing required property"); | |
| 1019 | + } | |
| 1020 | + if (!property_exists($obj, 'minDelay')) { | |
| 1021 | + throw new Exception("Missing required property"); | |
| 1022 | + } | |
| 1023 | + if (!property_exists($obj, 'reason')) { | |
| 1024 | + throw new Exception("Missing required property"); | |
| 1025 | + } | |
| 1026 | + if (!property_exists($obj, 'trend')) { | |
| 1027 | + throw new Exception("Missing required property"); | |
| 1028 | + } | |
| 1029 | + if (!property_exists($obj, 'type')) { | |
| 1030 | + throw new Exception("Missing required property"); | |
| 1031 | + } | |
| 981 | 1032 | return new Status( |
| 982 | 1033 | Status::fromAvgDelay($obj->{'avgDelay'}) |
| 983 | 1034 | ,Status::fromClosureBegin($obj->{'closureBegin'}) |
| @@ -1301,6 +1352,21 @@ class Weather { | ||
| 1301 | 1352 | * @throws Exception |
| 1302 | 1353 | */ |
| 1303 | 1354 | public static function from(stdClass $obj): Weather { |
| 1355 | + if (!property_exists($obj, 'meta')) { | |
| 1356 | + throw new Exception("Missing required property"); | |
| 1357 | + } | |
| 1358 | + if (!property_exists($obj, 'temp')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1361 | + if (!property_exists($obj, 'visibility')) { | |
| 1362 | + throw new Exception("Missing required property"); | |
| 1363 | + } | |
| 1364 | + if (!property_exists($obj, 'weather')) { | |
| 1365 | + throw new Exception("Missing required property"); | |
| 1366 | + } | |
| 1367 | + if (!property_exists($obj, 'wind')) { | |
| 1368 | + throw new Exception("Missing required property"); | |
| 1369 | + } | |
| 1304 | 1370 | return new Weather( |
| 1305 | 1371 | Weather::fromMeta($obj->{'meta'}) |
| 1306 | 1372 | ,Weather::fromTemp($obj->{'temp'}) |
| @@ -1511,6 +1577,15 @@ class Meta { | ||
| 1511 | 1577 | * @throws Exception |
| 1512 | 1578 | */ |
| 1513 | 1579 | public static function from(stdClass $obj): Meta { |
| 1580 | + if (!property_exists($obj, 'credit')) { | |
| 1581 | + throw new Exception("Missing required property"); | |
| 1582 | + } | |
| 1583 | + if (!property_exists($obj, 'updated')) { | |
| 1584 | + throw new Exception("Missing required property"); | |
| 1585 | + } | |
| 1586 | + if (!property_exists($obj, 'url')) { | |
| 1587 | + throw new Exception("Missing required property"); | |
| 1588 | + } | |
| 1514 | 1589 | return new Meta( |
| 1515 | 1590 | Meta::fromCredit($obj->{'credit'}) |
| 1516 | 1591 | ,Meta::fromUpdated($obj->{'updated'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/5f3a1.json
Mphpdefault / TopLevel.php+9 −0
| @@ -205,6 +205,15 @@ class TopLevel { | ||
| 205 | 205 | * @throws Exception |
| 206 | 206 | */ |
| 207 | 207 | public static function from(stdClass $obj): TopLevel { |
| 208 | + if (!property_exists($obj, 'base')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'date')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 214 | + if (!property_exists($obj, 'rates')) { | |
| 215 | + throw new Exception("Missing required property"); | |
| 216 | + } | |
| 208 | 217 | return new TopLevel( |
| 209 | 218 | TopLevel::fromBase($obj->{'base'}) |
| 210 | 219 | ,TopLevel::fromDate($obj->{'date'}) |
Test case
1 generated file · +321 −0test/inputs/json/misc/5f7fe.json
Mphpdefault / TopLevel.php+321 −0
| @@ -190,6 +190,12 @@ class TopLevel { | ||
| 190 | 190 | * @throws Exception |
| 191 | 191 | */ |
| 192 | 192 | public static function from(stdClass $obj): TopLevel { |
| 193 | + if (!property_exists($obj, 'data')) { | |
| 194 | + throw new Exception("Missing required property"); | |
| 195 | + } | |
| 196 | + if (!property_exists($obj, 'meta')) { | |
| 197 | + throw new Exception("Missing required property"); | |
| 198 | + } | |
| 193 | 199 | return new TopLevel( |
| 194 | 200 | TopLevel::fromData($obj->{'data'}) |
| 195 | 201 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -291,6 +297,9 @@ class Meta { | ||
| 291 | 297 | * @throws Exception |
| 292 | 298 | */ |
| 293 | 299 | public static function from(stdClass $obj): Meta { |
| 300 | + if (!property_exists($obj, 'view')) { | |
| 301 | + throw new Exception("Missing required property"); | |
| 302 | + } | |
| 294 | 303 | return new Meta( |
| 295 | 304 | Meta::fromView($obj->{'view'}) |
| 296 | 305 | ); |
| @@ -2383,6 +2392,120 @@ class View { | ||
| 2383 | 2392 | * @throws Exception |
| 2384 | 2393 | */ |
| 2385 | 2394 | public static function from(stdClass $obj): View { |
| 2395 | + if (!property_exists($obj, 'attribution')) { | |
| 2396 | + throw new Exception("Missing required property"); | |
| 2397 | + } | |
| 2398 | + if (!property_exists($obj, 'attributionLink')) { | |
| 2399 | + throw new Exception("Missing required property"); | |
| 2400 | + } | |
| 2401 | + if (!property_exists($obj, 'averageRating')) { | |
| 2402 | + throw new Exception("Missing required property"); | |
| 2403 | + } | |
| 2404 | + if (!property_exists($obj, 'category')) { | |
| 2405 | + throw new Exception("Missing required property"); | |
| 2406 | + } | |
| 2407 | + if (!property_exists($obj, 'columns')) { | |
| 2408 | + throw new Exception("Missing required property"); | |
| 2409 | + } | |
| 2410 | + if (!property_exists($obj, 'createdAt')) { | |
| 2411 | + throw new Exception("Missing required property"); | |
| 2412 | + } | |
| 2413 | + if (!property_exists($obj, 'description')) { | |
| 2414 | + throw new Exception("Missing required property"); | |
| 2415 | + } | |
| 2416 | + if (!property_exists($obj, 'displayType')) { | |
| 2417 | + throw new Exception("Missing required property"); | |
| 2418 | + } | |
| 2419 | + if (!property_exists($obj, 'downloadCount')) { | |
| 2420 | + throw new Exception("Missing required property"); | |
| 2421 | + } | |
| 2422 | + if (!property_exists($obj, 'flags')) { | |
| 2423 | + throw new Exception("Missing required property"); | |
| 2424 | + } | |
| 2425 | + if (!property_exists($obj, 'grants')) { | |
| 2426 | + throw new Exception("Missing required property"); | |
| 2427 | + } | |
| 2428 | + if (!property_exists($obj, 'hideFromCatalog')) { | |
| 2429 | + throw new Exception("Missing required property"); | |
| 2430 | + } | |
| 2431 | + if (!property_exists($obj, 'hideFromDataJson')) { | |
| 2432 | + throw new Exception("Missing required property"); | |
| 2433 | + } | |
| 2434 | + if (!property_exists($obj, 'id')) { | |
| 2435 | + throw new Exception("Missing required property"); | |
| 2436 | + } | |
| 2437 | + if (!property_exists($obj, 'indexUpdatedAt')) { | |
| 2438 | + throw new Exception("Missing required property"); | |
| 2439 | + } | |
| 2440 | + if (!property_exists($obj, 'locale')) { | |
| 2441 | + throw new Exception("Missing required property"); | |
| 2442 | + } | |
| 2443 | + if (!property_exists($obj, 'metadata')) { | |
| 2444 | + throw new Exception("Missing required property"); | |
| 2445 | + } | |
| 2446 | + if (!property_exists($obj, 'name')) { | |
| 2447 | + throw new Exception("Missing required property"); | |
| 2448 | + } | |
| 2449 | + if (!property_exists($obj, 'newBackend')) { | |
| 2450 | + throw new Exception("Missing required property"); | |
| 2451 | + } | |
| 2452 | + if (!property_exists($obj, 'numberOfComments')) { | |
| 2453 | + throw new Exception("Missing required property"); | |
| 2454 | + } | |
| 2455 | + if (!property_exists($obj, 'oid')) { | |
| 2456 | + throw new Exception("Missing required property"); | |
| 2457 | + } | |
| 2458 | + if (!property_exists($obj, 'owner')) { | |
| 2459 | + throw new Exception("Missing required property"); | |
| 2460 | + } | |
| 2461 | + if (!property_exists($obj, 'provenance')) { | |
| 2462 | + throw new Exception("Missing required property"); | |
| 2463 | + } | |
| 2464 | + if (!property_exists($obj, 'publicationAppendEnabled')) { | |
| 2465 | + throw new Exception("Missing required property"); | |
| 2466 | + } | |
| 2467 | + if (!property_exists($obj, 'publicationDate')) { | |
| 2468 | + throw new Exception("Missing required property"); | |
| 2469 | + } | |
| 2470 | + if (!property_exists($obj, 'publicationGroup')) { | |
| 2471 | + throw new Exception("Missing required property"); | |
| 2472 | + } | |
| 2473 | + if (!property_exists($obj, 'publicationStage')) { | |
| 2474 | + throw new Exception("Missing required property"); | |
| 2475 | + } | |
| 2476 | + if (!property_exists($obj, 'query')) { | |
| 2477 | + throw new Exception("Missing required property"); | |
| 2478 | + } | |
| 2479 | + if (!property_exists($obj, 'rights')) { | |
| 2480 | + throw new Exception("Missing required property"); | |
| 2481 | + } | |
| 2482 | + if (!property_exists($obj, 'rowsUpdatedAt')) { | |
| 2483 | + throw new Exception("Missing required property"); | |
| 2484 | + } | |
| 2485 | + if (!property_exists($obj, 'rowsUpdatedBy')) { | |
| 2486 | + throw new Exception("Missing required property"); | |
| 2487 | + } | |
| 2488 | + if (!property_exists($obj, 'tableAuthor')) { | |
| 2489 | + throw new Exception("Missing required property"); | |
| 2490 | + } | |
| 2491 | + if (!property_exists($obj, 'tableId')) { | |
| 2492 | + throw new Exception("Missing required property"); | |
| 2493 | + } | |
| 2494 | + if (!property_exists($obj, 'tags')) { | |
| 2495 | + throw new Exception("Missing required property"); | |
| 2496 | + } | |
| 2497 | + if (!property_exists($obj, 'totalTimesRated')) { | |
| 2498 | + throw new Exception("Missing required property"); | |
| 2499 | + } | |
| 2500 | + if (!property_exists($obj, 'viewCount')) { | |
| 2501 | + throw new Exception("Missing required property"); | |
| 2502 | + } | |
| 2503 | + if (!property_exists($obj, 'viewLastModified')) { | |
| 2504 | + throw new Exception("Missing required property"); | |
| 2505 | + } | |
| 2506 | + if (!property_exists($obj, 'viewType')) { | |
| 2507 | + throw new Exception("Missing required property"); | |
| 2508 | + } | |
| 2386 | 2509 | return new View( |
| 2387 | 2510 | View::fromAttribution($obj->{'attribution'}) |
| 2388 | 2511 | ,View::fromAttributionLink($obj->{'attributionLink'}) |
| @@ -3133,6 +3256,27 @@ class Column { | ||
| 3133 | 3256 | * @throws Exception |
| 3134 | 3257 | */ |
| 3135 | 3258 | public static function from(stdClass $obj): Column { |
| 3259 | + if (!property_exists($obj, 'dataTypeName')) { | |
| 3260 | + throw new Exception("Missing required property"); | |
| 3261 | + } | |
| 3262 | + if (!property_exists($obj, 'fieldName')) { | |
| 3263 | + throw new Exception("Missing required property"); | |
| 3264 | + } | |
| 3265 | + if (!property_exists($obj, 'format')) { | |
| 3266 | + throw new Exception("Missing required property"); | |
| 3267 | + } | |
| 3268 | + if (!property_exists($obj, 'id')) { | |
| 3269 | + throw new Exception("Missing required property"); | |
| 3270 | + } | |
| 3271 | + if (!property_exists($obj, 'name')) { | |
| 3272 | + throw new Exception("Missing required property"); | |
| 3273 | + } | |
| 3274 | + if (!property_exists($obj, 'position')) { | |
| 3275 | + throw new Exception("Missing required property"); | |
| 3276 | + } | |
| 3277 | + if (!property_exists($obj, 'renderTypeName')) { | |
| 3278 | + throw new Exception("Missing required property"); | |
| 3279 | + } | |
| 3136 | 3280 | return new Column( |
| 3137 | 3281 | Column::fromCachedContents($obj->{'cachedContents'}) |
| 3138 | 3282 | ,Column::fromDataTypeName($obj->{'dataTypeName'}) |
| @@ -3471,6 +3615,21 @@ class CachedContents { | ||
| 3471 | 3615 | * @throws Exception |
| 3472 | 3616 | */ |
| 3473 | 3617 | public static function from(stdClass $obj): CachedContents { |
| 3618 | + if (!property_exists($obj, 'largest')) { | |
| 3619 | + throw new Exception("Missing required property"); | |
| 3620 | + } | |
| 3621 | + if (!property_exists($obj, 'non_null')) { | |
| 3622 | + throw new Exception("Missing required property"); | |
| 3623 | + } | |
| 3624 | + if (!property_exists($obj, 'null')) { | |
| 3625 | + throw new Exception("Missing required property"); | |
| 3626 | + } | |
| 3627 | + if (!property_exists($obj, 'smallest')) { | |
| 3628 | + throw new Exception("Missing required property"); | |
| 3629 | + } | |
| 3630 | + if (!property_exists($obj, 'top')) { | |
| 3631 | + throw new Exception("Missing required property"); | |
| 3632 | + } | |
| 3474 | 3633 | return new CachedContents( |
| 3475 | 3634 | CachedContents::fromLargest($obj->{'largest'}) |
| 3476 | 3635 | ,CachedContents::fromNonNull($obj->{'non_null'}) |
| @@ -3629,6 +3788,12 @@ class Top { | ||
| 3629 | 3788 | * @throws Exception |
| 3630 | 3789 | */ |
| 3631 | 3790 | public static function from(stdClass $obj): Top { |
| 3791 | + if (!property_exists($obj, 'count')) { | |
| 3792 | + throw new Exception("Missing required property"); | |
| 3793 | + } | |
| 3794 | + if (!property_exists($obj, 'item')) { | |
| 3795 | + throw new Exception("Missing required property"); | |
| 3796 | + } | |
| 3632 | 3797 | return new Top( |
| 3633 | 3798 | Top::fromCount($obj->{'count'}) |
| 3634 | 3799 | ,Top::fromItem($obj->{'item'}) |
| @@ -4072,6 +4237,15 @@ class Grant { | ||
| 4072 | 4237 | * @throws Exception |
| 4073 | 4238 | */ |
| 4074 | 4239 | public static function from(stdClass $obj): Grant { |
| 4240 | + if (!property_exists($obj, 'flags')) { | |
| 4241 | + throw new Exception("Missing required property"); | |
| 4242 | + } | |
| 4243 | + if (!property_exists($obj, 'inherited')) { | |
| 4244 | + throw new Exception("Missing required property"); | |
| 4245 | + } | |
| 4246 | + if (!property_exists($obj, 'type')) { | |
| 4247 | + throw new Exception("Missing required property"); | |
| 4248 | + } | |
| 4075 | 4249 | return new Grant( |
| 4076 | 4250 | Grant::fromFlags($obj->{'flags'}) |
| 4077 | 4251 | ,Grant::fromInherited($obj->{'inherited'}) |
| @@ -4463,6 +4637,24 @@ class Metadata { | ||
| 4463 | 4637 | * @throws Exception |
| 4464 | 4638 | */ |
| 4465 | 4639 | public static function from(stdClass $obj): Metadata { |
| 4640 | + if (!property_exists($obj, 'attachments')) { | |
| 4641 | + throw new Exception("Missing required property"); | |
| 4642 | + } | |
| 4643 | + if (!property_exists($obj, 'availableDisplayTypes')) { | |
| 4644 | + throw new Exception("Missing required property"); | |
| 4645 | + } | |
| 4646 | + if (!property_exists($obj, 'custom_fields')) { | |
| 4647 | + throw new Exception("Missing required property"); | |
| 4648 | + } | |
| 4649 | + if (!property_exists($obj, 'jsonQuery')) { | |
| 4650 | + throw new Exception("Missing required property"); | |
| 4651 | + } | |
| 4652 | + if (!property_exists($obj, 'rdfSubject')) { | |
| 4653 | + throw new Exception("Missing required property"); | |
| 4654 | + } | |
| 4655 | + if (!property_exists($obj, 'renderTypeConfig')) { | |
| 4656 | + throw new Exception("Missing required property"); | |
| 4657 | + } | |
| 4466 | 4658 | return new Metadata( |
| 4467 | 4659 | Metadata::fromAttachments($obj->{'attachments'}) |
| 4468 | 4660 | ,Metadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'}) |
| @@ -4727,6 +4919,18 @@ class Attachment { | ||
| 4727 | 4919 | * @throws Exception |
| 4728 | 4920 | */ |
| 4729 | 4921 | public static function from(stdClass $obj): Attachment { |
| 4922 | + if (!property_exists($obj, 'assetId')) { | |
| 4923 | + throw new Exception("Missing required property"); | |
| 4924 | + } | |
| 4925 | + if (!property_exists($obj, 'blobId')) { | |
| 4926 | + throw new Exception("Missing required property"); | |
| 4927 | + } | |
| 4928 | + if (!property_exists($obj, 'filename')) { | |
| 4929 | + throw new Exception("Missing required property"); | |
| 4930 | + } | |
| 4931 | + if (!property_exists($obj, 'name')) { | |
| 4932 | + throw new Exception("Missing required property"); | |
| 4933 | + } | |
| 4730 | 4934 | return new Attachment( |
| 4731 | 4935 | Attachment::fromAssetID($obj->{'assetId'}) |
| 4732 | 4936 | ,Attachment::fromBlobID($obj->{'blobId'}) |
| @@ -5044,6 +5248,21 @@ class CustomFields { | ||
| 5044 | 5248 | * @throws Exception |
| 5045 | 5249 | */ |
| 5046 | 5250 | public static function from(stdClass $obj): CustomFields { |
| 5251 | + if (!property_exists($obj, 'Additional Resources')) { | |
| 5252 | + throw new Exception("Missing required property"); | |
| 5253 | + } | |
| 5254 | + if (!property_exists($obj, 'Common Core')) { | |
| 5255 | + throw new Exception("Missing required property"); | |
| 5256 | + } | |
| 5257 | + if (!property_exists($obj, 'Dataset Information')) { | |
| 5258 | + throw new Exception("Missing required property"); | |
| 5259 | + } | |
| 5260 | + if (!property_exists($obj, 'Dataset Summary')) { | |
| 5261 | + throw new Exception("Missing required property"); | |
| 5262 | + } | |
| 5263 | + if (!property_exists($obj, 'Notes')) { | |
| 5264 | + throw new Exception("Missing required property"); | |
| 5265 | + } | |
| 5047 | 5266 | return new CustomFields( |
| 5048 | 5267 | CustomFields::fromAdditionalResources($obj->{'Additional Resources'}) |
| 5049 | 5268 | ,CustomFields::fromCommonCore($obj->{'Common Core'}) |
| @@ -5202,6 +5421,12 @@ class AdditionalResources { | ||
| 5202 | 5421 | * @throws Exception |
| 5203 | 5422 | */ |
| 5204 | 5423 | public static function from(stdClass $obj): AdditionalResources { |
| 5424 | + if (!property_exists($obj, 'See Also ')) { | |
| 5425 | + throw new Exception("Missing required property"); | |
| 5426 | + } | |
| 5427 | + if (!property_exists($obj, 'See Also')) { | |
| 5428 | + throw new Exception("Missing required property"); | |
| 5429 | + } | |
| 5205 | 5430 | return new AdditionalResources( |
| 5206 | 5431 | AdditionalResources::fromAdditionalResourcesSeeAlso($obj->{'See Also '}) |
| 5207 | 5432 | ,AdditionalResources::fromSeeAlso($obj->{'See Also'}) |
| @@ -5406,6 +5631,15 @@ class CommonCore { | ||
| 5406 | 5631 | * @throws Exception |
| 5407 | 5632 | */ |
| 5408 | 5633 | public static function from(stdClass $obj): CommonCore { |
| 5634 | + if (!property_exists($obj, 'Contact Email')) { | |
| 5635 | + throw new Exception("Missing required property"); | |
| 5636 | + } | |
| 5637 | + if (!property_exists($obj, 'Contact Name')) { | |
| 5638 | + throw new Exception("Missing required property"); | |
| 5639 | + } | |
| 5640 | + if (!property_exists($obj, 'Publisher')) { | |
| 5641 | + throw new Exception("Missing required property"); | |
| 5642 | + } | |
| 5409 | 5643 | return new CommonCore( |
| 5410 | 5644 | CommonCore::fromContactEmail($obj->{'Contact Email'}) |
| 5411 | 5645 | ,CommonCore::fromContactName($obj->{'Contact Name'}) |
| @@ -5508,6 +5742,9 @@ class DatasetInformation { | ||
| 5508 | 5742 | * @throws Exception |
| 5509 | 5743 | */ |
| 5510 | 5744 | public static function from(stdClass $obj): DatasetInformation { |
| 5745 | + if (!property_exists($obj, 'Agency')) { | |
| 5746 | + throw new Exception("Missing required property"); | |
| 5747 | + } | |
| 5511 | 5748 | return new DatasetInformation( |
| 5512 | 5749 | DatasetInformation::fromAgency($obj->{'Agency'}) |
| 5513 | 5750 | ); |
| @@ -6022,6 +6259,33 @@ class DatasetSummary { | ||
| 6022 | 6259 | * @throws Exception |
| 6023 | 6260 | */ |
| 6024 | 6261 | public static function from(stdClass $obj): DatasetSummary { |
| 6262 | + if (!property_exists($obj, 'Contact Information')) { | |
| 6263 | + throw new Exception("Missing required property"); | |
| 6264 | + } | |
| 6265 | + if (!property_exists($obj, 'Coverage')) { | |
| 6266 | + throw new Exception("Missing required property"); | |
| 6267 | + } | |
| 6268 | + if (!property_exists($obj, 'Data Frequency')) { | |
| 6269 | + throw new Exception("Missing required property"); | |
| 6270 | + } | |
| 6271 | + if (!property_exists($obj, 'Dataset Owner')) { | |
| 6272 | + throw new Exception("Missing required property"); | |
| 6273 | + } | |
| 6274 | + if (!property_exists($obj, 'Granularity')) { | |
| 6275 | + throw new Exception("Missing required property"); | |
| 6276 | + } | |
| 6277 | + if (!property_exists($obj, 'Organization')) { | |
| 6278 | + throw new Exception("Missing required property"); | |
| 6279 | + } | |
| 6280 | + if (!property_exists($obj, 'Posting Frequency')) { | |
| 6281 | + throw new Exception("Missing required property"); | |
| 6282 | + } | |
| 6283 | + if (!property_exists($obj, 'Time Period')) { | |
| 6284 | + throw new Exception("Missing required property"); | |
| 6285 | + } | |
| 6286 | + if (!property_exists($obj, 'Units')) { | |
| 6287 | + throw new Exception("Missing required property"); | |
| 6288 | + } | |
| 6025 | 6289 | return new DatasetSummary( |
| 6026 | 6290 | DatasetSummary::fromContactInformation($obj->{'Contact Information'}) |
| 6027 | 6291 | ,DatasetSummary::fromCoverage($obj->{'Coverage'}) |
| @@ -6136,6 +6400,9 @@ class Notes { | ||
| 6136 | 6400 | * @throws Exception |
| 6137 | 6401 | */ |
| 6138 | 6402 | public static function from(stdClass $obj): Notes { |
| 6403 | + if (!property_exists($obj, 'Notes')) { | |
| 6404 | + throw new Exception("Missing required property"); | |
| 6405 | + } | |
| 6139 | 6406 | return new Notes( |
| 6140 | 6407 | Notes::fromNotes($obj->{'Notes'}) |
| 6141 | 6408 | ); |
| @@ -6246,6 +6513,9 @@ class JSONQuery { | ||
| 6246 | 6513 | * @throws Exception |
| 6247 | 6514 | */ |
| 6248 | 6515 | public static function from(stdClass $obj): JSONQuery { |
| 6516 | + if (!property_exists($obj, 'order')) { | |
| 6517 | + throw new Exception("Missing required property"); | |
| 6518 | + } | |
| 6249 | 6519 | return new JSONQuery( |
| 6250 | 6520 | JSONQuery::fromOrder($obj->{'order'}) |
| 6251 | 6521 | ); |
| @@ -6396,6 +6666,12 @@ class Order { | ||
| 6396 | 6666 | * @throws Exception |
| 6397 | 6667 | */ |
| 6398 | 6668 | public static function from(stdClass $obj): Order { |
| 6669 | + if (!property_exists($obj, 'ascending')) { | |
| 6670 | + throw new Exception("Missing required property"); | |
| 6671 | + } | |
| 6672 | + if (!property_exists($obj, 'columnFieldName')) { | |
| 6673 | + throw new Exception("Missing required property"); | |
| 6674 | + } | |
| 6399 | 6675 | return new Order( |
| 6400 | 6676 | Order::fromAscending($obj->{'ascending'}) |
| 6401 | 6677 | ,Order::fromColumnFieldName($obj->{'columnFieldName'}) |
| @@ -6497,6 +6773,9 @@ class RenderTypeConfig { | ||
| 6497 | 6773 | * @throws Exception |
| 6498 | 6774 | */ |
| 6499 | 6775 | public static function from(stdClass $obj): RenderTypeConfig { |
| 6776 | + if (!property_exists($obj, 'visible')) { | |
| 6777 | + throw new Exception("Missing required property"); | |
| 6778 | + } | |
| 6500 | 6779 | return new RenderTypeConfig( |
| 6501 | 6780 | RenderTypeConfig::fromVisible($obj->{'visible'}) |
| 6502 | 6781 | ); |
| @@ -6595,6 +6874,9 @@ class Visible { | ||
| 6595 | 6874 | * @throws Exception |
| 6596 | 6875 | */ |
| 6597 | 6876 | public static function from(stdClass $obj): Visible { |
| 6877 | + if (!property_exists($obj, 'table')) { | |
| 6878 | + throw new Exception("Missing required property"); | |
| 6879 | + } | |
| 6598 | 6880 | return new Visible( |
| 6599 | 6881 | Visible::fromTable($obj->{'table'}) |
| 6600 | 6882 | ); |
| @@ -7071,6 +7353,30 @@ class Owner { | ||
| 7071 | 7353 | * @throws Exception |
| 7072 | 7354 | */ |
| 7073 | 7355 | public static function from(stdClass $obj): Owner { |
| 7356 | + if (!property_exists($obj, 'displayName')) { | |
| 7357 | + throw new Exception("Missing required property"); | |
| 7358 | + } | |
| 7359 | + if (!property_exists($obj, 'id')) { | |
| 7360 | + throw new Exception("Missing required property"); | |
| 7361 | + } | |
| 7362 | + if (!property_exists($obj, 'profileImageUrlLarge')) { | |
| 7363 | + throw new Exception("Missing required property"); | |
| 7364 | + } | |
| 7365 | + if (!property_exists($obj, 'profileImageUrlMedium')) { | |
| 7366 | + throw new Exception("Missing required property"); | |
| 7367 | + } | |
| 7368 | + if (!property_exists($obj, 'profileImageUrlSmall')) { | |
| 7369 | + throw new Exception("Missing required property"); | |
| 7370 | + } | |
| 7371 | + if (!property_exists($obj, 'rights')) { | |
| 7372 | + throw new Exception("Missing required property"); | |
| 7373 | + } | |
| 7374 | + if (!property_exists($obj, 'roleName')) { | |
| 7375 | + throw new Exception("Missing required property"); | |
| 7376 | + } | |
| 7377 | + if (!property_exists($obj, 'screenName')) { | |
| 7378 | + throw new Exception("Missing required property"); | |
| 7379 | + } | |
| 7074 | 7380 | return new Owner( |
| 7075 | 7381 | Owner::fromDisplayName($obj->{'displayName'}) |
| 7076 | 7382 | ,Owner::fromID($obj->{'id'}) |
| @@ -7195,6 +7501,9 @@ class Query { | ||
| 7195 | 7501 | * @throws Exception |
| 7196 | 7502 | */ |
| 7197 | 7503 | public static function from(stdClass $obj): Query { |
| 7504 | + if (!property_exists($obj, 'orderBys')) { | |
| 7505 | + throw new Exception("Missing required property"); | |
| 7506 | + } | |
| 7198 | 7507 | return new Query( |
| 7199 | 7508 | Query::fromOrderBys($obj->{'orderBys'}) |
| 7200 | 7509 | ); |
| @@ -7346,6 +7655,12 @@ class OrderBy { | ||
| 7346 | 7655 | * @throws Exception |
| 7347 | 7656 | */ |
| 7348 | 7657 | public static function from(stdClass $obj): OrderBy { |
| 7658 | + if (!property_exists($obj, 'ascending')) { | |
| 7659 | + throw new Exception("Missing required property"); | |
| 7660 | + } | |
| 7661 | + if (!property_exists($obj, 'expression')) { | |
| 7662 | + throw new Exception("Missing required property"); | |
| 7663 | + } | |
| 7349 | 7664 | return new OrderBy( |
| 7350 | 7665 | OrderBy::fromAscending($obj->{'ascending'}) |
| 7351 | 7666 | ,OrderBy::fromExpression($obj->{'expression'}) |
| @@ -7498,6 +7813,12 @@ class Expression { | ||
| 7498 | 7813 | * @throws Exception |
| 7499 | 7814 | */ |
| 7500 | 7815 | public static function from(stdClass $obj): Expression { |
| 7816 | + if (!property_exists($obj, 'columnId')) { | |
| 7817 | + throw new Exception("Missing required property"); | |
| 7818 | + } | |
| 7819 | + if (!property_exists($obj, 'type')) { | |
| 7820 | + throw new Exception("Missing required property"); | |
| 7821 | + } | |
| 7501 | 7822 | return new Expression( |
| 7502 | 7823 | Expression::fromColumnID($obj->{'columnId'}) |
| 7503 | 7824 | ,Expression::fromType($obj->{'type'}) |
Test case
1 generated file · +315 −0test/inputs/json/misc/617e8.json
Mphpdefault / TopLevel.php+315 −0
| @@ -190,6 +190,12 @@ class TopLevel { | ||
| 190 | 190 | * @throws Exception |
| 191 | 191 | */ |
| 192 | 192 | public static function from(stdClass $obj): TopLevel { |
| 193 | + if (!property_exists($obj, 'data')) { | |
| 194 | + throw new Exception("Missing required property"); | |
| 195 | + } | |
| 196 | + if (!property_exists($obj, 'meta')) { | |
| 197 | + throw new Exception("Missing required property"); | |
| 198 | + } | |
| 193 | 199 | return new TopLevel( |
| 194 | 200 | TopLevel::fromData($obj->{'data'}) |
| 195 | 201 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -291,6 +297,9 @@ class Meta { | ||
| 291 | 297 | * @throws Exception |
| 292 | 298 | */ |
| 293 | 299 | public static function from(stdClass $obj): Meta { |
| 300 | + if (!property_exists($obj, 'view')) { | |
| 301 | + throw new Exception("Missing required property"); | |
| 302 | + } | |
| 294 | 303 | return new Meta( |
| 295 | 304 | Meta::fromView($obj->{'view'}) |
| 296 | 305 | ); |
| @@ -2383,6 +2392,120 @@ class View { | ||
| 2383 | 2392 | * @throws Exception |
| 2384 | 2393 | */ |
| 2385 | 2394 | public static function from(stdClass $obj): View { |
| 2395 | + if (!property_exists($obj, 'attribution')) { | |
| 2396 | + throw new Exception("Missing required property"); | |
| 2397 | + } | |
| 2398 | + if (!property_exists($obj, 'attributionLink')) { | |
| 2399 | + throw new Exception("Missing required property"); | |
| 2400 | + } | |
| 2401 | + if (!property_exists($obj, 'averageRating')) { | |
| 2402 | + throw new Exception("Missing required property"); | |
| 2403 | + } | |
| 2404 | + if (!property_exists($obj, 'category')) { | |
| 2405 | + throw new Exception("Missing required property"); | |
| 2406 | + } | |
| 2407 | + if (!property_exists($obj, 'columns')) { | |
| 2408 | + throw new Exception("Missing required property"); | |
| 2409 | + } | |
| 2410 | + if (!property_exists($obj, 'createdAt')) { | |
| 2411 | + throw new Exception("Missing required property"); | |
| 2412 | + } | |
| 2413 | + if (!property_exists($obj, 'description')) { | |
| 2414 | + throw new Exception("Missing required property"); | |
| 2415 | + } | |
| 2416 | + if (!property_exists($obj, 'displayType')) { | |
| 2417 | + throw new Exception("Missing required property"); | |
| 2418 | + } | |
| 2419 | + if (!property_exists($obj, 'downloadCount')) { | |
| 2420 | + throw new Exception("Missing required property"); | |
| 2421 | + } | |
| 2422 | + if (!property_exists($obj, 'flags')) { | |
| 2423 | + throw new Exception("Missing required property"); | |
| 2424 | + } | |
| 2425 | + if (!property_exists($obj, 'grants')) { | |
| 2426 | + throw new Exception("Missing required property"); | |
| 2427 | + } | |
| 2428 | + if (!property_exists($obj, 'hideFromCatalog')) { | |
| 2429 | + throw new Exception("Missing required property"); | |
| 2430 | + } | |
| 2431 | + if (!property_exists($obj, 'hideFromDataJson')) { | |
| 2432 | + throw new Exception("Missing required property"); | |
| 2433 | + } | |
| 2434 | + if (!property_exists($obj, 'id')) { | |
| 2435 | + throw new Exception("Missing required property"); | |
| 2436 | + } | |
| 2437 | + if (!property_exists($obj, 'indexUpdatedAt')) { | |
| 2438 | + throw new Exception("Missing required property"); | |
| 2439 | + } | |
| 2440 | + if (!property_exists($obj, 'locale')) { | |
| 2441 | + throw new Exception("Missing required property"); | |
| 2442 | + } | |
| 2443 | + if (!property_exists($obj, 'metadata')) { | |
| 2444 | + throw new Exception("Missing required property"); | |
| 2445 | + } | |
| 2446 | + if (!property_exists($obj, 'name')) { | |
| 2447 | + throw new Exception("Missing required property"); | |
| 2448 | + } | |
| 2449 | + if (!property_exists($obj, 'newBackend')) { | |
| 2450 | + throw new Exception("Missing required property"); | |
| 2451 | + } | |
| 2452 | + if (!property_exists($obj, 'numberOfComments')) { | |
| 2453 | + throw new Exception("Missing required property"); | |
| 2454 | + } | |
| 2455 | + if (!property_exists($obj, 'oid')) { | |
| 2456 | + throw new Exception("Missing required property"); | |
| 2457 | + } | |
| 2458 | + if (!property_exists($obj, 'owner')) { | |
| 2459 | + throw new Exception("Missing required property"); | |
| 2460 | + } | |
| 2461 | + if (!property_exists($obj, 'provenance')) { | |
| 2462 | + throw new Exception("Missing required property"); | |
| 2463 | + } | |
| 2464 | + if (!property_exists($obj, 'publicationAppendEnabled')) { | |
| 2465 | + throw new Exception("Missing required property"); | |
| 2466 | + } | |
| 2467 | + if (!property_exists($obj, 'publicationDate')) { | |
| 2468 | + throw new Exception("Missing required property"); | |
| 2469 | + } | |
| 2470 | + if (!property_exists($obj, 'publicationGroup')) { | |
| 2471 | + throw new Exception("Missing required property"); | |
| 2472 | + } | |
| 2473 | + if (!property_exists($obj, 'publicationStage')) { | |
| 2474 | + throw new Exception("Missing required property"); | |
| 2475 | + } | |
| 2476 | + if (!property_exists($obj, 'query')) { | |
| 2477 | + throw new Exception("Missing required property"); | |
| 2478 | + } | |
| 2479 | + if (!property_exists($obj, 'rights')) { | |
| 2480 | + throw new Exception("Missing required property"); | |
| 2481 | + } | |
| 2482 | + if (!property_exists($obj, 'rowsUpdatedAt')) { | |
| 2483 | + throw new Exception("Missing required property"); | |
| 2484 | + } | |
| 2485 | + if (!property_exists($obj, 'rowsUpdatedBy')) { | |
| 2486 | + throw new Exception("Missing required property"); | |
| 2487 | + } | |
| 2488 | + if (!property_exists($obj, 'tableAuthor')) { | |
| 2489 | + throw new Exception("Missing required property"); | |
| 2490 | + } | |
| 2491 | + if (!property_exists($obj, 'tableId')) { | |
| 2492 | + throw new Exception("Missing required property"); | |
| 2493 | + } | |
| 2494 | + if (!property_exists($obj, 'tags')) { | |
| 2495 | + throw new Exception("Missing required property"); | |
| 2496 | + } | |
| 2497 | + if (!property_exists($obj, 'totalTimesRated')) { | |
| 2498 | + throw new Exception("Missing required property"); | |
| 2499 | + } | |
| 2500 | + if (!property_exists($obj, 'viewCount')) { | |
| 2501 | + throw new Exception("Missing required property"); | |
| 2502 | + } | |
| 2503 | + if (!property_exists($obj, 'viewLastModified')) { | |
| 2504 | + throw new Exception("Missing required property"); | |
| 2505 | + } | |
| 2506 | + if (!property_exists($obj, 'viewType')) { | |
| 2507 | + throw new Exception("Missing required property"); | |
| 2508 | + } | |
| 2386 | 2509 | return new View( |
| 2387 | 2510 | View::fromAttribution($obj->{'attribution'}) |
| 2388 | 2511 | ,View::fromAttributionLink($obj->{'attributionLink'}) |
| @@ -3195,6 +3318,27 @@ class Column { | ||
| 3195 | 3318 | * @throws Exception |
| 3196 | 3319 | */ |
| 3197 | 3320 | public static function from(stdClass $obj): Column { |
| 3321 | + if (!property_exists($obj, 'dataTypeName')) { | |
| 3322 | + throw new Exception("Missing required property"); | |
| 3323 | + } | |
| 3324 | + if (!property_exists($obj, 'fieldName')) { | |
| 3325 | + throw new Exception("Missing required property"); | |
| 3326 | + } | |
| 3327 | + if (!property_exists($obj, 'format')) { | |
| 3328 | + throw new Exception("Missing required property"); | |
| 3329 | + } | |
| 3330 | + if (!property_exists($obj, 'id')) { | |
| 3331 | + throw new Exception("Missing required property"); | |
| 3332 | + } | |
| 3333 | + if (!property_exists($obj, 'name')) { | |
| 3334 | + throw new Exception("Missing required property"); | |
| 3335 | + } | |
| 3336 | + if (!property_exists($obj, 'position')) { | |
| 3337 | + throw new Exception("Missing required property"); | |
| 3338 | + } | |
| 3339 | + if (!property_exists($obj, 'renderTypeName')) { | |
| 3340 | + throw new Exception("Missing required property"); | |
| 3341 | + } | |
| 3198 | 3342 | return new Column( |
| 3199 | 3343 | Column::fromCachedContents($obj->{'cachedContents'}) |
| 3200 | 3344 | ,Column::fromDataTypeName($obj->{'dataTypeName'}) |
| @@ -3535,6 +3679,21 @@ class CachedContents { | ||
| 3535 | 3679 | * @throws Exception |
| 3536 | 3680 | */ |
| 3537 | 3681 | public static function from(stdClass $obj): CachedContents { |
| 3682 | + if (!property_exists($obj, 'largest')) { | |
| 3683 | + throw new Exception("Missing required property"); | |
| 3684 | + } | |
| 3685 | + if (!property_exists($obj, 'non_null')) { | |
| 3686 | + throw new Exception("Missing required property"); | |
| 3687 | + } | |
| 3688 | + if (!property_exists($obj, 'null')) { | |
| 3689 | + throw new Exception("Missing required property"); | |
| 3690 | + } | |
| 3691 | + if (!property_exists($obj, 'smallest')) { | |
| 3692 | + throw new Exception("Missing required property"); | |
| 3693 | + } | |
| 3694 | + if (!property_exists($obj, 'top')) { | |
| 3695 | + throw new Exception("Missing required property"); | |
| 3696 | + } | |
| 3538 | 3697 | return new CachedContents( |
| 3539 | 3698 | CachedContents::fromLargest($obj->{'largest'}) |
| 3540 | 3699 | ,CachedContents::fromNonNull($obj->{'non_null'}) |
| @@ -3693,6 +3852,12 @@ class Top { | ||
| 3693 | 3852 | * @throws Exception |
| 3694 | 3853 | */ |
| 3695 | 3854 | public static function from(stdClass $obj): Top { |
| 3855 | + if (!property_exists($obj, 'count')) { | |
| 3856 | + throw new Exception("Missing required property"); | |
| 3857 | + } | |
| 3858 | + if (!property_exists($obj, 'item')) { | |
| 3859 | + throw new Exception("Missing required property"); | |
| 3860 | + } | |
| 3696 | 3861 | return new Top( |
| 3697 | 3862 | Top::fromCount($obj->{'count'}) |
| 3698 | 3863 | ,Top::fromItem($obj->{'item'}) |
| @@ -4136,6 +4301,15 @@ class Grant { | ||
| 4136 | 4301 | * @throws Exception |
| 4137 | 4302 | */ |
| 4138 | 4303 | public static function from(stdClass $obj): Grant { |
| 4304 | + if (!property_exists($obj, 'flags')) { | |
| 4305 | + throw new Exception("Missing required property"); | |
| 4306 | + } | |
| 4307 | + if (!property_exists($obj, 'inherited')) { | |
| 4308 | + throw new Exception("Missing required property"); | |
| 4309 | + } | |
| 4310 | + if (!property_exists($obj, 'type')) { | |
| 4311 | + throw new Exception("Missing required property"); | |
| 4312 | + } | |
| 4139 | 4313 | return new Grant( |
| 4140 | 4314 | Grant::fromFlags($obj->{'flags'}) |
| 4141 | 4315 | ,Grant::fromInherited($obj->{'inherited'}) |
| @@ -4527,6 +4701,24 @@ class Metadata { | ||
| 4527 | 4701 | * @throws Exception |
| 4528 | 4702 | */ |
| 4529 | 4703 | public static function from(stdClass $obj): Metadata { |
| 4704 | + if (!property_exists($obj, 'attachments')) { | |
| 4705 | + throw new Exception("Missing required property"); | |
| 4706 | + } | |
| 4707 | + if (!property_exists($obj, 'availableDisplayTypes')) { | |
| 4708 | + throw new Exception("Missing required property"); | |
| 4709 | + } | |
| 4710 | + if (!property_exists($obj, 'custom_fields')) { | |
| 4711 | + throw new Exception("Missing required property"); | |
| 4712 | + } | |
| 4713 | + if (!property_exists($obj, 'jsonQuery')) { | |
| 4714 | + throw new Exception("Missing required property"); | |
| 4715 | + } | |
| 4716 | + if (!property_exists($obj, 'rdfSubject')) { | |
| 4717 | + throw new Exception("Missing required property"); | |
| 4718 | + } | |
| 4719 | + if (!property_exists($obj, 'renderTypeConfig')) { | |
| 4720 | + throw new Exception("Missing required property"); | |
| 4721 | + } | |
| 4530 | 4722 | return new Metadata( |
| 4531 | 4723 | Metadata::fromAttachments($obj->{'attachments'}) |
| 4532 | 4724 | ,Metadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'}) |
| @@ -4791,6 +4983,18 @@ class Attachment { | ||
| 4791 | 4983 | * @throws Exception |
| 4792 | 4984 | */ |
| 4793 | 4985 | public static function from(stdClass $obj): Attachment { |
| 4986 | + if (!property_exists($obj, 'assetId')) { | |
| 4987 | + throw new Exception("Missing required property"); | |
| 4988 | + } | |
| 4989 | + if (!property_exists($obj, 'blobId')) { | |
| 4990 | + throw new Exception("Missing required property"); | |
| 4991 | + } | |
| 4992 | + if (!property_exists($obj, 'filename')) { | |
| 4993 | + throw new Exception("Missing required property"); | |
| 4994 | + } | |
| 4995 | + if (!property_exists($obj, 'name')) { | |
| 4996 | + throw new Exception("Missing required property"); | |
| 4997 | + } | |
| 4794 | 4998 | return new Attachment( |
| 4795 | 4999 | Attachment::fromAssetID($obj->{'assetId'}) |
| 4796 | 5000 | ,Attachment::fromBlobID($obj->{'blobId'}) |
| @@ -5108,6 +5312,21 @@ class CustomFields { | ||
| 5108 | 5312 | * @throws Exception |
| 5109 | 5313 | */ |
| 5110 | 5314 | public static function from(stdClass $obj): CustomFields { |
| 5315 | + if (!property_exists($obj, 'Additional Resources')) { | |
| 5316 | + throw new Exception("Missing required property"); | |
| 5317 | + } | |
| 5318 | + if (!property_exists($obj, 'Common Core')) { | |
| 5319 | + throw new Exception("Missing required property"); | |
| 5320 | + } | |
| 5321 | + if (!property_exists($obj, 'Dataset Information')) { | |
| 5322 | + throw new Exception("Missing required property"); | |
| 5323 | + } | |
| 5324 | + if (!property_exists($obj, 'Dataset Summary')) { | |
| 5325 | + throw new Exception("Missing required property"); | |
| 5326 | + } | |
| 5327 | + if (!property_exists($obj, 'Notes')) { | |
| 5328 | + throw new Exception("Missing required property"); | |
| 5329 | + } | |
| 5111 | 5330 | return new CustomFields( |
| 5112 | 5331 | CustomFields::fromAdditionalResources($obj->{'Additional Resources'}) |
| 5113 | 5332 | ,CustomFields::fromCommonCore($obj->{'Common Core'}) |
| @@ -5214,6 +5433,9 @@ class AdditionalResources { | ||
| 5214 | 5433 | * @throws Exception |
| 5215 | 5434 | */ |
| 5216 | 5435 | public static function from(stdClass $obj): AdditionalResources { |
| 5436 | + if (!property_exists($obj, 'See Also')) { | |
| 5437 | + throw new Exception("Missing required property"); | |
| 5438 | + } | |
| 5217 | 5439 | return new AdditionalResources( |
| 5218 | 5440 | AdditionalResources::fromSeeAlso($obj->{'See Also'}) |
| 5219 | 5441 | ); |
| @@ -5416,6 +5638,15 @@ class CommonCore { | ||
| 5416 | 5638 | * @throws Exception |
| 5417 | 5639 | */ |
| 5418 | 5640 | public static function from(stdClass $obj): CommonCore { |
| 5641 | + if (!property_exists($obj, 'Contact Email')) { | |
| 5642 | + throw new Exception("Missing required property"); | |
| 5643 | + } | |
| 5644 | + if (!property_exists($obj, 'Contact Name')) { | |
| 5645 | + throw new Exception("Missing required property"); | |
| 5646 | + } | |
| 5647 | + if (!property_exists($obj, 'Publisher')) { | |
| 5648 | + throw new Exception("Missing required property"); | |
| 5649 | + } | |
| 5419 | 5650 | return new CommonCore( |
| 5420 | 5651 | CommonCore::fromContactEmail($obj->{'Contact Email'}) |
| 5421 | 5652 | ,CommonCore::fromContactName($obj->{'Contact Name'}) |
| @@ -5518,6 +5749,9 @@ class DatasetInformation { | ||
| 5518 | 5749 | * @throws Exception |
| 5519 | 5750 | */ |
| 5520 | 5751 | public static function from(stdClass $obj): DatasetInformation { |
| 5752 | + if (!property_exists($obj, 'Agency')) { | |
| 5753 | + throw new Exception("Missing required property"); | |
| 5754 | + } | |
| 5521 | 5755 | return new DatasetInformation( |
| 5522 | 5756 | DatasetInformation::fromAgency($obj->{'Agency'}) |
| 5523 | 5757 | ); |
| @@ -5980,6 +6214,30 @@ class DatasetSummary { | ||
| 5980 | 6214 | * @throws Exception |
| 5981 | 6215 | */ |
| 5982 | 6216 | public static function from(stdClass $obj): DatasetSummary { |
| 6217 | + if (!property_exists($obj, 'Contact Information')) { | |
| 6218 | + throw new Exception("Missing required property"); | |
| 6219 | + } | |
| 6220 | + if (!property_exists($obj, 'Coverage')) { | |
| 6221 | + throw new Exception("Missing required property"); | |
| 6222 | + } | |
| 6223 | + if (!property_exists($obj, 'Data Frequency')) { | |
| 6224 | + throw new Exception("Missing required property"); | |
| 6225 | + } | |
| 6226 | + if (!property_exists($obj, 'Dataset Owner')) { | |
| 6227 | + throw new Exception("Missing required property"); | |
| 6228 | + } | |
| 6229 | + if (!property_exists($obj, 'Granularity')) { | |
| 6230 | + throw new Exception("Missing required property"); | |
| 6231 | + } | |
| 6232 | + if (!property_exists($obj, 'Organization')) { | |
| 6233 | + throw new Exception("Missing required property"); | |
| 6234 | + } | |
| 6235 | + if (!property_exists($obj, 'Posting Frequency')) { | |
| 6236 | + throw new Exception("Missing required property"); | |
| 6237 | + } | |
| 6238 | + if (!property_exists($obj, 'Time Period')) { | |
| 6239 | + throw new Exception("Missing required property"); | |
| 6240 | + } | |
| 5983 | 6241 | return new DatasetSummary( |
| 5984 | 6242 | DatasetSummary::fromContactInformation($obj->{'Contact Information'}) |
| 5985 | 6243 | ,DatasetSummary::fromCoverage($obj->{'Coverage'}) |
| @@ -6092,6 +6350,9 @@ class Notes { | ||
| 6092 | 6350 | * @throws Exception |
| 6093 | 6351 | */ |
| 6094 | 6352 | public static function from(stdClass $obj): Notes { |
| 6353 | + if (!property_exists($obj, 'Notes')) { | |
| 6354 | + throw new Exception("Missing required property"); | |
| 6355 | + } | |
| 6095 | 6356 | return new Notes( |
| 6096 | 6357 | Notes::fromNotes($obj->{'Notes'}) |
| 6097 | 6358 | ); |
| @@ -6202,6 +6463,9 @@ class JSONQuery { | ||
| 6202 | 6463 | * @throws Exception |
| 6203 | 6464 | */ |
| 6204 | 6465 | public static function from(stdClass $obj): JSONQuery { |
| 6466 | + if (!property_exists($obj, 'order')) { | |
| 6467 | + throw new Exception("Missing required property"); | |
| 6468 | + } | |
| 6205 | 6469 | return new JSONQuery( |
| 6206 | 6470 | JSONQuery::fromOrder($obj->{'order'}) |
| 6207 | 6471 | ); |
| @@ -6352,6 +6616,12 @@ class Order { | ||
| 6352 | 6616 | * @throws Exception |
| 6353 | 6617 | */ |
| 6354 | 6618 | public static function from(stdClass $obj): Order { |
| 6619 | + if (!property_exists($obj, 'ascending')) { | |
| 6620 | + throw new Exception("Missing required property"); | |
| 6621 | + } | |
| 6622 | + if (!property_exists($obj, 'columnFieldName')) { | |
| 6623 | + throw new Exception("Missing required property"); | |
| 6624 | + } | |
| 6355 | 6625 | return new Order( |
| 6356 | 6626 | Order::fromAscending($obj->{'ascending'}) |
| 6357 | 6627 | ,Order::fromColumnFieldName($obj->{'columnFieldName'}) |
| @@ -6453,6 +6723,9 @@ class RenderTypeConfig { | ||
| 6453 | 6723 | * @throws Exception |
| 6454 | 6724 | */ |
| 6455 | 6725 | public static function from(stdClass $obj): RenderTypeConfig { |
| 6726 | + if (!property_exists($obj, 'visible')) { | |
| 6727 | + throw new Exception("Missing required property"); | |
| 6728 | + } | |
| 6456 | 6729 | return new RenderTypeConfig( |
| 6457 | 6730 | RenderTypeConfig::fromVisible($obj->{'visible'}) |
| 6458 | 6731 | ); |
| @@ -6551,6 +6824,9 @@ class Visible { | ||
| 6551 | 6824 | * @throws Exception |
| 6552 | 6825 | */ |
| 6553 | 6826 | public static function from(stdClass $obj): Visible { |
| 6827 | + if (!property_exists($obj, 'table')) { | |
| 6828 | + throw new Exception("Missing required property"); | |
| 6829 | + } | |
| 6554 | 6830 | return new Visible( |
| 6555 | 6831 | Visible::fromTable($obj->{'table'}) |
| 6556 | 6832 | ); |
| @@ -7027,6 +7303,30 @@ class Owner { | ||
| 7027 | 7303 | * @throws Exception |
| 7028 | 7304 | */ |
| 7029 | 7305 | public static function from(stdClass $obj): Owner { |
| 7306 | + if (!property_exists($obj, 'displayName')) { | |
| 7307 | + throw new Exception("Missing required property"); | |
| 7308 | + } | |
| 7309 | + if (!property_exists($obj, 'id')) { | |
| 7310 | + throw new Exception("Missing required property"); | |
| 7311 | + } | |
| 7312 | + if (!property_exists($obj, 'profileImageUrlLarge')) { | |
| 7313 | + throw new Exception("Missing required property"); | |
| 7314 | + } | |
| 7315 | + if (!property_exists($obj, 'profileImageUrlMedium')) { | |
| 7316 | + throw new Exception("Missing required property"); | |
| 7317 | + } | |
| 7318 | + if (!property_exists($obj, 'profileImageUrlSmall')) { | |
| 7319 | + throw new Exception("Missing required property"); | |
| 7320 | + } | |
| 7321 | + if (!property_exists($obj, 'rights')) { | |
| 7322 | + throw new Exception("Missing required property"); | |
| 7323 | + } | |
| 7324 | + if (!property_exists($obj, 'roleName')) { | |
| 7325 | + throw new Exception("Missing required property"); | |
| 7326 | + } | |
| 7327 | + if (!property_exists($obj, 'screenName')) { | |
| 7328 | + throw new Exception("Missing required property"); | |
| 7329 | + } | |
| 7030 | 7330 | return new Owner( |
| 7031 | 7331 | Owner::fromDisplayName($obj->{'displayName'}) |
| 7032 | 7332 | ,Owner::fromID($obj->{'id'}) |
| @@ -7151,6 +7451,9 @@ class Query { | ||
| 7151 | 7451 | * @throws Exception |
| 7152 | 7452 | */ |
| 7153 | 7453 | public static function from(stdClass $obj): Query { |
| 7454 | + if (!property_exists($obj, 'orderBys')) { | |
| 7455 | + throw new Exception("Missing required property"); | |
| 7456 | + } | |
| 7154 | 7457 | return new Query( |
| 7155 | 7458 | Query::fromOrderBys($obj->{'orderBys'}) |
| 7156 | 7459 | ); |
| @@ -7302,6 +7605,12 @@ class OrderBy { | ||
| 7302 | 7605 | * @throws Exception |
| 7303 | 7606 | */ |
| 7304 | 7607 | public static function from(stdClass $obj): OrderBy { |
| 7608 | + if (!property_exists($obj, 'ascending')) { | |
| 7609 | + throw new Exception("Missing required property"); | |
| 7610 | + } | |
| 7611 | + if (!property_exists($obj, 'expression')) { | |
| 7612 | + throw new Exception("Missing required property"); | |
| 7613 | + } | |
| 7305 | 7614 | return new OrderBy( |
| 7306 | 7615 | OrderBy::fromAscending($obj->{'ascending'}) |
| 7307 | 7616 | ,OrderBy::fromExpression($obj->{'expression'}) |
| @@ -7454,6 +7763,12 @@ class Expression { | ||
| 7454 | 7763 | * @throws Exception |
| 7455 | 7764 | */ |
| 7456 | 7765 | public static function from(stdClass $obj): Expression { |
| 7766 | + if (!property_exists($obj, 'columnId')) { | |
| 7767 | + throw new Exception("Missing required property"); | |
| 7768 | + } | |
| 7769 | + if (!property_exists($obj, 'type')) { | |
| 7770 | + throw new Exception("Missing required property"); | |
| 7771 | + } | |
| 7457 | 7772 | return new Expression( |
| 7458 | 7773 | Expression::fromColumnID($obj->{'columnId'}) |
| 7459 | 7774 | ,Expression::fromType($obj->{'type'}) |
Test case
1 generated file · +75 −0test/inputs/json/misc/61b66.json
Mphpdefault / TopLevel.php+75 −0
| @@ -450,6 +450,30 @@ class TopLevel { | ||
| 450 | 450 | * @throws Exception |
| 451 | 451 | */ |
| 452 | 452 | public static function from(stdClass $obj): TopLevel { |
| 453 | + if (!property_exists($obj, 'city')) { | |
| 454 | + throw new Exception("Missing required property"); | |
| 455 | + } | |
| 456 | + if (!property_exists($obj, 'delay')) { | |
| 457 | + throw new Exception("Missing required property"); | |
| 458 | + } | |
| 459 | + if (!property_exists($obj, 'IATA')) { | |
| 460 | + throw new Exception("Missing required property"); | |
| 461 | + } | |
| 462 | + if (!property_exists($obj, 'ICAO')) { | |
| 463 | + throw new Exception("Missing required property"); | |
| 464 | + } | |
| 465 | + if (!property_exists($obj, 'name')) { | |
| 466 | + throw new Exception("Missing required property"); | |
| 467 | + } | |
| 468 | + if (!property_exists($obj, 'state')) { | |
| 469 | + throw new Exception("Missing required property"); | |
| 470 | + } | |
| 471 | + if (!property_exists($obj, 'status')) { | |
| 472 | + throw new Exception("Missing required property"); | |
| 473 | + } | |
| 474 | + if (!property_exists($obj, 'weather')) { | |
| 475 | + throw new Exception("Missing required property"); | |
| 476 | + } | |
| 453 | 477 | return new TopLevel( |
| 454 | 478 | TopLevel::fromCity($obj->{'city'}) |
| 455 | 479 | ,TopLevel::fromDelay($obj->{'delay'}) |
| @@ -978,6 +1002,33 @@ class Status { | ||
| 978 | 1002 | * @throws Exception |
| 979 | 1003 | */ |
| 980 | 1004 | public static function from(stdClass $obj): Status { |
| 1005 | + if (!property_exists($obj, 'avgDelay')) { | |
| 1006 | + throw new Exception("Missing required property"); | |
| 1007 | + } | |
| 1008 | + if (!property_exists($obj, 'closureBegin')) { | |
| 1009 | + throw new Exception("Missing required property"); | |
| 1010 | + } | |
| 1011 | + if (!property_exists($obj, 'closureEnd')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'endTime')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 1017 | + if (!property_exists($obj, 'maxDelay')) { | |
| 1018 | + throw new Exception("Missing required property"); | |
| 1019 | + } | |
| 1020 | + if (!property_exists($obj, 'minDelay')) { | |
| 1021 | + throw new Exception("Missing required property"); | |
| 1022 | + } | |
| 1023 | + if (!property_exists($obj, 'reason')) { | |
| 1024 | + throw new Exception("Missing required property"); | |
| 1025 | + } | |
| 1026 | + if (!property_exists($obj, 'trend')) { | |
| 1027 | + throw new Exception("Missing required property"); | |
| 1028 | + } | |
| 1029 | + if (!property_exists($obj, 'type')) { | |
| 1030 | + throw new Exception("Missing required property"); | |
| 1031 | + } | |
| 981 | 1032 | return new Status( |
| 982 | 1033 | Status::fromAvgDelay($obj->{'avgDelay'}) |
| 983 | 1034 | ,Status::fromClosureBegin($obj->{'closureBegin'}) |
| @@ -1301,6 +1352,21 @@ class Weather { | ||
| 1301 | 1352 | * @throws Exception |
| 1302 | 1353 | */ |
| 1303 | 1354 | public static function from(stdClass $obj): Weather { |
| 1355 | + if (!property_exists($obj, 'meta')) { | |
| 1356 | + throw new Exception("Missing required property"); | |
| 1357 | + } | |
| 1358 | + if (!property_exists($obj, 'temp')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1361 | + if (!property_exists($obj, 'visibility')) { | |
| 1362 | + throw new Exception("Missing required property"); | |
| 1363 | + } | |
| 1364 | + if (!property_exists($obj, 'weather')) { | |
| 1365 | + throw new Exception("Missing required property"); | |
| 1366 | + } | |
| 1367 | + if (!property_exists($obj, 'wind')) { | |
| 1368 | + throw new Exception("Missing required property"); | |
| 1369 | + } | |
| 1304 | 1370 | return new Weather( |
| 1305 | 1371 | Weather::fromMeta($obj->{'meta'}) |
| 1306 | 1372 | ,Weather::fromTemp($obj->{'temp'}) |
| @@ -1511,6 +1577,15 @@ class Meta { | ||
| 1511 | 1577 | * @throws Exception |
| 1512 | 1578 | */ |
| 1513 | 1579 | public static function from(stdClass $obj): Meta { |
| 1580 | + if (!property_exists($obj, 'credit')) { | |
| 1581 | + throw new Exception("Missing required property"); | |
| 1582 | + } | |
| 1583 | + if (!property_exists($obj, 'updated')) { | |
| 1584 | + throw new Exception("Missing required property"); | |
| 1585 | + } | |
| 1586 | + if (!property_exists($obj, 'url')) { | |
| 1587 | + throw new Exception("Missing required property"); | |
| 1588 | + } | |
| 1514 | 1589 | return new Meta( |
| 1515 | 1590 | Meta::fromCredit($obj->{'credit'}) |
| 1516 | 1591 | ,Meta::fromUpdated($obj->{'updated'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/6260a.json
Mphpdefault / TopLevel.php+9 −0
| @@ -205,6 +205,15 @@ class TopLevel { | ||
| 205 | 205 | * @throws Exception |
| 206 | 206 | */ |
| 207 | 207 | public static function from(stdClass $obj): TopLevel { |
| 208 | + if (!property_exists($obj, 'base')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'date')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 214 | + if (!property_exists($obj, 'rates')) { | |
| 215 | + throw new Exception("Missing required property"); | |
| 216 | + } | |
| 208 | 217 | return new TopLevel( |
| 209 | 218 | TopLevel::fromBase($obj->{'base'}) |
| 210 | 219 | ,TopLevel::fromDate($obj->{'date'}) |
Test case
1 generated file · +87 −0test/inputs/json/misc/65dec.json
Mphpdefault / TopLevel.php+87 −0
| @@ -630,6 +630,39 @@ class TopLevel { | ||
| 630 | 630 | * @throws Exception |
| 631 | 631 | */ |
| 632 | 632 | public static function from(stdClass $obj): TopLevel { |
| 633 | + if (!property_exists($obj, 'booster')) { | |
| 634 | + throw new Exception("Missing required property"); | |
| 635 | + } | |
| 636 | + if (!property_exists($obj, 'border')) { | |
| 637 | + throw new Exception("Missing required property"); | |
| 638 | + } | |
| 639 | + if (!property_exists($obj, 'cards')) { | |
| 640 | + throw new Exception("Missing required property"); | |
| 641 | + } | |
| 642 | + if (!property_exists($obj, 'code')) { | |
| 643 | + throw new Exception("Missing required property"); | |
| 644 | + } | |
| 645 | + if (!property_exists($obj, 'gathererCode')) { | |
| 646 | + throw new Exception("Missing required property"); | |
| 647 | + } | |
| 648 | + if (!property_exists($obj, 'magicCardsInfoCode')) { | |
| 649 | + throw new Exception("Missing required property"); | |
| 650 | + } | |
| 651 | + if (!property_exists($obj, 'mkm_id')) { | |
| 652 | + throw new Exception("Missing required property"); | |
| 653 | + } | |
| 654 | + if (!property_exists($obj, 'mkm_name')) { | |
| 655 | + throw new Exception("Missing required property"); | |
| 656 | + } | |
| 657 | + if (!property_exists($obj, 'name')) { | |
| 658 | + throw new Exception("Missing required property"); | |
| 659 | + } | |
| 660 | + if (!property_exists($obj, 'releaseDate')) { | |
| 661 | + throw new Exception("Missing required property"); | |
| 662 | + } | |
| 663 | + if (!property_exists($obj, 'type')) { | |
| 664 | + throw new Exception("Missing required property"); | |
| 665 | + } | |
| 633 | 666 | return new TopLevel( |
| 634 | 667 | TopLevel::fromBooster($obj->{'booster'}) |
| 635 | 668 | ,TopLevel::fromBorder($obj->{'border'}) |
| @@ -2411,6 +2444,48 @@ class Card { | ||
| 2411 | 2444 | * @throws Exception |
| 2412 | 2445 | */ |
| 2413 | 2446 | public static function from(stdClass $obj): Card { |
| 2447 | + if (!property_exists($obj, 'artist')) { | |
| 2448 | + throw new Exception("Missing required property"); | |
| 2449 | + } | |
| 2450 | + if (!property_exists($obj, 'cmc')) { | |
| 2451 | + throw new Exception("Missing required property"); | |
| 2452 | + } | |
| 2453 | + if (!property_exists($obj, 'id')) { | |
| 2454 | + throw new Exception("Missing required property"); | |
| 2455 | + } | |
| 2456 | + if (!property_exists($obj, 'imageName')) { | |
| 2457 | + throw new Exception("Missing required property"); | |
| 2458 | + } | |
| 2459 | + if (!property_exists($obj, 'layout')) { | |
| 2460 | + throw new Exception("Missing required property"); | |
| 2461 | + } | |
| 2462 | + if (!property_exists($obj, 'legalities')) { | |
| 2463 | + throw new Exception("Missing required property"); | |
| 2464 | + } | |
| 2465 | + if (!property_exists($obj, 'multiverseid')) { | |
| 2466 | + throw new Exception("Missing required property"); | |
| 2467 | + } | |
| 2468 | + if (!property_exists($obj, 'name')) { | |
| 2469 | + throw new Exception("Missing required property"); | |
| 2470 | + } | |
| 2471 | + if (!property_exists($obj, 'originalText')) { | |
| 2472 | + throw new Exception("Missing required property"); | |
| 2473 | + } | |
| 2474 | + if (!property_exists($obj, 'originalType')) { | |
| 2475 | + throw new Exception("Missing required property"); | |
| 2476 | + } | |
| 2477 | + if (!property_exists($obj, 'printings')) { | |
| 2478 | + throw new Exception("Missing required property"); | |
| 2479 | + } | |
| 2480 | + if (!property_exists($obj, 'rarity')) { | |
| 2481 | + throw new Exception("Missing required property"); | |
| 2482 | + } | |
| 2483 | + if (!property_exists($obj, 'type')) { | |
| 2484 | + throw new Exception("Missing required property"); | |
| 2485 | + } | |
| 2486 | + if (!property_exists($obj, 'types')) { | |
| 2487 | + throw new Exception("Missing required property"); | |
| 2488 | + } | |
| 2414 | 2489 | return new Card( |
| 2415 | 2490 | Card::fromArtist($obj->{'artist'}) |
| 2416 | 2491 | ,Card::fromCmc($obj->{'cmc'}) |
| @@ -2783,6 +2858,12 @@ class LegalityElement { | ||
| 2783 | 2858 | * @throws Exception |
| 2784 | 2859 | */ |
| 2785 | 2860 | public static function from(stdClass $obj): LegalityElement { |
| 2861 | + if (!property_exists($obj, 'format')) { | |
| 2862 | + throw new Exception("Missing required property"); | |
| 2863 | + } | |
| 2864 | + if (!property_exists($obj, 'legality')) { | |
| 2865 | + throw new Exception("Missing required property"); | |
| 2866 | + } | |
| 2786 | 2867 | return new LegalityElement( |
| 2787 | 2868 | LegalityElement::fromFormat($obj->{'format'}) |
| 2788 | 2869 | ,LegalityElement::fromLegality($obj->{'legality'}) |
| @@ -3045,6 +3126,12 @@ class Ruling { | ||
| 3045 | 3126 | * @throws Exception |
| 3046 | 3127 | */ |
| 3047 | 3128 | public static function from(stdClass $obj): Ruling { |
| 3129 | + if (!property_exists($obj, 'date')) { | |
| 3130 | + throw new Exception("Missing required property"); | |
| 3131 | + } | |
| 3132 | + if (!property_exists($obj, 'text')) { | |
| 3133 | + throw new Exception("Missing required property"); | |
| 3134 | + } | |
| 3048 | 3135 | return new Ruling( |
| 3049 | 3136 | Ruling::fromDate($obj->{'date'}) |
| 3050 | 3137 | ,Ruling::fromText($obj->{'text'}) |
Test case
1 generated file · +45 −0test/inputs/json/misc/66121.json
Mphpdefault / TopLevel.php+45 −0
| @@ -517,6 +517,30 @@ class TopLevel { | ||
| 517 | 517 | * @throws Exception |
| 518 | 518 | */ |
| 519 | 519 | public static function from(stdClass $obj): TopLevel { |
| 520 | + if (!property_exists($obj, 'id')) { | |
| 521 | + throw new Exception("Missing required property"); | |
| 522 | + } | |
| 523 | + if (!property_exists($obj, 'identifiers')) { | |
| 524 | + throw new Exception("Missing required property"); | |
| 525 | + } | |
| 526 | + if (!property_exists($obj, 'keywords')) { | |
| 527 | + throw new Exception("Missing required property"); | |
| 528 | + } | |
| 529 | + if (!property_exists($obj, 'links')) { | |
| 530 | + throw new Exception("Missing required property"); | |
| 531 | + } | |
| 532 | + if (!property_exists($obj, 'name')) { | |
| 533 | + throw new Exception("Missing required property"); | |
| 534 | + } | |
| 535 | + if (!property_exists($obj, 'other_names')) { | |
| 536 | + throw new Exception("Missing required property"); | |
| 537 | + } | |
| 538 | + if (!property_exists($obj, 'superseded_by')) { | |
| 539 | + throw new Exception("Missing required property"); | |
| 540 | + } | |
| 541 | + if (!property_exists($obj, 'text')) { | |
| 542 | + throw new Exception("Missing required property"); | |
| 543 | + } | |
| 520 | 544 | return new TopLevel( |
| 521 | 545 | TopLevel::fromID($obj->{'id'}) |
| 522 | 546 | ,TopLevel::fromIdentifiers($obj->{'identifiers'}) |
| @@ -682,6 +706,12 @@ class Identifier { | ||
| 682 | 706 | * @throws Exception |
| 683 | 707 | */ |
| 684 | 708 | public static function from(stdClass $obj): Identifier { |
| 709 | + if (!property_exists($obj, 'identifier')) { | |
| 710 | + throw new Exception("Missing required property"); | |
| 711 | + } | |
| 712 | + if (!property_exists($obj, 'scheme')) { | |
| 713 | + throw new Exception("Missing required property"); | |
| 714 | + } | |
| 685 | 715 | return new Identifier( |
| 686 | 716 | Identifier::fromIdentifier($obj->{'identifier'}) |
| 687 | 717 | ,Identifier::fromScheme($obj->{'scheme'}) |
| @@ -941,6 +971,12 @@ class Link { | ||
| 941 | 971 | * @throws Exception |
| 942 | 972 | */ |
| 943 | 973 | public static function from(stdClass $obj): Link { |
| 974 | + if (!property_exists($obj, 'note')) { | |
| 975 | + throw new Exception("Missing required property"); | |
| 976 | + } | |
| 977 | + if (!property_exists($obj, 'url')) { | |
| 978 | + throw new Exception("Missing required property"); | |
| 979 | + } | |
| 944 | 980 | return new Link( |
| 945 | 981 | Link::fromNote($obj->{'note'}) |
| 946 | 982 | ,Link::fromURL($obj->{'url'}) |
| @@ -1192,6 +1228,15 @@ class Text { | ||
| 1192 | 1228 | * @throws Exception |
| 1193 | 1229 | */ |
| 1194 | 1230 | public static function from(stdClass $obj): Text { |
| 1231 | + if (!property_exists($obj, 'media_type')) { | |
| 1232 | + throw new Exception("Missing required property"); | |
| 1233 | + } | |
| 1234 | + if (!property_exists($obj, 'title')) { | |
| 1235 | + throw new Exception("Missing required property"); | |
| 1236 | + } | |
| 1237 | + if (!property_exists($obj, 'url')) { | |
| 1238 | + throw new Exception("Missing required property"); | |
| 1239 | + } | |
| 1195 | 1240 | return new Text( |
| 1196 | 1241 | Text::fromMediaType($obj->{'media_type'}) |
| 1197 | 1242 | ,Text::fromTitle($obj->{'title'}) |
Test case
1 generated file · +15 −0test/inputs/json/misc/6617c.json
Mphpdefault / TopLevel.php+15 −0
| @@ -189,6 +189,15 @@ class TopLevel { | ||
| 189 | 189 | * @throws Exception |
| 190 | 190 | */ |
| 191 | 191 | public static function from(stdClass $obj): TopLevel { |
| 192 | + if (!property_exists($obj, 'iss_position')) { | |
| 193 | + throw new Exception("Missing required property"); | |
| 194 | + } | |
| 195 | + if (!property_exists($obj, 'message')) { | |
| 196 | + throw new Exception("Missing required property"); | |
| 197 | + } | |
| 198 | + if (!property_exists($obj, 'timestamp')) { | |
| 199 | + throw new Exception("Missing required property"); | |
| 200 | + } | |
| 192 | 201 | return new TopLevel( |
| 193 | 202 | TopLevel::fromIssPosition($obj->{'iss_position'}) |
| 194 | 203 | ,TopLevel::fromMessage($obj->{'message'}) |
| @@ -343,6 +352,12 @@ class IssPosition { | ||
| 343 | 352 | * @throws Exception |
| 344 | 353 | */ |
| 345 | 354 | public static function from(stdClass $obj): IssPosition { |
| 355 | + if (!property_exists($obj, 'latitude')) { | |
| 356 | + throw new Exception("Missing required property"); | |
| 357 | + } | |
| 358 | + if (!property_exists($obj, 'longitude')) { | |
| 359 | + throw new Exception("Missing required property"); | |
| 360 | + } | |
| 346 | 361 | return new IssPosition( |
| 347 | 362 | IssPosition::fromLatitude($obj->{'latitude'}) |
| 348 | 363 | ,IssPosition::fromLongitude($obj->{'longitude'}) |
Test case
1 generated file · +15 −0test/inputs/json/misc/67c03.json
Mphpdefault / TopLevel.php+15 −0
| @@ -200,6 +200,15 @@ class TopLevel { | ||
| 200 | 200 | * @throws Exception |
| 201 | 201 | */ |
| 202 | 202 | public static function from(stdClass $obj): TopLevel { |
| 203 | + if (!property_exists($obj, 'message')) { | |
| 204 | + throw new Exception("Missing required property"); | |
| 205 | + } | |
| 206 | + if (!property_exists($obj, 'number')) { | |
| 207 | + throw new Exception("Missing required property"); | |
| 208 | + } | |
| 209 | + if (!property_exists($obj, 'people')) { | |
| 210 | + throw new Exception("Missing required property"); | |
| 211 | + } | |
| 203 | 212 | return new TopLevel( |
| 204 | 213 | TopLevel::fromMessage($obj->{'message'}) |
| 205 | 214 | ,TopLevel::fromNumber($obj->{'number'}) |
| @@ -354,6 +363,12 @@ class Person { | ||
| 354 | 363 | * @throws Exception |
| 355 | 364 | */ |
| 356 | 365 | public static function from(stdClass $obj): Person { |
| 366 | + if (!property_exists($obj, 'craft')) { | |
| 367 | + throw new Exception("Missing required property"); | |
| 368 | + } | |
| 369 | + if (!property_exists($obj, 'name')) { | |
| 370 | + throw new Exception("Missing required property"); | |
| 371 | + } | |
| 357 | 372 | return new Person( |
| 358 | 373 | Person::fromCraft($obj->{'craft'}) |
| 359 | 374 | ,Person::fromName($obj->{'name'}) |
Test case
1 generated file · +69 −0test/inputs/json/misc/68c30.json
Mphpdefault / TopLevel.php+69 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'txs')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromTxs($obj->{'txs'}) |
| 101 | 104 | ); |
| @@ -790,6 +793,42 @@ class Tx { | ||
| 790 | 793 | * @throws Exception |
| 791 | 794 | */ |
| 792 | 795 | public static function from(stdClass $obj): Tx { |
| 796 | + if (!property_exists($obj, 'double_spend')) { | |
| 797 | + throw new Exception("Missing required property"); | |
| 798 | + } | |
| 799 | + if (!property_exists($obj, 'hash')) { | |
| 800 | + throw new Exception("Missing required property"); | |
| 801 | + } | |
| 802 | + if (!property_exists($obj, 'inputs')) { | |
| 803 | + throw new Exception("Missing required property"); | |
| 804 | + } | |
| 805 | + if (!property_exists($obj, 'lock_time')) { | |
| 806 | + throw new Exception("Missing required property"); | |
| 807 | + } | |
| 808 | + if (!property_exists($obj, 'out')) { | |
| 809 | + throw new Exception("Missing required property"); | |
| 810 | + } | |
| 811 | + if (!property_exists($obj, 'relayed_by')) { | |
| 812 | + throw new Exception("Missing required property"); | |
| 813 | + } | |
| 814 | + if (!property_exists($obj, 'size')) { | |
| 815 | + throw new Exception("Missing required property"); | |
| 816 | + } | |
| 817 | + if (!property_exists($obj, 'time')) { | |
| 818 | + throw new Exception("Missing required property"); | |
| 819 | + } | |
| 820 | + if (!property_exists($obj, 'tx_index')) { | |
| 821 | + throw new Exception("Missing required property"); | |
| 822 | + } | |
| 823 | + if (!property_exists($obj, 'ver')) { | |
| 824 | + throw new Exception("Missing required property"); | |
| 825 | + } | |
| 826 | + if (!property_exists($obj, 'vin_sz')) { | |
| 827 | + throw new Exception("Missing required property"); | |
| 828 | + } | |
| 829 | + if (!property_exists($obj, 'vout_sz')) { | |
| 830 | + throw new Exception("Missing required property"); | |
| 831 | + } | |
| 793 | 832 | return new Tx( |
| 794 | 833 | Tx::fromDoubleSpend($obj->{'double_spend'}) |
| 795 | 834 | ,Tx::fromHash($obj->{'hash'}) |
| @@ -1015,6 +1054,15 @@ class Input { | ||
| 1015 | 1054 | * @throws Exception |
| 1016 | 1055 | */ |
| 1017 | 1056 | public static function from(stdClass $obj): Input { |
| 1057 | + if (!property_exists($obj, 'prev_out')) { | |
| 1058 | + throw new Exception("Missing required property"); | |
| 1059 | + } | |
| 1060 | + if (!property_exists($obj, 'script')) { | |
| 1061 | + throw new Exception("Missing required property"); | |
| 1062 | + } | |
| 1063 | + if (!property_exists($obj, 'sequence')) { | |
| 1064 | + throw new Exception("Missing required property"); | |
| 1065 | + } | |
| 1018 | 1066 | return new Input( |
| 1019 | 1067 | Input::fromPrevOut($obj->{'prev_out'}) |
| 1020 | 1068 | ,Input::fromScript($obj->{'script'}) |
| @@ -1429,6 +1477,27 @@ class Out { | ||
| 1429 | 1477 | * @throws Exception |
| 1430 | 1478 | */ |
| 1431 | 1479 | public static function from(stdClass $obj): Out { |
| 1480 | + if (!property_exists($obj, 'addr')) { | |
| 1481 | + throw new Exception("Missing required property"); | |
| 1482 | + } | |
| 1483 | + if (!property_exists($obj, 'n')) { | |
| 1484 | + throw new Exception("Missing required property"); | |
| 1485 | + } | |
| 1486 | + if (!property_exists($obj, 'script')) { | |
| 1487 | + throw new Exception("Missing required property"); | |
| 1488 | + } | |
| 1489 | + if (!property_exists($obj, 'spent')) { | |
| 1490 | + throw new Exception("Missing required property"); | |
| 1491 | + } | |
| 1492 | + if (!property_exists($obj, 'tx_index')) { | |
| 1493 | + throw new Exception("Missing required property"); | |
| 1494 | + } | |
| 1495 | + if (!property_exists($obj, 'type')) { | |
| 1496 | + throw new Exception("Missing required property"); | |
| 1497 | + } | |
| 1498 | + if (!property_exists($obj, 'value')) { | |
| 1499 | + throw new Exception("Missing required property"); | |
| 1500 | + } | |
| 1432 | 1501 | return new Out( |
| 1433 | 1502 | Out::fromAddr($obj->{'addr'}) |
| 1434 | 1503 | ,Out::fromN($obj->{'n'}) |
Test case
1 generated file · +108 −0test/inputs/json/misc/6c155.json
Mphpdefault / TopLevel.php+108 −0
| @@ -149,6 +149,12 @@ class TopLevel { | ||
| 149 | 149 | * @throws Exception |
| 150 | 150 | */ |
| 151 | 151 | public static function from(stdClass $obj): TopLevel { |
| 152 | + if (!property_exists($obj, 'metadata')) { | |
| 153 | + throw new Exception("Missing required property"); | |
| 154 | + } | |
| 155 | + if (!property_exists($obj, 'results')) { | |
| 156 | + throw new Exception("Missing required property"); | |
| 157 | + } | |
| 152 | 158 | return new TopLevel( |
| 153 | 159 | TopLevel::fromMetadata($obj->{'metadata'}) |
| 154 | 160 | ,TopLevel::fromResults($obj->{'results'}) |
| @@ -355,6 +361,15 @@ class Metadata { | ||
| 355 | 361 | * @throws Exception |
| 356 | 362 | */ |
| 357 | 363 | public static function from(stdClass $obj): Metadata { |
| 364 | + if (!property_exists($obj, 'executionTime')) { | |
| 365 | + throw new Exception("Missing required property"); | |
| 366 | + } | |
| 367 | + if (!property_exists($obj, 'responseInfo')) { | |
| 368 | + throw new Exception("Missing required property"); | |
| 369 | + } | |
| 370 | + if (!property_exists($obj, 'resultset')) { | |
| 371 | + throw new Exception("Missing required property"); | |
| 372 | + } | |
| 358 | 373 | return new Metadata( |
| 359 | 374 | Metadata::fromExecutionTime($obj->{'executionTime'}) |
| 360 | 375 | ,Metadata::fromResponseInfo($obj->{'responseInfo'}) |
| @@ -509,6 +524,12 @@ class ResponseInfo { | ||
| 509 | 524 | * @throws Exception |
| 510 | 525 | */ |
| 511 | 526 | public static function from(stdClass $obj): ResponseInfo { |
| 527 | + if (!property_exists($obj, 'developerMessage')) { | |
| 528 | + throw new Exception("Missing required property"); | |
| 529 | + } | |
| 530 | + if (!property_exists($obj, 'status')) { | |
| 531 | + throw new Exception("Missing required property"); | |
| 532 | + } | |
| 512 | 533 | return new ResponseInfo( |
| 513 | 534 | ResponseInfo::fromDeveloperMessage($obj->{'developerMessage'}) |
| 514 | 535 | ,ResponseInfo::fromStatus($obj->{'status'}) |
| @@ -713,6 +734,15 @@ class Resultset { | ||
| 713 | 734 | * @throws Exception |
| 714 | 735 | */ |
| 715 | 736 | public static function from(stdClass $obj): Resultset { |
| 737 | + if (!property_exists($obj, 'count')) { | |
| 738 | + throw new Exception("Missing required property"); | |
| 739 | + } | |
| 740 | + if (!property_exists($obj, 'page')) { | |
| 741 | + throw new Exception("Missing required property"); | |
| 742 | + } | |
| 743 | + if (!property_exists($obj, 'pagesize')) { | |
| 744 | + throw new Exception("Missing required property"); | |
| 745 | + } | |
| 716 | 746 | return new Resultset( |
| 717 | 747 | Resultset::fromCount($obj->{'count'}) |
| 718 | 748 | ,Resultset::fromPage($obj->{'page'}) |
| @@ -1546,6 +1576,48 @@ class Result { | ||
| 1546 | 1576 | * @throws Exception |
| 1547 | 1577 | */ |
| 1548 | 1578 | public static function from(stdClass $obj): Result { |
| 1579 | + if (!property_exists($obj, 'attachment')) { | |
| 1580 | + throw new Exception("Missing required property"); | |
| 1581 | + } | |
| 1582 | + if (!property_exists($obj, 'body')) { | |
| 1583 | + throw new Exception("Missing required property"); | |
| 1584 | + } | |
| 1585 | + if (!property_exists($obj, 'changed')) { | |
| 1586 | + throw new Exception("Missing required property"); | |
| 1587 | + } | |
| 1588 | + if (!property_exists($obj, 'component')) { | |
| 1589 | + throw new Exception("Missing required property"); | |
| 1590 | + } | |
| 1591 | + if (!property_exists($obj, 'created')) { | |
| 1592 | + throw new Exception("Missing required property"); | |
| 1593 | + } | |
| 1594 | + if (!property_exists($obj, 'date')) { | |
| 1595 | + throw new Exception("Missing required property"); | |
| 1596 | + } | |
| 1597 | + if (!property_exists($obj, 'image')) { | |
| 1598 | + throw new Exception("Missing required property"); | |
| 1599 | + } | |
| 1600 | + if (!property_exists($obj, 'location')) { | |
| 1601 | + throw new Exception("Missing required property"); | |
| 1602 | + } | |
| 1603 | + if (!property_exists($obj, 'teaser')) { | |
| 1604 | + throw new Exception("Missing required property"); | |
| 1605 | + } | |
| 1606 | + if (!property_exists($obj, 'title')) { | |
| 1607 | + throw new Exception("Missing required property"); | |
| 1608 | + } | |
| 1609 | + if (!property_exists($obj, 'topic')) { | |
| 1610 | + throw new Exception("Missing required property"); | |
| 1611 | + } | |
| 1612 | + if (!property_exists($obj, 'url')) { | |
| 1613 | + throw new Exception("Missing required property"); | |
| 1614 | + } | |
| 1615 | + if (!property_exists($obj, 'uuid')) { | |
| 1616 | + throw new Exception("Missing required property"); | |
| 1617 | + } | |
| 1618 | + if (!property_exists($obj, 'vuuid')) { | |
| 1619 | + throw new Exception("Missing required property"); | |
| 1620 | + } | |
| 1549 | 1621 | return new Result( |
| 1550 | 1622 | Result::fromAttachment($obj->{'attachment'}) |
| 1551 | 1623 | ,Result::fromBody($obj->{'body'}) |
| @@ -1725,6 +1797,12 @@ class Component { | ||
| 1725 | 1797 | * @throws Exception |
| 1726 | 1798 | */ |
| 1727 | 1799 | public static function from(stdClass $obj): Component { |
| 1800 | + if (!property_exists($obj, 'name')) { | |
| 1801 | + throw new Exception("Missing required property"); | |
| 1802 | + } | |
| 1803 | + if (!property_exists($obj, 'uuid')) { | |
| 1804 | + throw new Exception("Missing required property"); | |
| 1805 | + } | |
| 1728 | 1806 | return new Component( |
| 1729 | 1807 | Component::fromName($obj->{'name'}) |
| 1730 | 1808 | ,Component::fromUUID($obj->{'uuid'}) |
| @@ -2296,6 +2374,36 @@ class Location { | ||
| 2296 | 2374 | * @throws Exception |
| 2297 | 2375 | */ |
| 2298 | 2376 | public static function from(stdClass $obj): Location { |
| 2377 | + if (!property_exists($obj, 'administrative_area')) { | |
| 2378 | + throw new Exception("Missing required property"); | |
| 2379 | + } | |
| 2380 | + if (!property_exists($obj, 'country')) { | |
| 2381 | + throw new Exception("Missing required property"); | |
| 2382 | + } | |
| 2383 | + if (!property_exists($obj, 'fax_number')) { | |
| 2384 | + throw new Exception("Missing required property"); | |
| 2385 | + } | |
| 2386 | + if (!property_exists($obj, 'locality')) { | |
| 2387 | + throw new Exception("Missing required property"); | |
| 2388 | + } | |
| 2389 | + if (!property_exists($obj, 'mobile_number')) { | |
| 2390 | + throw new Exception("Missing required property"); | |
| 2391 | + } | |
| 2392 | + if (!property_exists($obj, 'phone_number')) { | |
| 2393 | + throw new Exception("Missing required property"); | |
| 2394 | + } | |
| 2395 | + if (!property_exists($obj, 'phone_number_extension')) { | |
| 2396 | + throw new Exception("Missing required property"); | |
| 2397 | + } | |
| 2398 | + if (!property_exists($obj, 'postal_code')) { | |
| 2399 | + throw new Exception("Missing required property"); | |
| 2400 | + } | |
| 2401 | + if (!property_exists($obj, 'sub_premise')) { | |
| 2402 | + throw new Exception("Missing required property"); | |
| 2403 | + } | |
| 2404 | + if (!property_exists($obj, 'thoroughfare')) { | |
| 2405 | + throw new Exception("Missing required property"); | |
| 2406 | + } | |
| 2299 | 2407 | return new Location( |
| 2300 | 2408 | Location::fromAdministrativeArea($obj->{'administrative_area'}) |
| 2301 | 2409 | ,Location::fromCountry($obj->{'country'}) |
Test case
1 generated file · +285 −0test/inputs/json/misc/6de06.json
Mphpdefault / TopLevel.php+285 −0
| @@ -137,6 +137,12 @@ class TopLevel { | ||
| 137 | 137 | * @throws Exception |
| 138 | 138 | */ |
| 139 | 139 | public static function from(stdClass $obj): TopLevel { |
| 140 | + if (!property_exists($obj, 'data')) { | |
| 141 | + throw new Exception("Missing required property"); | |
| 142 | + } | |
| 143 | + if (!property_exists($obj, 'kind')) { | |
| 144 | + throw new Exception("Missing required property"); | |
| 145 | + } | |
| 140 | 146 | return new TopLevel( |
| 141 | 147 | TopLevel::fromData($obj->{'data'}) |
| 142 | 148 | ,TopLevel::fromKind($obj->{'kind'}) |
| @@ -408,6 +414,18 @@ class TopLevelData { | ||
| 408 | 414 | * @throws Exception |
| 409 | 415 | */ |
| 410 | 416 | public static function from(stdClass $obj): TopLevelData { |
| 417 | + if (!property_exists($obj, 'after')) { | |
| 418 | + throw new Exception("Missing required property"); | |
| 419 | + } | |
| 420 | + if (!property_exists($obj, 'before')) { | |
| 421 | + throw new Exception("Missing required property"); | |
| 422 | + } | |
| 423 | + if (!property_exists($obj, 'children')) { | |
| 424 | + throw new Exception("Missing required property"); | |
| 425 | + } | |
| 426 | + if (!property_exists($obj, 'modhash')) { | |
| 427 | + throw new Exception("Missing required property"); | |
| 428 | + } | |
| 411 | 429 | return new TopLevelData( |
| 412 | 430 | TopLevelData::fromAfter($obj->{'after'}) |
| 413 | 431 | ,TopLevelData::fromBefore($obj->{'before'}) |
| @@ -566,6 +584,12 @@ class Child { | ||
| 566 | 584 | * @throws Exception |
| 567 | 585 | */ |
| 568 | 586 | public static function from(stdClass $obj): Child { |
| 587 | + if (!property_exists($obj, 'data')) { | |
| 588 | + throw new Exception("Missing required property"); | |
| 589 | + } | |
| 590 | + if (!property_exists($obj, 'kind')) { | |
| 591 | + throw new Exception("Missing required property"); | |
| 592 | + } | |
| 569 | 593 | return new Child( |
| 570 | 594 | Child::fromData($obj->{'data'}) |
| 571 | 595 | ,Child::fromKind($obj->{'kind'}) |
| @@ -4121,6 +4145,192 @@ class ChildData { | ||
| 4121 | 4145 | * @throws Exception |
| 4122 | 4146 | */ |
| 4123 | 4147 | public static function from(stdClass $obj): ChildData { |
| 4148 | + if (!property_exists($obj, 'approved_at_utc')) { | |
| 4149 | + throw new Exception("Missing required property"); | |
| 4150 | + } | |
| 4151 | + if (!property_exists($obj, 'approved_by')) { | |
| 4152 | + throw new Exception("Missing required property"); | |
| 4153 | + } | |
| 4154 | + if (!property_exists($obj, 'archived')) { | |
| 4155 | + throw new Exception("Missing required property"); | |
| 4156 | + } | |
| 4157 | + if (!property_exists($obj, 'author')) { | |
| 4158 | + throw new Exception("Missing required property"); | |
| 4159 | + } | |
| 4160 | + if (!property_exists($obj, 'author_flair_css_class')) { | |
| 4161 | + throw new Exception("Missing required property"); | |
| 4162 | + } | |
| 4163 | + if (!property_exists($obj, 'author_flair_text')) { | |
| 4164 | + throw new Exception("Missing required property"); | |
| 4165 | + } | |
| 4166 | + if (!property_exists($obj, 'banned_at_utc')) { | |
| 4167 | + throw new Exception("Missing required property"); | |
| 4168 | + } | |
| 4169 | + if (!property_exists($obj, 'banned_by')) { | |
| 4170 | + throw new Exception("Missing required property"); | |
| 4171 | + } | |
| 4172 | + if (!property_exists($obj, 'brand_safe')) { | |
| 4173 | + throw new Exception("Missing required property"); | |
| 4174 | + } | |
| 4175 | + if (!property_exists($obj, 'can_gild')) { | |
| 4176 | + throw new Exception("Missing required property"); | |
| 4177 | + } | |
| 4178 | + if (!property_exists($obj, 'can_mod_post')) { | |
| 4179 | + throw new Exception("Missing required property"); | |
| 4180 | + } | |
| 4181 | + if (!property_exists($obj, 'clicked')) { | |
| 4182 | + throw new Exception("Missing required property"); | |
| 4183 | + } | |
| 4184 | + if (!property_exists($obj, 'contest_mode')) { | |
| 4185 | + throw new Exception("Missing required property"); | |
| 4186 | + } | |
| 4187 | + if (!property_exists($obj, 'created')) { | |
| 4188 | + throw new Exception("Missing required property"); | |
| 4189 | + } | |
| 4190 | + if (!property_exists($obj, 'created_utc')) { | |
| 4191 | + throw new Exception("Missing required property"); | |
| 4192 | + } | |
| 4193 | + if (!property_exists($obj, 'distinguished')) { | |
| 4194 | + throw new Exception("Missing required property"); | |
| 4195 | + } | |
| 4196 | + if (!property_exists($obj, 'domain')) { | |
| 4197 | + throw new Exception("Missing required property"); | |
| 4198 | + } | |
| 4199 | + if (!property_exists($obj, 'downs')) { | |
| 4200 | + throw new Exception("Missing required property"); | |
| 4201 | + } | |
| 4202 | + if (!property_exists($obj, 'edited')) { | |
| 4203 | + throw new Exception("Missing required property"); | |
| 4204 | + } | |
| 4205 | + if (!property_exists($obj, 'gilded')) { | |
| 4206 | + throw new Exception("Missing required property"); | |
| 4207 | + } | |
| 4208 | + if (!property_exists($obj, 'hidden')) { | |
| 4209 | + throw new Exception("Missing required property"); | |
| 4210 | + } | |
| 4211 | + if (!property_exists($obj, 'hide_score')) { | |
| 4212 | + throw new Exception("Missing required property"); | |
| 4213 | + } | |
| 4214 | + if (!property_exists($obj, 'id')) { | |
| 4215 | + throw new Exception("Missing required property"); | |
| 4216 | + } | |
| 4217 | + if (!property_exists($obj, 'is_self')) { | |
| 4218 | + throw new Exception("Missing required property"); | |
| 4219 | + } | |
| 4220 | + if (!property_exists($obj, 'is_video')) { | |
| 4221 | + throw new Exception("Missing required property"); | |
| 4222 | + } | |
| 4223 | + if (!property_exists($obj, 'likes')) { | |
| 4224 | + throw new Exception("Missing required property"); | |
| 4225 | + } | |
| 4226 | + if (!property_exists($obj, 'link_flair_css_class')) { | |
| 4227 | + throw new Exception("Missing required property"); | |
| 4228 | + } | |
| 4229 | + if (!property_exists($obj, 'link_flair_text')) { | |
| 4230 | + throw new Exception("Missing required property"); | |
| 4231 | + } | |
| 4232 | + if (!property_exists($obj, 'locked')) { | |
| 4233 | + throw new Exception("Missing required property"); | |
| 4234 | + } | |
| 4235 | + if (!property_exists($obj, 'media')) { | |
| 4236 | + throw new Exception("Missing required property"); | |
| 4237 | + } | |
| 4238 | + if (!property_exists($obj, 'media_embed')) { | |
| 4239 | + throw new Exception("Missing required property"); | |
| 4240 | + } | |
| 4241 | + if (!property_exists($obj, 'mod_reports')) { | |
| 4242 | + throw new Exception("Missing required property"); | |
| 4243 | + } | |
| 4244 | + if (!property_exists($obj, 'name')) { | |
| 4245 | + throw new Exception("Missing required property"); | |
| 4246 | + } | |
| 4247 | + if (!property_exists($obj, 'num_comments')) { | |
| 4248 | + throw new Exception("Missing required property"); | |
| 4249 | + } | |
| 4250 | + if (!property_exists($obj, 'num_reports')) { | |
| 4251 | + throw new Exception("Missing required property"); | |
| 4252 | + } | |
| 4253 | + if (!property_exists($obj, 'over_18')) { | |
| 4254 | + throw new Exception("Missing required property"); | |
| 4255 | + } | |
| 4256 | + if (!property_exists($obj, 'permalink')) { | |
| 4257 | + throw new Exception("Missing required property"); | |
| 4258 | + } | |
| 4259 | + if (!property_exists($obj, 'quarantine')) { | |
| 4260 | + throw new Exception("Missing required property"); | |
| 4261 | + } | |
| 4262 | + if (!property_exists($obj, 'removal_reason')) { | |
| 4263 | + throw new Exception("Missing required property"); | |
| 4264 | + } | |
| 4265 | + if (!property_exists($obj, 'report_reasons')) { | |
| 4266 | + throw new Exception("Missing required property"); | |
| 4267 | + } | |
| 4268 | + if (!property_exists($obj, 'saved')) { | |
| 4269 | + throw new Exception("Missing required property"); | |
| 4270 | + } | |
| 4271 | + if (!property_exists($obj, 'score')) { | |
| 4272 | + throw new Exception("Missing required property"); | |
| 4273 | + } | |
| 4274 | + if (!property_exists($obj, 'secure_media')) { | |
| 4275 | + throw new Exception("Missing required property"); | |
| 4276 | + } | |
| 4277 | + if (!property_exists($obj, 'secure_media_embed')) { | |
| 4278 | + throw new Exception("Missing required property"); | |
| 4279 | + } | |
| 4280 | + if (!property_exists($obj, 'selftext')) { | |
| 4281 | + throw new Exception("Missing required property"); | |
| 4282 | + } | |
| 4283 | + if (!property_exists($obj, 'selftext_html')) { | |
| 4284 | + throw new Exception("Missing required property"); | |
| 4285 | + } | |
| 4286 | + if (!property_exists($obj, 'spoiler')) { | |
| 4287 | + throw new Exception("Missing required property"); | |
| 4288 | + } | |
| 4289 | + if (!property_exists($obj, 'stickied')) { | |
| 4290 | + throw new Exception("Missing required property"); | |
| 4291 | + } | |
| 4292 | + if (!property_exists($obj, 'subreddit')) { | |
| 4293 | + throw new Exception("Missing required property"); | |
| 4294 | + } | |
| 4295 | + if (!property_exists($obj, 'subreddit_id')) { | |
| 4296 | + throw new Exception("Missing required property"); | |
| 4297 | + } | |
| 4298 | + if (!property_exists($obj, 'subreddit_name_prefixed')) { | |
| 4299 | + throw new Exception("Missing required property"); | |
| 4300 | + } | |
| 4301 | + if (!property_exists($obj, 'subreddit_type')) { | |
| 4302 | + throw new Exception("Missing required property"); | |
| 4303 | + } | |
| 4304 | + if (!property_exists($obj, 'suggested_sort')) { | |
| 4305 | + throw new Exception("Missing required property"); | |
| 4306 | + } | |
| 4307 | + if (!property_exists($obj, 'thumbnail')) { | |
| 4308 | + throw new Exception("Missing required property"); | |
| 4309 | + } | |
| 4310 | + if (!property_exists($obj, 'thumbnail_height')) { | |
| 4311 | + throw new Exception("Missing required property"); | |
| 4312 | + } | |
| 4313 | + if (!property_exists($obj, 'thumbnail_width')) { | |
| 4314 | + throw new Exception("Missing required property"); | |
| 4315 | + } | |
| 4316 | + if (!property_exists($obj, 'title')) { | |
| 4317 | + throw new Exception("Missing required property"); | |
| 4318 | + } | |
| 4319 | + if (!property_exists($obj, 'ups')) { | |
| 4320 | + throw new Exception("Missing required property"); | |
| 4321 | + } | |
| 4322 | + if (!property_exists($obj, 'url')) { | |
| 4323 | + throw new Exception("Missing required property"); | |
| 4324 | + } | |
| 4325 | + if (!property_exists($obj, 'user_reports')) { | |
| 4326 | + throw new Exception("Missing required property"); | |
| 4327 | + } | |
| 4328 | + if (!property_exists($obj, 'view_count')) { | |
| 4329 | + throw new Exception("Missing required property"); | |
| 4330 | + } | |
| 4331 | + if (!property_exists($obj, 'visited')) { | |
| 4332 | + throw new Exception("Missing required property"); | |
| 4333 | + } | |
| 4124 | 4334 | return new ChildData( |
| 4125 | 4335 | ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'}) |
| 4126 | 4336 | ,ChildData::fromApprovedBy($obj->{'approved_by'}) |
| @@ -4398,6 +4608,12 @@ class Media { | ||
| 4398 | 4608 | * @throws Exception |
| 4399 | 4609 | */ |
| 4400 | 4610 | public static function from(stdClass $obj): Media { |
| 4611 | + if (!property_exists($obj, 'oembed')) { | |
| 4612 | + throw new Exception("Missing required property"); | |
| 4613 | + } | |
| 4614 | + if (!property_exists($obj, 'type')) { | |
| 4615 | + throw new Exception("Missing required property"); | |
| 4616 | + } | |
| 4401 | 4617 | return new Media( |
| 4402 | 4618 | Media::fromOembed($obj->{'oembed'}) |
| 4403 | 4619 | ,Media::fromType($obj->{'type'}) |
| @@ -5070,6 +5286,42 @@ class Oembed { | ||
| 5070 | 5286 | * @throws Exception |
| 5071 | 5287 | */ |
| 5072 | 5288 | public static function from(stdClass $obj): Oembed { |
| 5289 | + if (!property_exists($obj, 'description')) { | |
| 5290 | + throw new Exception("Missing required property"); | |
| 5291 | + } | |
| 5292 | + if (!property_exists($obj, 'height')) { | |
| 5293 | + throw new Exception("Missing required property"); | |
| 5294 | + } | |
| 5295 | + if (!property_exists($obj, 'html')) { | |
| 5296 | + throw new Exception("Missing required property"); | |
| 5297 | + } | |
| 5298 | + if (!property_exists($obj, 'provider_name')) { | |
| 5299 | + throw new Exception("Missing required property"); | |
| 5300 | + } | |
| 5301 | + if (!property_exists($obj, 'provider_url')) { | |
| 5302 | + throw new Exception("Missing required property"); | |
| 5303 | + } | |
| 5304 | + if (!property_exists($obj, 'thumbnail_height')) { | |
| 5305 | + throw new Exception("Missing required property"); | |
| 5306 | + } | |
| 5307 | + if (!property_exists($obj, 'thumbnail_url')) { | |
| 5308 | + throw new Exception("Missing required property"); | |
| 5309 | + } | |
| 5310 | + if (!property_exists($obj, 'thumbnail_width')) { | |
| 5311 | + throw new Exception("Missing required property"); | |
| 5312 | + } | |
| 5313 | + if (!property_exists($obj, 'title')) { | |
| 5314 | + throw new Exception("Missing required property"); | |
| 5315 | + } | |
| 5316 | + if (!property_exists($obj, 'type')) { | |
| 5317 | + throw new Exception("Missing required property"); | |
| 5318 | + } | |
| 5319 | + if (!property_exists($obj, 'version')) { | |
| 5320 | + throw new Exception("Missing required property"); | |
| 5321 | + } | |
| 5322 | + if (!property_exists($obj, 'width')) { | |
| 5323 | + throw new Exception("Missing required property"); | |
| 5324 | + } | |
| 5073 | 5325 | return new Oembed( |
| 5074 | 5326 | Oembed::fromDescription($obj->{'description'}) |
| 5075 | 5327 | ,Oembed::fromHeight($obj->{'height'}) |
| @@ -5607,6 +5859,12 @@ class Preview { | ||
| 5607 | 5859 | * @throws Exception |
| 5608 | 5860 | */ |
| 5609 | 5861 | public static function from(stdClass $obj): Preview { |
| 5862 | + if (!property_exists($obj, 'enabled')) { | |
| 5863 | + throw new Exception("Missing required property"); | |
| 5864 | + } | |
| 5865 | + if (!property_exists($obj, 'images')) { | |
| 5866 | + throw new Exception("Missing required property"); | |
| 5867 | + } | |
| 5610 | 5868 | return new Preview( |
| 5611 | 5869 | Preview::fromEnabled($obj->{'enabled'}) |
| 5612 | 5870 | ,Preview::fromImages($obj->{'images'}) |
| @@ -5877,6 +6135,18 @@ class Image { | ||
| 5877 | 6135 | * @throws Exception |
| 5878 | 6136 | */ |
| 5879 | 6137 | public static function from(stdClass $obj): Image { |
| 6138 | + if (!property_exists($obj, 'id')) { | |
| 6139 | + throw new Exception("Missing required property"); | |
| 6140 | + } | |
| 6141 | + if (!property_exists($obj, 'resolutions')) { | |
| 6142 | + throw new Exception("Missing required property"); | |
| 6143 | + } | |
| 6144 | + if (!property_exists($obj, 'source')) { | |
| 6145 | + throw new Exception("Missing required property"); | |
| 6146 | + } | |
| 6147 | + if (!property_exists($obj, 'variants')) { | |
| 6148 | + throw new Exception("Missing required property"); | |
| 6149 | + } | |
| 5880 | 6150 | return new Image( |
| 5881 | 6151 | Image::fromID($obj->{'id'}) |
| 5882 | 6152 | ,Image::fromResolutions($obj->{'resolutions'}) |
| @@ -6085,6 +6355,15 @@ class Source { | ||
| 6085 | 6355 | * @throws Exception |
| 6086 | 6356 | */ |
| 6087 | 6357 | public static function from(stdClass $obj): Source { |
| 6358 | + if (!property_exists($obj, 'height')) { | |
| 6359 | + throw new Exception("Missing required property"); | |
| 6360 | + } | |
| 6361 | + if (!property_exists($obj, 'url')) { | |
| 6362 | + throw new Exception("Missing required property"); | |
| 6363 | + } | |
| 6364 | + if (!property_exists($obj, 'width')) { | |
| 6365 | + throw new Exception("Missing required property"); | |
| 6366 | + } | |
| 6088 | 6367 | return new Source( |
| 6089 | 6368 | Source::fromHeight($obj->{'height'}) |
| 6090 | 6369 | ,Source::fromURL($obj->{'url'}) |
| @@ -6556,6 +6835,12 @@ class GIF { | ||
| 6556 | 6835 | * @throws Exception |
| 6557 | 6836 | */ |
| 6558 | 6837 | public static function from(stdClass $obj): GIF { |
| 6838 | + if (!property_exists($obj, 'resolutions')) { | |
| 6839 | + throw new Exception("Missing required property"); | |
| 6840 | + } | |
| 6841 | + if (!property_exists($obj, 'source')) { | |
| 6842 | + throw new Exception("Missing required property"); | |
| 6843 | + } | |
| 6559 | 6844 | return new GIF( |
| 6560 | 6845 | GIF::fromResolutions($obj->{'resolutions'}) |
| 6561 | 6846 | ,GIF::fromSource($obj->{'source'}) |
Test case
1 generated file · +180 −0test/inputs/json/misc/6dec6.json
Mphpdefault / TopLevel.php+180 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'query')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromQuery($obj->{'query'}) |
| 90 | 93 | ); |
| @@ -347,6 +350,18 @@ class Query { | ||
| 347 | 350 | * @throws Exception |
| 348 | 351 | */ |
| 349 | 352 | public static function from(stdClass $obj): Query { |
| 353 | + if (!property_exists($obj, 'count')) { | |
| 354 | + throw new Exception("Missing required property"); | |
| 355 | + } | |
| 356 | + if (!property_exists($obj, 'created')) { | |
| 357 | + throw new Exception("Missing required property"); | |
| 358 | + } | |
| 359 | + if (!property_exists($obj, 'lang')) { | |
| 360 | + throw new Exception("Missing required property"); | |
| 361 | + } | |
| 362 | + if (!property_exists($obj, 'results')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 350 | 365 | return new Query( |
| 351 | 366 | Query::fromCount($obj->{'count'}) |
| 352 | 367 | ,Query::fromCreated($obj->{'created'}) |
| @@ -452,6 +467,9 @@ class Results { | ||
| 452 | 467 | * @throws Exception |
| 453 | 468 | */ |
| 454 | 469 | public static function from(stdClass $obj): Results { |
| 470 | + if (!property_exists($obj, 'channel')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 455 | 473 | return new Results( |
| 456 | 474 | Results::fromChannel($obj->{'channel'}) |
| 457 | 475 | ); |
| @@ -1181,6 +1199,45 @@ class Channel { | ||
| 1181 | 1199 | * @throws Exception |
| 1182 | 1200 | */ |
| 1183 | 1201 | public static function from(stdClass $obj): Channel { |
| 1202 | + if (!property_exists($obj, 'astronomy')) { | |
| 1203 | + throw new Exception("Missing required property"); | |
| 1204 | + } | |
| 1205 | + if (!property_exists($obj, 'atmosphere')) { | |
| 1206 | + throw new Exception("Missing required property"); | |
| 1207 | + } | |
| 1208 | + if (!property_exists($obj, 'description')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'image')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1214 | + if (!property_exists($obj, 'item')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'language')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'lastBuildDate')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'link')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'location')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'title')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'ttl')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'units')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'wind')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1184 | 1241 | return new Channel( |
| 1185 | 1242 | Channel::fromAstronomy($obj->{'astronomy'}) |
| 1186 | 1243 | ,Channel::fromAtmosphere($obj->{'atmosphere'}) |
| @@ -1355,6 +1412,12 @@ class Astronomy { | ||
| 1355 | 1412 | * @throws Exception |
| 1356 | 1413 | */ |
| 1357 | 1414 | public static function from(stdClass $obj): Astronomy { |
| 1415 | + if (!property_exists($obj, 'sunrise')) { | |
| 1416 | + throw new Exception("Missing required property"); | |
| 1417 | + } | |
| 1418 | + if (!property_exists($obj, 'sunset')) { | |
| 1419 | + throw new Exception("Missing required property"); | |
| 1420 | + } | |
| 1358 | 1421 | return new Astronomy( |
| 1359 | 1422 | Astronomy::fromSunrise($obj->{'sunrise'}) |
| 1360 | 1423 | ,Astronomy::fromSunset($obj->{'sunset'}) |
| @@ -1611,6 +1674,18 @@ class Atmosphere { | ||
| 1611 | 1674 | * @throws Exception |
| 1612 | 1675 | */ |
| 1613 | 1676 | public static function from(stdClass $obj): Atmosphere { |
| 1677 | + if (!property_exists($obj, 'humidity')) { | |
| 1678 | + throw new Exception("Missing required property"); | |
| 1679 | + } | |
| 1680 | + if (!property_exists($obj, 'pressure')) { | |
| 1681 | + throw new Exception("Missing required property"); | |
| 1682 | + } | |
| 1683 | + if (!property_exists($obj, 'rising')) { | |
| 1684 | + throw new Exception("Missing required property"); | |
| 1685 | + } | |
| 1686 | + if (!property_exists($obj, 'visibility')) { | |
| 1687 | + throw new Exception("Missing required property"); | |
| 1688 | + } | |
| 1614 | 1689 | return new Atmosphere( |
| 1615 | 1690 | Atmosphere::fromHumidity($obj->{'humidity'}) |
| 1616 | 1691 | ,Atmosphere::fromPressure($obj->{'pressure'}) |
| @@ -1923,6 +1998,21 @@ class Image { | ||
| 1923 | 1998 | * @throws Exception |
| 1924 | 1999 | */ |
| 1925 | 2000 | public static function from(stdClass $obj): Image { |
| 2001 | + if (!property_exists($obj, 'height')) { | |
| 2002 | + throw new Exception("Missing required property"); | |
| 2003 | + } | |
| 2004 | + if (!property_exists($obj, 'link')) { | |
| 2005 | + throw new Exception("Missing required property"); | |
| 2006 | + } | |
| 2007 | + if (!property_exists($obj, 'title')) { | |
| 2008 | + throw new Exception("Missing required property"); | |
| 2009 | + } | |
| 2010 | + if (!property_exists($obj, 'url')) { | |
| 2011 | + throw new Exception("Missing required property"); | |
| 2012 | + } | |
| 2013 | + if (!property_exists($obj, 'width')) { | |
| 2014 | + throw new Exception("Missing required property"); | |
| 2015 | + } | |
| 1926 | 2016 | return new Image( |
| 1927 | 2017 | Image::fromHeight($obj->{'height'}) |
| 1928 | 2018 | ,Image::fromLink($obj->{'link'}) |
| @@ -2459,6 +2549,33 @@ class Item { | ||
| 2459 | 2549 | * @throws Exception |
| 2460 | 2550 | */ |
| 2461 | 2551 | public static function from(stdClass $obj): Item { |
| 2552 | + if (!property_exists($obj, 'condition')) { | |
| 2553 | + throw new Exception("Missing required property"); | |
| 2554 | + } | |
| 2555 | + if (!property_exists($obj, 'description')) { | |
| 2556 | + throw new Exception("Missing required property"); | |
| 2557 | + } | |
| 2558 | + if (!property_exists($obj, 'forecast')) { | |
| 2559 | + throw new Exception("Missing required property"); | |
| 2560 | + } | |
| 2561 | + if (!property_exists($obj, 'guid')) { | |
| 2562 | + throw new Exception("Missing required property"); | |
| 2563 | + } | |
| 2564 | + if (!property_exists($obj, 'lat')) { | |
| 2565 | + throw new Exception("Missing required property"); | |
| 2566 | + } | |
| 2567 | + if (!property_exists($obj, 'link')) { | |
| 2568 | + throw new Exception("Missing required property"); | |
| 2569 | + } | |
| 2570 | + if (!property_exists($obj, 'long')) { | |
| 2571 | + throw new Exception("Missing required property"); | |
| 2572 | + } | |
| 2573 | + if (!property_exists($obj, 'pubDate')) { | |
| 2574 | + throw new Exception("Missing required property"); | |
| 2575 | + } | |
| 2576 | + if (!property_exists($obj, 'title')) { | |
| 2577 | + throw new Exception("Missing required property"); | |
| 2578 | + } | |
| 2462 | 2579 | return new Item( |
| 2463 | 2580 | Item::fromCondition($obj->{'condition'}) |
| 2464 | 2581 | ,Item::fromDescription($obj->{'description'}) |
| @@ -2729,6 +2846,18 @@ class Condition { | ||
| 2729 | 2846 | * @throws Exception |
| 2730 | 2847 | */ |
| 2731 | 2848 | public static function from(stdClass $obj): Condition { |
| 2849 | + if (!property_exists($obj, 'code')) { | |
| 2850 | + throw new Exception("Missing required property"); | |
| 2851 | + } | |
| 2852 | + if (!property_exists($obj, 'date')) { | |
| 2853 | + throw new Exception("Missing required property"); | |
| 2854 | + } | |
| 2855 | + if (!property_exists($obj, 'temp')) { | |
| 2856 | + throw new Exception("Missing required property"); | |
| 2857 | + } | |
| 2858 | + if (!property_exists($obj, 'text')) { | |
| 2859 | + throw new Exception("Missing required property"); | |
| 2860 | + } | |
| 2732 | 2861 | return new Condition( |
| 2733 | 2862 | Condition::fromCode($obj->{'code'}) |
| 2734 | 2863 | ,Condition::fromDate($obj->{'date'}) |
| @@ -3094,6 +3223,24 @@ class Forecast { | ||
| 3094 | 3223 | * @throws Exception |
| 3095 | 3224 | */ |
| 3096 | 3225 | public static function from(stdClass $obj): Forecast { |
| 3226 | + if (!property_exists($obj, 'code')) { | |
| 3227 | + throw new Exception("Missing required property"); | |
| 3228 | + } | |
| 3229 | + if (!property_exists($obj, 'date')) { | |
| 3230 | + throw new Exception("Missing required property"); | |
| 3231 | + } | |
| 3232 | + if (!property_exists($obj, 'day')) { | |
| 3233 | + throw new Exception("Missing required property"); | |
| 3234 | + } | |
| 3235 | + if (!property_exists($obj, 'high')) { | |
| 3236 | + throw new Exception("Missing required property"); | |
| 3237 | + } | |
| 3238 | + if (!property_exists($obj, 'low')) { | |
| 3239 | + throw new Exception("Missing required property"); | |
| 3240 | + } | |
| 3241 | + if (!property_exists($obj, 'text')) { | |
| 3242 | + throw new Exception("Missing required property"); | |
| 3243 | + } | |
| 3097 | 3244 | return new Forecast( |
| 3098 | 3245 | Forecast::fromCode($obj->{'code'}) |
| 3099 | 3246 | ,Forecast::fromDate($obj->{'date'}) |
| @@ -3255,6 +3402,9 @@ class GUID { | ||
| 3255 | 3402 | * @throws Exception |
| 3256 | 3403 | */ |
| 3257 | 3404 | public static function from(stdClass $obj): GUID { |
| 3405 | + if (!property_exists($obj, 'isPermaLink')) { | |
| 3406 | + throw new Exception("Missing required property"); | |
| 3407 | + } | |
| 3258 | 3408 | return new GUID( |
| 3259 | 3409 | GUID::fromIsPermaLink($obj->{'isPermaLink'}) |
| 3260 | 3410 | ); |
| @@ -3457,6 +3607,15 @@ class Location { | ||
| 3457 | 3607 | * @throws Exception |
| 3458 | 3608 | */ |
| 3459 | 3609 | public static function from(stdClass $obj): Location { |
| 3610 | + if (!property_exists($obj, 'city')) { | |
| 3611 | + throw new Exception("Missing required property"); | |
| 3612 | + } | |
| 3613 | + if (!property_exists($obj, 'country')) { | |
| 3614 | + throw new Exception("Missing required property"); | |
| 3615 | + } | |
| 3616 | + if (!property_exists($obj, 'region')) { | |
| 3617 | + throw new Exception("Missing required property"); | |
| 3618 | + } | |
| 3460 | 3619 | return new Location( |
| 3461 | 3620 | Location::fromCity($obj->{'city'}) |
| 3462 | 3621 | ,Location::fromCountry($obj->{'country'}) |
| @@ -3715,6 +3874,18 @@ class Units { | ||
| 3715 | 3874 | * @throws Exception |
| 3716 | 3875 | */ |
| 3717 | 3876 | public static function from(stdClass $obj): Units { |
| 3877 | + if (!property_exists($obj, 'distance')) { | |
| 3878 | + throw new Exception("Missing required property"); | |
| 3879 | + } | |
| 3880 | + if (!property_exists($obj, 'pressure')) { | |
| 3881 | + throw new Exception("Missing required property"); | |
| 3882 | + } | |
| 3883 | + if (!property_exists($obj, 'speed')) { | |
| 3884 | + throw new Exception("Missing required property"); | |
| 3885 | + } | |
| 3886 | + if (!property_exists($obj, 'temperature')) { | |
| 3887 | + throw new Exception("Missing required property"); | |
| 3888 | + } | |
| 3718 | 3889 | return new Units( |
| 3719 | 3890 | Units::fromDistance($obj->{'distance'}) |
| 3720 | 3891 | ,Units::fromPressure($obj->{'pressure'}) |
| @@ -3923,6 +4094,15 @@ class Wind { | ||
| 3923 | 4094 | * @throws Exception |
| 3924 | 4095 | */ |
| 3925 | 4096 | public static function from(stdClass $obj): Wind { |
| 4097 | + if (!property_exists($obj, 'chill')) { | |
| 4098 | + throw new Exception("Missing required property"); | |
| 4099 | + } | |
| 4100 | + if (!property_exists($obj, 'direction')) { | |
| 4101 | + throw new Exception("Missing required property"); | |
| 4102 | + } | |
| 4103 | + if (!property_exists($obj, 'speed')) { | |
| 4104 | + throw new Exception("Missing required property"); | |
| 4105 | + } | |
| 3926 | 4106 | return new Wind( |
| 3927 | 4107 | Wind::fromChill($obj->{'chill'}) |
| 3928 | 4108 | ,Wind::fromDirection($obj->{'direction'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/6eb00.json
Mphpdefault / TopLevel.php+9 −0
| @@ -188,6 +188,15 @@ class TopLevel { | ||
| 188 | 188 | * @throws Exception |
| 189 | 189 | */ |
| 190 | 190 | public static function from(stdClass $obj): TopLevel { |
| 191 | + if (!property_exists($obj, 'DirectorateID')) { | |
| 192 | + throw new Exception("Missing required property"); | |
| 193 | + } | |
| 194 | + if (!property_exists($obj, 'Id')) { | |
| 195 | + throw new Exception("Missing required property"); | |
| 196 | + } | |
| 197 | + if (!property_exists($obj, 'Name')) { | |
| 198 | + throw new Exception("Missing required property"); | |
| 199 | + } | |
| 191 | 200 | return new TopLevel( |
| 192 | 201 | TopLevel::fromDirectorateID($obj->{'DirectorateID'}) |
| 193 | 202 | ,TopLevel::fromID($obj->{'Id'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/70c77.json
Mphpdefault / TopLevel.php+9 −0
| @@ -205,6 +205,15 @@ class TopLevel { | ||
| 205 | 205 | * @throws Exception |
| 206 | 206 | */ |
| 207 | 207 | public static function from(stdClass $obj): TopLevel { |
| 208 | + if (!property_exists($obj, 'base')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'date')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 214 | + if (!property_exists($obj, 'rates')) { | |
| 215 | + throw new Exception("Missing required property"); | |
| 216 | + } | |
| 208 | 217 | return new TopLevel( |
| 209 | 218 | TopLevel::fromBase($obj->{'base'}) |
| 210 | 219 | ,TopLevel::fromDate($obj->{'date'}) |
Test case
1 generated file · +171 −0test/inputs/json/misc/734ad.json
Mphpdefault / TopLevel.php+171 −0
| @@ -409,6 +409,27 @@ class TopLevel { | ||
| 409 | 409 | * @throws Exception |
| 410 | 410 | */ |
| 411 | 411 | public static function from(stdClass $obj): TopLevel { |
| 412 | + if (!property_exists($obj, 'count')) { | |
| 413 | + throw new Exception("Missing required property"); | |
| 414 | + } | |
| 415 | + if (!property_exists($obj, 'facets')) { | |
| 416 | + throw new Exception("Missing required property"); | |
| 417 | + } | |
| 418 | + if (!property_exists($obj, 'limit')) { | |
| 419 | + throw new Exception("Missing required property"); | |
| 420 | + } | |
| 421 | + if (!property_exists($obj, 'next')) { | |
| 422 | + throw new Exception("Missing required property"); | |
| 423 | + } | |
| 424 | + if (!property_exists($obj, 'offset')) { | |
| 425 | + throw new Exception("Missing required property"); | |
| 426 | + } | |
| 427 | + if (!property_exists($obj, 'previous')) { | |
| 428 | + throw new Exception("Missing required property"); | |
| 429 | + } | |
| 430 | + if (!property_exists($obj, 'results')) { | |
| 431 | + throw new Exception("Missing required property"); | |
| 432 | + } | |
| 412 | 433 | return new TopLevel( |
| 413 | 434 | TopLevel::fromCount($obj->{'count'}) |
| 414 | 435 | ,TopLevel::fromFacets($obj->{'facets'}) |
| @@ -3780,6 +3801,156 @@ class Result { | ||
| 3780 | 3801 | * @throws Exception |
| 3781 | 3802 | */ |
| 3782 | 3803 | public static function from(stdClass $obj): Result { |
| 3804 | + if (!property_exists($obj, 'acronym')) { | |
| 3805 | + throw new Exception("Missing required property"); | |
| 3806 | + } | |
| 3807 | + if (!property_exists($obj, 'activity_consult_committees')) { | |
| 3808 | + throw new Exception("Missing required property"); | |
| 3809 | + } | |
| 3810 | + if (!property_exists($obj, 'activity_eu_legislative')) { | |
| 3811 | + throw new Exception("Missing required property"); | |
| 3812 | + } | |
| 3813 | + if (!property_exists($obj, 'activity_expert_groups')) { | |
| 3814 | + throw new Exception("Missing required property"); | |
| 3815 | + } | |
| 3816 | + if (!property_exists($obj, 'activity_high_level_groups')) { | |
| 3817 | + throw new Exception("Missing required property"); | |
| 3818 | + } | |
| 3819 | + if (!property_exists($obj, 'activity_industry_forums')) { | |
| 3820 | + throw new Exception("Missing required property"); | |
| 3821 | + } | |
| 3822 | + if (!property_exists($obj, 'activity_inter_groups')) { | |
| 3823 | + throw new Exception("Missing required property"); | |
| 3824 | + } | |
| 3825 | + if (!property_exists($obj, 'activity_other')) { | |
| 3826 | + throw new Exception("Missing required property"); | |
| 3827 | + } | |
| 3828 | + if (!property_exists($obj, 'activity_relevant_comm')) { | |
| 3829 | + throw new Exception("Missing required property"); | |
| 3830 | + } | |
| 3831 | + if (!property_exists($obj, 'code_of_conduct')) { | |
| 3832 | + throw new Exception("Missing required property"); | |
| 3833 | + } | |
| 3834 | + if (!property_exists($obj, 'contact_country')) { | |
| 3835 | + throw new Exception("Missing required property"); | |
| 3836 | + } | |
| 3837 | + if (!property_exists($obj, 'created_at')) { | |
| 3838 | + throw new Exception("Missing required property"); | |
| 3839 | + } | |
| 3840 | + if (!property_exists($obj, 'entity')) { | |
| 3841 | + throw new Exception("Missing required property"); | |
| 3842 | + } | |
| 3843 | + if (!property_exists($obj, 'goals')) { | |
| 3844 | + throw new Exception("Missing required property"); | |
| 3845 | + } | |
| 3846 | + if (!property_exists($obj, 'head')) { | |
| 3847 | + throw new Exception("Missing required property"); | |
| 3848 | + } | |
| 3849 | + if (!property_exists($obj, 'head_office_country')) { | |
| 3850 | + throw new Exception("Missing required property"); | |
| 3851 | + } | |
| 3852 | + if (!property_exists($obj, 'head_office_lat')) { | |
| 3853 | + throw new Exception("Missing required property"); | |
| 3854 | + } | |
| 3855 | + if (!property_exists($obj, 'head_office_lon')) { | |
| 3856 | + throw new Exception("Missing required property"); | |
| 3857 | + } | |
| 3858 | + if (!property_exists($obj, 'head_office_phone')) { | |
| 3859 | + throw new Exception("Missing required property"); | |
| 3860 | + } | |
| 3861 | + if (!property_exists($obj, 'head_office_post_code')) { | |
| 3862 | + throw new Exception("Missing required property"); | |
| 3863 | + } | |
| 3864 | + if (!property_exists($obj, 'head_office_postbox')) { | |
| 3865 | + throw new Exception("Missing required property"); | |
| 3866 | + } | |
| 3867 | + if (!property_exists($obj, 'head_office_street')) { | |
| 3868 | + throw new Exception("Missing required property"); | |
| 3869 | + } | |
| 3870 | + if (!property_exists($obj, 'head_office_town')) { | |
| 3871 | + throw new Exception("Missing required property"); | |
| 3872 | + } | |
| 3873 | + if (!property_exists($obj, 'id')) { | |
| 3874 | + throw new Exception("Missing required property"); | |
| 3875 | + } | |
| 3876 | + if (!property_exists($obj, 'identification_code')) { | |
| 3877 | + throw new Exception("Missing required property"); | |
| 3878 | + } | |
| 3879 | + if (!property_exists($obj, 'info_members')) { | |
| 3880 | + throw new Exception("Missing required property"); | |
| 3881 | + } | |
| 3882 | + if (!property_exists($obj, 'last_update_date')) { | |
| 3883 | + throw new Exception("Missing required property"); | |
| 3884 | + } | |
| 3885 | + if (!property_exists($obj, 'legal')) { | |
| 3886 | + throw new Exception("Missing required property"); | |
| 3887 | + } | |
| 3888 | + if (!property_exists($obj, 'legal_status')) { | |
| 3889 | + throw new Exception("Missing required property"); | |
| 3890 | + } | |
| 3891 | + if (!property_exists($obj, 'main_category')) { | |
| 3892 | + throw new Exception("Missing required property"); | |
| 3893 | + } | |
| 3894 | + if (!property_exists($obj, 'main_category_title')) { | |
| 3895 | + throw new Exception("Missing required property"); | |
| 3896 | + } | |
| 3897 | + if (!property_exists($obj, 'members')) { | |
| 3898 | + throw new Exception("Missing required property"); | |
| 3899 | + } | |
| 3900 | + if (!property_exists($obj, 'members_100')) { | |
| 3901 | + throw new Exception("Missing required property"); | |
| 3902 | + } | |
| 3903 | + if (!property_exists($obj, 'members_25')) { | |
| 3904 | + throw new Exception("Missing required property"); | |
| 3905 | + } | |
| 3906 | + if (!property_exists($obj, 'members_50')) { | |
| 3907 | + throw new Exception("Missing required property"); | |
| 3908 | + } | |
| 3909 | + if (!property_exists($obj, 'members_75')) { | |
| 3910 | + throw new Exception("Missing required property"); | |
| 3911 | + } | |
| 3912 | + if (!property_exists($obj, 'members_fte')) { | |
| 3913 | + throw new Exception("Missing required property"); | |
| 3914 | + } | |
| 3915 | + if (!property_exists($obj, 'name')) { | |
| 3916 | + throw new Exception("Missing required property"); | |
| 3917 | + } | |
| 3918 | + if (!property_exists($obj, 'native_name')) { | |
| 3919 | + throw new Exception("Missing required property"); | |
| 3920 | + } | |
| 3921 | + if (!property_exists($obj, 'networking')) { | |
| 3922 | + throw new Exception("Missing required property"); | |
| 3923 | + } | |
| 3924 | + if (!property_exists($obj, 'number_of_natural_persons')) { | |
| 3925 | + throw new Exception("Missing required property"); | |
| 3926 | + } | |
| 3927 | + if (!property_exists($obj, 'other_code_of_conduct')) { | |
| 3928 | + throw new Exception("Missing required property"); | |
| 3929 | + } | |
| 3930 | + if (!property_exists($obj, 'registration_date')) { | |
| 3931 | + throw new Exception("Missing required property"); | |
| 3932 | + } | |
| 3933 | + if (!property_exists($obj, 'status')) { | |
| 3934 | + throw new Exception("Missing required property"); | |
| 3935 | + } | |
| 3936 | + if (!property_exists($obj, 'structure_members')) { | |
| 3937 | + throw new Exception("Missing required property"); | |
| 3938 | + } | |
| 3939 | + if (!property_exists($obj, 'sub_category')) { | |
| 3940 | + throw new Exception("Missing required property"); | |
| 3941 | + } | |
| 3942 | + if (!property_exists($obj, 'sub_category_title')) { | |
| 3943 | + throw new Exception("Missing required property"); | |
| 3944 | + } | |
| 3945 | + if (!property_exists($obj, 'updated_at')) { | |
| 3946 | + throw new Exception("Missing required property"); | |
| 3947 | + } | |
| 3948 | + if (!property_exists($obj, 'uri')) { | |
| 3949 | + throw new Exception("Missing required property"); | |
| 3950 | + } | |
| 3951 | + if (!property_exists($obj, 'web_site_url')) { | |
| 3952 | + throw new Exception("Missing required property"); | |
| 3953 | + } | |
| 3783 | 3954 | return new Result( |
| 3784 | 3955 | Result::fromAcronym($obj->{'acronym'}) |
| 3785 | 3956 | ,Result::fromActivityConsultCommittees($obj->{'activity_consult_committees'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/75912.json
Mphpdefault / TopLevel.php+9 −0
| @@ -205,6 +205,15 @@ class TopLevel { | ||
| 205 | 205 | * @throws Exception |
| 206 | 206 | */ |
| 207 | 207 | public static function from(stdClass $obj): TopLevel { |
| 208 | + if (!property_exists($obj, 'base')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'date')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 214 | + if (!property_exists($obj, 'rates')) { | |
| 215 | + throw new Exception("Missing required property"); | |
| 216 | + } | |
| 208 | 217 | return new TopLevel( |
| 209 | 218 | TopLevel::fromBase($obj->{'base'}) |
| 210 | 219 | ,TopLevel::fromDate($obj->{'date'}) |
Test case
1 generated file · +204 −0test/inputs/json/misc/7681c.json
Mphpdefault / TopLevel.php+204 −0
| @@ -202,6 +202,15 @@ class TopLevel { | ||
| 202 | 202 | * @throws Exception |
| 203 | 203 | */ |
| 204 | 204 | public static function from(stdClass $obj): TopLevel { |
| 205 | + if (!property_exists($obj, 'data')) { | |
| 206 | + throw new Exception("Missing required property"); | |
| 207 | + } | |
| 208 | + if (!property_exists($obj, 'meta')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'pagination')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 205 | 214 | return new TopLevel( |
| 206 | 215 | TopLevel::fromData($obj->{'data'}) |
| 207 | 216 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -1203,6 +1212,57 @@ class Datum { | ||
| 1203 | 1212 | * @throws Exception |
| 1204 | 1213 | */ |
| 1205 | 1214 | public static function from(stdClass $obj): Datum { |
| 1215 | + if (!property_exists($obj, 'bitly_gif_url')) { | |
| 1216 | + throw new Exception("Missing required property"); | |
| 1217 | + } | |
| 1218 | + if (!property_exists($obj, 'bitly_url')) { | |
| 1219 | + throw new Exception("Missing required property"); | |
| 1220 | + } | |
| 1221 | + if (!property_exists($obj, 'content_url')) { | |
| 1222 | + throw new Exception("Missing required property"); | |
| 1223 | + } | |
| 1224 | + if (!property_exists($obj, 'embed_url')) { | |
| 1225 | + throw new Exception("Missing required property"); | |
| 1226 | + } | |
| 1227 | + if (!property_exists($obj, 'id')) { | |
| 1228 | + throw new Exception("Missing required property"); | |
| 1229 | + } | |
| 1230 | + if (!property_exists($obj, 'images')) { | |
| 1231 | + throw new Exception("Missing required property"); | |
| 1232 | + } | |
| 1233 | + if (!property_exists($obj, 'import_datetime')) { | |
| 1234 | + throw new Exception("Missing required property"); | |
| 1235 | + } | |
| 1236 | + if (!property_exists($obj, 'is_indexable')) { | |
| 1237 | + throw new Exception("Missing required property"); | |
| 1238 | + } | |
| 1239 | + if (!property_exists($obj, 'rating')) { | |
| 1240 | + throw new Exception("Missing required property"); | |
| 1241 | + } | |
| 1242 | + if (!property_exists($obj, 'slug')) { | |
| 1243 | + throw new Exception("Missing required property"); | |
| 1244 | + } | |
| 1245 | + if (!property_exists($obj, 'source')) { | |
| 1246 | + throw new Exception("Missing required property"); | |
| 1247 | + } | |
| 1248 | + if (!property_exists($obj, 'source_post_url')) { | |
| 1249 | + throw new Exception("Missing required property"); | |
| 1250 | + } | |
| 1251 | + if (!property_exists($obj, 'source_tld')) { | |
| 1252 | + throw new Exception("Missing required property"); | |
| 1253 | + } | |
| 1254 | + if (!property_exists($obj, 'trending_datetime')) { | |
| 1255 | + throw new Exception("Missing required property"); | |
| 1256 | + } | |
| 1257 | + if (!property_exists($obj, 'type')) { | |
| 1258 | + throw new Exception("Missing required property"); | |
| 1259 | + } | |
| 1260 | + if (!property_exists($obj, 'url')) { | |
| 1261 | + throw new Exception("Missing required property"); | |
| 1262 | + } | |
| 1263 | + if (!property_exists($obj, 'username')) { | |
| 1264 | + throw new Exception("Missing required property"); | |
| 1265 | + } | |
| 1206 | 1266 | return new Datum( |
| 1207 | 1267 | Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'}) |
| 1208 | 1268 | ,Datum::fromBitlyURL($obj->{'bitly_url'}) |
| @@ -2512,6 +2572,72 @@ class Images { | ||
| 2512 | 2572 | * @throws Exception |
| 2513 | 2573 | */ |
| 2514 | 2574 | public static function from(stdClass $obj): Images { |
| 2575 | + if (!property_exists($obj, 'downsized')) { | |
| 2576 | + throw new Exception("Missing required property"); | |
| 2577 | + } | |
| 2578 | + if (!property_exists($obj, 'downsized_large')) { | |
| 2579 | + throw new Exception("Missing required property"); | |
| 2580 | + } | |
| 2581 | + if (!property_exists($obj, 'downsized_medium')) { | |
| 2582 | + throw new Exception("Missing required property"); | |
| 2583 | + } | |
| 2584 | + if (!property_exists($obj, 'downsized_small')) { | |
| 2585 | + throw new Exception("Missing required property"); | |
| 2586 | + } | |
| 2587 | + if (!property_exists($obj, 'downsized_still')) { | |
| 2588 | + throw new Exception("Missing required property"); | |
| 2589 | + } | |
| 2590 | + if (!property_exists($obj, 'fixed_height')) { | |
| 2591 | + throw new Exception("Missing required property"); | |
| 2592 | + } | |
| 2593 | + if (!property_exists($obj, 'fixed_height_downsampled')) { | |
| 2594 | + throw new Exception("Missing required property"); | |
| 2595 | + } | |
| 2596 | + if (!property_exists($obj, 'fixed_height_small')) { | |
| 2597 | + throw new Exception("Missing required property"); | |
| 2598 | + } | |
| 2599 | + if (!property_exists($obj, 'fixed_height_small_still')) { | |
| 2600 | + throw new Exception("Missing required property"); | |
| 2601 | + } | |
| 2602 | + if (!property_exists($obj, 'fixed_height_still')) { | |
| 2603 | + throw new Exception("Missing required property"); | |
| 2604 | + } | |
| 2605 | + if (!property_exists($obj, 'fixed_width')) { | |
| 2606 | + throw new Exception("Missing required property"); | |
| 2607 | + } | |
| 2608 | + if (!property_exists($obj, 'fixed_width_downsampled')) { | |
| 2609 | + throw new Exception("Missing required property"); | |
| 2610 | + } | |
| 2611 | + if (!property_exists($obj, 'fixed_width_small')) { | |
| 2612 | + throw new Exception("Missing required property"); | |
| 2613 | + } | |
| 2614 | + if (!property_exists($obj, 'fixed_width_small_still')) { | |
| 2615 | + throw new Exception("Missing required property"); | |
| 2616 | + } | |
| 2617 | + if (!property_exists($obj, 'fixed_width_still')) { | |
| 2618 | + throw new Exception("Missing required property"); | |
| 2619 | + } | |
| 2620 | + if (!property_exists($obj, 'looping')) { | |
| 2621 | + throw new Exception("Missing required property"); | |
| 2622 | + } | |
| 2623 | + if (!property_exists($obj, 'original')) { | |
| 2624 | + throw new Exception("Missing required property"); | |
| 2625 | + } | |
| 2626 | + if (!property_exists($obj, 'original_mp4')) { | |
| 2627 | + throw new Exception("Missing required property"); | |
| 2628 | + } | |
| 2629 | + if (!property_exists($obj, 'original_still')) { | |
| 2630 | + throw new Exception("Missing required property"); | |
| 2631 | + } | |
| 2632 | + if (!property_exists($obj, 'preview')) { | |
| 2633 | + throw new Exception("Missing required property"); | |
| 2634 | + } | |
| 2635 | + if (!property_exists($obj, 'preview_gif')) { | |
| 2636 | + throw new Exception("Missing required property"); | |
| 2637 | + } | |
| 2638 | + if (!property_exists($obj, 'preview_webp')) { | |
| 2639 | + throw new Exception("Missing required property"); | |
| 2640 | + } | |
| 2515 | 2641 | return new Images( |
| 2516 | 2642 | Images::fromDownsized($obj->{'downsized'}) |
| 2517 | 2643 | ,Images::fromDownsizedLarge($obj->{'downsized_large'}) |
| @@ -2820,6 +2946,15 @@ class Downsized { | ||
| 2820 | 2946 | * @throws Exception |
| 2821 | 2947 | */ |
| 2822 | 2948 | public static function from(stdClass $obj): Downsized { |
| 2949 | + if (!property_exists($obj, 'height')) { | |
| 2950 | + throw new Exception("Missing required property"); | |
| 2951 | + } | |
| 2952 | + if (!property_exists($obj, 'url')) { | |
| 2953 | + throw new Exception("Missing required property"); | |
| 2954 | + } | |
| 2955 | + if (!property_exists($obj, 'width')) { | |
| 2956 | + throw new Exception("Missing required property"); | |
| 2957 | + } | |
| 2823 | 2958 | return new Downsized( |
| 2824 | 2959 | Downsized::fromHeight($obj->{'height'}) |
| 2825 | 2960 | ,Downsized::fromSize($obj->{'size'}) |
| @@ -3080,6 +3215,18 @@ class DownsizedSmall { | ||
| 3080 | 3215 | * @throws Exception |
| 3081 | 3216 | */ |
| 3082 | 3217 | public static function from(stdClass $obj): DownsizedSmall { |
| 3218 | + if (!property_exists($obj, 'height')) { | |
| 3219 | + throw new Exception("Missing required property"); | |
| 3220 | + } | |
| 3221 | + if (!property_exists($obj, 'mp4')) { | |
| 3222 | + throw new Exception("Missing required property"); | |
| 3223 | + } | |
| 3224 | + if (!property_exists($obj, 'mp4_size')) { | |
| 3225 | + throw new Exception("Missing required property"); | |
| 3226 | + } | |
| 3227 | + if (!property_exists($obj, 'width')) { | |
| 3228 | + throw new Exception("Missing required property"); | |
| 3229 | + } | |
| 3083 | 3230 | return new DownsizedSmall( |
| 3084 | 3231 | DownsizedSmall::fromHeight($obj->{'height'}) |
| 3085 | 3232 | ,DownsizedSmall::fromMp4($obj->{'mp4'}) |
| @@ -3692,6 +3839,24 @@ class FixedHeight { | ||
| 3692 | 3839 | * @throws Exception |
| 3693 | 3840 | */ |
| 3694 | 3841 | public static function from(stdClass $obj): FixedHeight { |
| 3842 | + if (!property_exists($obj, 'height')) { | |
| 3843 | + throw new Exception("Missing required property"); | |
| 3844 | + } | |
| 3845 | + if (!property_exists($obj, 'size')) { | |
| 3846 | + throw new Exception("Missing required property"); | |
| 3847 | + } | |
| 3848 | + if (!property_exists($obj, 'url')) { | |
| 3849 | + throw new Exception("Missing required property"); | |
| 3850 | + } | |
| 3851 | + if (!property_exists($obj, 'webp')) { | |
| 3852 | + throw new Exception("Missing required property"); | |
| 3853 | + } | |
| 3854 | + if (!property_exists($obj, 'webp_size')) { | |
| 3855 | + throw new Exception("Missing required property"); | |
| 3856 | + } | |
| 3857 | + if (!property_exists($obj, 'width')) { | |
| 3858 | + throw new Exception("Missing required property"); | |
| 3859 | + } | |
| 3695 | 3860 | return new FixedHeight( |
| 3696 | 3861 | FixedHeight::fromFrames($obj->{'frames'}) |
| 3697 | 3862 | ,FixedHeight::fromHash($obj->{'hash'}) |
| @@ -3860,6 +4025,12 @@ class Looping { | ||
| 3860 | 4025 | * @throws Exception |
| 3861 | 4026 | */ |
| 3862 | 4027 | public static function from(stdClass $obj): Looping { |
| 4028 | + if (!property_exists($obj, 'mp4')) { | |
| 4029 | + throw new Exception("Missing required property"); | |
| 4030 | + } | |
| 4031 | + if (!property_exists($obj, 'mp4_size')) { | |
| 4032 | + throw new Exception("Missing required property"); | |
| 4033 | + } | |
| 3863 | 4034 | return new Looping( |
| 3864 | 4035 | Looping::fromMp4($obj->{'mp4'}) |
| 3865 | 4036 | ,Looping::fromMp4Size($obj->{'mp4_size'}) |
| @@ -4328,6 +4499,21 @@ class User { | ||
| 4328 | 4499 | * @throws Exception |
| 4329 | 4500 | */ |
| 4330 | 4501 | public static function from(stdClass $obj): User { |
| 4502 | + if (!property_exists($obj, 'avatar_url')) { | |
| 4503 | + throw new Exception("Missing required property"); | |
| 4504 | + } | |
| 4505 | + if (!property_exists($obj, 'banner_url')) { | |
| 4506 | + throw new Exception("Missing required property"); | |
| 4507 | + } | |
| 4508 | + if (!property_exists($obj, 'display_name')) { | |
| 4509 | + throw new Exception("Missing required property"); | |
| 4510 | + } | |
| 4511 | + if (!property_exists($obj, 'profile_url')) { | |
| 4512 | + throw new Exception("Missing required property"); | |
| 4513 | + } | |
| 4514 | + if (!property_exists($obj, 'username')) { | |
| 4515 | + throw new Exception("Missing required property"); | |
| 4516 | + } | |
| 4331 | 4517 | return new User( |
| 4332 | 4518 | User::fromAvatarURL($obj->{'avatar_url'}) |
| 4333 | 4519 | ,User::fromBannerURL($obj->{'banner_url'}) |
| @@ -4597,6 +4783,15 @@ class Meta { | ||
| 4597 | 4783 | * @throws Exception |
| 4598 | 4784 | */ |
| 4599 | 4785 | public static function from(stdClass $obj): Meta { |
| 4786 | + if (!property_exists($obj, 'msg')) { | |
| 4787 | + throw new Exception("Missing required property"); | |
| 4788 | + } | |
| 4789 | + if (!property_exists($obj, 'response_id')) { | |
| 4790 | + throw new Exception("Missing required property"); | |
| 4791 | + } | |
| 4792 | + if (!property_exists($obj, 'status')) { | |
| 4793 | + throw new Exception("Missing required property"); | |
| 4794 | + } | |
| 4600 | 4795 | return new Meta( |
| 4601 | 4796 | Meta::fromMsg($obj->{'msg'}) |
| 4602 | 4797 | ,Meta::fromResponseID($obj->{'response_id'}) |
| @@ -4803,6 +4998,15 @@ class Pagination { | ||
| 4803 | 4998 | * @throws Exception |
| 4804 | 4999 | */ |
| 4805 | 5000 | public static function from(stdClass $obj): Pagination { |
| 5001 | + if (!property_exists($obj, 'count')) { | |
| 5002 | + throw new Exception("Missing required property"); | |
| 5003 | + } | |
| 5004 | + if (!property_exists($obj, 'offset')) { | |
| 5005 | + throw new Exception("Missing required property"); | |
| 5006 | + } | |
| 5007 | + if (!property_exists($obj, 'total_count')) { | |
| 5008 | + throw new Exception("Missing required property"); | |
| 5009 | + } | |
| 4806 | 5010 | return new Pagination( |
| 4807 | 5011 | Pagination::fromCount($obj->{'count'}) |
| 4808 | 5012 | ,Pagination::fromOffset($obj->{'offset'}) |
Test case
1 generated file · +312 −0test/inputs/json/misc/76ae1.json
Mphpdefault / TopLevel.php+312 −0
| @@ -479,6 +479,30 @@ class TopLevel { | ||
| 479 | 479 | * @throws Exception |
| 480 | 480 | */ |
| 481 | 481 | public static function from(stdClass $obj): TopLevel { |
| 482 | + if (!property_exists($obj, 'basePath')) { | |
| 483 | + throw new Exception("Missing required property"); | |
| 484 | + } | |
| 485 | + if (!property_exists($obj, 'definitions')) { | |
| 486 | + throw new Exception("Missing required property"); | |
| 487 | + } | |
| 488 | + if (!property_exists($obj, 'host')) { | |
| 489 | + throw new Exception("Missing required property"); | |
| 490 | + } | |
| 491 | + if (!property_exists($obj, 'info')) { | |
| 492 | + throw new Exception("Missing required property"); | |
| 493 | + } | |
| 494 | + if (!property_exists($obj, 'paths')) { | |
| 495 | + throw new Exception("Missing required property"); | |
| 496 | + } | |
| 497 | + if (!property_exists($obj, 'produces')) { | |
| 498 | + throw new Exception("Missing required property"); | |
| 499 | + } | |
| 500 | + if (!property_exists($obj, 'schemes')) { | |
| 501 | + throw new Exception("Missing required property"); | |
| 502 | + } | |
| 503 | + if (!property_exists($obj, 'swagger')) { | |
| 504 | + throw new Exception("Missing required property"); | |
| 505 | + } | |
| 482 | 506 | return new TopLevel( |
| 483 | 507 | TopLevel::fromBasePath($obj->{'basePath'}) |
| 484 | 508 | ,TopLevel::fromDefinitions($obj->{'definitions'}) |
| @@ -1228,6 +1252,45 @@ class Definitions { | ||
| 1228 | 1252 | * @throws Exception |
| 1229 | 1253 | */ |
| 1230 | 1254 | public static function from(stdClass $obj): Definitions { |
| 1255 | + if (!property_exists($obj, 'Article')) { | |
| 1256 | + throw new Exception("Missing required property"); | |
| 1257 | + } | |
| 1258 | + if (!property_exists($obj, 'Center')) { | |
| 1259 | + throw new Exception("Missing required property"); | |
| 1260 | + } | |
| 1261 | + if (!property_exists($obj, 'DeMinimis')) { | |
| 1262 | + throw new Exception("Missing required property"); | |
| 1263 | + } | |
| 1264 | + if (!property_exists($obj, 'Event')) { | |
| 1265 | + throw new Exception("Missing required property"); | |
| 1266 | + } | |
| 1267 | + if (!property_exists($obj, 'FAQ')) { | |
| 1268 | + throw new Exception("Missing required property"); | |
| 1269 | + } | |
| 1270 | + if (!property_exists($obj, 'Lead')) { | |
| 1271 | + throw new Exception("Missing required property"); | |
| 1272 | + } | |
| 1273 | + if (!property_exists($obj, 'List')) { | |
| 1274 | + throw new Exception("Missing required property"); | |
| 1275 | + } | |
| 1276 | + if (!property_exists($obj, 'MarketIntelligence')) { | |
| 1277 | + throw new Exception("Missing required property"); | |
| 1278 | + } | |
| 1279 | + if (!property_exists($obj, 'Office')) { | |
| 1280 | + throw new Exception("Missing required property"); | |
| 1281 | + } | |
| 1282 | + if (!property_exists($obj, 'Provider')) { | |
| 1283 | + throw new Exception("Missing required property"); | |
| 1284 | + } | |
| 1285 | + if (!property_exists($obj, 'Rate')) { | |
| 1286 | + throw new Exception("Missing required property"); | |
| 1287 | + } | |
| 1288 | + if (!property_exists($obj, 'Report')) { | |
| 1289 | + throw new Exception("Missing required property"); | |
| 1290 | + } | |
| 1291 | + if (!property_exists($obj, 'Taxonomy')) { | |
| 1292 | + throw new Exception("Missing required property"); | |
| 1293 | + } | |
| 1231 | 1294 | return new Definitions( |
| 1232 | 1295 | Definitions::fromArticle($obj->{'Article'}) |
| 1233 | 1296 | ,Definitions::fromCenter($obj->{'Center'}) |
| @@ -1365,6 +1428,9 @@ class Article { | ||
| 1365 | 1428 | * @throws Exception |
| 1366 | 1429 | */ |
| 1367 | 1430 | public static function from(stdClass $obj): Article { |
| 1431 | + if (!property_exists($obj, 'properties')) { | |
| 1432 | + throw new Exception("Missing required property"); | |
| 1433 | + } | |
| 1368 | 1434 | return new Article( |
| 1369 | 1435 | Article::fromProperties($obj->{'properties'}) |
| 1370 | 1436 | ); |
| @@ -1516,6 +1582,12 @@ class Property { | ||
| 1516 | 1582 | * @throws Exception |
| 1517 | 1583 | */ |
| 1518 | 1584 | public static function from(stdClass $obj): Property { |
| 1585 | + if (!property_exists($obj, 'description')) { | |
| 1586 | + throw new Exception("Missing required property"); | |
| 1587 | + } | |
| 1588 | + if (!property_exists($obj, 'type')) { | |
| 1589 | + throw new Exception("Missing required property"); | |
| 1590 | + } | |
| 1519 | 1591 | return new Property( |
| 1520 | 1592 | Property::fromDescription($obj->{'description'}) |
| 1521 | 1593 | ,Property::fromType($obj->{'type'}) |
| @@ -1662,6 +1734,9 @@ class DeMinimis { | ||
| 1662 | 1734 | * @throws Exception |
| 1663 | 1735 | */ |
| 1664 | 1736 | public static function from(stdClass $obj): DeMinimis { |
| 1737 | + if (!property_exists($obj, 'properties')) { | |
| 1738 | + throw new Exception("Missing required property"); | |
| 1739 | + } | |
| 1665 | 1740 | return new DeMinimis( |
| 1666 | 1741 | DeMinimis::fromProperties($obj->{'properties'}) |
| 1667 | 1742 | ); |
| @@ -2079,6 +2154,27 @@ class DeMinimisProperties { | ||
| 2079 | 2154 | * @throws Exception |
| 2080 | 2155 | */ |
| 2081 | 2156 | public static function from(stdClass $obj): DeMinimisProperties { |
| 2157 | + if (!property_exists($obj, 'countries')) { | |
| 2158 | + throw new Exception("Missing required property"); | |
| 2159 | + } | |
| 2160 | + if (!property_exists($obj, 'country')) { | |
| 2161 | + throw new Exception("Missing required property"); | |
| 2162 | + } | |
| 2163 | + if (!property_exists($obj, 'de_minimis_currency')) { | |
| 2164 | + throw new Exception("Missing required property"); | |
| 2165 | + } | |
| 2166 | + if (!property_exists($obj, 'de_minimis_value')) { | |
| 2167 | + throw new Exception("Missing required property"); | |
| 2168 | + } | |
| 2169 | + if (!property_exists($obj, 'notes')) { | |
| 2170 | + throw new Exception("Missing required property"); | |
| 2171 | + } | |
| 2172 | + if (!property_exists($obj, 'vat_amount')) { | |
| 2173 | + throw new Exception("Missing required property"); | |
| 2174 | + } | |
| 2175 | + if (!property_exists($obj, 'vat_currency')) { | |
| 2176 | + throw new Exception("Missing required property"); | |
| 2177 | + } | |
| 2082 | 2178 | return new DeMinimisProperties( |
| 2083 | 2179 | DeMinimisProperties::fromCountries($obj->{'countries'}) |
| 2084 | 2180 | ,DeMinimisProperties::fromCountry($obj->{'country'}) |
| @@ -2190,6 +2286,9 @@ class FAQ { | ||
| 2190 | 2286 | * @throws Exception |
| 2191 | 2287 | */ |
| 2192 | 2288 | public static function from(stdClass $obj): FAQ { |
| 2289 | + if (!property_exists($obj, 'properties')) { | |
| 2290 | + throw new Exception("Missing required property"); | |
| 2291 | + } | |
| 2193 | 2292 | return new FAQ( |
| 2194 | 2293 | FAQ::fromProperties($obj->{'properties'}) |
| 2195 | 2294 | ); |
| @@ -2819,6 +2918,39 @@ class FAQProperties { | ||
| 2819 | 2918 | * @throws Exception |
| 2820 | 2919 | */ |
| 2821 | 2920 | public static function from(stdClass $obj): FAQProperties { |
| 2921 | + if (!property_exists($obj, 'answer')) { | |
| 2922 | + throw new Exception("Missing required property"); | |
| 2923 | + } | |
| 2924 | + if (!property_exists($obj, 'countries')) { | |
| 2925 | + throw new Exception("Missing required property"); | |
| 2926 | + } | |
| 2927 | + if (!property_exists($obj, 'first_published_date')) { | |
| 2928 | + throw new Exception("Missing required property"); | |
| 2929 | + } | |
| 2930 | + if (!property_exists($obj, 'id')) { | |
| 2931 | + throw new Exception("Missing required property"); | |
| 2932 | + } | |
| 2933 | + if (!property_exists($obj, 'industries')) { | |
| 2934 | + throw new Exception("Missing required property"); | |
| 2935 | + } | |
| 2936 | + if (!property_exists($obj, 'last_published_date')) { | |
| 2937 | + throw new Exception("Missing required property"); | |
| 2938 | + } | |
| 2939 | + if (!property_exists($obj, 'question')) { | |
| 2940 | + throw new Exception("Missing required property"); | |
| 2941 | + } | |
| 2942 | + if (!property_exists($obj, 'topics')) { | |
| 2943 | + throw new Exception("Missing required property"); | |
| 2944 | + } | |
| 2945 | + if (!property_exists($obj, 'trade_regions')) { | |
| 2946 | + throw new Exception("Missing required property"); | |
| 2947 | + } | |
| 2948 | + if (!property_exists($obj, 'url')) { | |
| 2949 | + throw new Exception("Missing required property"); | |
| 2950 | + } | |
| 2951 | + if (!property_exists($obj, 'world_regions')) { | |
| 2952 | + throw new Exception("Missing required property"); | |
| 2953 | + } | |
| 2822 | 2954 | return new FAQProperties( |
| 2823 | 2955 | FAQProperties::fromAnswer($obj->{'answer'}) |
| 2824 | 2956 | ,FAQProperties::fromCountries($obj->{'countries'}) |
| @@ -2938,6 +3070,9 @@ class Report { | ||
| 2938 | 3070 | * @throws Exception |
| 2939 | 3071 | */ |
| 2940 | 3072 | public static function from(stdClass $obj): Report { |
| 3073 | + if (!property_exists($obj, 'properties')) { | |
| 3074 | + throw new Exception("Missing required property"); | |
| 3075 | + } | |
| 2941 | 3076 | return new Report( |
| 2942 | 3077 | Report::fromProperties($obj->{'properties'}) |
| 2943 | 3078 | ); |
| @@ -3461,6 +3596,33 @@ class ReportProperties { | ||
| 3461 | 3596 | * @throws Exception |
| 3462 | 3597 | */ |
| 3463 | 3598 | public static function from(stdClass $obj): ReportProperties { |
| 3599 | + if (!property_exists($obj, 'countries')) { | |
| 3600 | + throw new Exception("Missing required property"); | |
| 3601 | + } | |
| 3602 | + if (!property_exists($obj, 'description')) { | |
| 3603 | + throw new Exception("Missing required property"); | |
| 3604 | + } | |
| 3605 | + if (!property_exists($obj, 'expiration_date')) { | |
| 3606 | + throw new Exception("Missing required property"); | |
| 3607 | + } | |
| 3608 | + if (!property_exists($obj, 'id')) { | |
| 3609 | + throw new Exception("Missing required property"); | |
| 3610 | + } | |
| 3611 | + if (!property_exists($obj, 'industries')) { | |
| 3612 | + throw new Exception("Missing required property"); | |
| 3613 | + } | |
| 3614 | + if (!property_exists($obj, 'ita_industries')) { | |
| 3615 | + throw new Exception("Missing required property"); | |
| 3616 | + } | |
| 3617 | + if (!property_exists($obj, 'report_type')) { | |
| 3618 | + throw new Exception("Missing required property"); | |
| 3619 | + } | |
| 3620 | + if (!property_exists($obj, 'title')) { | |
| 3621 | + throw new Exception("Missing required property"); | |
| 3622 | + } | |
| 3623 | + if (!property_exists($obj, 'url')) { | |
| 3624 | + throw new Exception("Missing required property"); | |
| 3625 | + } | |
| 3464 | 3626 | return new ReportProperties( |
| 3465 | 3627 | ReportProperties::fromCountries($obj->{'countries'}) |
| 3466 | 3628 | ,ReportProperties::fromDescription($obj->{'description'}) |
| @@ -3576,6 +3738,9 @@ class Taxonomy { | ||
| 3576 | 3738 | * @throws Exception |
| 3577 | 3739 | */ |
| 3578 | 3740 | public static function from(stdClass $obj): Taxonomy { |
| 3741 | + if (!property_exists($obj, 'properties')) { | |
| 3742 | + throw new Exception("Missing required property"); | |
| 3743 | + } | |
| 3579 | 3744 | return new Taxonomy( |
| 3580 | 3745 | Taxonomy::fromProperties($obj->{'properties'}) |
| 3581 | 3746 | ); |
| @@ -3940,6 +4105,24 @@ class TaxonomyProperties { | ||
| 3940 | 4105 | * @throws Exception |
| 3941 | 4106 | */ |
| 3942 | 4107 | public static function from(stdClass $obj): TaxonomyProperties { |
| 4108 | + if (!property_exists($obj, 'annotations')) { | |
| 4109 | + throw new Exception("Missing required property"); | |
| 4110 | + } | |
| 4111 | + if (!property_exists($obj, 'datatype_properties')) { | |
| 4112 | + throw new Exception("Missing required property"); | |
| 4113 | + } | |
| 4114 | + if (!property_exists($obj, 'id')) { | |
| 4115 | + throw new Exception("Missing required property"); | |
| 4116 | + } | |
| 4117 | + if (!property_exists($obj, 'label')) { | |
| 4118 | + throw new Exception("Missing required property"); | |
| 4119 | + } | |
| 4120 | + if (!property_exists($obj, 'sub_class_of')) { | |
| 4121 | + throw new Exception("Missing required property"); | |
| 4122 | + } | |
| 4123 | + if (!property_exists($obj, 'type')) { | |
| 4124 | + throw new Exception("Missing required property"); | |
| 4125 | + } | |
| 3943 | 4126 | return new TaxonomyProperties( |
| 3944 | 4127 | TaxonomyProperties::fromAnnotations($obj->{'annotations'}) |
| 3945 | 4128 | ,TaxonomyProperties::fromDatatypeProperties($obj->{'datatype_properties'}) |
| @@ -4152,6 +4335,15 @@ class Info { | ||
| 4152 | 4335 | * @throws Exception |
| 4153 | 4336 | */ |
| 4154 | 4337 | public static function from(stdClass $obj): Info { |
| 4338 | + if (!property_exists($obj, 'description')) { | |
| 4339 | + throw new Exception("Missing required property"); | |
| 4340 | + } | |
| 4341 | + if (!property_exists($obj, 'title')) { | |
| 4342 | + throw new Exception("Missing required property"); | |
| 4343 | + } | |
| 4344 | + if (!property_exists($obj, 'version')) { | |
| 4345 | + throw new Exception("Missing required property"); | |
| 4346 | + } | |
| 4155 | 4347 | return new Info( |
| 4156 | 4348 | Info::fromDescription($obj->{'description'}) |
| 4157 | 4349 | ,Info::fromTitle($obj->{'title'}) |
| @@ -4891,6 +5083,45 @@ class Paths { | ||
| 4891 | 5083 | * @throws Exception |
| 4892 | 5084 | */ |
| 4893 | 5085 | public static function from(stdClass $obj): Paths { |
| 5086 | + if (!property_exists($obj, '/business_service_providers/search')) { | |
| 5087 | + throw new Exception("Missing required property"); | |
| 5088 | + } | |
| 5089 | + if (!property_exists($obj, '/consolidated_screening_list/search')) { | |
| 5090 | + throw new Exception("Missing required property"); | |
| 5091 | + } | |
| 5092 | + if (!property_exists($obj, '/de_minimis/search')) { | |
| 5093 | + throw new Exception("Missing required property"); | |
| 5094 | + } | |
| 5095 | + if (!property_exists($obj, '/ita_faqs/search')) { | |
| 5096 | + throw new Exception("Missing required property"); | |
| 5097 | + } | |
| 5098 | + if (!property_exists($obj, '/ita_office_locations/search')) { | |
| 5099 | + throw new Exception("Missing required property"); | |
| 5100 | + } | |
| 5101 | + if (!property_exists($obj, '/ita_taxonomies/search')) { | |
| 5102 | + throw new Exception("Missing required property"); | |
| 5103 | + } | |
| 5104 | + if (!property_exists($obj, '/ita_zipcode_to_post/search')) { | |
| 5105 | + throw new Exception("Missing required property"); | |
| 5106 | + } | |
| 5107 | + if (!property_exists($obj, '/market_intelligence/search')) { | |
| 5108 | + throw new Exception("Missing required property"); | |
| 5109 | + } | |
| 5110 | + if (!property_exists($obj, '/market_research_library/search')) { | |
| 5111 | + throw new Exception("Missing required property"); | |
| 5112 | + } | |
| 5113 | + if (!property_exists($obj, '/tariff_rates/search')) { | |
| 5114 | + throw new Exception("Missing required property"); | |
| 5115 | + } | |
| 5116 | + if (!property_exists($obj, '/trade_articles/search')) { | |
| 5117 | + throw new Exception("Missing required property"); | |
| 5118 | + } | |
| 5119 | + if (!property_exists($obj, '/trade_events/search')) { | |
| 5120 | + throw new Exception("Missing required property"); | |
| 5121 | + } | |
| 5122 | + if (!property_exists($obj, '/trade_leads/search')) { | |
| 5123 | + throw new Exception("Missing required property"); | |
| 5124 | + } | |
| 4894 | 5125 | return new Paths( |
| 4895 | 5126 | Paths::fromBusinessServiceProvidersSearch($obj->{'/business_service_providers/search'}) |
| 4896 | 5127 | ,Paths::fromConsolidatedScreeningListSearch($obj->{'/consolidated_screening_list/search'}) |
| @@ -5014,6 +5245,9 @@ class BusinessServiceProvidersSearchClass { | ||
| 5014 | 5245 | * @throws Exception |
| 5015 | 5246 | */ |
| 5016 | 5247 | public static function from(stdClass $obj): BusinessServiceProvidersSearchClass { |
| 5248 | + if (!property_exists($obj, 'get')) { | |
| 5249 | + throw new Exception("Missing required property"); | |
| 5250 | + } | |
| 5017 | 5251 | return new BusinessServiceProvidersSearchClass( |
| 5018 | 5252 | BusinessServiceProvidersSearchClass::fromGet($obj->{'get'}) |
| 5019 | 5253 | ); |
| @@ -5347,6 +5581,21 @@ class BusinessServiceProvidersSearchGet { | ||
| 5347 | 5581 | * @throws Exception |
| 5348 | 5582 | */ |
| 5349 | 5583 | public static function from(stdClass $obj): BusinessServiceProvidersSearchGet { |
| 5584 | + if (!property_exists($obj, 'description')) { | |
| 5585 | + throw new Exception("Missing required property"); | |
| 5586 | + } | |
| 5587 | + if (!property_exists($obj, 'parameters')) { | |
| 5588 | + throw new Exception("Missing required property"); | |
| 5589 | + } | |
| 5590 | + if (!property_exists($obj, 'responses')) { | |
| 5591 | + throw new Exception("Missing required property"); | |
| 5592 | + } | |
| 5593 | + if (!property_exists($obj, 'summary')) { | |
| 5594 | + throw new Exception("Missing required property"); | |
| 5595 | + } | |
| 5596 | + if (!property_exists($obj, 'tags')) { | |
| 5597 | + throw new Exception("Missing required property"); | |
| 5598 | + } | |
| 5350 | 5599 | return new BusinessServiceProvidersSearchGet( |
| 5351 | 5600 | BusinessServiceProvidersSearchGet::fromDescription($obj->{'description'}) |
| 5352 | 5601 | ,BusinessServiceProvidersSearchGet::fromParameters($obj->{'parameters'}) |
| @@ -5716,6 +5965,24 @@ class Parameter { | ||
| 5716 | 5965 | * @throws Exception |
| 5717 | 5966 | */ |
| 5718 | 5967 | public static function from(stdClass $obj): Parameter { |
| 5968 | + if (!property_exists($obj, 'description')) { | |
| 5969 | + throw new Exception("Missing required property"); | |
| 5970 | + } | |
| 5971 | + if (!property_exists($obj, 'format')) { | |
| 5972 | + throw new Exception("Missing required property"); | |
| 5973 | + } | |
| 5974 | + if (!property_exists($obj, 'in')) { | |
| 5975 | + throw new Exception("Missing required property"); | |
| 5976 | + } | |
| 5977 | + if (!property_exists($obj, 'name')) { | |
| 5978 | + throw new Exception("Missing required property"); | |
| 5979 | + } | |
| 5980 | + if (!property_exists($obj, 'required')) { | |
| 5981 | + throw new Exception("Missing required property"); | |
| 5982 | + } | |
| 5983 | + if (!property_exists($obj, 'type')) { | |
| 5984 | + throw new Exception("Missing required property"); | |
| 5985 | + } | |
| 5719 | 5986 | return new Parameter( |
| 5720 | 5987 | Parameter::fromDescription($obj->{'description'}) |
| 5721 | 5988 | ,Parameter::fromFormat($obj->{'format'}) |
| @@ -5870,6 +6137,9 @@ class PurpleResponses { | ||
| 5870 | 6137 | * @throws Exception |
| 5871 | 6138 | */ |
| 5872 | 6139 | public static function from(stdClass $obj): PurpleResponses { |
| 6140 | + if (!property_exists($obj, '200')) { | |
| 6141 | + throw new Exception("Missing required property"); | |
| 6142 | + } | |
| 5873 | 6143 | return new PurpleResponses( |
| 5874 | 6144 | PurpleResponses::fromThe200($obj->{'200'}) |
| 5875 | 6145 | ); |
| @@ -6021,6 +6291,12 @@ class Purple200 { | ||
| 6021 | 6291 | * @throws Exception |
| 6022 | 6292 | */ |
| 6023 | 6293 | public static function from(stdClass $obj): Purple200 { |
| 6294 | + if (!property_exists($obj, 'description')) { | |
| 6295 | + throw new Exception("Missing required property"); | |
| 6296 | + } | |
| 6297 | + if (!property_exists($obj, 'schema')) { | |
| 6298 | + throw new Exception("Missing required property"); | |
| 6299 | + } | |
| 6024 | 6300 | return new Purple200( |
| 6025 | 6301 | Purple200::fromDescription($obj->{'description'}) |
| 6026 | 6302 | ,Purple200::fromSchema($obj->{'schema'}) |
| @@ -6121,6 +6397,9 @@ class ItemsClass { | ||
| 6121 | 6397 | * @throws Exception |
| 6122 | 6398 | */ |
| 6123 | 6399 | public static function from(stdClass $obj): ItemsClass { |
| 6400 | + if (!property_exists($obj, '$ref')) { | |
| 6401 | + throw new Exception("Missing required property"); | |
| 6402 | + } | |
| 6124 | 6403 | return new ItemsClass( |
| 6125 | 6404 | ItemsClass::fromRef($obj->{'$ref'}) |
| 6126 | 6405 | ); |
| @@ -6220,6 +6499,9 @@ class ConsolidatedScreeningListSearchClass { | ||
| 6220 | 6499 | * @throws Exception |
| 6221 | 6500 | */ |
| 6222 | 6501 | public static function from(stdClass $obj): ConsolidatedScreeningListSearchClass { |
| 6502 | + if (!property_exists($obj, 'get')) { | |
| 6503 | + throw new Exception("Missing required property"); | |
| 6504 | + } | |
| 6223 | 6505 | return new ConsolidatedScreeningListSearchClass( |
| 6224 | 6506 | ConsolidatedScreeningListSearchClass::fromGet($obj->{'get'}) |
| 6225 | 6507 | ); |
| @@ -6553,6 +6835,21 @@ class ConsolidatedScreeningListSearchGet { | ||
| 6553 | 6835 | * @throws Exception |
| 6554 | 6836 | */ |
| 6555 | 6837 | public static function from(stdClass $obj): ConsolidatedScreeningListSearchGet { |
| 6838 | + if (!property_exists($obj, 'description')) { | |
| 6839 | + throw new Exception("Missing required property"); | |
| 6840 | + } | |
| 6841 | + if (!property_exists($obj, 'parameters')) { | |
| 6842 | + throw new Exception("Missing required property"); | |
| 6843 | + } | |
| 6844 | + if (!property_exists($obj, 'responses')) { | |
| 6845 | + throw new Exception("Missing required property"); | |
| 6846 | + } | |
| 6847 | + if (!property_exists($obj, 'summary')) { | |
| 6848 | + throw new Exception("Missing required property"); | |
| 6849 | + } | |
| 6850 | + if (!property_exists($obj, 'tags')) { | |
| 6851 | + throw new Exception("Missing required property"); | |
| 6852 | + } | |
| 6556 | 6853 | return new ConsolidatedScreeningListSearchGet( |
| 6557 | 6854 | ConsolidatedScreeningListSearchGet::fromDescription($obj->{'description'}) |
| 6558 | 6855 | ,ConsolidatedScreeningListSearchGet::fromParameters($obj->{'parameters'}) |
| @@ -6660,6 +6957,9 @@ class FluffyResponses { | ||
| 6660 | 6957 | * @throws Exception |
| 6661 | 6958 | */ |
| 6662 | 6959 | public static function from(stdClass $obj): FluffyResponses { |
| 6960 | + if (!property_exists($obj, '200')) { | |
| 6961 | + throw new Exception("Missing required property"); | |
| 6962 | + } | |
| 6663 | 6963 | return new FluffyResponses( |
| 6664 | 6964 | FluffyResponses::fromThe200($obj->{'200'}) |
| 6665 | 6965 | ); |
| @@ -6811,6 +7111,12 @@ class Fluffy200 { | ||
| 6811 | 7111 | * @throws Exception |
| 6812 | 7112 | */ |
| 6813 | 7113 | public static function from(stdClass $obj): Fluffy200 { |
| 7114 | + if (!property_exists($obj, 'description')) { | |
| 7115 | + throw new Exception("Missing required property"); | |
| 7116 | + } | |
| 7117 | + if (!property_exists($obj, 'schema')) { | |
| 7118 | + throw new Exception("Missing required property"); | |
| 7119 | + } | |
| 6814 | 7120 | return new Fluffy200( |
| 6815 | 7121 | Fluffy200::fromDescription($obj->{'description'}) |
| 6816 | 7122 | ,Fluffy200::fromSchema($obj->{'schema'}) |
| @@ -6965,6 +7271,12 @@ class PurpleSchema { | ||
| 6965 | 7271 | * @throws Exception |
| 6966 | 7272 | */ |
| 6967 | 7273 | public static function from(stdClass $obj): PurpleSchema { |
| 7274 | + if (!property_exists($obj, 'items')) { | |
| 7275 | + throw new Exception("Missing required property"); | |
| 7276 | + } | |
| 7277 | + if (!property_exists($obj, 'type')) { | |
| 7278 | + throw new Exception("Missing required property"); | |
| 7279 | + } | |
| 6968 | 7280 | return new PurpleSchema( |
| 6969 | 7281 | PurpleSchema::fromItems($obj->{'items'}) |
| 6970 | 7282 | ,PurpleSchema::fromType($obj->{'type'}) |
Test case
1 generated file · +21 −0test/inputs/json/misc/77392.json
Mphpdefault / TopLevel.php+21 −0
| @@ -591,6 +591,27 @@ class TopLevel { | ||
| 591 | 591 | * @throws Exception |
| 592 | 592 | */ |
| 593 | 593 | public static function from(stdClass $obj): TopLevel { |
| 594 | + if (!property_exists($obj, 'designation')) { | |
| 595 | + throw new Exception("Missing required property"); | |
| 596 | + } | |
| 597 | + if (!property_exists($obj, 'discovery_date')) { | |
| 598 | + throw new Exception("Missing required property"); | |
| 599 | + } | |
| 600 | + if (!property_exists($obj, 'i_deg')) { | |
| 601 | + throw new Exception("Missing required property"); | |
| 602 | + } | |
| 603 | + if (!property_exists($obj, 'moid_au')) { | |
| 604 | + throw new Exception("Missing required property"); | |
| 605 | + } | |
| 606 | + if (!property_exists($obj, 'orbit_class')) { | |
| 607 | + throw new Exception("Missing required property"); | |
| 608 | + } | |
| 609 | + if (!property_exists($obj, 'pha')) { | |
| 610 | + throw new Exception("Missing required property"); | |
| 611 | + } | |
| 612 | + if (!property_exists($obj, 'q_au_1')) { | |
| 613 | + throw new Exception("Missing required property"); | |
| 614 | + } | |
| 594 | 615 | return new TopLevel( |
| 595 | 616 | TopLevel::fromDesignation($obj->{'designation'}) |
| 596 | 617 | ,TopLevel::fromDiscoveryDate($obj->{'discovery_date'}) |
Test case
1 generated file · +102 −0test/inputs/json/misc/7d397.json
Mphpdefault / TopLevel.php+102 −0
| @@ -479,6 +479,30 @@ class TopLevel { | ||
| 479 | 479 | * @throws Exception |
| 480 | 480 | */ |
| 481 | 481 | public static function from(stdClass $obj): TopLevel { |
| 482 | + if (!property_exists($obj, 'basePath')) { | |
| 483 | + throw new Exception("Missing required property"); | |
| 484 | + } | |
| 485 | + if (!property_exists($obj, 'definitions')) { | |
| 486 | + throw new Exception("Missing required property"); | |
| 487 | + } | |
| 488 | + if (!property_exists($obj, 'host')) { | |
| 489 | + throw new Exception("Missing required property"); | |
| 490 | + } | |
| 491 | + if (!property_exists($obj, 'info')) { | |
| 492 | + throw new Exception("Missing required property"); | |
| 493 | + } | |
| 494 | + if (!property_exists($obj, 'paths')) { | |
| 495 | + throw new Exception("Missing required property"); | |
| 496 | + } | |
| 497 | + if (!property_exists($obj, 'produces')) { | |
| 498 | + throw new Exception("Missing required property"); | |
| 499 | + } | |
| 500 | + if (!property_exists($obj, 'schemes')) { | |
| 501 | + throw new Exception("Missing required property"); | |
| 502 | + } | |
| 503 | + if (!property_exists($obj, 'swagger')) { | |
| 504 | + throw new Exception("Missing required property"); | |
| 505 | + } | |
| 482 | 506 | return new TopLevel( |
| 483 | 507 | TopLevel::fromBasePath($obj->{'basePath'}) |
| 484 | 508 | ,TopLevel::fromDefinitions($obj->{'definitions'}) |
| @@ -592,6 +616,9 @@ class Definitions { | ||
| 592 | 616 | * @throws Exception |
| 593 | 617 | */ |
| 594 | 618 | public static function from(stdClass $obj): Definitions { |
| 619 | + if (!property_exists($obj, 'List')) { | |
| 620 | + throw new Exception("Missing required property"); | |
| 621 | + } | |
| 595 | 622 | return new Definitions( |
| 596 | 623 | Definitions::fromList($obj->{'List'}) |
| 597 | 624 | ); |
| @@ -705,6 +732,9 @@ class ListClass { | ||
| 705 | 732 | * @throws Exception |
| 706 | 733 | */ |
| 707 | 734 | public static function from(stdClass $obj): ListClass { |
| 735 | + if (!property_exists($obj, 'properties')) { | |
| 736 | + throw new Exception("Missing required property"); | |
| 737 | + } | |
| 708 | 738 | return new ListClass( |
| 709 | 739 | ListClass::fromProperties($obj->{'properties'}) |
| 710 | 740 | ); |
| @@ -856,6 +886,12 @@ class Property { | ||
| 856 | 886 | * @throws Exception |
| 857 | 887 | */ |
| 858 | 888 | public static function from(stdClass $obj): Property { |
| 889 | + if (!property_exists($obj, 'description')) { | |
| 890 | + throw new Exception("Missing required property"); | |
| 891 | + } | |
| 892 | + if (!property_exists($obj, 'type')) { | |
| 893 | + throw new Exception("Missing required property"); | |
| 894 | + } | |
| 859 | 895 | return new Property( |
| 860 | 896 | Property::fromDescription($obj->{'description'}) |
| 861 | 897 | ,Property::fromType($obj->{'type'}) |
| @@ -1105,6 +1141,15 @@ class Info { | ||
| 1105 | 1141 | * @throws Exception |
| 1106 | 1142 | */ |
| 1107 | 1143 | public static function from(stdClass $obj): Info { |
| 1144 | + if (!property_exists($obj, 'description')) { | |
| 1145 | + throw new Exception("Missing required property"); | |
| 1146 | + } | |
| 1147 | + if (!property_exists($obj, 'title')) { | |
| 1148 | + throw new Exception("Missing required property"); | |
| 1149 | + } | |
| 1150 | + if (!property_exists($obj, 'version')) { | |
| 1151 | + throw new Exception("Missing required property"); | |
| 1152 | + } | |
| 1108 | 1153 | return new Info( |
| 1109 | 1154 | Info::fromDescription($obj->{'description'}) |
| 1110 | 1155 | ,Info::fromTitle($obj->{'title'}) |
| @@ -1208,6 +1253,9 @@ class Paths { | ||
| 1208 | 1253 | * @throws Exception |
| 1209 | 1254 | */ |
| 1210 | 1255 | public static function from(stdClass $obj): Paths { |
| 1256 | + if (!property_exists($obj, '/consolidated_screening_list/search')) { | |
| 1257 | + throw new Exception("Missing required property"); | |
| 1258 | + } | |
| 1211 | 1259 | return new Paths( |
| 1212 | 1260 | Paths::fromConsolidatedScreeningListSearch($obj->{'/consolidated_screening_list/search'}) |
| 1213 | 1261 | ); |
| @@ -1307,6 +1355,9 @@ class ConsolidatedScreeningListSearch { | ||
| 1307 | 1355 | * @throws Exception |
| 1308 | 1356 | */ |
| 1309 | 1357 | public static function from(stdClass $obj): ConsolidatedScreeningListSearch { |
| 1358 | + if (!property_exists($obj, 'get')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1310 | 1361 | return new ConsolidatedScreeningListSearch( |
| 1311 | 1362 | ConsolidatedScreeningListSearch::fromGet($obj->{'get'}) |
| 1312 | 1363 | ); |
| @@ -1640,6 +1691,21 @@ class Get { | ||
| 1640 | 1691 | * @throws Exception |
| 1641 | 1692 | */ |
| 1642 | 1693 | public static function from(stdClass $obj): Get { |
| 1694 | + if (!property_exists($obj, 'description')) { | |
| 1695 | + throw new Exception("Missing required property"); | |
| 1696 | + } | |
| 1697 | + if (!property_exists($obj, 'parameters')) { | |
| 1698 | + throw new Exception("Missing required property"); | |
| 1699 | + } | |
| 1700 | + if (!property_exists($obj, 'responses')) { | |
| 1701 | + throw new Exception("Missing required property"); | |
| 1702 | + } | |
| 1703 | + if (!property_exists($obj, 'summary')) { | |
| 1704 | + throw new Exception("Missing required property"); | |
| 1705 | + } | |
| 1706 | + if (!property_exists($obj, 'tags')) { | |
| 1707 | + throw new Exception("Missing required property"); | |
| 1708 | + } | |
| 1643 | 1709 | return new Get( |
| 1644 | 1710 | Get::fromDescription($obj->{'description'}) |
| 1645 | 1711 | ,Get::fromParameters($obj->{'parameters'}) |
| @@ -2009,6 +2075,24 @@ class Parameter { | ||
| 2009 | 2075 | * @throws Exception |
| 2010 | 2076 | */ |
| 2011 | 2077 | public static function from(stdClass $obj): Parameter { |
| 2078 | + if (!property_exists($obj, 'description')) { | |
| 2079 | + throw new Exception("Missing required property"); | |
| 2080 | + } | |
| 2081 | + if (!property_exists($obj, 'format')) { | |
| 2082 | + throw new Exception("Missing required property"); | |
| 2083 | + } | |
| 2084 | + if (!property_exists($obj, 'in')) { | |
| 2085 | + throw new Exception("Missing required property"); | |
| 2086 | + } | |
| 2087 | + if (!property_exists($obj, 'name')) { | |
| 2088 | + throw new Exception("Missing required property"); | |
| 2089 | + } | |
| 2090 | + if (!property_exists($obj, 'required')) { | |
| 2091 | + throw new Exception("Missing required property"); | |
| 2092 | + } | |
| 2093 | + if (!property_exists($obj, 'type')) { | |
| 2094 | + throw new Exception("Missing required property"); | |
| 2095 | + } | |
| 2012 | 2096 | return new Parameter( |
| 2013 | 2097 | Parameter::fromDescription($obj->{'description'}) |
| 2014 | 2098 | ,Parameter::fromFormat($obj->{'format'}) |
| @@ -2163,6 +2247,9 @@ class Responses { | ||
| 2163 | 2247 | * @throws Exception |
| 2164 | 2248 | */ |
| 2165 | 2249 | public static function from(stdClass $obj): Responses { |
| 2250 | + if (!property_exists($obj, '200')) { | |
| 2251 | + throw new Exception("Missing required property"); | |
| 2252 | + } | |
| 2166 | 2253 | return new Responses( |
| 2167 | 2254 | Responses::fromThe200($obj->{'200'}) |
| 2168 | 2255 | ); |
| @@ -2314,6 +2401,12 @@ class The200 { | ||
| 2314 | 2401 | * @throws Exception |
| 2315 | 2402 | */ |
| 2316 | 2403 | public static function from(stdClass $obj): The200 { |
| 2404 | + if (!property_exists($obj, 'description')) { | |
| 2405 | + throw new Exception("Missing required property"); | |
| 2406 | + } | |
| 2407 | + if (!property_exists($obj, 'schema')) { | |
| 2408 | + throw new Exception("Missing required property"); | |
| 2409 | + } | |
| 2317 | 2410 | return new The200( |
| 2318 | 2411 | The200::fromDescription($obj->{'description'}) |
| 2319 | 2412 | ,The200::fromSchema($obj->{'schema'}) |
| @@ -2467,6 +2560,12 @@ class Schema { | ||
| 2467 | 2560 | * @throws Exception |
| 2468 | 2561 | */ |
| 2469 | 2562 | public static function from(stdClass $obj): Schema { |
| 2563 | + if (!property_exists($obj, 'items')) { | |
| 2564 | + throw new Exception("Missing required property"); | |
| 2565 | + } | |
| 2566 | + if (!property_exists($obj, 'type')) { | |
| 2567 | + throw new Exception("Missing required property"); | |
| 2568 | + } | |
| 2470 | 2569 | return new Schema( |
| 2471 | 2570 | Schema::fromItems($obj->{'items'}) |
| 2472 | 2571 | ,Schema::fromType($obj->{'type'}) |
| @@ -2567,6 +2666,9 @@ class Items { | ||
| 2567 | 2666 | * @throws Exception |
| 2568 | 2667 | */ |
| 2569 | 2668 | public static function from(stdClass $obj): Items { |
| 2669 | + if (!property_exists($obj, '$ref')) { | |
| 2670 | + throw new Exception("Missing required property"); | |
| 2671 | + } | |
| 2570 | 2672 | return new Items( |
| 2571 | 2673 | Items::fromRef($obj->{'$ref'}) |
| 2572 | 2674 | ); |
Test case
1 generated file · +75 −0test/inputs/json/misc/7d722.json
Mphpdefault / TopLevel.php+75 −0
| @@ -450,6 +450,30 @@ class TopLevel { | ||
| 450 | 450 | * @throws Exception |
| 451 | 451 | */ |
| 452 | 452 | public static function from(stdClass $obj): TopLevel { |
| 453 | + if (!property_exists($obj, 'city')) { | |
| 454 | + throw new Exception("Missing required property"); | |
| 455 | + } | |
| 456 | + if (!property_exists($obj, 'delay')) { | |
| 457 | + throw new Exception("Missing required property"); | |
| 458 | + } | |
| 459 | + if (!property_exists($obj, 'IATA')) { | |
| 460 | + throw new Exception("Missing required property"); | |
| 461 | + } | |
| 462 | + if (!property_exists($obj, 'ICAO')) { | |
| 463 | + throw new Exception("Missing required property"); | |
| 464 | + } | |
| 465 | + if (!property_exists($obj, 'name')) { | |
| 466 | + throw new Exception("Missing required property"); | |
| 467 | + } | |
| 468 | + if (!property_exists($obj, 'state')) { | |
| 469 | + throw new Exception("Missing required property"); | |
| 470 | + } | |
| 471 | + if (!property_exists($obj, 'status')) { | |
| 472 | + throw new Exception("Missing required property"); | |
| 473 | + } | |
| 474 | + if (!property_exists($obj, 'weather')) { | |
| 475 | + throw new Exception("Missing required property"); | |
| 476 | + } | |
| 453 | 477 | return new TopLevel( |
| 454 | 478 | TopLevel::fromCity($obj->{'city'}) |
| 455 | 479 | ,TopLevel::fromDelay($obj->{'delay'}) |
| @@ -978,6 +1002,33 @@ class Status { | ||
| 978 | 1002 | * @throws Exception |
| 979 | 1003 | */ |
| 980 | 1004 | public static function from(stdClass $obj): Status { |
| 1005 | + if (!property_exists($obj, 'avgDelay')) { | |
| 1006 | + throw new Exception("Missing required property"); | |
| 1007 | + } | |
| 1008 | + if (!property_exists($obj, 'closureBegin')) { | |
| 1009 | + throw new Exception("Missing required property"); | |
| 1010 | + } | |
| 1011 | + if (!property_exists($obj, 'closureEnd')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'endTime')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 1017 | + if (!property_exists($obj, 'maxDelay')) { | |
| 1018 | + throw new Exception("Missing required property"); | |
| 1019 | + } | |
| 1020 | + if (!property_exists($obj, 'minDelay')) { | |
| 1021 | + throw new Exception("Missing required property"); | |
| 1022 | + } | |
| 1023 | + if (!property_exists($obj, 'reason')) { | |
| 1024 | + throw new Exception("Missing required property"); | |
| 1025 | + } | |
| 1026 | + if (!property_exists($obj, 'trend')) { | |
| 1027 | + throw new Exception("Missing required property"); | |
| 1028 | + } | |
| 1029 | + if (!property_exists($obj, 'type')) { | |
| 1030 | + throw new Exception("Missing required property"); | |
| 1031 | + } | |
| 981 | 1032 | return new Status( |
| 982 | 1033 | Status::fromAvgDelay($obj->{'avgDelay'}) |
| 983 | 1034 | ,Status::fromClosureBegin($obj->{'closureBegin'}) |
| @@ -1301,6 +1352,21 @@ class Weather { | ||
| 1301 | 1352 | * @throws Exception |
| 1302 | 1353 | */ |
| 1303 | 1354 | public static function from(stdClass $obj): Weather { |
| 1355 | + if (!property_exists($obj, 'meta')) { | |
| 1356 | + throw new Exception("Missing required property"); | |
| 1357 | + } | |
| 1358 | + if (!property_exists($obj, 'temp')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1361 | + if (!property_exists($obj, 'visibility')) { | |
| 1362 | + throw new Exception("Missing required property"); | |
| 1363 | + } | |
| 1364 | + if (!property_exists($obj, 'weather')) { | |
| 1365 | + throw new Exception("Missing required property"); | |
| 1366 | + } | |
| 1367 | + if (!property_exists($obj, 'wind')) { | |
| 1368 | + throw new Exception("Missing required property"); | |
| 1369 | + } | |
| 1304 | 1370 | return new Weather( |
| 1305 | 1371 | Weather::fromMeta($obj->{'meta'}) |
| 1306 | 1372 | ,Weather::fromTemp($obj->{'temp'}) |
| @@ -1511,6 +1577,15 @@ class Meta { | ||
| 1511 | 1577 | * @throws Exception |
| 1512 | 1578 | */ |
| 1513 | 1579 | public static function from(stdClass $obj): Meta { |
| 1580 | + if (!property_exists($obj, 'credit')) { | |
| 1581 | + throw new Exception("Missing required property"); | |
| 1582 | + } | |
| 1583 | + if (!property_exists($obj, 'updated')) { | |
| 1584 | + throw new Exception("Missing required property"); | |
| 1585 | + } | |
| 1586 | + if (!property_exists($obj, 'url')) { | |
| 1587 | + throw new Exception("Missing required property"); | |
| 1588 | + } | |
| 1514 | 1589 | return new Meta( |
| 1515 | 1590 | Meta::fromCredit($obj->{'credit'}) |
| 1516 | 1591 | ,Meta::fromUpdated($obj->{'updated'}) |
Test case
1 generated file · +24 −0test/inputs/json/misc/7df41.json
Mphpdefault / TopLevel.php+24 −0
| @@ -297,6 +297,21 @@ class TopLevel { | ||
| 297 | 297 | * @throws Exception |
| 298 | 298 | */ |
| 299 | 299 | public static function from(stdClass $obj): TopLevel { |
| 300 | + if (!property_exists($obj, 'pc')) { | |
| 301 | + throw new Exception("Missing required property"); | |
| 302 | + } | |
| 303 | + if (!property_exists($obj, 'ps3')) { | |
| 304 | + throw new Exception("Missing required property"); | |
| 305 | + } | |
| 306 | + if (!property_exists($obj, 'ps4')) { | |
| 307 | + throw new Exception("Missing required property"); | |
| 308 | + } | |
| 309 | + if (!property_exists($obj, 'xbox')) { | |
| 310 | + throw new Exception("Missing required property"); | |
| 311 | + } | |
| 312 | + if (!property_exists($obj, 'xone')) { | |
| 313 | + throw new Exception("Missing required property"); | |
| 314 | + } | |
| 300 | 315 | return new TopLevel( |
| 301 | 316 | TopLevel::fromPC($obj->{'pc'}) |
| 302 | 317 | ,TopLevel::fromPs3($obj->{'ps3'}) |
| @@ -507,6 +522,15 @@ class PC { | ||
| 507 | 522 | * @throws Exception |
| 508 | 523 | */ |
| 509 | 524 | public static function from(stdClass $obj): PC { |
| 525 | + if (!property_exists($obj, 'count')) { | |
| 526 | + throw new Exception("Missing required property"); | |
| 527 | + } | |
| 528 | + if (!property_exists($obj, 'label')) { | |
| 529 | + throw new Exception("Missing required property"); | |
| 530 | + } | |
| 531 | + if (!property_exists($obj, 'peak24')) { | |
| 532 | + throw new Exception("Missing required property"); | |
| 533 | + } | |
| 510 | 534 | return new PC( |
| 511 | 535 | PC::fromCount($obj->{'count'}) |
| 512 | 536 | ,PC::fromLabel($obj->{'label'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/7dfa6.json
Mphpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'total_population')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromTotalPopulation($obj->{'total_population'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class TotalPopulation { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): TotalPopulation { |
| 252 | + if (!property_exists($obj, 'date')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'population')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new TotalPopulation( |
| 250 | 259 | TotalPopulation::fromDate($obj->{'date'}) |
| 251 | 260 | ,TotalPopulation::fromPopulation($obj->{'population'}) |
Test case
1 generated file · +66 −0test/inputs/json/misc/7eb30.json
Mphpdefault / TopLevel.php+66 −0
| @@ -255,6 +255,18 @@ class TopLevel { | ||
| 255 | 255 | * @throws Exception |
| 256 | 256 | */ |
| 257 | 257 | public static function from(stdClass $obj): TopLevel { |
| 258 | + if (!property_exists($obj, 'count')) { | |
| 259 | + throw new Exception("Missing required property"); | |
| 260 | + } | |
| 261 | + if (!property_exists($obj, 'next')) { | |
| 262 | + throw new Exception("Missing required property"); | |
| 263 | + } | |
| 264 | + if (!property_exists($obj, 'previous')) { | |
| 265 | + throw new Exception("Missing required property"); | |
| 266 | + } | |
| 267 | + if (!property_exists($obj, 'results')) { | |
| 268 | + throw new Exception("Missing required property"); | |
| 269 | + } | |
| 258 | 270 | return new TopLevel( |
| 259 | 271 | TopLevel::fromCount($obj->{'count'}) |
| 260 | 272 | ,TopLevel::fromNext($obj->{'next'}) |
| @@ -1038,6 +1050,48 @@ class Result { | ||
| 1038 | 1050 | * @throws Exception |
| 1039 | 1051 | */ |
| 1040 | 1052 | public static function from(stdClass $obj): Result { |
| 1053 | + if (!property_exists($obj, 'code')) { | |
| 1054 | + throw new Exception("Missing required property"); | |
| 1055 | + } | |
| 1056 | + if (!property_exists($obj, 'english')) { | |
| 1057 | + throw new Exception("Missing required property"); | |
| 1058 | + } | |
| 1059 | + if (!property_exists($obj, 'fav')) { | |
| 1060 | + throw new Exception("Missing required property"); | |
| 1061 | + } | |
| 1062 | + if (!property_exists($obj, 'group')) { | |
| 1063 | + throw new Exception("Missing required property"); | |
| 1064 | + } | |
| 1065 | + if (!property_exists($obj, 'location')) { | |
| 1066 | + throw new Exception("Missing required property"); | |
| 1067 | + } | |
| 1068 | + if (!property_exists($obj, 'min_screens')) { | |
| 1069 | + throw new Exception("Missing required property"); | |
| 1070 | + } | |
| 1071 | + if (!property_exists($obj, 'num_views')) { | |
| 1072 | + throw new Exception("Missing required property"); | |
| 1073 | + } | |
| 1074 | + if (!property_exists($obj, 'showtimes')) { | |
| 1075 | + throw new Exception("Missing required property"); | |
| 1076 | + } | |
| 1077 | + if (!property_exists($obj, 'stars')) { | |
| 1078 | + throw new Exception("Missing required property"); | |
| 1079 | + } | |
| 1080 | + if (!property_exists($obj, 'tel')) { | |
| 1081 | + throw new Exception("Missing required property"); | |
| 1082 | + } | |
| 1083 | + if (!property_exists($obj, 'thai')) { | |
| 1084 | + throw new Exception("Missing required property"); | |
| 1085 | + } | |
| 1086 | + if (!property_exists($obj, 'today_screens')) { | |
| 1087 | + throw new Exception("Missing required property"); | |
| 1088 | + } | |
| 1089 | + if (!property_exists($obj, 'url')) { | |
| 1090 | + throw new Exception("Missing required property"); | |
| 1091 | + } | |
| 1092 | + if (!property_exists($obj, 'website')) { | |
| 1093 | + throw new Exception("Missing required property"); | |
| 1094 | + } | |
| 1041 | 1095 | return new Result( |
| 1042 | 1096 | Result::fromCode($obj->{'code'}) |
| 1043 | 1097 | ,Result::fromEnglish($obj->{'english'}) |
| @@ -1321,6 +1375,18 @@ class Group { | ||
| 1321 | 1375 | * @throws Exception |
| 1322 | 1376 | */ |
| 1323 | 1377 | public static function from(stdClass $obj): Group { |
| 1378 | + if (!property_exists($obj, 'code')) { | |
| 1379 | + throw new Exception("Missing required property"); | |
| 1380 | + } | |
| 1381 | + if (!property_exists($obj, 'english')) { | |
| 1382 | + throw new Exception("Missing required property"); | |
| 1383 | + } | |
| 1384 | + if (!property_exists($obj, 'thai')) { | |
| 1385 | + throw new Exception("Missing required property"); | |
| 1386 | + } | |
| 1387 | + if (!property_exists($obj, 'website')) { | |
| 1388 | + throw new Exception("Missing required property"); | |
| 1389 | + } | |
| 1324 | 1390 | return new Group( |
| 1325 | 1391 | Group::fromCode($obj->{'code'}) |
| 1326 | 1392 | ,Group::fromEnglish($obj->{'english'}) |
Test case
1 generated file · +63 −0test/inputs/json/misc/7f568.json
Mphpdefault / TopLevel.php+63 −0
| @@ -906,6 +906,54 @@ class TopLevel { | ||
| 906 | 906 | * @throws Exception |
| 907 | 907 | */ |
| 908 | 908 | public static function from(stdClass $obj): TopLevel { |
| 909 | + if (!property_exists($obj, 'comments')) { | |
| 910 | + throw new Exception("Missing required property"); | |
| 911 | + } | |
| 912 | + if (!property_exists($obj, 'comments_url')) { | |
| 913 | + throw new Exception("Missing required property"); | |
| 914 | + } | |
| 915 | + if (!property_exists($obj, 'commits_url')) { | |
| 916 | + throw new Exception("Missing required property"); | |
| 917 | + } | |
| 918 | + if (!property_exists($obj, 'created_at')) { | |
| 919 | + throw new Exception("Missing required property"); | |
| 920 | + } | |
| 921 | + if (!property_exists($obj, 'description')) { | |
| 922 | + throw new Exception("Missing required property"); | |
| 923 | + } | |
| 924 | + if (!property_exists($obj, 'files')) { | |
| 925 | + throw new Exception("Missing required property"); | |
| 926 | + } | |
| 927 | + if (!property_exists($obj, 'forks_url')) { | |
| 928 | + throw new Exception("Missing required property"); | |
| 929 | + } | |
| 930 | + if (!property_exists($obj, 'git_pull_url')) { | |
| 931 | + throw new Exception("Missing required property"); | |
| 932 | + } | |
| 933 | + if (!property_exists($obj, 'git_push_url')) { | |
| 934 | + throw new Exception("Missing required property"); | |
| 935 | + } | |
| 936 | + if (!property_exists($obj, 'html_url')) { | |
| 937 | + throw new Exception("Missing required property"); | |
| 938 | + } | |
| 939 | + if (!property_exists($obj, 'id')) { | |
| 940 | + throw new Exception("Missing required property"); | |
| 941 | + } | |
| 942 | + if (!property_exists($obj, 'public')) { | |
| 943 | + throw new Exception("Missing required property"); | |
| 944 | + } | |
| 945 | + if (!property_exists($obj, 'truncated')) { | |
| 946 | + throw new Exception("Missing required property"); | |
| 947 | + } | |
| 948 | + if (!property_exists($obj, 'updated_at')) { | |
| 949 | + throw new Exception("Missing required property"); | |
| 950 | + } | |
| 951 | + if (!property_exists($obj, 'url')) { | |
| 952 | + throw new Exception("Missing required property"); | |
| 953 | + } | |
| 954 | + if (!property_exists($obj, 'user')) { | |
| 955 | + throw new Exception("Missing required property"); | |
| 956 | + } | |
| 909 | 957 | return new TopLevel( |
| 910 | 958 | TopLevel::fromComments($obj->{'comments'}) |
| 911 | 959 | ,TopLevel::fromCommentsURL($obj->{'comments_url'}) |
| @@ -1254,6 +1302,21 @@ class File { | ||
| 1254 | 1302 | * @throws Exception |
| 1255 | 1303 | */ |
| 1256 | 1304 | public static function from(stdClass $obj): File { |
| 1305 | + if (!property_exists($obj, 'filename')) { | |
| 1306 | + throw new Exception("Missing required property"); | |
| 1307 | + } | |
| 1308 | + if (!property_exists($obj, 'language')) { | |
| 1309 | + throw new Exception("Missing required property"); | |
| 1310 | + } | |
| 1311 | + if (!property_exists($obj, 'raw_url')) { | |
| 1312 | + throw new Exception("Missing required property"); | |
| 1313 | + } | |
| 1314 | + if (!property_exists($obj, 'size')) { | |
| 1315 | + throw new Exception("Missing required property"); | |
| 1316 | + } | |
| 1317 | + if (!property_exists($obj, 'type')) { | |
| 1318 | + throw new Exception("Missing required property"); | |
| 1319 | + } | |
| 1257 | 1320 | return new File( |
| 1258 | 1321 | File::fromFilename($obj->{'filename'}) |
| 1259 | 1322 | ,File::fromLanguage($obj->{'language'}) |
Test case
1 generated file · +42 −0test/inputs/json/misc/80aff.json
Mphpdefault / TopLevel.php+42 −0
| @@ -409,6 +409,27 @@ class TopLevel { | ||
| 409 | 409 | * @throws Exception |
| 410 | 410 | */ |
| 411 | 411 | public static function from(stdClass $obj): TopLevel { |
| 412 | + if (!property_exists($obj, 'count')) { | |
| 413 | + throw new Exception("Missing required property"); | |
| 414 | + } | |
| 415 | + if (!property_exists($obj, 'facets')) { | |
| 416 | + throw new Exception("Missing required property"); | |
| 417 | + } | |
| 418 | + if (!property_exists($obj, 'limit')) { | |
| 419 | + throw new Exception("Missing required property"); | |
| 420 | + } | |
| 421 | + if (!property_exists($obj, 'next')) { | |
| 422 | + throw new Exception("Missing required property"); | |
| 423 | + } | |
| 424 | + if (!property_exists($obj, 'offset')) { | |
| 425 | + throw new Exception("Missing required property"); | |
| 426 | + } | |
| 427 | + if (!property_exists($obj, 'previous')) { | |
| 428 | + throw new Exception("Missing required property"); | |
| 429 | + } | |
| 430 | + if (!property_exists($obj, 'results')) { | |
| 431 | + throw new Exception("Missing required property"); | |
| 432 | + } | |
| 412 | 433 | return new TopLevel( |
| 413 | 434 | TopLevel::fromCount($obj->{'count'}) |
| 414 | 435 | ,TopLevel::fromFacets($obj->{'facets'}) |
| @@ -900,6 +921,27 @@ class Result { | ||
| 900 | 921 | * @throws Exception |
| 901 | 922 | */ |
| 902 | 923 | public static function from(stdClass $obj): Result { |
| 924 | + if (!property_exists($obj, 'created_at')) { | |
| 925 | + throw new Exception("Missing required property"); | |
| 926 | + } | |
| 927 | + if (!property_exists($obj, 'id')) { | |
| 928 | + throw new Exception("Missing required property"); | |
| 929 | + } | |
| 930 | + if (!property_exists($obj, 'items')) { | |
| 931 | + throw new Exception("Missing required property"); | |
| 932 | + } | |
| 933 | + if (!property_exists($obj, 'name')) { | |
| 934 | + throw new Exception("Missing required property"); | |
| 935 | + } | |
| 936 | + if (!property_exists($obj, 'parent')) { | |
| 937 | + throw new Exception("Missing required property"); | |
| 938 | + } | |
| 939 | + if (!property_exists($obj, 'updated_at')) { | |
| 940 | + throw new Exception("Missing required property"); | |
| 941 | + } | |
| 942 | + if (!property_exists($obj, 'uri')) { | |
| 943 | + throw new Exception("Missing required property"); | |
| 944 | + } | |
| 903 | 945 | return new Result( |
| 904 | 946 | Result::fromCreatedAt($obj->{'created_at'}) |
| 905 | 947 | ,Result::fromID($obj->{'id'}) |
Test case
1 generated file · +3 −0test/inputs/json/misc/82509.json
Mphpdefault / TopLevel.php+3 −0
| @@ -84,6 +84,9 @@ class TopLevel { | ||
| 84 | 84 | * @throws Exception |
| 85 | 85 | */ |
| 86 | 86 | public static function from(stdClass $obj): TopLevel { |
| 87 | + if (!property_exists($obj, 'origin')) { | |
| 88 | + throw new Exception("Missing required property"); | |
| 89 | + } | |
| 87 | 90 | return new TopLevel( |
| 88 | 91 | TopLevel::fromOrigin($obj->{'origin'}) |
| 89 | 92 | ); |
Test case
1 generated file · +237 −0test/inputs/json/misc/8592b.json
Mphpdefault / TopLevel.php+237 −0
| @@ -137,6 +137,12 @@ class TopLevel { | ||
| 137 | 137 | * @throws Exception |
| 138 | 138 | */ |
| 139 | 139 | public static function from(stdClass $obj): TopLevel { |
| 140 | + if (!property_exists($obj, 'data')) { | |
| 141 | + throw new Exception("Missing required property"); | |
| 142 | + } | |
| 143 | + if (!property_exists($obj, 'kind')) { | |
| 144 | + throw new Exception("Missing required property"); | |
| 145 | + } | |
| 140 | 146 | return new TopLevel( |
| 141 | 147 | TopLevel::fromData($obj->{'data'}) |
| 142 | 148 | ,TopLevel::fromKind($obj->{'kind'}) |
| @@ -408,6 +414,18 @@ class TopLevelData { | ||
| 408 | 414 | * @throws Exception |
| 409 | 415 | */ |
| 410 | 416 | public static function from(stdClass $obj): TopLevelData { |
| 417 | + if (!property_exists($obj, 'after')) { | |
| 418 | + throw new Exception("Missing required property"); | |
| 419 | + } | |
| 420 | + if (!property_exists($obj, 'before')) { | |
| 421 | + throw new Exception("Missing required property"); | |
| 422 | + } | |
| 423 | + if (!property_exists($obj, 'children')) { | |
| 424 | + throw new Exception("Missing required property"); | |
| 425 | + } | |
| 426 | + if (!property_exists($obj, 'modhash')) { | |
| 427 | + throw new Exception("Missing required property"); | |
| 428 | + } | |
| 411 | 429 | return new TopLevelData( |
| 412 | 430 | TopLevelData::fromAfter($obj->{'after'}) |
| 413 | 431 | ,TopLevelData::fromBefore($obj->{'before'}) |
| @@ -566,6 +584,12 @@ class Child { | ||
| 566 | 584 | * @throws Exception |
| 567 | 585 | */ |
| 568 | 586 | public static function from(stdClass $obj): Child { |
| 587 | + if (!property_exists($obj, 'data')) { | |
| 588 | + throw new Exception("Missing required property"); | |
| 589 | + } | |
| 590 | + if (!property_exists($obj, 'kind')) { | |
| 591 | + throw new Exception("Missing required property"); | |
| 592 | + } | |
| 569 | 593 | return new Child( |
| 570 | 594 | Child::fromData($obj->{'data'}) |
| 571 | 595 | ,Child::fromKind($obj->{'kind'}) |
| @@ -4079,6 +4103,192 @@ class ChildData { | ||
| 4079 | 4103 | * @throws Exception |
| 4080 | 4104 | */ |
| 4081 | 4105 | public static function from(stdClass $obj): ChildData { |
| 4106 | + if (!property_exists($obj, 'approved_at_utc')) { | |
| 4107 | + throw new Exception("Missing required property"); | |
| 4108 | + } | |
| 4109 | + if (!property_exists($obj, 'approved_by')) { | |
| 4110 | + throw new Exception("Missing required property"); | |
| 4111 | + } | |
| 4112 | + if (!property_exists($obj, 'archived')) { | |
| 4113 | + throw new Exception("Missing required property"); | |
| 4114 | + } | |
| 4115 | + if (!property_exists($obj, 'author')) { | |
| 4116 | + throw new Exception("Missing required property"); | |
| 4117 | + } | |
| 4118 | + if (!property_exists($obj, 'author_flair_css_class')) { | |
| 4119 | + throw new Exception("Missing required property"); | |
| 4120 | + } | |
| 4121 | + if (!property_exists($obj, 'author_flair_text')) { | |
| 4122 | + throw new Exception("Missing required property"); | |
| 4123 | + } | |
| 4124 | + if (!property_exists($obj, 'banned_at_utc')) { | |
| 4125 | + throw new Exception("Missing required property"); | |
| 4126 | + } | |
| 4127 | + if (!property_exists($obj, 'banned_by')) { | |
| 4128 | + throw new Exception("Missing required property"); | |
| 4129 | + } | |
| 4130 | + if (!property_exists($obj, 'brand_safe')) { | |
| 4131 | + throw new Exception("Missing required property"); | |
| 4132 | + } | |
| 4133 | + if (!property_exists($obj, 'can_gild')) { | |
| 4134 | + throw new Exception("Missing required property"); | |
| 4135 | + } | |
| 4136 | + if (!property_exists($obj, 'can_mod_post')) { | |
| 4137 | + throw new Exception("Missing required property"); | |
| 4138 | + } | |
| 4139 | + if (!property_exists($obj, 'clicked')) { | |
| 4140 | + throw new Exception("Missing required property"); | |
| 4141 | + } | |
| 4142 | + if (!property_exists($obj, 'contest_mode')) { | |
| 4143 | + throw new Exception("Missing required property"); | |
| 4144 | + } | |
| 4145 | + if (!property_exists($obj, 'created')) { | |
| 4146 | + throw new Exception("Missing required property"); | |
| 4147 | + } | |
| 4148 | + if (!property_exists($obj, 'created_utc')) { | |
| 4149 | + throw new Exception("Missing required property"); | |
| 4150 | + } | |
| 4151 | + if (!property_exists($obj, 'distinguished')) { | |
| 4152 | + throw new Exception("Missing required property"); | |
| 4153 | + } | |
| 4154 | + if (!property_exists($obj, 'domain')) { | |
| 4155 | + throw new Exception("Missing required property"); | |
| 4156 | + } | |
| 4157 | + if (!property_exists($obj, 'downs')) { | |
| 4158 | + throw new Exception("Missing required property"); | |
| 4159 | + } | |
| 4160 | + if (!property_exists($obj, 'edited')) { | |
| 4161 | + throw new Exception("Missing required property"); | |
| 4162 | + } | |
| 4163 | + if (!property_exists($obj, 'gilded')) { | |
| 4164 | + throw new Exception("Missing required property"); | |
| 4165 | + } | |
| 4166 | + if (!property_exists($obj, 'hidden')) { | |
| 4167 | + throw new Exception("Missing required property"); | |
| 4168 | + } | |
| 4169 | + if (!property_exists($obj, 'hide_score')) { | |
| 4170 | + throw new Exception("Missing required property"); | |
| 4171 | + } | |
| 4172 | + if (!property_exists($obj, 'id')) { | |
| 4173 | + throw new Exception("Missing required property"); | |
| 4174 | + } | |
| 4175 | + if (!property_exists($obj, 'is_self')) { | |
| 4176 | + throw new Exception("Missing required property"); | |
| 4177 | + } | |
| 4178 | + if (!property_exists($obj, 'is_video')) { | |
| 4179 | + throw new Exception("Missing required property"); | |
| 4180 | + } | |
| 4181 | + if (!property_exists($obj, 'likes')) { | |
| 4182 | + throw new Exception("Missing required property"); | |
| 4183 | + } | |
| 4184 | + if (!property_exists($obj, 'link_flair_css_class')) { | |
| 4185 | + throw new Exception("Missing required property"); | |
| 4186 | + } | |
| 4187 | + if (!property_exists($obj, 'link_flair_text')) { | |
| 4188 | + throw new Exception("Missing required property"); | |
| 4189 | + } | |
| 4190 | + if (!property_exists($obj, 'locked')) { | |
| 4191 | + throw new Exception("Missing required property"); | |
| 4192 | + } | |
| 4193 | + if (!property_exists($obj, 'media')) { | |
| 4194 | + throw new Exception("Missing required property"); | |
| 4195 | + } | |
| 4196 | + if (!property_exists($obj, 'media_embed')) { | |
| 4197 | + throw new Exception("Missing required property"); | |
| 4198 | + } | |
| 4199 | + if (!property_exists($obj, 'mod_reports')) { | |
| 4200 | + throw new Exception("Missing required property"); | |
| 4201 | + } | |
| 4202 | + if (!property_exists($obj, 'name')) { | |
| 4203 | + throw new Exception("Missing required property"); | |
| 4204 | + } | |
| 4205 | + if (!property_exists($obj, 'num_comments')) { | |
| 4206 | + throw new Exception("Missing required property"); | |
| 4207 | + } | |
| 4208 | + if (!property_exists($obj, 'num_reports')) { | |
| 4209 | + throw new Exception("Missing required property"); | |
| 4210 | + } | |
| 4211 | + if (!property_exists($obj, 'over_18')) { | |
| 4212 | + throw new Exception("Missing required property"); | |
| 4213 | + } | |
| 4214 | + if (!property_exists($obj, 'permalink')) { | |
| 4215 | + throw new Exception("Missing required property"); | |
| 4216 | + } | |
| 4217 | + if (!property_exists($obj, 'quarantine')) { | |
| 4218 | + throw new Exception("Missing required property"); | |
| 4219 | + } | |
| 4220 | + if (!property_exists($obj, 'removal_reason')) { | |
| 4221 | + throw new Exception("Missing required property"); | |
| 4222 | + } | |
| 4223 | + if (!property_exists($obj, 'report_reasons')) { | |
| 4224 | + throw new Exception("Missing required property"); | |
| 4225 | + } | |
| 4226 | + if (!property_exists($obj, 'saved')) { | |
| 4227 | + throw new Exception("Missing required property"); | |
| 4228 | + } | |
| 4229 | + if (!property_exists($obj, 'score')) { | |
| 4230 | + throw new Exception("Missing required property"); | |
| 4231 | + } | |
| 4232 | + if (!property_exists($obj, 'secure_media')) { | |
| 4233 | + throw new Exception("Missing required property"); | |
| 4234 | + } | |
| 4235 | + if (!property_exists($obj, 'secure_media_embed')) { | |
| 4236 | + throw new Exception("Missing required property"); | |
| 4237 | + } | |
| 4238 | + if (!property_exists($obj, 'selftext')) { | |
| 4239 | + throw new Exception("Missing required property"); | |
| 4240 | + } | |
| 4241 | + if (!property_exists($obj, 'selftext_html')) { | |
| 4242 | + throw new Exception("Missing required property"); | |
| 4243 | + } | |
| 4244 | + if (!property_exists($obj, 'spoiler')) { | |
| 4245 | + throw new Exception("Missing required property"); | |
| 4246 | + } | |
| 4247 | + if (!property_exists($obj, 'stickied')) { | |
| 4248 | + throw new Exception("Missing required property"); | |
| 4249 | + } | |
| 4250 | + if (!property_exists($obj, 'subreddit')) { | |
| 4251 | + throw new Exception("Missing required property"); | |
| 4252 | + } | |
| 4253 | + if (!property_exists($obj, 'subreddit_id')) { | |
| 4254 | + throw new Exception("Missing required property"); | |
| 4255 | + } | |
| 4256 | + if (!property_exists($obj, 'subreddit_name_prefixed')) { | |
| 4257 | + throw new Exception("Missing required property"); | |
| 4258 | + } | |
| 4259 | + if (!property_exists($obj, 'subreddit_type')) { | |
| 4260 | + throw new Exception("Missing required property"); | |
| 4261 | + } | |
| 4262 | + if (!property_exists($obj, 'suggested_sort')) { | |
| 4263 | + throw new Exception("Missing required property"); | |
| 4264 | + } | |
| 4265 | + if (!property_exists($obj, 'thumbnail')) { | |
| 4266 | + throw new Exception("Missing required property"); | |
| 4267 | + } | |
| 4268 | + if (!property_exists($obj, 'thumbnail_height')) { | |
| 4269 | + throw new Exception("Missing required property"); | |
| 4270 | + } | |
| 4271 | + if (!property_exists($obj, 'thumbnail_width')) { | |
| 4272 | + throw new Exception("Missing required property"); | |
| 4273 | + } | |
| 4274 | + if (!property_exists($obj, 'title')) { | |
| 4275 | + throw new Exception("Missing required property"); | |
| 4276 | + } | |
| 4277 | + if (!property_exists($obj, 'ups')) { | |
| 4278 | + throw new Exception("Missing required property"); | |
| 4279 | + } | |
| 4280 | + if (!property_exists($obj, 'url')) { | |
| 4281 | + throw new Exception("Missing required property"); | |
| 4282 | + } | |
| 4283 | + if (!property_exists($obj, 'user_reports')) { | |
| 4284 | + throw new Exception("Missing required property"); | |
| 4285 | + } | |
| 4286 | + if (!property_exists($obj, 'view_count')) { | |
| 4287 | + throw new Exception("Missing required property"); | |
| 4288 | + } | |
| 4289 | + if (!property_exists($obj, 'visited')) { | |
| 4290 | + throw new Exception("Missing required property"); | |
| 4291 | + } | |
| 4082 | 4292 | return new ChildData( |
| 4083 | 4293 | ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'}) |
| 4084 | 4294 | ,ChildData::fromApprovedBy($obj->{'approved_by'}) |
| @@ -4457,6 +4667,12 @@ class Preview { | ||
| 4457 | 4667 | * @throws Exception |
| 4458 | 4668 | */ |
| 4459 | 4669 | public static function from(stdClass $obj): Preview { |
| 4670 | + if (!property_exists($obj, 'enabled')) { | |
| 4671 | + throw new Exception("Missing required property"); | |
| 4672 | + } | |
| 4673 | + if (!property_exists($obj, 'images')) { | |
| 4674 | + throw new Exception("Missing required property"); | |
| 4675 | + } | |
| 4460 | 4676 | return new Preview( |
| 4461 | 4677 | Preview::fromEnabled($obj->{'enabled'}) |
| 4462 | 4678 | ,Preview::fromImages($obj->{'images'}) |
| @@ -4727,6 +4943,18 @@ class Image { | ||
| 4727 | 4943 | * @throws Exception |
| 4728 | 4944 | */ |
| 4729 | 4945 | public static function from(stdClass $obj): Image { |
| 4946 | + if (!property_exists($obj, 'id')) { | |
| 4947 | + throw new Exception("Missing required property"); | |
| 4948 | + } | |
| 4949 | + if (!property_exists($obj, 'resolutions')) { | |
| 4950 | + throw new Exception("Missing required property"); | |
| 4951 | + } | |
| 4952 | + if (!property_exists($obj, 'source')) { | |
| 4953 | + throw new Exception("Missing required property"); | |
| 4954 | + } | |
| 4955 | + if (!property_exists($obj, 'variants')) { | |
| 4956 | + throw new Exception("Missing required property"); | |
| 4957 | + } | |
| 4730 | 4958 | return new Image( |
| 4731 | 4959 | Image::fromID($obj->{'id'}) |
| 4732 | 4960 | ,Image::fromResolutions($obj->{'resolutions'}) |
| @@ -4935,6 +5163,15 @@ class Source { | ||
| 4935 | 5163 | * @throws Exception |
| 4936 | 5164 | */ |
| 4937 | 5165 | public static function from(stdClass $obj): Source { |
| 5166 | + if (!property_exists($obj, 'height')) { | |
| 5167 | + throw new Exception("Missing required property"); | |
| 5168 | + } | |
| 5169 | + if (!property_exists($obj, 'url')) { | |
| 5170 | + throw new Exception("Missing required property"); | |
| 5171 | + } | |
| 5172 | + if (!property_exists($obj, 'width')) { | |
| 5173 | + throw new Exception("Missing required property"); | |
| 5174 | + } | |
| 4938 | 5175 | return new Source( |
| 4939 | 5176 | Source::fromHeight($obj->{'height'}) |
| 4940 | 5177 | ,Source::fromURL($obj->{'url'}) |
Test case
1 generated file · +180 −0test/inputs/json/misc/88130.json
Mphpdefault / TopLevel.php+180 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'query')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromQuery($obj->{'query'}) |
| 90 | 93 | ); |
| @@ -347,6 +350,18 @@ class Query { | ||
| 347 | 350 | * @throws Exception |
| 348 | 351 | */ |
| 349 | 352 | public static function from(stdClass $obj): Query { |
| 353 | + if (!property_exists($obj, 'count')) { | |
| 354 | + throw new Exception("Missing required property"); | |
| 355 | + } | |
| 356 | + if (!property_exists($obj, 'created')) { | |
| 357 | + throw new Exception("Missing required property"); | |
| 358 | + } | |
| 359 | + if (!property_exists($obj, 'lang')) { | |
| 360 | + throw new Exception("Missing required property"); | |
| 361 | + } | |
| 362 | + if (!property_exists($obj, 'results')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 350 | 365 | return new Query( |
| 351 | 366 | Query::fromCount($obj->{'count'}) |
| 352 | 367 | ,Query::fromCreated($obj->{'created'}) |
| @@ -452,6 +467,9 @@ class Results { | ||
| 452 | 467 | * @throws Exception |
| 453 | 468 | */ |
| 454 | 469 | public static function from(stdClass $obj): Results { |
| 470 | + if (!property_exists($obj, 'channel')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 455 | 473 | return new Results( |
| 456 | 474 | Results::fromChannel($obj->{'channel'}) |
| 457 | 475 | ); |
| @@ -1181,6 +1199,45 @@ class Channel { | ||
| 1181 | 1199 | * @throws Exception |
| 1182 | 1200 | */ |
| 1183 | 1201 | public static function from(stdClass $obj): Channel { |
| 1202 | + if (!property_exists($obj, 'astronomy')) { | |
| 1203 | + throw new Exception("Missing required property"); | |
| 1204 | + } | |
| 1205 | + if (!property_exists($obj, 'atmosphere')) { | |
| 1206 | + throw new Exception("Missing required property"); | |
| 1207 | + } | |
| 1208 | + if (!property_exists($obj, 'description')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'image')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1214 | + if (!property_exists($obj, 'item')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'language')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'lastBuildDate')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'link')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'location')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'title')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'ttl')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'units')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'wind')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1184 | 1241 | return new Channel( |
| 1185 | 1242 | Channel::fromAstronomy($obj->{'astronomy'}) |
| 1186 | 1243 | ,Channel::fromAtmosphere($obj->{'atmosphere'}) |
| @@ -1355,6 +1412,12 @@ class Astronomy { | ||
| 1355 | 1412 | * @throws Exception |
| 1356 | 1413 | */ |
| 1357 | 1414 | public static function from(stdClass $obj): Astronomy { |
| 1415 | + if (!property_exists($obj, 'sunrise')) { | |
| 1416 | + throw new Exception("Missing required property"); | |
| 1417 | + } | |
| 1418 | + if (!property_exists($obj, 'sunset')) { | |
| 1419 | + throw new Exception("Missing required property"); | |
| 1420 | + } | |
| 1358 | 1421 | return new Astronomy( |
| 1359 | 1422 | Astronomy::fromSunrise($obj->{'sunrise'}) |
| 1360 | 1423 | ,Astronomy::fromSunset($obj->{'sunset'}) |
| @@ -1611,6 +1674,18 @@ class Atmosphere { | ||
| 1611 | 1674 | * @throws Exception |
| 1612 | 1675 | */ |
| 1613 | 1676 | public static function from(stdClass $obj): Atmosphere { |
| 1677 | + if (!property_exists($obj, 'humidity')) { | |
| 1678 | + throw new Exception("Missing required property"); | |
| 1679 | + } | |
| 1680 | + if (!property_exists($obj, 'pressure')) { | |
| 1681 | + throw new Exception("Missing required property"); | |
| 1682 | + } | |
| 1683 | + if (!property_exists($obj, 'rising')) { | |
| 1684 | + throw new Exception("Missing required property"); | |
| 1685 | + } | |
| 1686 | + if (!property_exists($obj, 'visibility')) { | |
| 1687 | + throw new Exception("Missing required property"); | |
| 1688 | + } | |
| 1614 | 1689 | return new Atmosphere( |
| 1615 | 1690 | Atmosphere::fromHumidity($obj->{'humidity'}) |
| 1616 | 1691 | ,Atmosphere::fromPressure($obj->{'pressure'}) |
| @@ -1923,6 +1998,21 @@ class Image { | ||
| 1923 | 1998 | * @throws Exception |
| 1924 | 1999 | */ |
| 1925 | 2000 | public static function from(stdClass $obj): Image { |
| 2001 | + if (!property_exists($obj, 'height')) { | |
| 2002 | + throw new Exception("Missing required property"); | |
| 2003 | + } | |
| 2004 | + if (!property_exists($obj, 'link')) { | |
| 2005 | + throw new Exception("Missing required property"); | |
| 2006 | + } | |
| 2007 | + if (!property_exists($obj, 'title')) { | |
| 2008 | + throw new Exception("Missing required property"); | |
| 2009 | + } | |
| 2010 | + if (!property_exists($obj, 'url')) { | |
| 2011 | + throw new Exception("Missing required property"); | |
| 2012 | + } | |
| 2013 | + if (!property_exists($obj, 'width')) { | |
| 2014 | + throw new Exception("Missing required property"); | |
| 2015 | + } | |
| 1926 | 2016 | return new Image( |
| 1927 | 2017 | Image::fromHeight($obj->{'height'}) |
| 1928 | 2018 | ,Image::fromLink($obj->{'link'}) |
| @@ -2459,6 +2549,33 @@ class Item { | ||
| 2459 | 2549 | * @throws Exception |
| 2460 | 2550 | */ |
| 2461 | 2551 | public static function from(stdClass $obj): Item { |
| 2552 | + if (!property_exists($obj, 'condition')) { | |
| 2553 | + throw new Exception("Missing required property"); | |
| 2554 | + } | |
| 2555 | + if (!property_exists($obj, 'description')) { | |
| 2556 | + throw new Exception("Missing required property"); | |
| 2557 | + } | |
| 2558 | + if (!property_exists($obj, 'forecast')) { | |
| 2559 | + throw new Exception("Missing required property"); | |
| 2560 | + } | |
| 2561 | + if (!property_exists($obj, 'guid')) { | |
| 2562 | + throw new Exception("Missing required property"); | |
| 2563 | + } | |
| 2564 | + if (!property_exists($obj, 'lat')) { | |
| 2565 | + throw new Exception("Missing required property"); | |
| 2566 | + } | |
| 2567 | + if (!property_exists($obj, 'link')) { | |
| 2568 | + throw new Exception("Missing required property"); | |
| 2569 | + } | |
| 2570 | + if (!property_exists($obj, 'long')) { | |
| 2571 | + throw new Exception("Missing required property"); | |
| 2572 | + } | |
| 2573 | + if (!property_exists($obj, 'pubDate')) { | |
| 2574 | + throw new Exception("Missing required property"); | |
| 2575 | + } | |
| 2576 | + if (!property_exists($obj, 'title')) { | |
| 2577 | + throw new Exception("Missing required property"); | |
| 2578 | + } | |
| 2462 | 2579 | return new Item( |
| 2463 | 2580 | Item::fromCondition($obj->{'condition'}) |
| 2464 | 2581 | ,Item::fromDescription($obj->{'description'}) |
| @@ -2729,6 +2846,18 @@ class Condition { | ||
| 2729 | 2846 | * @throws Exception |
| 2730 | 2847 | */ |
| 2731 | 2848 | public static function from(stdClass $obj): Condition { |
| 2849 | + if (!property_exists($obj, 'code')) { | |
| 2850 | + throw new Exception("Missing required property"); | |
| 2851 | + } | |
| 2852 | + if (!property_exists($obj, 'date')) { | |
| 2853 | + throw new Exception("Missing required property"); | |
| 2854 | + } | |
| 2855 | + if (!property_exists($obj, 'temp')) { | |
| 2856 | + throw new Exception("Missing required property"); | |
| 2857 | + } | |
| 2858 | + if (!property_exists($obj, 'text')) { | |
| 2859 | + throw new Exception("Missing required property"); | |
| 2860 | + } | |
| 2732 | 2861 | return new Condition( |
| 2733 | 2862 | Condition::fromCode($obj->{'code'}) |
| 2734 | 2863 | ,Condition::fromDate($obj->{'date'}) |
| @@ -3093,6 +3222,24 @@ class Forecast { | ||
| 3093 | 3222 | * @throws Exception |
| 3094 | 3223 | */ |
| 3095 | 3224 | public static function from(stdClass $obj): Forecast { |
| 3225 | + if (!property_exists($obj, 'code')) { | |
| 3226 | + throw new Exception("Missing required property"); | |
| 3227 | + } | |
| 3228 | + if (!property_exists($obj, 'date')) { | |
| 3229 | + throw new Exception("Missing required property"); | |
| 3230 | + } | |
| 3231 | + if (!property_exists($obj, 'day')) { | |
| 3232 | + throw new Exception("Missing required property"); | |
| 3233 | + } | |
| 3234 | + if (!property_exists($obj, 'high')) { | |
| 3235 | + throw new Exception("Missing required property"); | |
| 3236 | + } | |
| 3237 | + if (!property_exists($obj, 'low')) { | |
| 3238 | + throw new Exception("Missing required property"); | |
| 3239 | + } | |
| 3240 | + if (!property_exists($obj, 'text')) { | |
| 3241 | + throw new Exception("Missing required property"); | |
| 3242 | + } | |
| 3096 | 3243 | return new Forecast( |
| 3097 | 3244 | Forecast::fromCode($obj->{'code'}) |
| 3098 | 3245 | ,Forecast::fromDate($obj->{'date'}) |
| @@ -3201,6 +3348,9 @@ class GUID { | ||
| 3201 | 3348 | * @throws Exception |
| 3202 | 3349 | */ |
| 3203 | 3350 | public static function from(stdClass $obj): GUID { |
| 3351 | + if (!property_exists($obj, 'isPermaLink')) { | |
| 3352 | + throw new Exception("Missing required property"); | |
| 3353 | + } | |
| 3204 | 3354 | return new GUID( |
| 3205 | 3355 | GUID::fromIsPermaLink($obj->{'isPermaLink'}) |
| 3206 | 3356 | ); |
| @@ -3403,6 +3553,15 @@ class Location { | ||
| 3403 | 3553 | * @throws Exception |
| 3404 | 3554 | */ |
| 3405 | 3555 | public static function from(stdClass $obj): Location { |
| 3556 | + if (!property_exists($obj, 'city')) { | |
| 3557 | + throw new Exception("Missing required property"); | |
| 3558 | + } | |
| 3559 | + if (!property_exists($obj, 'country')) { | |
| 3560 | + throw new Exception("Missing required property"); | |
| 3561 | + } | |
| 3562 | + if (!property_exists($obj, 'region')) { | |
| 3563 | + throw new Exception("Missing required property"); | |
| 3564 | + } | |
| 3406 | 3565 | return new Location( |
| 3407 | 3566 | Location::fromCity($obj->{'city'}) |
| 3408 | 3567 | ,Location::fromCountry($obj->{'country'}) |
| @@ -3661,6 +3820,18 @@ class Units { | ||
| 3661 | 3820 | * @throws Exception |
| 3662 | 3821 | */ |
| 3663 | 3822 | public static function from(stdClass $obj): Units { |
| 3823 | + if (!property_exists($obj, 'distance')) { | |
| 3824 | + throw new Exception("Missing required property"); | |
| 3825 | + } | |
| 3826 | + if (!property_exists($obj, 'pressure')) { | |
| 3827 | + throw new Exception("Missing required property"); | |
| 3828 | + } | |
| 3829 | + if (!property_exists($obj, 'speed')) { | |
| 3830 | + throw new Exception("Missing required property"); | |
| 3831 | + } | |
| 3832 | + if (!property_exists($obj, 'temperature')) { | |
| 3833 | + throw new Exception("Missing required property"); | |
| 3834 | + } | |
| 3664 | 3835 | return new Units( |
| 3665 | 3836 | Units::fromDistance($obj->{'distance'}) |
| 3666 | 3837 | ,Units::fromPressure($obj->{'pressure'}) |
| @@ -3869,6 +4040,15 @@ class Wind { | ||
| 3869 | 4040 | * @throws Exception |
| 3870 | 4041 | */ |
| 3871 | 4042 | public static function from(stdClass $obj): Wind { |
| 4043 | + if (!property_exists($obj, 'chill')) { | |
| 4044 | + throw new Exception("Missing required property"); | |
| 4045 | + } | |
| 4046 | + if (!property_exists($obj, 'direction')) { | |
| 4047 | + throw new Exception("Missing required property"); | |
| 4048 | + } | |
| 4049 | + if (!property_exists($obj, 'speed')) { | |
| 4050 | + throw new Exception("Missing required property"); | |
| 4051 | + } | |
| 3872 | 4052 | return new Wind( |
| 3873 | 4053 | Wind::fromChill($obj->{'chill'}) |
| 3874 | 4054 | ,Wind::fromDirection($obj->{'direction'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/8a62c.json
Mphpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'total_population')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromTotalPopulation($obj->{'total_population'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class TotalPopulation { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): TotalPopulation { |
| 252 | + if (!property_exists($obj, 'date')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'population')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new TotalPopulation( |
| 250 | 259 | TotalPopulation::fromDate($obj->{'date'}) |
| 251 | 260 | ,TotalPopulation::fromPopulation($obj->{'population'}) |
Test case
1 generated file · +12 −0test/inputs/json/misc/908db.json
Mphpdefault / TopLevel.php+12 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'states')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromStates($obj->{'states'}) |
| 101 | 104 | ); |
| @@ -195,6 +198,9 @@ class StateElement { | ||
| 195 | 198 | * @throws Exception |
| 196 | 199 | */ |
| 197 | 200 | public static function from(stdClass $obj): StateElement { |
| 201 | + if (!property_exists($obj, 'state')) { | |
| 202 | + throw new Exception("Missing required property"); | |
| 203 | + } | |
| 198 | 204 | return new StateElement( |
| 199 | 205 | StateElement::fromState($obj->{'state'}) |
| 200 | 206 | ); |
| @@ -345,6 +351,12 @@ class StateState { | ||
| 345 | 351 | * @throws Exception |
| 346 | 352 | */ |
| 347 | 353 | public static function from(stdClass $obj): StateState { |
| 354 | + if (!property_exists($obj, 'state_id')) { | |
| 355 | + throw new Exception("Missing required property"); | |
| 356 | + } | |
| 357 | + if (!property_exists($obj, 'state_name')) { | |
| 358 | + throw new Exception("Missing required property"); | |
| 359 | + } | |
| 348 | 360 | return new StateState( |
| 349 | 361 | StateState::fromStateID($obj->{'state_id'}) |
| 350 | 362 | ,StateState::fromStateName($obj->{'state_name'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/9617f.json
Mphpdefault / TopLevel.php+9 −0
| @@ -205,6 +205,15 @@ class TopLevel { | ||
| 205 | 205 | * @throws Exception |
| 206 | 206 | */ |
| 207 | 207 | public static function from(stdClass $obj): TopLevel { |
| 208 | + if (!property_exists($obj, 'base')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'date')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 214 | + if (!property_exists($obj, 'rates')) { | |
| 215 | + throw new Exception("Missing required property"); | |
| 216 | + } | |
| 208 | 217 | return new TopLevel( |
| 209 | 218 | TopLevel::fromBase($obj->{'base'}) |
| 210 | 219 | ,TopLevel::fromDate($obj->{'date'}) |
Test case
1 generated file · +18 −0test/inputs/json/misc/96f7c.json
Mphpdefault / TopLevel.php+18 −0
| @@ -400,6 +400,24 @@ class TopLevel { | ||
| 400 | 400 | * @throws Exception |
| 401 | 401 | */ |
| 402 | 402 | public static function from(stdClass $obj): TopLevel { |
| 403 | + if (!property_exists($obj, 'git')) { | |
| 404 | + throw new Exception("Missing required property"); | |
| 405 | + } | |
| 406 | + if (!property_exists($obj, 'github_services_sha')) { | |
| 407 | + throw new Exception("Missing required property"); | |
| 408 | + } | |
| 409 | + if (!property_exists($obj, 'hooks')) { | |
| 410 | + throw new Exception("Missing required property"); | |
| 411 | + } | |
| 412 | + if (!property_exists($obj, 'importer')) { | |
| 413 | + throw new Exception("Missing required property"); | |
| 414 | + } | |
| 415 | + if (!property_exists($obj, 'pages')) { | |
| 416 | + throw new Exception("Missing required property"); | |
| 417 | + } | |
| 418 | + if (!property_exists($obj, 'verifiable_password_authentication')) { | |
| 419 | + throw new Exception("Missing required property"); | |
| 420 | + } | |
| 403 | 421 | return new TopLevel( |
| 404 | 422 | TopLevel::fromGit($obj->{'git'}) |
| 405 | 423 | ,TopLevel::fromGithubServicesSHA($obj->{'github_services_sha'}) |
Test case
1 generated file · +6 −0test/inputs/json/misc/9847b.json
Mphpdefault / TopLevel.php+6 −0
| @@ -136,6 +136,12 @@ class TopLevel { | ||
| 136 | 136 | * @throws Exception |
| 137 | 137 | */ |
| 138 | 138 | public static function from(stdClass $obj): TopLevel { |
| 139 | + if (!property_exists($obj, 'id')) { | |
| 140 | + throw new Exception("Missing required property"); | |
| 141 | + } | |
| 142 | + if (!property_exists($obj, 'name')) { | |
| 143 | + throw new Exception("Missing required property"); | |
| 144 | + } | |
| 139 | 145 | return new TopLevel( |
| 140 | 146 | TopLevel::fromID($obj->{'id'}) |
| 141 | 147 | ,TopLevel::fromName($obj->{'name'}) |
Test case
1 generated file · +180 −0test/inputs/json/misc/9929c.json
Mphpdefault / TopLevel.php+180 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'query')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromQuery($obj->{'query'}) |
| 90 | 93 | ); |
| @@ -347,6 +350,18 @@ class Query { | ||
| 347 | 350 | * @throws Exception |
| 348 | 351 | */ |
| 349 | 352 | public static function from(stdClass $obj): Query { |
| 353 | + if (!property_exists($obj, 'count')) { | |
| 354 | + throw new Exception("Missing required property"); | |
| 355 | + } | |
| 356 | + if (!property_exists($obj, 'created')) { | |
| 357 | + throw new Exception("Missing required property"); | |
| 358 | + } | |
| 359 | + if (!property_exists($obj, 'lang')) { | |
| 360 | + throw new Exception("Missing required property"); | |
| 361 | + } | |
| 362 | + if (!property_exists($obj, 'results')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 350 | 365 | return new Query( |
| 351 | 366 | Query::fromCount($obj->{'count'}) |
| 352 | 367 | ,Query::fromCreated($obj->{'created'}) |
| @@ -452,6 +467,9 @@ class Results { | ||
| 452 | 467 | * @throws Exception |
| 453 | 468 | */ |
| 454 | 469 | public static function from(stdClass $obj): Results { |
| 470 | + if (!property_exists($obj, 'channel')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 455 | 473 | return new Results( |
| 456 | 474 | Results::fromChannel($obj->{'channel'}) |
| 457 | 475 | ); |
| @@ -1181,6 +1199,45 @@ class Channel { | ||
| 1181 | 1199 | * @throws Exception |
| 1182 | 1200 | */ |
| 1183 | 1201 | public static function from(stdClass $obj): Channel { |
| 1202 | + if (!property_exists($obj, 'astronomy')) { | |
| 1203 | + throw new Exception("Missing required property"); | |
| 1204 | + } | |
| 1205 | + if (!property_exists($obj, 'atmosphere')) { | |
| 1206 | + throw new Exception("Missing required property"); | |
| 1207 | + } | |
| 1208 | + if (!property_exists($obj, 'description')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'image')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1214 | + if (!property_exists($obj, 'item')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'language')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'lastBuildDate')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'link')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'location')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'title')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'ttl')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'units')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'wind')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1184 | 1241 | return new Channel( |
| 1185 | 1242 | Channel::fromAstronomy($obj->{'astronomy'}) |
| 1186 | 1243 | ,Channel::fromAtmosphere($obj->{'atmosphere'}) |
| @@ -1355,6 +1412,12 @@ class Astronomy { | ||
| 1355 | 1412 | * @throws Exception |
| 1356 | 1413 | */ |
| 1357 | 1414 | public static function from(stdClass $obj): Astronomy { |
| 1415 | + if (!property_exists($obj, 'sunrise')) { | |
| 1416 | + throw new Exception("Missing required property"); | |
| 1417 | + } | |
| 1418 | + if (!property_exists($obj, 'sunset')) { | |
| 1419 | + throw new Exception("Missing required property"); | |
| 1420 | + } | |
| 1358 | 1421 | return new Astronomy( |
| 1359 | 1422 | Astronomy::fromSunrise($obj->{'sunrise'}) |
| 1360 | 1423 | ,Astronomy::fromSunset($obj->{'sunset'}) |
| @@ -1611,6 +1674,18 @@ class Atmosphere { | ||
| 1611 | 1674 | * @throws Exception |
| 1612 | 1675 | */ |
| 1613 | 1676 | public static function from(stdClass $obj): Atmosphere { |
| 1677 | + if (!property_exists($obj, 'humidity')) { | |
| 1678 | + throw new Exception("Missing required property"); | |
| 1679 | + } | |
| 1680 | + if (!property_exists($obj, 'pressure')) { | |
| 1681 | + throw new Exception("Missing required property"); | |
| 1682 | + } | |
| 1683 | + if (!property_exists($obj, 'rising')) { | |
| 1684 | + throw new Exception("Missing required property"); | |
| 1685 | + } | |
| 1686 | + if (!property_exists($obj, 'visibility')) { | |
| 1687 | + throw new Exception("Missing required property"); | |
| 1688 | + } | |
| 1614 | 1689 | return new Atmosphere( |
| 1615 | 1690 | Atmosphere::fromHumidity($obj->{'humidity'}) |
| 1616 | 1691 | ,Atmosphere::fromPressure($obj->{'pressure'}) |
| @@ -1923,6 +1998,21 @@ class Image { | ||
| 1923 | 1998 | * @throws Exception |
| 1924 | 1999 | */ |
| 1925 | 2000 | public static function from(stdClass $obj): Image { |
| 2001 | + if (!property_exists($obj, 'height')) { | |
| 2002 | + throw new Exception("Missing required property"); | |
| 2003 | + } | |
| 2004 | + if (!property_exists($obj, 'link')) { | |
| 2005 | + throw new Exception("Missing required property"); | |
| 2006 | + } | |
| 2007 | + if (!property_exists($obj, 'title')) { | |
| 2008 | + throw new Exception("Missing required property"); | |
| 2009 | + } | |
| 2010 | + if (!property_exists($obj, 'url')) { | |
| 2011 | + throw new Exception("Missing required property"); | |
| 2012 | + } | |
| 2013 | + if (!property_exists($obj, 'width')) { | |
| 2014 | + throw new Exception("Missing required property"); | |
| 2015 | + } | |
| 1926 | 2016 | return new Image( |
| 1927 | 2017 | Image::fromHeight($obj->{'height'}) |
| 1928 | 2018 | ,Image::fromLink($obj->{'link'}) |
| @@ -2459,6 +2549,33 @@ class Item { | ||
| 2459 | 2549 | * @throws Exception |
| 2460 | 2550 | */ |
| 2461 | 2551 | public static function from(stdClass $obj): Item { |
| 2552 | + if (!property_exists($obj, 'condition')) { | |
| 2553 | + throw new Exception("Missing required property"); | |
| 2554 | + } | |
| 2555 | + if (!property_exists($obj, 'description')) { | |
| 2556 | + throw new Exception("Missing required property"); | |
| 2557 | + } | |
| 2558 | + if (!property_exists($obj, 'forecast')) { | |
| 2559 | + throw new Exception("Missing required property"); | |
| 2560 | + } | |
| 2561 | + if (!property_exists($obj, 'guid')) { | |
| 2562 | + throw new Exception("Missing required property"); | |
| 2563 | + } | |
| 2564 | + if (!property_exists($obj, 'lat')) { | |
| 2565 | + throw new Exception("Missing required property"); | |
| 2566 | + } | |
| 2567 | + if (!property_exists($obj, 'link')) { | |
| 2568 | + throw new Exception("Missing required property"); | |
| 2569 | + } | |
| 2570 | + if (!property_exists($obj, 'long')) { | |
| 2571 | + throw new Exception("Missing required property"); | |
| 2572 | + } | |
| 2573 | + if (!property_exists($obj, 'pubDate')) { | |
| 2574 | + throw new Exception("Missing required property"); | |
| 2575 | + } | |
| 2576 | + if (!property_exists($obj, 'title')) { | |
| 2577 | + throw new Exception("Missing required property"); | |
| 2578 | + } | |
| 2462 | 2579 | return new Item( |
| 2463 | 2580 | Item::fromCondition($obj->{'condition'}) |
| 2464 | 2581 | ,Item::fromDescription($obj->{'description'}) |
| @@ -2729,6 +2846,18 @@ class Condition { | ||
| 2729 | 2846 | * @throws Exception |
| 2730 | 2847 | */ |
| 2731 | 2848 | public static function from(stdClass $obj): Condition { |
| 2849 | + if (!property_exists($obj, 'code')) { | |
| 2850 | + throw new Exception("Missing required property"); | |
| 2851 | + } | |
| 2852 | + if (!property_exists($obj, 'date')) { | |
| 2853 | + throw new Exception("Missing required property"); | |
| 2854 | + } | |
| 2855 | + if (!property_exists($obj, 'temp')) { | |
| 2856 | + throw new Exception("Missing required property"); | |
| 2857 | + } | |
| 2858 | + if (!property_exists($obj, 'text')) { | |
| 2859 | + throw new Exception("Missing required property"); | |
| 2860 | + } | |
| 2732 | 2861 | return new Condition( |
| 2733 | 2862 | Condition::fromCode($obj->{'code'}) |
| 2734 | 2863 | ,Condition::fromDate($obj->{'date'}) |
| @@ -3093,6 +3222,24 @@ class Forecast { | ||
| 3093 | 3222 | * @throws Exception |
| 3094 | 3223 | */ |
| 3095 | 3224 | public static function from(stdClass $obj): Forecast { |
| 3225 | + if (!property_exists($obj, 'code')) { | |
| 3226 | + throw new Exception("Missing required property"); | |
| 3227 | + } | |
| 3228 | + if (!property_exists($obj, 'date')) { | |
| 3229 | + throw new Exception("Missing required property"); | |
| 3230 | + } | |
| 3231 | + if (!property_exists($obj, 'day')) { | |
| 3232 | + throw new Exception("Missing required property"); | |
| 3233 | + } | |
| 3234 | + if (!property_exists($obj, 'high')) { | |
| 3235 | + throw new Exception("Missing required property"); | |
| 3236 | + } | |
| 3237 | + if (!property_exists($obj, 'low')) { | |
| 3238 | + throw new Exception("Missing required property"); | |
| 3239 | + } | |
| 3240 | + if (!property_exists($obj, 'text')) { | |
| 3241 | + throw new Exception("Missing required property"); | |
| 3242 | + } | |
| 3096 | 3243 | return new Forecast( |
| 3097 | 3244 | Forecast::fromCode($obj->{'code'}) |
| 3098 | 3245 | ,Forecast::fromDate($obj->{'date'}) |
| @@ -3201,6 +3348,9 @@ class GUID { | ||
| 3201 | 3348 | * @throws Exception |
| 3202 | 3349 | */ |
| 3203 | 3350 | public static function from(stdClass $obj): GUID { |
| 3351 | + if (!property_exists($obj, 'isPermaLink')) { | |
| 3352 | + throw new Exception("Missing required property"); | |
| 3353 | + } | |
| 3204 | 3354 | return new GUID( |
| 3205 | 3355 | GUID::fromIsPermaLink($obj->{'isPermaLink'}) |
| 3206 | 3356 | ); |
| @@ -3403,6 +3553,15 @@ class Location { | ||
| 3403 | 3553 | * @throws Exception |
| 3404 | 3554 | */ |
| 3405 | 3555 | public static function from(stdClass $obj): Location { |
| 3556 | + if (!property_exists($obj, 'city')) { | |
| 3557 | + throw new Exception("Missing required property"); | |
| 3558 | + } | |
| 3559 | + if (!property_exists($obj, 'country')) { | |
| 3560 | + throw new Exception("Missing required property"); | |
| 3561 | + } | |
| 3562 | + if (!property_exists($obj, 'region')) { | |
| 3563 | + throw new Exception("Missing required property"); | |
| 3564 | + } | |
| 3406 | 3565 | return new Location( |
| 3407 | 3566 | Location::fromCity($obj->{'city'}) |
| 3408 | 3567 | ,Location::fromCountry($obj->{'country'}) |
| @@ -3661,6 +3820,18 @@ class Units { | ||
| 3661 | 3820 | * @throws Exception |
| 3662 | 3821 | */ |
| 3663 | 3822 | public static function from(stdClass $obj): Units { |
| 3823 | + if (!property_exists($obj, 'distance')) { | |
| 3824 | + throw new Exception("Missing required property"); | |
| 3825 | + } | |
| 3826 | + if (!property_exists($obj, 'pressure')) { | |
| 3827 | + throw new Exception("Missing required property"); | |
| 3828 | + } | |
| 3829 | + if (!property_exists($obj, 'speed')) { | |
| 3830 | + throw new Exception("Missing required property"); | |
| 3831 | + } | |
| 3832 | + if (!property_exists($obj, 'temperature')) { | |
| 3833 | + throw new Exception("Missing required property"); | |
| 3834 | + } | |
| 3664 | 3835 | return new Units( |
| 3665 | 3836 | Units::fromDistance($obj->{'distance'}) |
| 3666 | 3837 | ,Units::fromPressure($obj->{'pressure'}) |
| @@ -3869,6 +4040,15 @@ class Wind { | ||
| 3869 | 4040 | * @throws Exception |
| 3870 | 4041 | */ |
| 3871 | 4042 | public static function from(stdClass $obj): Wind { |
| 4043 | + if (!property_exists($obj, 'chill')) { | |
| 4044 | + throw new Exception("Missing required property"); | |
| 4045 | + } | |
| 4046 | + if (!property_exists($obj, 'direction')) { | |
| 4047 | + throw new Exception("Missing required property"); | |
| 4048 | + } | |
| 4049 | + if (!property_exists($obj, 'speed')) { | |
| 4050 | + throw new Exception("Missing required property"); | |
| 4051 | + } | |
| 3872 | 4052 | return new Wind( |
| 3873 | 4053 | Wind::fromChill($obj->{'chill'}) |
| 3874 | 4054 | ,Wind::fromDirection($obj->{'direction'}) |
Test case
1 generated file · +45 −0test/inputs/json/misc/996bd.json
Mphpdefault / TopLevel.php+45 −0
| @@ -517,6 +517,30 @@ class TopLevel { | ||
| 517 | 517 | * @throws Exception |
| 518 | 518 | */ |
| 519 | 519 | public static function from(stdClass $obj): TopLevel { |
| 520 | + if (!property_exists($obj, 'id')) { | |
| 521 | + throw new Exception("Missing required property"); | |
| 522 | + } | |
| 523 | + if (!property_exists($obj, 'identifiers')) { | |
| 524 | + throw new Exception("Missing required property"); | |
| 525 | + } | |
| 526 | + if (!property_exists($obj, 'keywords')) { | |
| 527 | + throw new Exception("Missing required property"); | |
| 528 | + } | |
| 529 | + if (!property_exists($obj, 'links')) { | |
| 530 | + throw new Exception("Missing required property"); | |
| 531 | + } | |
| 532 | + if (!property_exists($obj, 'name')) { | |
| 533 | + throw new Exception("Missing required property"); | |
| 534 | + } | |
| 535 | + if (!property_exists($obj, 'other_names')) { | |
| 536 | + throw new Exception("Missing required property"); | |
| 537 | + } | |
| 538 | + if (!property_exists($obj, 'superseded_by')) { | |
| 539 | + throw new Exception("Missing required property"); | |
| 540 | + } | |
| 541 | + if (!property_exists($obj, 'text')) { | |
| 542 | + throw new Exception("Missing required property"); | |
| 543 | + } | |
| 520 | 544 | return new TopLevel( |
| 521 | 545 | TopLevel::fromID($obj->{'id'}) |
| 522 | 546 | ,TopLevel::fromIdentifiers($obj->{'identifiers'}) |
| @@ -682,6 +706,12 @@ class Identifier { | ||
| 682 | 706 | * @throws Exception |
| 683 | 707 | */ |
| 684 | 708 | public static function from(stdClass $obj): Identifier { |
| 709 | + if (!property_exists($obj, 'identifier')) { | |
| 710 | + throw new Exception("Missing required property"); | |
| 711 | + } | |
| 712 | + if (!property_exists($obj, 'scheme')) { | |
| 713 | + throw new Exception("Missing required property"); | |
| 714 | + } | |
| 685 | 715 | return new Identifier( |
| 686 | 716 | Identifier::fromIdentifier($obj->{'identifier'}) |
| 687 | 717 | ,Identifier::fromScheme($obj->{'scheme'}) |
| @@ -944,6 +974,12 @@ class Link { | ||
| 944 | 974 | * @throws Exception |
| 945 | 975 | */ |
| 946 | 976 | public static function from(stdClass $obj): Link { |
| 977 | + if (!property_exists($obj, 'note')) { | |
| 978 | + throw new Exception("Missing required property"); | |
| 979 | + } | |
| 980 | + if (!property_exists($obj, 'url')) { | |
| 981 | + throw new Exception("Missing required property"); | |
| 982 | + } | |
| 947 | 983 | return new Link( |
| 948 | 984 | Link::fromNote($obj->{'note'}) |
| 949 | 985 | ,Link::fromURL($obj->{'url'}) |
| @@ -1150,6 +1186,15 @@ class Text { | ||
| 1150 | 1186 | * @throws Exception |
| 1151 | 1187 | */ |
| 1152 | 1188 | public static function from(stdClass $obj): Text { |
| 1189 | + if (!property_exists($obj, 'media_type')) { | |
| 1190 | + throw new Exception("Missing required property"); | |
| 1191 | + } | |
| 1192 | + if (!property_exists($obj, 'title')) { | |
| 1193 | + throw new Exception("Missing required property"); | |
| 1194 | + } | |
| 1195 | + if (!property_exists($obj, 'url')) { | |
| 1196 | + throw new Exception("Missing required property"); | |
| 1197 | + } | |
| 1153 | 1198 | return new Text( |
| 1154 | 1199 | Text::fromMediaType($obj->{'media_type'}) |
| 1155 | 1200 | ,Text::fromTitle($obj->{'title'}) |
Test case
1 generated file · +45 −0test/inputs/json/misc/9a503.json
Mphpdefault / TopLevel.php+45 −0
| @@ -510,6 +510,30 @@ class TopLevel { | ||
| 510 | 510 | * @throws Exception |
| 511 | 511 | */ |
| 512 | 512 | public static function from(stdClass $obj): TopLevel { |
| 513 | + if (!property_exists($obj, 'id')) { | |
| 514 | + throw new Exception("Missing required property"); | |
| 515 | + } | |
| 516 | + if (!property_exists($obj, 'identifiers')) { | |
| 517 | + throw new Exception("Missing required property"); | |
| 518 | + } | |
| 519 | + if (!property_exists($obj, 'keywords')) { | |
| 520 | + throw new Exception("Missing required property"); | |
| 521 | + } | |
| 522 | + if (!property_exists($obj, 'links')) { | |
| 523 | + throw new Exception("Missing required property"); | |
| 524 | + } | |
| 525 | + if (!property_exists($obj, 'name')) { | |
| 526 | + throw new Exception("Missing required property"); | |
| 527 | + } | |
| 528 | + if (!property_exists($obj, 'other_names')) { | |
| 529 | + throw new Exception("Missing required property"); | |
| 530 | + } | |
| 531 | + if (!property_exists($obj, 'superseded_by')) { | |
| 532 | + throw new Exception("Missing required property"); | |
| 533 | + } | |
| 534 | + if (!property_exists($obj, 'text')) { | |
| 535 | + throw new Exception("Missing required property"); | |
| 536 | + } | |
| 513 | 537 | return new TopLevel( |
| 514 | 538 | TopLevel::fromID($obj->{'id'}) |
| 515 | 539 | ,TopLevel::fromIdentifiers($obj->{'identifiers'}) |
| @@ -674,6 +698,12 @@ class Identifier { | ||
| 674 | 698 | * @throws Exception |
| 675 | 699 | */ |
| 676 | 700 | public static function from(stdClass $obj): Identifier { |
| 701 | + if (!property_exists($obj, 'identifier')) { | |
| 702 | + throw new Exception("Missing required property"); | |
| 703 | + } | |
| 704 | + if (!property_exists($obj, 'scheme')) { | |
| 705 | + throw new Exception("Missing required property"); | |
| 706 | + } | |
| 677 | 707 | return new Identifier( |
| 678 | 708 | Identifier::fromIdentifier($obj->{'identifier'}) |
| 679 | 709 | ,Identifier::fromScheme($obj->{'scheme'}) |
| @@ -879,6 +909,12 @@ class Link { | ||
| 879 | 909 | * @throws Exception |
| 880 | 910 | */ |
| 881 | 911 | public static function from(stdClass $obj): Link { |
| 912 | + if (!property_exists($obj, 'note')) { | |
| 913 | + throw new Exception("Missing required property"); | |
| 914 | + } | |
| 915 | + if (!property_exists($obj, 'url')) { | |
| 916 | + throw new Exception("Missing required property"); | |
| 917 | + } | |
| 882 | 918 | return new Link( |
| 883 | 919 | Link::fromNote($obj->{'note'}) |
| 884 | 920 | ,Link::fromURL($obj->{'url'}) |
| @@ -1083,6 +1119,15 @@ class Text { | ||
| 1083 | 1119 | * @throws Exception |
| 1084 | 1120 | */ |
| 1085 | 1121 | public static function from(stdClass $obj): Text { |
| 1122 | + if (!property_exists($obj, 'media_type')) { | |
| 1123 | + throw new Exception("Missing required property"); | |
| 1124 | + } | |
| 1125 | + if (!property_exists($obj, 'title')) { | |
| 1126 | + throw new Exception("Missing required property"); | |
| 1127 | + } | |
| 1128 | + if (!property_exists($obj, 'url')) { | |
| 1129 | + throw new Exception("Missing required property"); | |
| 1130 | + } | |
| 1086 | 1131 | return new Text( |
| 1087 | 1132 | Text::fromMediaType($obj->{'media_type'}) |
| 1088 | 1133 | ,Text::fromTitle($obj->{'title'}) |
Test case
1 generated file · +54 −0test/inputs/json/misc/9ac3b.json
Mphpdefault / TopLevel.php+54 −0
| @@ -409,6 +409,27 @@ class TopLevel { | ||
| 409 | 409 | * @throws Exception |
| 410 | 410 | */ |
| 411 | 411 | public static function from(stdClass $obj): TopLevel { |
| 412 | + if (!property_exists($obj, 'count')) { | |
| 413 | + throw new Exception("Missing required property"); | |
| 414 | + } | |
| 415 | + if (!property_exists($obj, 'facets')) { | |
| 416 | + throw new Exception("Missing required property"); | |
| 417 | + } | |
| 418 | + if (!property_exists($obj, 'limit')) { | |
| 419 | + throw new Exception("Missing required property"); | |
| 420 | + } | |
| 421 | + if (!property_exists($obj, 'next')) { | |
| 422 | + throw new Exception("Missing required property"); | |
| 423 | + } | |
| 424 | + if (!property_exists($obj, 'offset')) { | |
| 425 | + throw new Exception("Missing required property"); | |
| 426 | + } | |
| 427 | + if (!property_exists($obj, 'previous')) { | |
| 428 | + throw new Exception("Missing required property"); | |
| 429 | + } | |
| 430 | + if (!property_exists($obj, 'results')) { | |
| 431 | + throw new Exception("Missing required property"); | |
| 432 | + } | |
| 412 | 433 | return new TopLevel( |
| 413 | 434 | TopLevel::fromCount($obj->{'count'}) |
| 414 | 435 | ,TopLevel::fromFacets($obj->{'facets'}) |
| @@ -1120,6 +1141,39 @@ class Result { | ||
| 1120 | 1141 | * @throws Exception |
| 1121 | 1142 | */ |
| 1122 | 1143 | public static function from(stdClass $obj): Result { |
| 1144 | + if (!property_exists($obj, 'created_at')) { | |
| 1145 | + throw new Exception("Missing required property"); | |
| 1146 | + } | |
| 1147 | + if (!property_exists($obj, 'entity')) { | |
| 1148 | + throw new Exception("Missing required property"); | |
| 1149 | + } | |
| 1150 | + if (!property_exists($obj, 'first_name')) { | |
| 1151 | + throw new Exception("Missing required property"); | |
| 1152 | + } | |
| 1153 | + if (!property_exists($obj, 'id')) { | |
| 1154 | + throw new Exception("Missing required property"); | |
| 1155 | + } | |
| 1156 | + if (!property_exists($obj, 'last_name')) { | |
| 1157 | + throw new Exception("Missing required property"); | |
| 1158 | + } | |
| 1159 | + if (!property_exists($obj, 'name')) { | |
| 1160 | + throw new Exception("Missing required property"); | |
| 1161 | + } | |
| 1162 | + if (!property_exists($obj, 'position')) { | |
| 1163 | + throw new Exception("Missing required property"); | |
| 1164 | + } | |
| 1165 | + if (!property_exists($obj, 'status')) { | |
| 1166 | + throw new Exception("Missing required property"); | |
| 1167 | + } | |
| 1168 | + if (!property_exists($obj, 'title')) { | |
| 1169 | + throw new Exception("Missing required property"); | |
| 1170 | + } | |
| 1171 | + if (!property_exists($obj, 'updated_at')) { | |
| 1172 | + throw new Exception("Missing required property"); | |
| 1173 | + } | |
| 1174 | + if (!property_exists($obj, 'uri')) { | |
| 1175 | + throw new Exception("Missing required property"); | |
| 1176 | + } | |
| 1123 | 1177 | return new Result( |
| 1124 | 1178 | Result::fromCreatedAt($obj->{'created_at'}) |
| 1125 | 1179 | ,Result::fromEntity($obj->{'entity'}) |
Test case
1 generated file · +45 −0test/inputs/json/misc/9eed5.json
Mphpdefault / TopLevel.php+45 −0
| @@ -510,6 +510,30 @@ class TopLevel { | ||
| 510 | 510 | * @throws Exception |
| 511 | 511 | */ |
| 512 | 512 | public static function from(stdClass $obj): TopLevel { |
| 513 | + if (!property_exists($obj, 'id')) { | |
| 514 | + throw new Exception("Missing required property"); | |
| 515 | + } | |
| 516 | + if (!property_exists($obj, 'identifiers')) { | |
| 517 | + throw new Exception("Missing required property"); | |
| 518 | + } | |
| 519 | + if (!property_exists($obj, 'keywords')) { | |
| 520 | + throw new Exception("Missing required property"); | |
| 521 | + } | |
| 522 | + if (!property_exists($obj, 'links')) { | |
| 523 | + throw new Exception("Missing required property"); | |
| 524 | + } | |
| 525 | + if (!property_exists($obj, 'name')) { | |
| 526 | + throw new Exception("Missing required property"); | |
| 527 | + } | |
| 528 | + if (!property_exists($obj, 'other_names')) { | |
| 529 | + throw new Exception("Missing required property"); | |
| 530 | + } | |
| 531 | + if (!property_exists($obj, 'superseded_by')) { | |
| 532 | + throw new Exception("Missing required property"); | |
| 533 | + } | |
| 534 | + if (!property_exists($obj, 'text')) { | |
| 535 | + throw new Exception("Missing required property"); | |
| 536 | + } | |
| 513 | 537 | return new TopLevel( |
| 514 | 538 | TopLevel::fromID($obj->{'id'}) |
| 515 | 539 | ,TopLevel::fromIdentifiers($obj->{'identifiers'}) |
| @@ -674,6 +698,12 @@ class Identifier { | ||
| 674 | 698 | * @throws Exception |
| 675 | 699 | */ |
| 676 | 700 | public static function from(stdClass $obj): Identifier { |
| 701 | + if (!property_exists($obj, 'identifier')) { | |
| 702 | + throw new Exception("Missing required property"); | |
| 703 | + } | |
| 704 | + if (!property_exists($obj, 'scheme')) { | |
| 705 | + throw new Exception("Missing required property"); | |
| 706 | + } | |
| 677 | 707 | return new Identifier( |
| 678 | 708 | Identifier::fromIdentifier($obj->{'identifier'}) |
| 679 | 709 | ,Identifier::fromScheme($obj->{'scheme'}) |
| @@ -875,6 +905,12 @@ class Link { | ||
| 875 | 905 | * @throws Exception |
| 876 | 906 | */ |
| 877 | 907 | public static function from(stdClass $obj): Link { |
| 908 | + if (!property_exists($obj, 'note')) { | |
| 909 | + throw new Exception("Missing required property"); | |
| 910 | + } | |
| 911 | + if (!property_exists($obj, 'url')) { | |
| 912 | + throw new Exception("Missing required property"); | |
| 913 | + } | |
| 878 | 914 | return new Link( |
| 879 | 915 | Link::fromNote($obj->{'note'}) |
| 880 | 916 | ,Link::fromURL($obj->{'url'}) |
| @@ -1079,6 +1115,15 @@ class Text { | ||
| 1079 | 1115 | * @throws Exception |
| 1080 | 1116 | */ |
| 1081 | 1117 | public static function from(stdClass $obj): Text { |
| 1118 | + if (!property_exists($obj, 'media_type')) { | |
| 1119 | + throw new Exception("Missing required property"); | |
| 1120 | + } | |
| 1121 | + if (!property_exists($obj, 'title')) { | |
| 1122 | + throw new Exception("Missing required property"); | |
| 1123 | + } | |
| 1124 | + if (!property_exists($obj, 'url')) { | |
| 1125 | + throw new Exception("Missing required property"); | |
| 1126 | + } | |
| 1082 | 1127 | return new Text( |
| 1083 | 1128 | Text::fromMediaType($obj->{'media_type'}) |
| 1084 | 1129 | ,Text::fromTitle($obj->{'title'}) |
Test case
1 generated file · +51 −0test/inputs/json/misc/a0496.json
Mphpdefault / TopLevel.php+51 −0
| @@ -991,6 +991,57 @@ class TopLevel { | ||
| 991 | 991 | * @throws Exception |
| 992 | 992 | */ |
| 993 | 993 | public static function from(stdClass $obj): TopLevel { |
| 994 | + if (!property_exists($obj, 'code')) { | |
| 995 | + throw new Exception("Missing required property"); | |
| 996 | + } | |
| 997 | + if (!property_exists($obj, 'column_names')) { | |
| 998 | + throw new Exception("Missing required property"); | |
| 999 | + } | |
| 1000 | + if (!property_exists($obj, 'data')) { | |
| 1001 | + throw new Exception("Missing required property"); | |
| 1002 | + } | |
| 1003 | + if (!property_exists($obj, 'description')) { | |
| 1004 | + throw new Exception("Missing required property"); | |
| 1005 | + } | |
| 1006 | + if (!property_exists($obj, 'display_url')) { | |
| 1007 | + throw new Exception("Missing required property"); | |
| 1008 | + } | |
| 1009 | + if (!property_exists($obj, 'errors')) { | |
| 1010 | + throw new Exception("Missing required property"); | |
| 1011 | + } | |
| 1012 | + if (!property_exists($obj, 'frequency')) { | |
| 1013 | + throw new Exception("Missing required property"); | |
| 1014 | + } | |
| 1015 | + if (!property_exists($obj, 'from_date')) { | |
| 1016 | + throw new Exception("Missing required property"); | |
| 1017 | + } | |
| 1018 | + if (!property_exists($obj, 'id')) { | |
| 1019 | + throw new Exception("Missing required property"); | |
| 1020 | + } | |
| 1021 | + if (!property_exists($obj, 'name')) { | |
| 1022 | + throw new Exception("Missing required property"); | |
| 1023 | + } | |
| 1024 | + if (!property_exists($obj, 'premium')) { | |
| 1025 | + throw new Exception("Missing required property"); | |
| 1026 | + } | |
| 1027 | + if (!property_exists($obj, 'source_code')) { | |
| 1028 | + throw new Exception("Missing required property"); | |
| 1029 | + } | |
| 1030 | + if (!property_exists($obj, 'source_name')) { | |
| 1031 | + throw new Exception("Missing required property"); | |
| 1032 | + } | |
| 1033 | + if (!property_exists($obj, 'to_date')) { | |
| 1034 | + throw new Exception("Missing required property"); | |
| 1035 | + } | |
| 1036 | + if (!property_exists($obj, 'type')) { | |
| 1037 | + throw new Exception("Missing required property"); | |
| 1038 | + } | |
| 1039 | + if (!property_exists($obj, 'updated_at')) { | |
| 1040 | + throw new Exception("Missing required property"); | |
| 1041 | + } | |
| 1042 | + if (!property_exists($obj, 'urlize_name')) { | |
| 1043 | + throw new Exception("Missing required property"); | |
| 1044 | + } | |
| 994 | 1045 | return new TopLevel( |
| 995 | 1046 | TopLevel::fromCode($obj->{'code'}) |
| 996 | 1047 | ,TopLevel::fromColumnNames($obj->{'column_names'}) |
Test case
1 generated file · +180 −0test/inputs/json/misc/a1eca.json
Mphpdefault / TopLevel.php+180 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'query')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromQuery($obj->{'query'}) |
| 90 | 93 | ); |
| @@ -347,6 +350,18 @@ class Query { | ||
| 347 | 350 | * @throws Exception |
| 348 | 351 | */ |
| 349 | 352 | public static function from(stdClass $obj): Query { |
| 353 | + if (!property_exists($obj, 'count')) { | |
| 354 | + throw new Exception("Missing required property"); | |
| 355 | + } | |
| 356 | + if (!property_exists($obj, 'created')) { | |
| 357 | + throw new Exception("Missing required property"); | |
| 358 | + } | |
| 359 | + if (!property_exists($obj, 'lang')) { | |
| 360 | + throw new Exception("Missing required property"); | |
| 361 | + } | |
| 362 | + if (!property_exists($obj, 'results')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 350 | 365 | return new Query( |
| 351 | 366 | Query::fromCount($obj->{'count'}) |
| 352 | 367 | ,Query::fromCreated($obj->{'created'}) |
| @@ -452,6 +467,9 @@ class Results { | ||
| 452 | 467 | * @throws Exception |
| 453 | 468 | */ |
| 454 | 469 | public static function from(stdClass $obj): Results { |
| 470 | + if (!property_exists($obj, 'channel')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 455 | 473 | return new Results( |
| 456 | 474 | Results::fromChannel($obj->{'channel'}) |
| 457 | 475 | ); |
| @@ -1181,6 +1199,45 @@ class Channel { | ||
| 1181 | 1199 | * @throws Exception |
| 1182 | 1200 | */ |
| 1183 | 1201 | public static function from(stdClass $obj): Channel { |
| 1202 | + if (!property_exists($obj, 'astronomy')) { | |
| 1203 | + throw new Exception("Missing required property"); | |
| 1204 | + } | |
| 1205 | + if (!property_exists($obj, 'atmosphere')) { | |
| 1206 | + throw new Exception("Missing required property"); | |
| 1207 | + } | |
| 1208 | + if (!property_exists($obj, 'description')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'image')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1214 | + if (!property_exists($obj, 'item')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'language')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'lastBuildDate')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'link')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'location')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'title')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'ttl')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'units')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'wind')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1184 | 1241 | return new Channel( |
| 1185 | 1242 | Channel::fromAstronomy($obj->{'astronomy'}) |
| 1186 | 1243 | ,Channel::fromAtmosphere($obj->{'atmosphere'}) |
| @@ -1355,6 +1412,12 @@ class Astronomy { | ||
| 1355 | 1412 | * @throws Exception |
| 1356 | 1413 | */ |
| 1357 | 1414 | public static function from(stdClass $obj): Astronomy { |
| 1415 | + if (!property_exists($obj, 'sunrise')) { | |
| 1416 | + throw new Exception("Missing required property"); | |
| 1417 | + } | |
| 1418 | + if (!property_exists($obj, 'sunset')) { | |
| 1419 | + throw new Exception("Missing required property"); | |
| 1420 | + } | |
| 1358 | 1421 | return new Astronomy( |
| 1359 | 1422 | Astronomy::fromSunrise($obj->{'sunrise'}) |
| 1360 | 1423 | ,Astronomy::fromSunset($obj->{'sunset'}) |
| @@ -1611,6 +1674,18 @@ class Atmosphere { | ||
| 1611 | 1674 | * @throws Exception |
| 1612 | 1675 | */ |
| 1613 | 1676 | public static function from(stdClass $obj): Atmosphere { |
| 1677 | + if (!property_exists($obj, 'humidity')) { | |
| 1678 | + throw new Exception("Missing required property"); | |
| 1679 | + } | |
| 1680 | + if (!property_exists($obj, 'pressure')) { | |
| 1681 | + throw new Exception("Missing required property"); | |
| 1682 | + } | |
| 1683 | + if (!property_exists($obj, 'rising')) { | |
| 1684 | + throw new Exception("Missing required property"); | |
| 1685 | + } | |
| 1686 | + if (!property_exists($obj, 'visibility')) { | |
| 1687 | + throw new Exception("Missing required property"); | |
| 1688 | + } | |
| 1614 | 1689 | return new Atmosphere( |
| 1615 | 1690 | Atmosphere::fromHumidity($obj->{'humidity'}) |
| 1616 | 1691 | ,Atmosphere::fromPressure($obj->{'pressure'}) |
| @@ -1923,6 +1998,21 @@ class Image { | ||
| 1923 | 1998 | * @throws Exception |
| 1924 | 1999 | */ |
| 1925 | 2000 | public static function from(stdClass $obj): Image { |
| 2001 | + if (!property_exists($obj, 'height')) { | |
| 2002 | + throw new Exception("Missing required property"); | |
| 2003 | + } | |
| 2004 | + if (!property_exists($obj, 'link')) { | |
| 2005 | + throw new Exception("Missing required property"); | |
| 2006 | + } | |
| 2007 | + if (!property_exists($obj, 'title')) { | |
| 2008 | + throw new Exception("Missing required property"); | |
| 2009 | + } | |
| 2010 | + if (!property_exists($obj, 'url')) { | |
| 2011 | + throw new Exception("Missing required property"); | |
| 2012 | + } | |
| 2013 | + if (!property_exists($obj, 'width')) { | |
| 2014 | + throw new Exception("Missing required property"); | |
| 2015 | + } | |
| 1926 | 2016 | return new Image( |
| 1927 | 2017 | Image::fromHeight($obj->{'height'}) |
| 1928 | 2018 | ,Image::fromLink($obj->{'link'}) |
| @@ -2459,6 +2549,33 @@ class Item { | ||
| 2459 | 2549 | * @throws Exception |
| 2460 | 2550 | */ |
| 2461 | 2551 | public static function from(stdClass $obj): Item { |
| 2552 | + if (!property_exists($obj, 'condition')) { | |
| 2553 | + throw new Exception("Missing required property"); | |
| 2554 | + } | |
| 2555 | + if (!property_exists($obj, 'description')) { | |
| 2556 | + throw new Exception("Missing required property"); | |
| 2557 | + } | |
| 2558 | + if (!property_exists($obj, 'forecast')) { | |
| 2559 | + throw new Exception("Missing required property"); | |
| 2560 | + } | |
| 2561 | + if (!property_exists($obj, 'guid')) { | |
| 2562 | + throw new Exception("Missing required property"); | |
| 2563 | + } | |
| 2564 | + if (!property_exists($obj, 'lat')) { | |
| 2565 | + throw new Exception("Missing required property"); | |
| 2566 | + } | |
| 2567 | + if (!property_exists($obj, 'link')) { | |
| 2568 | + throw new Exception("Missing required property"); | |
| 2569 | + } | |
| 2570 | + if (!property_exists($obj, 'long')) { | |
| 2571 | + throw new Exception("Missing required property"); | |
| 2572 | + } | |
| 2573 | + if (!property_exists($obj, 'pubDate')) { | |
| 2574 | + throw new Exception("Missing required property"); | |
| 2575 | + } | |
| 2576 | + if (!property_exists($obj, 'title')) { | |
| 2577 | + throw new Exception("Missing required property"); | |
| 2578 | + } | |
| 2462 | 2579 | return new Item( |
| 2463 | 2580 | Item::fromCondition($obj->{'condition'}) |
| 2464 | 2581 | ,Item::fromDescription($obj->{'description'}) |
| @@ -2729,6 +2846,18 @@ class Condition { | ||
| 2729 | 2846 | * @throws Exception |
| 2730 | 2847 | */ |
| 2731 | 2848 | public static function from(stdClass $obj): Condition { |
| 2849 | + if (!property_exists($obj, 'code')) { | |
| 2850 | + throw new Exception("Missing required property"); | |
| 2851 | + } | |
| 2852 | + if (!property_exists($obj, 'date')) { | |
| 2853 | + throw new Exception("Missing required property"); | |
| 2854 | + } | |
| 2855 | + if (!property_exists($obj, 'temp')) { | |
| 2856 | + throw new Exception("Missing required property"); | |
| 2857 | + } | |
| 2858 | + if (!property_exists($obj, 'text')) { | |
| 2859 | + throw new Exception("Missing required property"); | |
| 2860 | + } | |
| 2732 | 2861 | return new Condition( |
| 2733 | 2862 | Condition::fromCode($obj->{'code'}) |
| 2734 | 2863 | ,Condition::fromDate($obj->{'date'}) |
| @@ -3093,6 +3222,24 @@ class Forecast { | ||
| 3093 | 3222 | * @throws Exception |
| 3094 | 3223 | */ |
| 3095 | 3224 | public static function from(stdClass $obj): Forecast { |
| 3225 | + if (!property_exists($obj, 'code')) { | |
| 3226 | + throw new Exception("Missing required property"); | |
| 3227 | + } | |
| 3228 | + if (!property_exists($obj, 'date')) { | |
| 3229 | + throw new Exception("Missing required property"); | |
| 3230 | + } | |
| 3231 | + if (!property_exists($obj, 'day')) { | |
| 3232 | + throw new Exception("Missing required property"); | |
| 3233 | + } | |
| 3234 | + if (!property_exists($obj, 'high')) { | |
| 3235 | + throw new Exception("Missing required property"); | |
| 3236 | + } | |
| 3237 | + if (!property_exists($obj, 'low')) { | |
| 3238 | + throw new Exception("Missing required property"); | |
| 3239 | + } | |
| 3240 | + if (!property_exists($obj, 'text')) { | |
| 3241 | + throw new Exception("Missing required property"); | |
| 3242 | + } | |
| 3096 | 3243 | return new Forecast( |
| 3097 | 3244 | Forecast::fromCode($obj->{'code'}) |
| 3098 | 3245 | ,Forecast::fromDate($obj->{'date'}) |
| @@ -3201,6 +3348,9 @@ class GUID { | ||
| 3201 | 3348 | * @throws Exception |
| 3202 | 3349 | */ |
| 3203 | 3350 | public static function from(stdClass $obj): GUID { |
| 3351 | + if (!property_exists($obj, 'isPermaLink')) { | |
| 3352 | + throw new Exception("Missing required property"); | |
| 3353 | + } | |
| 3204 | 3354 | return new GUID( |
| 3205 | 3355 | GUID::fromIsPermaLink($obj->{'isPermaLink'}) |
| 3206 | 3356 | ); |
| @@ -3403,6 +3553,15 @@ class Location { | ||
| 3403 | 3553 | * @throws Exception |
| 3404 | 3554 | */ |
| 3405 | 3555 | public static function from(stdClass $obj): Location { |
| 3556 | + if (!property_exists($obj, 'city')) { | |
| 3557 | + throw new Exception("Missing required property"); | |
| 3558 | + } | |
| 3559 | + if (!property_exists($obj, 'country')) { | |
| 3560 | + throw new Exception("Missing required property"); | |
| 3561 | + } | |
| 3562 | + if (!property_exists($obj, 'region')) { | |
| 3563 | + throw new Exception("Missing required property"); | |
| 3564 | + } | |
| 3406 | 3565 | return new Location( |
| 3407 | 3566 | Location::fromCity($obj->{'city'}) |
| 3408 | 3567 | ,Location::fromCountry($obj->{'country'}) |
| @@ -3661,6 +3820,18 @@ class Units { | ||
| 3661 | 3820 | * @throws Exception |
| 3662 | 3821 | */ |
| 3663 | 3822 | public static function from(stdClass $obj): Units { |
| 3823 | + if (!property_exists($obj, 'distance')) { | |
| 3824 | + throw new Exception("Missing required property"); | |
| 3825 | + } | |
| 3826 | + if (!property_exists($obj, 'pressure')) { | |
| 3827 | + throw new Exception("Missing required property"); | |
| 3828 | + } | |
| 3829 | + if (!property_exists($obj, 'speed')) { | |
| 3830 | + throw new Exception("Missing required property"); | |
| 3831 | + } | |
| 3832 | + if (!property_exists($obj, 'temperature')) { | |
| 3833 | + throw new Exception("Missing required property"); | |
| 3834 | + } | |
| 3664 | 3835 | return new Units( |
| 3665 | 3836 | Units::fromDistance($obj->{'distance'}) |
| 3666 | 3837 | ,Units::fromPressure($obj->{'pressure'}) |
| @@ -3869,6 +4040,15 @@ class Wind { | ||
| 3869 | 4040 | * @throws Exception |
| 3870 | 4041 | */ |
| 3871 | 4042 | public static function from(stdClass $obj): Wind { |
| 4043 | + if (!property_exists($obj, 'chill')) { | |
| 4044 | + throw new Exception("Missing required property"); | |
| 4045 | + } | |
| 4046 | + if (!property_exists($obj, 'direction')) { | |
| 4047 | + throw new Exception("Missing required property"); | |
| 4048 | + } | |
| 4049 | + if (!property_exists($obj, 'speed')) { | |
| 4050 | + throw new Exception("Missing required property"); | |
| 4051 | + } | |
| 3872 | 4052 | return new Wind( |
| 3873 | 4053 | Wind::fromChill($obj->{'chill'}) |
| 3874 | 4054 | ,Wind::fromDirection($obj->{'direction'}) |
Test case
1 generated file · +204 −0test/inputs/json/misc/a3d8c.json
Mphpdefault / TopLevel.php+204 −0
| @@ -190,6 +190,12 @@ class TopLevel { | ||
| 190 | 190 | * @throws Exception |
| 191 | 191 | */ |
| 192 | 192 | public static function from(stdClass $obj): TopLevel { |
| 193 | + if (!property_exists($obj, 'data')) { | |
| 194 | + throw new Exception("Missing required property"); | |
| 195 | + } | |
| 196 | + if (!property_exists($obj, 'meta')) { | |
| 197 | + throw new Exception("Missing required property"); | |
| 198 | + } | |
| 193 | 199 | return new TopLevel( |
| 194 | 200 | TopLevel::fromData($obj->{'data'}) |
| 195 | 201 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -291,6 +297,9 @@ class Meta { | ||
| 291 | 297 | * @throws Exception |
| 292 | 298 | */ |
| 293 | 299 | public static function from(stdClass $obj): Meta { |
| 300 | + if (!property_exists($obj, 'view')) { | |
| 301 | + throw new Exception("Missing required property"); | |
| 302 | + } | |
| 294 | 303 | return new Meta( |
| 295 | 304 | Meta::fromView($obj->{'view'}) |
| 296 | 305 | ); |
| @@ -2318,6 +2327,117 @@ class View { | ||
| 2318 | 2327 | * @throws Exception |
| 2319 | 2328 | */ |
| 2320 | 2329 | public static function from(stdClass $obj): View { |
| 2330 | + if (!property_exists($obj, 'averageRating')) { | |
| 2331 | + throw new Exception("Missing required property"); | |
| 2332 | + } | |
| 2333 | + if (!property_exists($obj, 'category')) { | |
| 2334 | + throw new Exception("Missing required property"); | |
| 2335 | + } | |
| 2336 | + if (!property_exists($obj, 'columns')) { | |
| 2337 | + throw new Exception("Missing required property"); | |
| 2338 | + } | |
| 2339 | + if (!property_exists($obj, 'createdAt')) { | |
| 2340 | + throw new Exception("Missing required property"); | |
| 2341 | + } | |
| 2342 | + if (!property_exists($obj, 'displayType')) { | |
| 2343 | + throw new Exception("Missing required property"); | |
| 2344 | + } | |
| 2345 | + if (!property_exists($obj, 'downloadCount')) { | |
| 2346 | + throw new Exception("Missing required property"); | |
| 2347 | + } | |
| 2348 | + if (!property_exists($obj, 'flags')) { | |
| 2349 | + throw new Exception("Missing required property"); | |
| 2350 | + } | |
| 2351 | + if (!property_exists($obj, 'grants')) { | |
| 2352 | + throw new Exception("Missing required property"); | |
| 2353 | + } | |
| 2354 | + if (!property_exists($obj, 'hideFromCatalog')) { | |
| 2355 | + throw new Exception("Missing required property"); | |
| 2356 | + } | |
| 2357 | + if (!property_exists($obj, 'hideFromDataJson')) { | |
| 2358 | + throw new Exception("Missing required property"); | |
| 2359 | + } | |
| 2360 | + if (!property_exists($obj, 'id')) { | |
| 2361 | + throw new Exception("Missing required property"); | |
| 2362 | + } | |
| 2363 | + if (!property_exists($obj, 'indexUpdatedAt')) { | |
| 2364 | + throw new Exception("Missing required property"); | |
| 2365 | + } | |
| 2366 | + if (!property_exists($obj, 'license')) { | |
| 2367 | + throw new Exception("Missing required property"); | |
| 2368 | + } | |
| 2369 | + if (!property_exists($obj, 'licenseId')) { | |
| 2370 | + throw new Exception("Missing required property"); | |
| 2371 | + } | |
| 2372 | + if (!property_exists($obj, 'locale')) { | |
| 2373 | + throw new Exception("Missing required property"); | |
| 2374 | + } | |
| 2375 | + if (!property_exists($obj, 'metadata')) { | |
| 2376 | + throw new Exception("Missing required property"); | |
| 2377 | + } | |
| 2378 | + if (!property_exists($obj, 'name')) { | |
| 2379 | + throw new Exception("Missing required property"); | |
| 2380 | + } | |
| 2381 | + if (!property_exists($obj, 'newBackend')) { | |
| 2382 | + throw new Exception("Missing required property"); | |
| 2383 | + } | |
| 2384 | + if (!property_exists($obj, 'numberOfComments')) { | |
| 2385 | + throw new Exception("Missing required property"); | |
| 2386 | + } | |
| 2387 | + if (!property_exists($obj, 'oid')) { | |
| 2388 | + throw new Exception("Missing required property"); | |
| 2389 | + } | |
| 2390 | + if (!property_exists($obj, 'owner')) { | |
| 2391 | + throw new Exception("Missing required property"); | |
| 2392 | + } | |
| 2393 | + if (!property_exists($obj, 'provenance')) { | |
| 2394 | + throw new Exception("Missing required property"); | |
| 2395 | + } | |
| 2396 | + if (!property_exists($obj, 'publicationAppendEnabled')) { | |
| 2397 | + throw new Exception("Missing required property"); | |
| 2398 | + } | |
| 2399 | + if (!property_exists($obj, 'publicationDate')) { | |
| 2400 | + throw new Exception("Missing required property"); | |
| 2401 | + } | |
| 2402 | + if (!property_exists($obj, 'publicationGroup')) { | |
| 2403 | + throw new Exception("Missing required property"); | |
| 2404 | + } | |
| 2405 | + if (!property_exists($obj, 'publicationStage')) { | |
| 2406 | + throw new Exception("Missing required property"); | |
| 2407 | + } | |
| 2408 | + if (!property_exists($obj, 'query')) { | |
| 2409 | + throw new Exception("Missing required property"); | |
| 2410 | + } | |
| 2411 | + if (!property_exists($obj, 'rights')) { | |
| 2412 | + throw new Exception("Missing required property"); | |
| 2413 | + } | |
| 2414 | + if (!property_exists($obj, 'rowClass')) { | |
| 2415 | + throw new Exception("Missing required property"); | |
| 2416 | + } | |
| 2417 | + if (!property_exists($obj, 'rowsUpdatedAt')) { | |
| 2418 | + throw new Exception("Missing required property"); | |
| 2419 | + } | |
| 2420 | + if (!property_exists($obj, 'rowsUpdatedBy')) { | |
| 2421 | + throw new Exception("Missing required property"); | |
| 2422 | + } | |
| 2423 | + if (!property_exists($obj, 'tableAuthor')) { | |
| 2424 | + throw new Exception("Missing required property"); | |
| 2425 | + } | |
| 2426 | + if (!property_exists($obj, 'tableId')) { | |
| 2427 | + throw new Exception("Missing required property"); | |
| 2428 | + } | |
| 2429 | + if (!property_exists($obj, 'totalTimesRated')) { | |
| 2430 | + throw new Exception("Missing required property"); | |
| 2431 | + } | |
| 2432 | + if (!property_exists($obj, 'viewCount')) { | |
| 2433 | + throw new Exception("Missing required property"); | |
| 2434 | + } | |
| 2435 | + if (!property_exists($obj, 'viewLastModified')) { | |
| 2436 | + throw new Exception("Missing required property"); | |
| 2437 | + } | |
| 2438 | + if (!property_exists($obj, 'viewType')) { | |
| 2439 | + throw new Exception("Missing required property"); | |
| 2440 | + } | |
| 2321 | 2441 | return new View( |
| 2322 | 2442 | View::fromAverageRating($obj->{'averageRating'}) |
| 2323 | 2443 | ,View::fromCategory($obj->{'category'}) |
| @@ -3066,6 +3186,27 @@ class Column { | ||
| 3066 | 3186 | * @throws Exception |
| 3067 | 3187 | */ |
| 3068 | 3188 | public static function from(stdClass $obj): Column { |
| 3189 | + if (!property_exists($obj, 'dataTypeName')) { | |
| 3190 | + throw new Exception("Missing required property"); | |
| 3191 | + } | |
| 3192 | + if (!property_exists($obj, 'fieldName')) { | |
| 3193 | + throw new Exception("Missing required property"); | |
| 3194 | + } | |
| 3195 | + if (!property_exists($obj, 'format')) { | |
| 3196 | + throw new Exception("Missing required property"); | |
| 3197 | + } | |
| 3198 | + if (!property_exists($obj, 'id')) { | |
| 3199 | + throw new Exception("Missing required property"); | |
| 3200 | + } | |
| 3201 | + if (!property_exists($obj, 'name')) { | |
| 3202 | + throw new Exception("Missing required property"); | |
| 3203 | + } | |
| 3204 | + if (!property_exists($obj, 'position')) { | |
| 3205 | + throw new Exception("Missing required property"); | |
| 3206 | + } | |
| 3207 | + if (!property_exists($obj, 'renderTypeName')) { | |
| 3208 | + throw new Exception("Missing required property"); | |
| 3209 | + } | |
| 3069 | 3210 | return new Column( |
| 3070 | 3211 | Column::fromCachedContents($obj->{'cachedContents'}) |
| 3071 | 3212 | ,Column::fromDataTypeName($obj->{'dataTypeName'}) |
| @@ -3528,6 +3669,21 @@ class CachedContents { | ||
| 3528 | 3669 | * @throws Exception |
| 3529 | 3670 | */ |
| 3530 | 3671 | public static function from(stdClass $obj): CachedContents { |
| 3672 | + if (!property_exists($obj, 'largest')) { | |
| 3673 | + throw new Exception("Missing required property"); | |
| 3674 | + } | |
| 3675 | + if (!property_exists($obj, 'non_null')) { | |
| 3676 | + throw new Exception("Missing required property"); | |
| 3677 | + } | |
| 3678 | + if (!property_exists($obj, 'null')) { | |
| 3679 | + throw new Exception("Missing required property"); | |
| 3680 | + } | |
| 3681 | + if (!property_exists($obj, 'smallest')) { | |
| 3682 | + throw new Exception("Missing required property"); | |
| 3683 | + } | |
| 3684 | + if (!property_exists($obj, 'top')) { | |
| 3685 | + throw new Exception("Missing required property"); | |
| 3686 | + } | |
| 3531 | 3687 | return new CachedContents( |
| 3532 | 3688 | CachedContents::fromAverage($obj->{'average'}) |
| 3533 | 3689 | ,CachedContents::fromLargest($obj->{'largest'}) |
| @@ -3690,6 +3846,12 @@ class Top { | ||
| 3690 | 3846 | * @throws Exception |
| 3691 | 3847 | */ |
| 3692 | 3848 | public static function from(stdClass $obj): Top { |
| 3849 | + if (!property_exists($obj, 'count')) { | |
| 3850 | + throw new Exception("Missing required property"); | |
| 3851 | + } | |
| 3852 | + if (!property_exists($obj, 'item')) { | |
| 3853 | + throw new Exception("Missing required property"); | |
| 3854 | + } | |
| 3693 | 3855 | return new Top( |
| 3694 | 3856 | Top::fromCount($obj->{'count'}) |
| 3695 | 3857 | ,Top::fromItem($obj->{'item'}) |
| @@ -4006,6 +4168,15 @@ class Grant { | ||
| 4006 | 4168 | * @throws Exception |
| 4007 | 4169 | */ |
| 4008 | 4170 | public static function from(stdClass $obj): Grant { |
| 4171 | + if (!property_exists($obj, 'flags')) { | |
| 4172 | + throw new Exception("Missing required property"); | |
| 4173 | + } | |
| 4174 | + if (!property_exists($obj, 'inherited')) { | |
| 4175 | + throw new Exception("Missing required property"); | |
| 4176 | + } | |
| 4177 | + if (!property_exists($obj, 'type')) { | |
| 4178 | + throw new Exception("Missing required property"); | |
| 4179 | + } | |
| 4009 | 4180 | return new Grant( |
| 4010 | 4181 | Grant::fromFlags($obj->{'flags'}) |
| 4011 | 4182 | ,Grant::fromInherited($obj->{'inherited'}) |
| @@ -4108,6 +4279,9 @@ class License { | ||
| 4108 | 4279 | * @throws Exception |
| 4109 | 4280 | */ |
| 4110 | 4281 | public static function from(stdClass $obj): License { |
| 4282 | + if (!property_exists($obj, 'name')) { | |
| 4283 | + throw new Exception("Missing required property"); | |
| 4284 | + } | |
| 4111 | 4285 | return new License( |
| 4112 | 4286 | License::fromName($obj->{'name'}) |
| 4113 | 4287 | ); |
| @@ -4429,6 +4603,21 @@ class Metadata { | ||
| 4429 | 4603 | * @throws Exception |
| 4430 | 4604 | */ |
| 4431 | 4605 | public static function from(stdClass $obj): Metadata { |
| 4606 | + if (!property_exists($obj, 'availableDisplayTypes')) { | |
| 4607 | + throw new Exception("Missing required property"); | |
| 4608 | + } | |
| 4609 | + if (!property_exists($obj, 'rdfClass')) { | |
| 4610 | + throw new Exception("Missing required property"); | |
| 4611 | + } | |
| 4612 | + if (!property_exists($obj, 'rdfSubject')) { | |
| 4613 | + throw new Exception("Missing required property"); | |
| 4614 | + } | |
| 4615 | + if (!property_exists($obj, 'renderTypeConfig')) { | |
| 4616 | + throw new Exception("Missing required property"); | |
| 4617 | + } | |
| 4618 | + if (!property_exists($obj, 'rowIdentifier')) { | |
| 4619 | + throw new Exception("Missing required property"); | |
| 4620 | + } | |
| 4432 | 4621 | return new Metadata( |
| 4433 | 4622 | Metadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'}) |
| 4434 | 4623 | ,Metadata::fromRDFClass($obj->{'rdfClass'}) |
| @@ -4536,6 +4725,9 @@ class RenderTypeConfig { | ||
| 4536 | 4725 | * @throws Exception |
| 4537 | 4726 | */ |
| 4538 | 4727 | public static function from(stdClass $obj): RenderTypeConfig { |
| 4728 | + if (!property_exists($obj, 'visible')) { | |
| 4729 | + throw new Exception("Missing required property"); | |
| 4730 | + } | |
| 4539 | 4731 | return new RenderTypeConfig( |
| 4540 | 4732 | RenderTypeConfig::fromVisible($obj->{'visible'}) |
| 4541 | 4733 | ); |
| @@ -4634,6 +4826,9 @@ class Visible { | ||
| 4634 | 4826 | * @throws Exception |
| 4635 | 4827 | */ |
| 4636 | 4828 | public static function from(stdClass $obj): Visible { |
| 4829 | + if (!property_exists($obj, 'table')) { | |
| 4830 | + throw new Exception("Missing required property"); | |
| 4831 | + } | |
| 4637 | 4832 | return new Visible( |
| 4638 | 4833 | Visible::fromTable($obj->{'table'}) |
| 4639 | 4834 | ); |
| @@ -4836,6 +5031,15 @@ class Owner { | ||
| 4836 | 5031 | * @throws Exception |
| 4837 | 5032 | */ |
| 4838 | 5033 | public static function from(stdClass $obj): Owner { |
| 5034 | + if (!property_exists($obj, 'displayName')) { | |
| 5035 | + throw new Exception("Missing required property"); | |
| 5036 | + } | |
| 5037 | + if (!property_exists($obj, 'id')) { | |
| 5038 | + throw new Exception("Missing required property"); | |
| 5039 | + } | |
| 5040 | + if (!property_exists($obj, 'screenName')) { | |
| 5041 | + throw new Exception("Missing required property"); | |
| 5042 | + } | |
| 4839 | 5043 | return new Owner( |
| 4840 | 5044 | Owner::fromDisplayName($obj->{'displayName'}) |
| 4841 | 5045 | ,Owner::fromID($obj->{'id'}) |
Test case
1 generated file · +18 −0test/inputs/json/misc/a45b0.json
Mphpdefault / TopLevel.php+18 −0
| @@ -345,6 +345,24 @@ class TopLevel { | ||
| 345 | 345 | * @throws Exception |
| 346 | 346 | */ |
| 347 | 347 | public static function from(stdClass $obj): TopLevel { |
| 348 | + if (!property_exists($obj, 'age')) { | |
| 349 | + throw new Exception("Missing required property"); | |
| 350 | + } | |
| 351 | + if (!property_exists($obj, 'country')) { | |
| 352 | + throw new Exception("Missing required property"); | |
| 353 | + } | |
| 354 | + if (!property_exists($obj, 'females')) { | |
| 355 | + throw new Exception("Missing required property"); | |
| 356 | + } | |
| 357 | + if (!property_exists($obj, 'males')) { | |
| 358 | + throw new Exception("Missing required property"); | |
| 359 | + } | |
| 360 | + if (!property_exists($obj, 'total')) { | |
| 361 | + throw new Exception("Missing required property"); | |
| 362 | + } | |
| 363 | + if (!property_exists($obj, 'year')) { | |
| 364 | + throw new Exception("Missing required property"); | |
| 365 | + } | |
| 348 | 366 | return new TopLevel( |
| 349 | 367 | TopLevel::fromAge($obj->{'age'}) |
| 350 | 368 | ,TopLevel::fromCountry($obj->{'country'}) |
Test case
1 generated file · +75 −0test/inputs/json/misc/a71df.json
Mphpdefault / TopLevel.php+75 −0
| @@ -450,6 +450,30 @@ class TopLevel { | ||
| 450 | 450 | * @throws Exception |
| 451 | 451 | */ |
| 452 | 452 | public static function from(stdClass $obj): TopLevel { |
| 453 | + if (!property_exists($obj, 'city')) { | |
| 454 | + throw new Exception("Missing required property"); | |
| 455 | + } | |
| 456 | + if (!property_exists($obj, 'delay')) { | |
| 457 | + throw new Exception("Missing required property"); | |
| 458 | + } | |
| 459 | + if (!property_exists($obj, 'IATA')) { | |
| 460 | + throw new Exception("Missing required property"); | |
| 461 | + } | |
| 462 | + if (!property_exists($obj, 'ICAO')) { | |
| 463 | + throw new Exception("Missing required property"); | |
| 464 | + } | |
| 465 | + if (!property_exists($obj, 'name')) { | |
| 466 | + throw new Exception("Missing required property"); | |
| 467 | + } | |
| 468 | + if (!property_exists($obj, 'state')) { | |
| 469 | + throw new Exception("Missing required property"); | |
| 470 | + } | |
| 471 | + if (!property_exists($obj, 'status')) { | |
| 472 | + throw new Exception("Missing required property"); | |
| 473 | + } | |
| 474 | + if (!property_exists($obj, 'weather')) { | |
| 475 | + throw new Exception("Missing required property"); | |
| 476 | + } | |
| 453 | 477 | return new TopLevel( |
| 454 | 478 | TopLevel::fromCity($obj->{'city'}) |
| 455 | 479 | ,TopLevel::fromDelay($obj->{'delay'}) |
| @@ -978,6 +1002,33 @@ class Status { | ||
| 978 | 1002 | * @throws Exception |
| 979 | 1003 | */ |
| 980 | 1004 | public static function from(stdClass $obj): Status { |
| 1005 | + if (!property_exists($obj, 'avgDelay')) { | |
| 1006 | + throw new Exception("Missing required property"); | |
| 1007 | + } | |
| 1008 | + if (!property_exists($obj, 'closureBegin')) { | |
| 1009 | + throw new Exception("Missing required property"); | |
| 1010 | + } | |
| 1011 | + if (!property_exists($obj, 'closureEnd')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'endTime')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 1017 | + if (!property_exists($obj, 'maxDelay')) { | |
| 1018 | + throw new Exception("Missing required property"); | |
| 1019 | + } | |
| 1020 | + if (!property_exists($obj, 'minDelay')) { | |
| 1021 | + throw new Exception("Missing required property"); | |
| 1022 | + } | |
| 1023 | + if (!property_exists($obj, 'reason')) { | |
| 1024 | + throw new Exception("Missing required property"); | |
| 1025 | + } | |
| 1026 | + if (!property_exists($obj, 'trend')) { | |
| 1027 | + throw new Exception("Missing required property"); | |
| 1028 | + } | |
| 1029 | + if (!property_exists($obj, 'type')) { | |
| 1030 | + throw new Exception("Missing required property"); | |
| 1031 | + } | |
| 981 | 1032 | return new Status( |
| 982 | 1033 | Status::fromAvgDelay($obj->{'avgDelay'}) |
| 983 | 1034 | ,Status::fromClosureBegin($obj->{'closureBegin'}) |
| @@ -1301,6 +1352,21 @@ class Weather { | ||
| 1301 | 1352 | * @throws Exception |
| 1302 | 1353 | */ |
| 1303 | 1354 | public static function from(stdClass $obj): Weather { |
| 1355 | + if (!property_exists($obj, 'meta')) { | |
| 1356 | + throw new Exception("Missing required property"); | |
| 1357 | + } | |
| 1358 | + if (!property_exists($obj, 'temp')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1361 | + if (!property_exists($obj, 'visibility')) { | |
| 1362 | + throw new Exception("Missing required property"); | |
| 1363 | + } | |
| 1364 | + if (!property_exists($obj, 'weather')) { | |
| 1365 | + throw new Exception("Missing required property"); | |
| 1366 | + } | |
| 1367 | + if (!property_exists($obj, 'wind')) { | |
| 1368 | + throw new Exception("Missing required property"); | |
| 1369 | + } | |
| 1304 | 1370 | return new Weather( |
| 1305 | 1371 | Weather::fromMeta($obj->{'meta'}) |
| 1306 | 1372 | ,Weather::fromTemp($obj->{'temp'}) |
| @@ -1511,6 +1577,15 @@ class Meta { | ||
| 1511 | 1577 | * @throws Exception |
| 1512 | 1578 | */ |
| 1513 | 1579 | public static function from(stdClass $obj): Meta { |
| 1580 | + if (!property_exists($obj, 'credit')) { | |
| 1581 | + throw new Exception("Missing required property"); | |
| 1582 | + } | |
| 1583 | + if (!property_exists($obj, 'updated')) { | |
| 1584 | + throw new Exception("Missing required property"); | |
| 1585 | + } | |
| 1586 | + if (!property_exists($obj, 'url')) { | |
| 1587 | + throw new Exception("Missing required property"); | |
| 1588 | + } | |
| 1514 | 1589 | return new Meta( |
| 1515 | 1590 | Meta::fromCredit($obj->{'credit'}) |
| 1516 | 1591 | ,Meta::fromUpdated($obj->{'updated'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/a9691.json
Mphpdefault / TopLevel.php+9 −0
| @@ -205,6 +205,15 @@ class TopLevel { | ||
| 205 | 205 | * @throws Exception |
| 206 | 206 | */ |
| 207 | 207 | public static function from(stdClass $obj): TopLevel { |
| 208 | + if (!property_exists($obj, 'base')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'date')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 214 | + if (!property_exists($obj, 'rates')) { | |
| 215 | + throw new Exception("Missing required property"); | |
| 216 | + } | |
| 208 | 217 | return new TopLevel( |
| 209 | 218 | TopLevel::fromBase($obj->{'base'}) |
| 210 | 219 | ,TopLevel::fromDate($obj->{'date'}) |
Test case
1 generated file · +18 −0test/inputs/json/misc/ab0d1.json
Mphpdefault / TopLevel.php+18 −0
| @@ -345,6 +345,24 @@ class TopLevel { | ||
| 345 | 345 | * @throws Exception |
| 346 | 346 | */ |
| 347 | 347 | public static function from(stdClass $obj): TopLevel { |
| 348 | + if (!property_exists($obj, 'age')) { | |
| 349 | + throw new Exception("Missing required property"); | |
| 350 | + } | |
| 351 | + if (!property_exists($obj, 'country')) { | |
| 352 | + throw new Exception("Missing required property"); | |
| 353 | + } | |
| 354 | + if (!property_exists($obj, 'females')) { | |
| 355 | + throw new Exception("Missing required property"); | |
| 356 | + } | |
| 357 | + if (!property_exists($obj, 'males')) { | |
| 358 | + throw new Exception("Missing required property"); | |
| 359 | + } | |
| 360 | + if (!property_exists($obj, 'total')) { | |
| 361 | + throw new Exception("Missing required property"); | |
| 362 | + } | |
| 363 | + if (!property_exists($obj, 'year')) { | |
| 364 | + throw new Exception("Missing required property"); | |
| 365 | + } | |
| 348 | 366 | return new TopLevel( |
| 349 | 367 | TopLevel::fromAge($obj->{'age'}) |
| 350 | 368 | ,TopLevel::fromCountry($obj->{'country'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/abb4b.json
Mphpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'total_population')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromTotalPopulation($obj->{'total_population'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class TotalPopulation { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): TotalPopulation { |
| 252 | + if (!property_exists($obj, 'date')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'population')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new TotalPopulation( |
| 250 | 259 | TotalPopulation::fromDate($obj->{'date'}) |
| 251 | 260 | ,TotalPopulation::fromPopulation($obj->{'population'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/ac944.json
Mphpdefault / TopLevel.php+9 −0
| @@ -205,6 +205,15 @@ class TopLevel { | ||
| 205 | 205 | * @throws Exception |
| 206 | 206 | */ |
| 207 | 207 | public static function from(stdClass $obj): TopLevel { |
| 208 | + if (!property_exists($obj, 'base')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'date')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 214 | + if (!property_exists($obj, 'rates')) { | |
| 215 | + throw new Exception("Missing required property"); | |
| 216 | + } | |
| 208 | 217 | return new TopLevel( |
| 209 | 218 | TopLevel::fromBase($obj->{'base'}) |
| 210 | 219 | ,TopLevel::fromDate($obj->{'date'}) |
Test case
1 generated file · +51 −0test/inputs/json/misc/ad8be.json
Mphpdefault / TopLevel.php+51 −0
| @@ -518,6 +518,30 @@ class TopLevel { | ||
| 518 | 518 | * @throws Exception |
| 519 | 519 | */ |
| 520 | 520 | public static function from(stdClass $obj): TopLevel { |
| 521 | + if (!property_exists($obj, 'id')) { | |
| 522 | + throw new Exception("Missing required property"); | |
| 523 | + } | |
| 524 | + if (!property_exists($obj, 'identifiers')) { | |
| 525 | + throw new Exception("Missing required property"); | |
| 526 | + } | |
| 527 | + if (!property_exists($obj, 'keywords')) { | |
| 528 | + throw new Exception("Missing required property"); | |
| 529 | + } | |
| 530 | + if (!property_exists($obj, 'links')) { | |
| 531 | + throw new Exception("Missing required property"); | |
| 532 | + } | |
| 533 | + if (!property_exists($obj, 'name')) { | |
| 534 | + throw new Exception("Missing required property"); | |
| 535 | + } | |
| 536 | + if (!property_exists($obj, 'other_names')) { | |
| 537 | + throw new Exception("Missing required property"); | |
| 538 | + } | |
| 539 | + if (!property_exists($obj, 'superseded_by')) { | |
| 540 | + throw new Exception("Missing required property"); | |
| 541 | + } | |
| 542 | + if (!property_exists($obj, 'text')) { | |
| 543 | + throw new Exception("Missing required property"); | |
| 544 | + } | |
| 521 | 545 | return new TopLevel( |
| 522 | 546 | TopLevel::fromID($obj->{'id'}) |
| 523 | 547 | ,TopLevel::fromIdentifiers($obj->{'identifiers'}) |
| @@ -683,6 +707,12 @@ class Identifier { | ||
| 683 | 707 | * @throws Exception |
| 684 | 708 | */ |
| 685 | 709 | public static function from(stdClass $obj): Identifier { |
| 710 | + if (!property_exists($obj, 'identifier')) { | |
| 711 | + throw new Exception("Missing required property"); | |
| 712 | + } | |
| 713 | + if (!property_exists($obj, 'scheme')) { | |
| 714 | + throw new Exception("Missing required property"); | |
| 715 | + } | |
| 686 | 716 | return new Identifier( |
| 687 | 717 | Identifier::fromIdentifier($obj->{'identifier'}) |
| 688 | 718 | ,Identifier::fromScheme($obj->{'scheme'}) |
| @@ -978,6 +1008,12 @@ class Link { | ||
| 978 | 1008 | * @throws Exception |
| 979 | 1009 | */ |
| 980 | 1010 | public static function from(stdClass $obj): Link { |
| 1011 | + if (!property_exists($obj, 'note')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'url')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 981 | 1017 | return new Link( |
| 982 | 1018 | Link::fromNote($obj->{'note'}) |
| 983 | 1019 | ,Link::fromURL($obj->{'url'}) |
| @@ -1205,6 +1241,12 @@ class OtherName { | ||
| 1205 | 1241 | * @throws Exception |
| 1206 | 1242 | */ |
| 1207 | 1243 | public static function from(stdClass $obj): OtherName { |
| 1244 | + if (!property_exists($obj, 'name')) { | |
| 1245 | + throw new Exception("Missing required property"); | |
| 1246 | + } | |
| 1247 | + if (!property_exists($obj, 'note')) { | |
| 1248 | + throw new Exception("Missing required property"); | |
| 1249 | + } | |
| 1208 | 1250 | return new OtherName( |
| 1209 | 1251 | OtherName::fromName($obj->{'name'}) |
| 1210 | 1252 | ,OtherName::fromNote($obj->{'note'}) |
| @@ -1411,6 +1453,15 @@ class Text { | ||
| 1411 | 1453 | * @throws Exception |
| 1412 | 1454 | */ |
| 1413 | 1455 | public static function from(stdClass $obj): Text { |
| 1456 | + if (!property_exists($obj, 'media_type')) { | |
| 1457 | + throw new Exception("Missing required property"); | |
| 1458 | + } | |
| 1459 | + if (!property_exists($obj, 'title')) { | |
| 1460 | + throw new Exception("Missing required property"); | |
| 1461 | + } | |
| 1462 | + if (!property_exists($obj, 'url')) { | |
| 1463 | + throw new Exception("Missing required property"); | |
| 1464 | + } | |
| 1414 | 1465 | return new Text( |
| 1415 | 1466 | Text::fromMediaType($obj->{'media_type'}) |
| 1416 | 1467 | ,Text::fromTitle($obj->{'title'}) |
Test case
1 generated file · +204 −0test/inputs/json/misc/ae7f0.json
Mphpdefault / TopLevel.php+204 −0
| @@ -137,6 +137,12 @@ class TopLevel { | ||
| 137 | 137 | * @throws Exception |
| 138 | 138 | */ |
| 139 | 139 | public static function from(stdClass $obj): TopLevel { |
| 140 | + if (!property_exists($obj, 'data')) { | |
| 141 | + throw new Exception("Missing required property"); | |
| 142 | + } | |
| 143 | + if (!property_exists($obj, 'kind')) { | |
| 144 | + throw new Exception("Missing required property"); | |
| 145 | + } | |
| 140 | 146 | return new TopLevel( |
| 141 | 147 | TopLevel::fromData($obj->{'data'}) |
| 142 | 148 | ,TopLevel::fromKind($obj->{'kind'}) |
| @@ -408,6 +414,18 @@ class TopLevelData { | ||
| 408 | 414 | * @throws Exception |
| 409 | 415 | */ |
| 410 | 416 | public static function from(stdClass $obj): TopLevelData { |
| 417 | + if (!property_exists($obj, 'after')) { | |
| 418 | + throw new Exception("Missing required property"); | |
| 419 | + } | |
| 420 | + if (!property_exists($obj, 'before')) { | |
| 421 | + throw new Exception("Missing required property"); | |
| 422 | + } | |
| 423 | + if (!property_exists($obj, 'children')) { | |
| 424 | + throw new Exception("Missing required property"); | |
| 425 | + } | |
| 426 | + if (!property_exists($obj, 'modhash')) { | |
| 427 | + throw new Exception("Missing required property"); | |
| 428 | + } | |
| 411 | 429 | return new TopLevelData( |
| 412 | 430 | TopLevelData::fromAfter($obj->{'after'}) |
| 413 | 431 | ,TopLevelData::fromBefore($obj->{'before'}) |
| @@ -566,6 +584,12 @@ class Child { | ||
| 566 | 584 | * @throws Exception |
| 567 | 585 | */ |
| 568 | 586 | public static function from(stdClass $obj): Child { |
| 587 | + if (!property_exists($obj, 'data')) { | |
| 588 | + throw new Exception("Missing required property"); | |
| 589 | + } | |
| 590 | + if (!property_exists($obj, 'kind')) { | |
| 591 | + throw new Exception("Missing required property"); | |
| 592 | + } | |
| 569 | 593 | return new Child( |
| 570 | 594 | Child::fromData($obj->{'data'}) |
| 571 | 595 | ,Child::fromKind($obj->{'kind'}) |
| @@ -3831,6 +3855,186 @@ class ChildData { | ||
| 3831 | 3855 | * @throws Exception |
| 3832 | 3856 | */ |
| 3833 | 3857 | public static function from(stdClass $obj): ChildData { |
| 3858 | + if (!property_exists($obj, 'approved_at_utc')) { | |
| 3859 | + throw new Exception("Missing required property"); | |
| 3860 | + } | |
| 3861 | + if (!property_exists($obj, 'approved_by')) { | |
| 3862 | + throw new Exception("Missing required property"); | |
| 3863 | + } | |
| 3864 | + if (!property_exists($obj, 'archived')) { | |
| 3865 | + throw new Exception("Missing required property"); | |
| 3866 | + } | |
| 3867 | + if (!property_exists($obj, 'author')) { | |
| 3868 | + throw new Exception("Missing required property"); | |
| 3869 | + } | |
| 3870 | + if (!property_exists($obj, 'author_flair_css_class')) { | |
| 3871 | + throw new Exception("Missing required property"); | |
| 3872 | + } | |
| 3873 | + if (!property_exists($obj, 'author_flair_text')) { | |
| 3874 | + throw new Exception("Missing required property"); | |
| 3875 | + } | |
| 3876 | + if (!property_exists($obj, 'banned_at_utc')) { | |
| 3877 | + throw new Exception("Missing required property"); | |
| 3878 | + } | |
| 3879 | + if (!property_exists($obj, 'banned_by')) { | |
| 3880 | + throw new Exception("Missing required property"); | |
| 3881 | + } | |
| 3882 | + if (!property_exists($obj, 'brand_safe')) { | |
| 3883 | + throw new Exception("Missing required property"); | |
| 3884 | + } | |
| 3885 | + if (!property_exists($obj, 'can_gild')) { | |
| 3886 | + throw new Exception("Missing required property"); | |
| 3887 | + } | |
| 3888 | + if (!property_exists($obj, 'can_mod_post')) { | |
| 3889 | + throw new Exception("Missing required property"); | |
| 3890 | + } | |
| 3891 | + if (!property_exists($obj, 'clicked')) { | |
| 3892 | + throw new Exception("Missing required property"); | |
| 3893 | + } | |
| 3894 | + if (!property_exists($obj, 'contest_mode')) { | |
| 3895 | + throw new Exception("Missing required property"); | |
| 3896 | + } | |
| 3897 | + if (!property_exists($obj, 'created')) { | |
| 3898 | + throw new Exception("Missing required property"); | |
| 3899 | + } | |
| 3900 | + if (!property_exists($obj, 'created_utc')) { | |
| 3901 | + throw new Exception("Missing required property"); | |
| 3902 | + } | |
| 3903 | + if (!property_exists($obj, 'distinguished')) { | |
| 3904 | + throw new Exception("Missing required property"); | |
| 3905 | + } | |
| 3906 | + if (!property_exists($obj, 'domain')) { | |
| 3907 | + throw new Exception("Missing required property"); | |
| 3908 | + } | |
| 3909 | + if (!property_exists($obj, 'downs')) { | |
| 3910 | + throw new Exception("Missing required property"); | |
| 3911 | + } | |
| 3912 | + if (!property_exists($obj, 'edited')) { | |
| 3913 | + throw new Exception("Missing required property"); | |
| 3914 | + } | |
| 3915 | + if (!property_exists($obj, 'gilded')) { | |
| 3916 | + throw new Exception("Missing required property"); | |
| 3917 | + } | |
| 3918 | + if (!property_exists($obj, 'hidden')) { | |
| 3919 | + throw new Exception("Missing required property"); | |
| 3920 | + } | |
| 3921 | + if (!property_exists($obj, 'hide_score')) { | |
| 3922 | + throw new Exception("Missing required property"); | |
| 3923 | + } | |
| 3924 | + if (!property_exists($obj, 'id')) { | |
| 3925 | + throw new Exception("Missing required property"); | |
| 3926 | + } | |
| 3927 | + if (!property_exists($obj, 'is_self')) { | |
| 3928 | + throw new Exception("Missing required property"); | |
| 3929 | + } | |
| 3930 | + if (!property_exists($obj, 'is_video')) { | |
| 3931 | + throw new Exception("Missing required property"); | |
| 3932 | + } | |
| 3933 | + if (!property_exists($obj, 'likes')) { | |
| 3934 | + throw new Exception("Missing required property"); | |
| 3935 | + } | |
| 3936 | + if (!property_exists($obj, 'link_flair_css_class')) { | |
| 3937 | + throw new Exception("Missing required property"); | |
| 3938 | + } | |
| 3939 | + if (!property_exists($obj, 'link_flair_text')) { | |
| 3940 | + throw new Exception("Missing required property"); | |
| 3941 | + } | |
| 3942 | + if (!property_exists($obj, 'locked')) { | |
| 3943 | + throw new Exception("Missing required property"); | |
| 3944 | + } | |
| 3945 | + if (!property_exists($obj, 'media')) { | |
| 3946 | + throw new Exception("Missing required property"); | |
| 3947 | + } | |
| 3948 | + if (!property_exists($obj, 'media_embed')) { | |
| 3949 | + throw new Exception("Missing required property"); | |
| 3950 | + } | |
| 3951 | + if (!property_exists($obj, 'mod_reports')) { | |
| 3952 | + throw new Exception("Missing required property"); | |
| 3953 | + } | |
| 3954 | + if (!property_exists($obj, 'name')) { | |
| 3955 | + throw new Exception("Missing required property"); | |
| 3956 | + } | |
| 3957 | + if (!property_exists($obj, 'num_comments')) { | |
| 3958 | + throw new Exception("Missing required property"); | |
| 3959 | + } | |
| 3960 | + if (!property_exists($obj, 'num_reports')) { | |
| 3961 | + throw new Exception("Missing required property"); | |
| 3962 | + } | |
| 3963 | + if (!property_exists($obj, 'over_18')) { | |
| 3964 | + throw new Exception("Missing required property"); | |
| 3965 | + } | |
| 3966 | + if (!property_exists($obj, 'permalink')) { | |
| 3967 | + throw new Exception("Missing required property"); | |
| 3968 | + } | |
| 3969 | + if (!property_exists($obj, 'quarantine')) { | |
| 3970 | + throw new Exception("Missing required property"); | |
| 3971 | + } | |
| 3972 | + if (!property_exists($obj, 'removal_reason')) { | |
| 3973 | + throw new Exception("Missing required property"); | |
| 3974 | + } | |
| 3975 | + if (!property_exists($obj, 'report_reasons')) { | |
| 3976 | + throw new Exception("Missing required property"); | |
| 3977 | + } | |
| 3978 | + if (!property_exists($obj, 'saved')) { | |
| 3979 | + throw new Exception("Missing required property"); | |
| 3980 | + } | |
| 3981 | + if (!property_exists($obj, 'score')) { | |
| 3982 | + throw new Exception("Missing required property"); | |
| 3983 | + } | |
| 3984 | + if (!property_exists($obj, 'secure_media')) { | |
| 3985 | + throw new Exception("Missing required property"); | |
| 3986 | + } | |
| 3987 | + if (!property_exists($obj, 'secure_media_embed')) { | |
| 3988 | + throw new Exception("Missing required property"); | |
| 3989 | + } | |
| 3990 | + if (!property_exists($obj, 'selftext')) { | |
| 3991 | + throw new Exception("Missing required property"); | |
| 3992 | + } | |
| 3993 | + if (!property_exists($obj, 'selftext_html')) { | |
| 3994 | + throw new Exception("Missing required property"); | |
| 3995 | + } | |
| 3996 | + if (!property_exists($obj, 'spoiler')) { | |
| 3997 | + throw new Exception("Missing required property"); | |
| 3998 | + } | |
| 3999 | + if (!property_exists($obj, 'stickied')) { | |
| 4000 | + throw new Exception("Missing required property"); | |
| 4001 | + } | |
| 4002 | + if (!property_exists($obj, 'subreddit')) { | |
| 4003 | + throw new Exception("Missing required property"); | |
| 4004 | + } | |
| 4005 | + if (!property_exists($obj, 'subreddit_id')) { | |
| 4006 | + throw new Exception("Missing required property"); | |
| 4007 | + } | |
| 4008 | + if (!property_exists($obj, 'subreddit_name_prefixed')) { | |
| 4009 | + throw new Exception("Missing required property"); | |
| 4010 | + } | |
| 4011 | + if (!property_exists($obj, 'subreddit_type')) { | |
| 4012 | + throw new Exception("Missing required property"); | |
| 4013 | + } | |
| 4014 | + if (!property_exists($obj, 'suggested_sort')) { | |
| 4015 | + throw new Exception("Missing required property"); | |
| 4016 | + } | |
| 4017 | + if (!property_exists($obj, 'thumbnail')) { | |
| 4018 | + throw new Exception("Missing required property"); | |
| 4019 | + } | |
| 4020 | + if (!property_exists($obj, 'title')) { | |
| 4021 | + throw new Exception("Missing required property"); | |
| 4022 | + } | |
| 4023 | + if (!property_exists($obj, 'ups')) { | |
| 4024 | + throw new Exception("Missing required property"); | |
| 4025 | + } | |
| 4026 | + if (!property_exists($obj, 'url')) { | |
| 4027 | + throw new Exception("Missing required property"); | |
| 4028 | + } | |
| 4029 | + if (!property_exists($obj, 'user_reports')) { | |
| 4030 | + throw new Exception("Missing required property"); | |
| 4031 | + } | |
| 4032 | + if (!property_exists($obj, 'view_count')) { | |
| 4033 | + throw new Exception("Missing required property"); | |
| 4034 | + } | |
| 4035 | + if (!property_exists($obj, 'visited')) { | |
| 4036 | + throw new Exception("Missing required property"); | |
| 4037 | + } | |
| 3834 | 4038 | return new ChildData( |
| 3835 | 4039 | ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'}) |
| 3836 | 4040 | ,ChildData::fromApprovedBy($obj->{'approved_by'}) |
Test case
1 generated file · +54 −0test/inputs/json/misc/ae9ca.json
Mphpdefault / TopLevel.php+54 −0
| @@ -200,6 +200,15 @@ class TopLevel { | ||
| 200 | 200 | * @throws Exception |
| 201 | 201 | */ |
| 202 | 202 | public static function from(stdClass $obj): TopLevel { |
| 203 | + if (!property_exists($obj, 'features')) { | |
| 204 | + throw new Exception("Missing required property"); | |
| 205 | + } | |
| 206 | + if (!property_exists($obj, 'name')) { | |
| 207 | + throw new Exception("Missing required property"); | |
| 208 | + } | |
| 209 | + if (!property_exists($obj, 'type')) { | |
| 210 | + throw new Exception("Missing required property"); | |
| 211 | + } | |
| 203 | 212 | return new TopLevel( |
| 204 | 213 | TopLevel::fromFeatures($obj->{'features'}) |
| 205 | 214 | ,TopLevel::fromName($obj->{'name'}) |
| @@ -409,6 +418,15 @@ class Feature { | ||
| 409 | 418 | * @throws Exception |
| 410 | 419 | */ |
| 411 | 420 | public static function from(stdClass $obj): Feature { |
| 421 | + if (!property_exists($obj, 'geometry')) { | |
| 422 | + throw new Exception("Missing required property"); | |
| 423 | + } | |
| 424 | + if (!property_exists($obj, 'properties')) { | |
| 425 | + throw new Exception("Missing required property"); | |
| 426 | + } | |
| 427 | + if (!property_exists($obj, 'type')) { | |
| 428 | + throw new Exception("Missing required property"); | |
| 429 | + } | |
| 412 | 430 | return new Feature( |
| 413 | 431 | Feature::fromGeometry($obj->{'geometry'}) |
| 414 | 432 | ,Feature::fromProperties($obj->{'properties'}) |
| @@ -578,6 +596,12 @@ class Geometry { | ||
| 578 | 596 | * @throws Exception |
| 579 | 597 | */ |
| 580 | 598 | public static function from(stdClass $obj): Geometry { |
| 599 | + if (!property_exists($obj, 'coordinates')) { | |
| 600 | + throw new Exception("Missing required property"); | |
| 601 | + } | |
| 602 | + if (!property_exists($obj, 'type')) { | |
| 603 | + throw new Exception("Missing required property"); | |
| 604 | + } | |
| 581 | 605 | return new Geometry( |
| 582 | 606 | Geometry::fromCoordinates($obj->{'coordinates'}) |
| 583 | 607 | ,Geometry::fromType($obj->{'type'}) |
| @@ -1194,6 +1218,36 @@ class Properties { | ||
| 1194 | 1218 | * @throws Exception |
| 1195 | 1219 | */ |
| 1196 | 1220 | public static function from(stdClass $obj): Properties { |
| 1221 | + if (!property_exists($obj, 'Area')) { | |
| 1222 | + throw new Exception("Missing required property"); | |
| 1223 | + } | |
| 1224 | + if (!property_exists($obj, 'Central Asset ID')) { | |
| 1225 | + throw new Exception("Missing required property"); | |
| 1226 | + } | |
| 1227 | + if (!property_exists($obj, 'Class')) { | |
| 1228 | + throw new Exception("Missing required property"); | |
| 1229 | + } | |
| 1230 | + if (!property_exists($obj, 'Feature Location')) { | |
| 1231 | + throw new Exception("Missing required property"); | |
| 1232 | + } | |
| 1233 | + if (!property_exists($obj, 'lat')) { | |
| 1234 | + throw new Exception("Missing required property"); | |
| 1235 | + } | |
| 1236 | + if (!property_exists($obj, 'long')) { | |
| 1237 | + throw new Exception("Missing required property"); | |
| 1238 | + } | |
| 1239 | + if (!property_exists($obj, 'Maintaining Authority')) { | |
| 1240 | + throw new Exception("Missing required property"); | |
| 1241 | + } | |
| 1242 | + if (!property_exists($obj, 'Number')) { | |
| 1243 | + throw new Exception("Missing required property"); | |
| 1244 | + } | |
| 1245 | + if (!property_exists($obj, 'Site Name')) { | |
| 1246 | + throw new Exception("Missing required property"); | |
| 1247 | + } | |
| 1248 | + if (!property_exists($obj, 'Ward')) { | |
| 1249 | + throw new Exception("Missing required property"); | |
| 1250 | + } | |
| 1197 | 1251 | return new Properties( |
| 1198 | 1252 | Properties::fromArea($obj->{'Area'}) |
| 1199 | 1253 | ,Properties::fromCentralAssetID($obj->{'Central Asset ID'}) |
Test case
1 generated file · +156 −0test/inputs/json/misc/af2d1.json
Mphpdefault / TopLevel.php+156 −0
| @@ -253,6 +253,18 @@ class TopLevel { | ||
| 253 | 253 | * @throws Exception |
| 254 | 254 | */ |
| 255 | 255 | public static function from(stdClass $obj): TopLevel { |
| 256 | + if (!property_exists($obj, 'crs')) { | |
| 257 | + throw new Exception("Missing required property"); | |
| 258 | + } | |
| 259 | + if (!property_exists($obj, 'features')) { | |
| 260 | + throw new Exception("Missing required property"); | |
| 261 | + } | |
| 262 | + if (!property_exists($obj, 'totalFeatures')) { | |
| 263 | + throw new Exception("Missing required property"); | |
| 264 | + } | |
| 265 | + if (!property_exists($obj, 'type')) { | |
| 266 | + throw new Exception("Missing required property"); | |
| 267 | + } | |
| 256 | 268 | return new TopLevel( |
| 257 | 269 | TopLevel::fromCRS($obj->{'crs'}) |
| 258 | 270 | ,TopLevel::fromFeatures($obj->{'features'}) |
| @@ -410,6 +422,12 @@ class CRS { | ||
| 410 | 422 | * @throws Exception |
| 411 | 423 | */ |
| 412 | 424 | public static function from(stdClass $obj): CRS { |
| 425 | + if (!property_exists($obj, 'properties')) { | |
| 426 | + throw new Exception("Missing required property"); | |
| 427 | + } | |
| 428 | + if (!property_exists($obj, 'type')) { | |
| 429 | + throw new Exception("Missing required property"); | |
| 430 | + } | |
| 413 | 431 | return new CRS( |
| 414 | 432 | CRS::fromProperties($obj->{'properties'}) |
| 415 | 433 | ,CRS::fromType($obj->{'type'}) |
| @@ -510,6 +528,9 @@ class CRSProperties { | ||
| 510 | 528 | * @throws Exception |
| 511 | 529 | */ |
| 512 | 530 | public static function from(stdClass $obj): CRSProperties { |
| 531 | + if (!property_exists($obj, 'name')) { | |
| 532 | + throw new Exception("Missing required property"); | |
| 533 | + } | |
| 513 | 534 | return new CRSProperties( |
| 514 | 535 | CRSProperties::fromName($obj->{'name'}) |
| 515 | 536 | ); |
| @@ -820,6 +841,21 @@ class Feature { | ||
| 820 | 841 | * @throws Exception |
| 821 | 842 | */ |
| 822 | 843 | public static function from(stdClass $obj): Feature { |
| 844 | + if (!property_exists($obj, 'geometry')) { | |
| 845 | + throw new Exception("Missing required property"); | |
| 846 | + } | |
| 847 | + if (!property_exists($obj, 'geometry_name')) { | |
| 848 | + throw new Exception("Missing required property"); | |
| 849 | + } | |
| 850 | + if (!property_exists($obj, 'id')) { | |
| 851 | + throw new Exception("Missing required property"); | |
| 852 | + } | |
| 853 | + if (!property_exists($obj, 'properties')) { | |
| 854 | + throw new Exception("Missing required property"); | |
| 855 | + } | |
| 856 | + if (!property_exists($obj, 'type')) { | |
| 857 | + throw new Exception("Missing required property"); | |
| 858 | + } | |
| 823 | 859 | return new Feature( |
| 824 | 860 | Feature::fromGeometry($obj->{'geometry'}) |
| 825 | 861 | ,Feature::fromGeometryName($obj->{'geometry_name'}) |
| @@ -1026,6 +1062,12 @@ class Geometry { | ||
| 1026 | 1062 | * @throws Exception |
| 1027 | 1063 | */ |
| 1028 | 1064 | public static function from(stdClass $obj): Geometry { |
| 1065 | + if (!property_exists($obj, 'coordinates')) { | |
| 1066 | + throw new Exception("Missing required property"); | |
| 1067 | + } | |
| 1068 | + if (!property_exists($obj, 'type')) { | |
| 1069 | + throw new Exception("Missing required property"); | |
| 1070 | + } | |
| 1029 | 1071 | return new Geometry( |
| 1030 | 1072 | Geometry::fromCoordinates($obj->{'coordinates'}) |
| 1031 | 1073 | ,Geometry::fromType($obj->{'type'}) |
| @@ -3302,6 +3344,120 @@ class FeatureProperties { | ||
| 3302 | 3344 | * @throws Exception |
| 3303 | 3345 | */ |
| 3304 | 3346 | public static function from(stdClass $obj): FeatureProperties { |
| 3347 | + if (!property_exists($obj, 'add_improv')) { | |
| 3348 | + throw new Exception("Missing required property"); | |
| 3349 | + } | |
| 3350 | + if (!property_exists($obj, 'area_')) { | |
| 3351 | + throw new Exception("Missing required property"); | |
| 3352 | + } | |
| 3353 | + if (!property_exists($obj, 'asset_numb')) { | |
| 3354 | + throw new Exception("Missing required property"); | |
| 3355 | + } | |
| 3356 | + if (!property_exists($obj, 'comments')) { | |
| 3357 | + throw new Exception("Missing required property"); | |
| 3358 | + } | |
| 3359 | + if (!property_exists($obj, 'condition')) { | |
| 3360 | + throw new Exception("Missing required property"); | |
| 3361 | + } | |
| 3362 | + if (!property_exists($obj, 'constructi')) { | |
| 3363 | + throw new Exception("Missing required property"); | |
| 3364 | + } | |
| 3365 | + if (!property_exists($obj, 'createdate')) { | |
| 3366 | + throw new Exception("Missing required property"); | |
| 3367 | + } | |
| 3368 | + if (!property_exists($obj, 'createuser')) { | |
| 3369 | + throw new Exception("Missing required property"); | |
| 3370 | + } | |
| 3371 | + if (!property_exists($obj, 'disposal_d')) { | |
| 3372 | + throw new Exception("Missing required property"); | |
| 3373 | + } | |
| 3374 | + if (!property_exists($obj, 'documents')) { | |
| 3375 | + throw new Exception("Missing required property"); | |
| 3376 | + } | |
| 3377 | + if (!property_exists($obj, 'drawing_nu')) { | |
| 3378 | + throw new Exception("Missing required property"); | |
| 3379 | + } | |
| 3380 | + if (!property_exists($obj, 'file_numbe')) { | |
| 3381 | + throw new Exception("Missing required property"); | |
| 3382 | + } | |
| 3383 | + if (!property_exists($obj, 'folder_num')) { | |
| 3384 | + throw new Exception("Missing required property"); | |
| 3385 | + } | |
| 3386 | + if (!property_exists($obj, 'funding_ba')) { | |
| 3387 | + throw new Exception("Missing required property"); | |
| 3388 | + } | |
| 3389 | + if (!property_exists($obj, 'historic_c')) { | |
| 3390 | + throw new Exception("Missing required property"); | |
| 3391 | + } | |
| 3392 | + if (!property_exists($obj, 'inspection')) { | |
| 3393 | + throw new Exception("Missing required property"); | |
| 3394 | + } | |
| 3395 | + if (!property_exists($obj, 'inspectors')) { | |
| 3396 | + throw new Exception("Missing required property"); | |
| 3397 | + } | |
| 3398 | + if (!property_exists($obj, 'last_updat')) { | |
| 3399 | + throw new Exception("Missing required property"); | |
| 3400 | + } | |
| 3401 | + if (!property_exists($obj, 'level_accu')) { | |
| 3402 | + throw new Exception("Missing required property"); | |
| 3403 | + } | |
| 3404 | + if (!property_exists($obj, 'material')) { | |
| 3405 | + throw new Exception("Missing required property"); | |
| 3406 | + } | |
| 3407 | + if (!property_exists($obj, 'mi_prinx')) { | |
| 3408 | + throw new Exception("Missing required property"); | |
| 3409 | + } | |
| 3410 | + if (!property_exists($obj, 'mi_symbolo')) { | |
| 3411 | + throw new Exception("Missing required property"); | |
| 3412 | + } | |
| 3413 | + if (!property_exists($obj, 'number_lan')) { | |
| 3414 | + throw new Exception("Missing required property"); | |
| 3415 | + } | |
| 3416 | + if (!property_exists($obj, 'owner')) { | |
| 3417 | + throw new Exception("Missing required property"); | |
| 3418 | + } | |
| 3419 | + if (!property_exists($obj, 'positional')) { | |
| 3420 | + throw new Exception("Missing required property"); | |
| 3421 | + } | |
| 3422 | + if (!property_exists($obj, 'project_nu')) { | |
| 3423 | + throw new Exception("Missing required property"); | |
| 3424 | + } | |
| 3425 | + if (!property_exists($obj, 'rec_id')) { | |
| 3426 | + throw new Exception("Missing required property"); | |
| 3427 | + } | |
| 3428 | + if (!property_exists($obj, 'record_cre')) { | |
| 3429 | + throw new Exception("Missing required property"); | |
| 3430 | + } | |
| 3431 | + if (!property_exists($obj, 'shape_area')) { | |
| 3432 | + throw new Exception("Missing required property"); | |
| 3433 | + } | |
| 3434 | + if (!property_exists($obj, 'shape_leng')) { | |
| 3435 | + throw new Exception("Missing required property"); | |
| 3436 | + } | |
| 3437 | + if (!property_exists($obj, 'status')) { | |
| 3438 | + throw new Exception("Missing required property"); | |
| 3439 | + } | |
| 3440 | + if (!property_exists($obj, 'survey_num')) { | |
| 3441 | + throw new Exception("Missing required property"); | |
| 3442 | + } | |
| 3443 | + if (!property_exists($obj, 'toe_rl')) { | |
| 3444 | + throw new Exception("Missing required property"); | |
| 3445 | + } | |
| 3446 | + if (!property_exists($obj, 'top_rl')) { | |
| 3447 | + throw new Exception("Missing required property"); | |
| 3448 | + } | |
| 3449 | + if (!property_exists($obj, 'type')) { | |
| 3450 | + throw new Exception("Missing required property"); | |
| 3451 | + } | |
| 3452 | + if (!property_exists($obj, 'update_dat')) { | |
| 3453 | + throw new Exception("Missing required property"); | |
| 3454 | + } | |
| 3455 | + if (!property_exists($obj, 'updatedate')) { | |
| 3456 | + throw new Exception("Missing required property"); | |
| 3457 | + } | |
| 3458 | + if (!property_exists($obj, 'updateuser')) { | |
| 3459 | + throw new Exception("Missing required property"); | |
| 3460 | + } | |
| 3305 | 3461 | return new FeatureProperties( |
| 3306 | 3462 | FeatureProperties::fromAddImprov($obj->{'add_improv'}) |
| 3307 | 3463 | ,FeatureProperties::fromArea($obj->{'area_'}) |
Test case
1 generated file · +21 −0test/inputs/json/misc/b4865.json
Mphpdefault / TopLevel.php+21 −0
| @@ -736,6 +736,21 @@ class TopLevel { | ||
| 736 | 736 | * @throws Exception |
| 737 | 737 | */ |
| 738 | 738 | public static function from(stdClass $obj): TopLevel { |
| 739 | + if (!property_exists($obj, 'fall')) { | |
| 740 | + throw new Exception("Missing required property"); | |
| 741 | + } | |
| 742 | + if (!property_exists($obj, 'id')) { | |
| 743 | + throw new Exception("Missing required property"); | |
| 744 | + } | |
| 745 | + if (!property_exists($obj, 'name')) { | |
| 746 | + throw new Exception("Missing required property"); | |
| 747 | + } | |
| 748 | + if (!property_exists($obj, 'nametype')) { | |
| 749 | + throw new Exception("Missing required property"); | |
| 750 | + } | |
| 751 | + if (!property_exists($obj, 'recclass')) { | |
| 752 | + throw new Exception("Missing required property"); | |
| 753 | + } | |
| 739 | 754 | return new TopLevel( |
| 740 | 755 | TopLevel::fromComputedRegionCbhkFwbd($obj->{':@computed_region_cbhk_fwbd'}) |
| 741 | 756 | ,TopLevel::fromComputedRegionNnqa25F4($obj->{':@computed_region_nnqa_25f4'}) |
| @@ -972,6 +987,12 @@ class Geolocation { | ||
| 972 | 987 | * @throws Exception |
| 973 | 988 | */ |
| 974 | 989 | public static function from(stdClass $obj): Geolocation { |
| 990 | + if (!property_exists($obj, 'coordinates')) { | |
| 991 | + throw new Exception("Missing required property"); | |
| 992 | + } | |
| 993 | + if (!property_exists($obj, 'type')) { | |
| 994 | + throw new Exception("Missing required property"); | |
| 995 | + } | |
| 975 | 996 | return new Geolocation( |
| 976 | 997 | Geolocation::fromCoordinates($obj->{'coordinates'}) |
| 977 | 998 | ,Geolocation::fromType($obj->{'type'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/b6f2c.json
Mphpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'total_population')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromTotalPopulation($obj->{'total_population'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class TotalPopulation { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): TotalPopulation { |
| 252 | + if (!property_exists($obj, 'date')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'population')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new TotalPopulation( |
| 250 | 259 | TotalPopulation::fromDate($obj->{'date'}) |
| 251 | 260 | ,TotalPopulation::fromPopulation($obj->{'population'}) |
Test case
1 generated file · +12 −0test/inputs/json/misc/b6fe5.json
Mphpdefault / TopLevel.php+12 −0
| @@ -240,6 +240,18 @@ class TopLevel { | ||
| 240 | 240 | * @throws Exception |
| 241 | 241 | */ |
| 242 | 242 | public static function from(stdClass $obj): TopLevel { |
| 243 | + if (!property_exists($obj, 'group')) { | |
| 244 | + throw new Exception("Missing required property"); | |
| 245 | + } | |
| 246 | + if (!property_exists($obj, 'movie')) { | |
| 247 | + throw new Exception("Missing required property"); | |
| 248 | + } | |
| 249 | + if (!property_exists($obj, 'movie-image')) { | |
| 250 | + throw new Exception("Missing required property"); | |
| 251 | + } | |
| 252 | + if (!property_exists($obj, 'theater')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 243 | 255 | return new TopLevel( |
| 244 | 256 | TopLevel::fromGroup($obj->{'group'}) |
| 245 | 257 | ,TopLevel::fromMovie($obj->{'movie'}) |
Test case
1 generated file · +3 −0test/inputs/json/misc/b9f64.json
Mphpdefault / TopLevel.php+3 −0
| @@ -84,6 +84,9 @@ class TopLevel { | ||
| 84 | 84 | * @throws Exception |
| 85 | 85 | */ |
| 86 | 86 | public static function from(stdClass $obj): TopLevel { |
| 87 | + if (!property_exists($obj, 'user-agent')) { | |
| 88 | + throw new Exception("Missing required property"); | |
| 89 | + } | |
| 87 | 90 | return new TopLevel( |
| 88 | 91 | TopLevel::fromUserAgent($obj->{'user-agent'}) |
| 89 | 92 | ); |
Test case
1 generated file · +9 −0test/inputs/json/misc/bb1ec.json
Mphpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'total_population')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromTotalPopulation($obj->{'total_population'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class TotalPopulation { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): TotalPopulation { |
| 252 | + if (!property_exists($obj, 'date')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'population')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new TotalPopulation( |
| 250 | 259 | TotalPopulation::fromDate($obj->{'date'}) |
| 251 | 260 | ,TotalPopulation::fromPopulation($obj->{'population'}) |
Test case
1 generated file · +291 −0test/inputs/json/misc/be234.json
Mphpdefault / TopLevel.php+291 −0
| @@ -137,6 +137,12 @@ class TopLevel { | ||
| 137 | 137 | * @throws Exception |
| 138 | 138 | */ |
| 139 | 139 | public static function from(stdClass $obj): TopLevel { |
| 140 | + if (!property_exists($obj, 'data')) { | |
| 141 | + throw new Exception("Missing required property"); | |
| 142 | + } | |
| 143 | + if (!property_exists($obj, 'kind')) { | |
| 144 | + throw new Exception("Missing required property"); | |
| 145 | + } | |
| 140 | 146 | return new TopLevel( |
| 141 | 147 | TopLevel::fromData($obj->{'data'}) |
| 142 | 148 | ,TopLevel::fromKind($obj->{'kind'}) |
| @@ -408,6 +414,18 @@ class TopLevelData { | ||
| 408 | 414 | * @throws Exception |
| 409 | 415 | */ |
| 410 | 416 | public static function from(stdClass $obj): TopLevelData { |
| 417 | + if (!property_exists($obj, 'after')) { | |
| 418 | + throw new Exception("Missing required property"); | |
| 419 | + } | |
| 420 | + if (!property_exists($obj, 'before')) { | |
| 421 | + throw new Exception("Missing required property"); | |
| 422 | + } | |
| 423 | + if (!property_exists($obj, 'children')) { | |
| 424 | + throw new Exception("Missing required property"); | |
| 425 | + } | |
| 426 | + if (!property_exists($obj, 'modhash')) { | |
| 427 | + throw new Exception("Missing required property"); | |
| 428 | + } | |
| 411 | 429 | return new TopLevelData( |
| 412 | 430 | TopLevelData::fromAfter($obj->{'after'}) |
| 413 | 431 | ,TopLevelData::fromBefore($obj->{'before'}) |
| @@ -566,6 +584,12 @@ class Child { | ||
| 566 | 584 | * @throws Exception |
| 567 | 585 | */ |
| 568 | 586 | public static function from(stdClass $obj): Child { |
| 587 | + if (!property_exists($obj, 'data')) { | |
| 588 | + throw new Exception("Missing required property"); | |
| 589 | + } | |
| 590 | + if (!property_exists($obj, 'kind')) { | |
| 591 | + throw new Exception("Missing required property"); | |
| 592 | + } | |
| 569 | 593 | return new Child( |
| 570 | 594 | Child::fromData($obj->{'data'}) |
| 571 | 595 | ,Child::fromKind($obj->{'kind'}) |
| @@ -4057,6 +4081,198 @@ class ChildData { | ||
| 4057 | 4081 | * @throws Exception |
| 4058 | 4082 | */ |
| 4059 | 4083 | public static function from(stdClass $obj): ChildData { |
| 4084 | + if (!property_exists($obj, 'approved_at_utc')) { | |
| 4085 | + throw new Exception("Missing required property"); | |
| 4086 | + } | |
| 4087 | + if (!property_exists($obj, 'approved_by')) { | |
| 4088 | + throw new Exception("Missing required property"); | |
| 4089 | + } | |
| 4090 | + if (!property_exists($obj, 'archived')) { | |
| 4091 | + throw new Exception("Missing required property"); | |
| 4092 | + } | |
| 4093 | + if (!property_exists($obj, 'author')) { | |
| 4094 | + throw new Exception("Missing required property"); | |
| 4095 | + } | |
| 4096 | + if (!property_exists($obj, 'author_flair_css_class')) { | |
| 4097 | + throw new Exception("Missing required property"); | |
| 4098 | + } | |
| 4099 | + if (!property_exists($obj, 'author_flair_text')) { | |
| 4100 | + throw new Exception("Missing required property"); | |
| 4101 | + } | |
| 4102 | + if (!property_exists($obj, 'banned_at_utc')) { | |
| 4103 | + throw new Exception("Missing required property"); | |
| 4104 | + } | |
| 4105 | + if (!property_exists($obj, 'banned_by')) { | |
| 4106 | + throw new Exception("Missing required property"); | |
| 4107 | + } | |
| 4108 | + if (!property_exists($obj, 'brand_safe')) { | |
| 4109 | + throw new Exception("Missing required property"); | |
| 4110 | + } | |
| 4111 | + if (!property_exists($obj, 'can_gild')) { | |
| 4112 | + throw new Exception("Missing required property"); | |
| 4113 | + } | |
| 4114 | + if (!property_exists($obj, 'can_mod_post')) { | |
| 4115 | + throw new Exception("Missing required property"); | |
| 4116 | + } | |
| 4117 | + if (!property_exists($obj, 'clicked')) { | |
| 4118 | + throw new Exception("Missing required property"); | |
| 4119 | + } | |
| 4120 | + if (!property_exists($obj, 'contest_mode')) { | |
| 4121 | + throw new Exception("Missing required property"); | |
| 4122 | + } | |
| 4123 | + if (!property_exists($obj, 'created')) { | |
| 4124 | + throw new Exception("Missing required property"); | |
| 4125 | + } | |
| 4126 | + if (!property_exists($obj, 'created_utc')) { | |
| 4127 | + throw new Exception("Missing required property"); | |
| 4128 | + } | |
| 4129 | + if (!property_exists($obj, 'distinguished')) { | |
| 4130 | + throw new Exception("Missing required property"); | |
| 4131 | + } | |
| 4132 | + if (!property_exists($obj, 'domain')) { | |
| 4133 | + throw new Exception("Missing required property"); | |
| 4134 | + } | |
| 4135 | + if (!property_exists($obj, 'downs')) { | |
| 4136 | + throw new Exception("Missing required property"); | |
| 4137 | + } | |
| 4138 | + if (!property_exists($obj, 'edited')) { | |
| 4139 | + throw new Exception("Missing required property"); | |
| 4140 | + } | |
| 4141 | + if (!property_exists($obj, 'gilded')) { | |
| 4142 | + throw new Exception("Missing required property"); | |
| 4143 | + } | |
| 4144 | + if (!property_exists($obj, 'hidden')) { | |
| 4145 | + throw new Exception("Missing required property"); | |
| 4146 | + } | |
| 4147 | + if (!property_exists($obj, 'hide_score')) { | |
| 4148 | + throw new Exception("Missing required property"); | |
| 4149 | + } | |
| 4150 | + if (!property_exists($obj, 'id')) { | |
| 4151 | + throw new Exception("Missing required property"); | |
| 4152 | + } | |
| 4153 | + if (!property_exists($obj, 'is_self')) { | |
| 4154 | + throw new Exception("Missing required property"); | |
| 4155 | + } | |
| 4156 | + if (!property_exists($obj, 'is_video')) { | |
| 4157 | + throw new Exception("Missing required property"); | |
| 4158 | + } | |
| 4159 | + if (!property_exists($obj, 'likes')) { | |
| 4160 | + throw new Exception("Missing required property"); | |
| 4161 | + } | |
| 4162 | + if (!property_exists($obj, 'link_flair_css_class')) { | |
| 4163 | + throw new Exception("Missing required property"); | |
| 4164 | + } | |
| 4165 | + if (!property_exists($obj, 'link_flair_text')) { | |
| 4166 | + throw new Exception("Missing required property"); | |
| 4167 | + } | |
| 4168 | + if (!property_exists($obj, 'locked')) { | |
| 4169 | + throw new Exception("Missing required property"); | |
| 4170 | + } | |
| 4171 | + if (!property_exists($obj, 'media')) { | |
| 4172 | + throw new Exception("Missing required property"); | |
| 4173 | + } | |
| 4174 | + if (!property_exists($obj, 'media_embed')) { | |
| 4175 | + throw new Exception("Missing required property"); | |
| 4176 | + } | |
| 4177 | + if (!property_exists($obj, 'mod_reports')) { | |
| 4178 | + throw new Exception("Missing required property"); | |
| 4179 | + } | |
| 4180 | + if (!property_exists($obj, 'name')) { | |
| 4181 | + throw new Exception("Missing required property"); | |
| 4182 | + } | |
| 4183 | + if (!property_exists($obj, 'num_comments')) { | |
| 4184 | + throw new Exception("Missing required property"); | |
| 4185 | + } | |
| 4186 | + if (!property_exists($obj, 'num_reports')) { | |
| 4187 | + throw new Exception("Missing required property"); | |
| 4188 | + } | |
| 4189 | + if (!property_exists($obj, 'over_18')) { | |
| 4190 | + throw new Exception("Missing required property"); | |
| 4191 | + } | |
| 4192 | + if (!property_exists($obj, 'permalink')) { | |
| 4193 | + throw new Exception("Missing required property"); | |
| 4194 | + } | |
| 4195 | + if (!property_exists($obj, 'post_hint')) { | |
| 4196 | + throw new Exception("Missing required property"); | |
| 4197 | + } | |
| 4198 | + if (!property_exists($obj, 'preview')) { | |
| 4199 | + throw new Exception("Missing required property"); | |
| 4200 | + } | |
| 4201 | + if (!property_exists($obj, 'quarantine')) { | |
| 4202 | + throw new Exception("Missing required property"); | |
| 4203 | + } | |
| 4204 | + if (!property_exists($obj, 'removal_reason')) { | |
| 4205 | + throw new Exception("Missing required property"); | |
| 4206 | + } | |
| 4207 | + if (!property_exists($obj, 'report_reasons')) { | |
| 4208 | + throw new Exception("Missing required property"); | |
| 4209 | + } | |
| 4210 | + if (!property_exists($obj, 'saved')) { | |
| 4211 | + throw new Exception("Missing required property"); | |
| 4212 | + } | |
| 4213 | + if (!property_exists($obj, 'score')) { | |
| 4214 | + throw new Exception("Missing required property"); | |
| 4215 | + } | |
| 4216 | + if (!property_exists($obj, 'secure_media')) { | |
| 4217 | + throw new Exception("Missing required property"); | |
| 4218 | + } | |
| 4219 | + if (!property_exists($obj, 'secure_media_embed')) { | |
| 4220 | + throw new Exception("Missing required property"); | |
| 4221 | + } | |
| 4222 | + if (!property_exists($obj, 'selftext')) { | |
| 4223 | + throw new Exception("Missing required property"); | |
| 4224 | + } | |
| 4225 | + if (!property_exists($obj, 'selftext_html')) { | |
| 4226 | + throw new Exception("Missing required property"); | |
| 4227 | + } | |
| 4228 | + if (!property_exists($obj, 'spoiler')) { | |
| 4229 | + throw new Exception("Missing required property"); | |
| 4230 | + } | |
| 4231 | + if (!property_exists($obj, 'stickied')) { | |
| 4232 | + throw new Exception("Missing required property"); | |
| 4233 | + } | |
| 4234 | + if (!property_exists($obj, 'subreddit')) { | |
| 4235 | + throw new Exception("Missing required property"); | |
| 4236 | + } | |
| 4237 | + if (!property_exists($obj, 'subreddit_id')) { | |
| 4238 | + throw new Exception("Missing required property"); | |
| 4239 | + } | |
| 4240 | + if (!property_exists($obj, 'subreddit_name_prefixed')) { | |
| 4241 | + throw new Exception("Missing required property"); | |
| 4242 | + } | |
| 4243 | + if (!property_exists($obj, 'subreddit_type')) { | |
| 4244 | + throw new Exception("Missing required property"); | |
| 4245 | + } | |
| 4246 | + if (!property_exists($obj, 'suggested_sort')) { | |
| 4247 | + throw new Exception("Missing required property"); | |
| 4248 | + } | |
| 4249 | + if (!property_exists($obj, 'thumbnail')) { | |
| 4250 | + throw new Exception("Missing required property"); | |
| 4251 | + } | |
| 4252 | + if (!property_exists($obj, 'thumbnail_height')) { | |
| 4253 | + throw new Exception("Missing required property"); | |
| 4254 | + } | |
| 4255 | + if (!property_exists($obj, 'thumbnail_width')) { | |
| 4256 | + throw new Exception("Missing required property"); | |
| 4257 | + } | |
| 4258 | + if (!property_exists($obj, 'title')) { | |
| 4259 | + throw new Exception("Missing required property"); | |
| 4260 | + } | |
| 4261 | + if (!property_exists($obj, 'ups')) { | |
| 4262 | + throw new Exception("Missing required property"); | |
| 4263 | + } | |
| 4264 | + if (!property_exists($obj, 'url')) { | |
| 4265 | + throw new Exception("Missing required property"); | |
| 4266 | + } | |
| 4267 | + if (!property_exists($obj, 'user_reports')) { | |
| 4268 | + throw new Exception("Missing required property"); | |
| 4269 | + } | |
| 4270 | + if (!property_exists($obj, 'view_count')) { | |
| 4271 | + throw new Exception("Missing required property"); | |
| 4272 | + } | |
| 4273 | + if (!property_exists($obj, 'visited')) { | |
| 4274 | + throw new Exception("Missing required property"); | |
| 4275 | + } | |
| 4060 | 4276 | return new ChildData( |
| 4061 | 4277 | ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'}) |
| 4062 | 4278 | ,ChildData::fromApprovedBy($obj->{'approved_by'}) |
| @@ -4396,6 +4612,12 @@ class Media { | ||
| 4396 | 4612 | * @throws Exception |
| 4397 | 4613 | */ |
| 4398 | 4614 | public static function from(stdClass $obj): Media { |
| 4615 | + if (!property_exists($obj, 'oembed')) { | |
| 4616 | + throw new Exception("Missing required property"); | |
| 4617 | + } | |
| 4618 | + if (!property_exists($obj, 'type')) { | |
| 4619 | + throw new Exception("Missing required property"); | |
| 4620 | + } | |
| 4399 | 4621 | return new Media( |
| 4400 | 4622 | Media::fromOembed($obj->{'oembed'}) |
| 4401 | 4623 | ,Media::fromType($obj->{'type'}) |
| @@ -5068,6 +5290,42 @@ class Oembed { | ||
| 5068 | 5290 | * @throws Exception |
| 5069 | 5291 | */ |
| 5070 | 5292 | public static function from(stdClass $obj): Oembed { |
| 5293 | + if (!property_exists($obj, 'description')) { | |
| 5294 | + throw new Exception("Missing required property"); | |
| 5295 | + } | |
| 5296 | + if (!property_exists($obj, 'height')) { | |
| 5297 | + throw new Exception("Missing required property"); | |
| 5298 | + } | |
| 5299 | + if (!property_exists($obj, 'html')) { | |
| 5300 | + throw new Exception("Missing required property"); | |
| 5301 | + } | |
| 5302 | + if (!property_exists($obj, 'provider_name')) { | |
| 5303 | + throw new Exception("Missing required property"); | |
| 5304 | + } | |
| 5305 | + if (!property_exists($obj, 'provider_url')) { | |
| 5306 | + throw new Exception("Missing required property"); | |
| 5307 | + } | |
| 5308 | + if (!property_exists($obj, 'thumbnail_height')) { | |
| 5309 | + throw new Exception("Missing required property"); | |
| 5310 | + } | |
| 5311 | + if (!property_exists($obj, 'thumbnail_url')) { | |
| 5312 | + throw new Exception("Missing required property"); | |
| 5313 | + } | |
| 5314 | + if (!property_exists($obj, 'thumbnail_width')) { | |
| 5315 | + throw new Exception("Missing required property"); | |
| 5316 | + } | |
| 5317 | + if (!property_exists($obj, 'title')) { | |
| 5318 | + throw new Exception("Missing required property"); | |
| 5319 | + } | |
| 5320 | + if (!property_exists($obj, 'type')) { | |
| 5321 | + throw new Exception("Missing required property"); | |
| 5322 | + } | |
| 5323 | + if (!property_exists($obj, 'version')) { | |
| 5324 | + throw new Exception("Missing required property"); | |
| 5325 | + } | |
| 5326 | + if (!property_exists($obj, 'width')) { | |
| 5327 | + throw new Exception("Missing required property"); | |
| 5328 | + } | |
| 5071 | 5329 | return new Oembed( |
| 5072 | 5330 | Oembed::fromDescription($obj->{'description'}) |
| 5073 | 5331 | ,Oembed::fromHeight($obj->{'height'}) |
| @@ -5605,6 +5863,12 @@ class Preview { | ||
| 5605 | 5863 | * @throws Exception |
| 5606 | 5864 | */ |
| 5607 | 5865 | public static function from(stdClass $obj): Preview { |
| 5866 | + if (!property_exists($obj, 'enabled')) { | |
| 5867 | + throw new Exception("Missing required property"); | |
| 5868 | + } | |
| 5869 | + if (!property_exists($obj, 'images')) { | |
| 5870 | + throw new Exception("Missing required property"); | |
| 5871 | + } | |
| 5608 | 5872 | return new Preview( |
| 5609 | 5873 | Preview::fromEnabled($obj->{'enabled'}) |
| 5610 | 5874 | ,Preview::fromImages($obj->{'images'}) |
| @@ -5875,6 +6139,18 @@ class Image { | ||
| 5875 | 6139 | * @throws Exception |
| 5876 | 6140 | */ |
| 5877 | 6141 | public static function from(stdClass $obj): Image { |
| 6142 | + if (!property_exists($obj, 'id')) { | |
| 6143 | + throw new Exception("Missing required property"); | |
| 6144 | + } | |
| 6145 | + if (!property_exists($obj, 'resolutions')) { | |
| 6146 | + throw new Exception("Missing required property"); | |
| 6147 | + } | |
| 6148 | + if (!property_exists($obj, 'source')) { | |
| 6149 | + throw new Exception("Missing required property"); | |
| 6150 | + } | |
| 6151 | + if (!property_exists($obj, 'variants')) { | |
| 6152 | + throw new Exception("Missing required property"); | |
| 6153 | + } | |
| 5878 | 6154 | return new Image( |
| 5879 | 6155 | Image::fromID($obj->{'id'}) |
| 5880 | 6156 | ,Image::fromResolutions($obj->{'resolutions'}) |
| @@ -6083,6 +6359,15 @@ class Source { | ||
| 6083 | 6359 | * @throws Exception |
| 6084 | 6360 | */ |
| 6085 | 6361 | public static function from(stdClass $obj): Source { |
| 6362 | + if (!property_exists($obj, 'height')) { | |
| 6363 | + throw new Exception("Missing required property"); | |
| 6364 | + } | |
| 6365 | + if (!property_exists($obj, 'url')) { | |
| 6366 | + throw new Exception("Missing required property"); | |
| 6367 | + } | |
| 6368 | + if (!property_exists($obj, 'width')) { | |
| 6369 | + throw new Exception("Missing required property"); | |
| 6370 | + } | |
| 6086 | 6371 | return new Source( |
| 6087 | 6372 | Source::fromHeight($obj->{'height'}) |
| 6088 | 6373 | ,Source::fromURL($obj->{'url'}) |
| @@ -6424,6 +6709,12 @@ class GIF { | ||
| 6424 | 6709 | * @throws Exception |
| 6425 | 6710 | */ |
| 6426 | 6711 | public static function from(stdClass $obj): GIF { |
| 6712 | + if (!property_exists($obj, 'resolutions')) { | |
| 6713 | + throw new Exception("Missing required property"); | |
| 6714 | + } | |
| 6715 | + if (!property_exists($obj, 'source')) { | |
| 6716 | + throw new Exception("Missing required property"); | |
| 6717 | + } | |
| 6427 | 6718 | return new GIF( |
| 6428 | 6719 | GIF::fromResolutions($obj->{'resolutions'}) |
| 6429 | 6720 | ,GIF::fromSource($obj->{'source'}) |
Test case
1 generated file · +21 −0test/inputs/json/misc/c0356.json
Mphpdefault / TopLevel.php+21 −0
| @@ -152,6 +152,12 @@ class TopLevel { | ||
| 152 | 152 | * @throws Exception |
| 153 | 153 | */ |
| 154 | 154 | public static function from(stdClass $obj): TopLevel { |
| 155 | + if (!property_exists($obj, 'data')) { | |
| 156 | + throw new Exception("Missing required property"); | |
| 157 | + } | |
| 158 | + if (!property_exists($obj, 'description')) { | |
| 159 | + throw new Exception("Missing required property"); | |
| 160 | + } | |
| 155 | 161 | return new TopLevel( |
| 156 | 162 | TopLevel::fromData($obj->{'data'}) |
| 157 | 163 | ,TopLevel::fromDescription($obj->{'description'}) |
| @@ -304,6 +310,12 @@ class Datum { | ||
| 304 | 310 | * @throws Exception |
| 305 | 311 | */ |
| 306 | 312 | public static function from(stdClass $obj): Datum { |
| 313 | + if (!property_exists($obj, 'anomaly')) { | |
| 314 | + throw new Exception("Missing required property"); | |
| 315 | + } | |
| 316 | + if (!property_exists($obj, 'value')) { | |
| 317 | + throw new Exception("Missing required property"); | |
| 318 | + } | |
| 307 | 319 | return new Datum( |
| 308 | 320 | Datum::fromAnomaly($obj->{'anomaly'}) |
| 309 | 321 | ,Datum::fromValue($obj->{'value'}) |
| @@ -508,6 +520,15 @@ class Description { | ||
| 508 | 520 | * @throws Exception |
| 509 | 521 | */ |
| 510 | 522 | public static function from(stdClass $obj): Description { |
| 523 | + if (!property_exists($obj, 'base_period')) { | |
| 524 | + throw new Exception("Missing required property"); | |
| 525 | + } | |
| 526 | + if (!property_exists($obj, 'missing')) { | |
| 527 | + throw new Exception("Missing required property"); | |
| 528 | + } | |
| 529 | + if (!property_exists($obj, 'title')) { | |
| 530 | + throw new Exception("Missing required property"); | |
| 531 | + } | |
| 511 | 532 | return new Description( |
| 512 | 533 | Description::fromBasePeriod($obj->{'base_period'}) |
| 513 | 534 | ,Description::fromMissing($obj->{'missing'}) |
Test case
1 generated file · +75 −0test/inputs/json/misc/c0a3a.json
Mphpdefault / TopLevel.php+75 −0
| @@ -450,6 +450,30 @@ class TopLevel { | ||
| 450 | 450 | * @throws Exception |
| 451 | 451 | */ |
| 452 | 452 | public static function from(stdClass $obj): TopLevel { |
| 453 | + if (!property_exists($obj, 'city')) { | |
| 454 | + throw new Exception("Missing required property"); | |
| 455 | + } | |
| 456 | + if (!property_exists($obj, 'delay')) { | |
| 457 | + throw new Exception("Missing required property"); | |
| 458 | + } | |
| 459 | + if (!property_exists($obj, 'IATA')) { | |
| 460 | + throw new Exception("Missing required property"); | |
| 461 | + } | |
| 462 | + if (!property_exists($obj, 'ICAO')) { | |
| 463 | + throw new Exception("Missing required property"); | |
| 464 | + } | |
| 465 | + if (!property_exists($obj, 'name')) { | |
| 466 | + throw new Exception("Missing required property"); | |
| 467 | + } | |
| 468 | + if (!property_exists($obj, 'state')) { | |
| 469 | + throw new Exception("Missing required property"); | |
| 470 | + } | |
| 471 | + if (!property_exists($obj, 'status')) { | |
| 472 | + throw new Exception("Missing required property"); | |
| 473 | + } | |
| 474 | + if (!property_exists($obj, 'weather')) { | |
| 475 | + throw new Exception("Missing required property"); | |
| 476 | + } | |
| 453 | 477 | return new TopLevel( |
| 454 | 478 | TopLevel::fromCity($obj->{'city'}) |
| 455 | 479 | ,TopLevel::fromDelay($obj->{'delay'}) |
| @@ -978,6 +1002,33 @@ class Status { | ||
| 978 | 1002 | * @throws Exception |
| 979 | 1003 | */ |
| 980 | 1004 | public static function from(stdClass $obj): Status { |
| 1005 | + if (!property_exists($obj, 'avgDelay')) { | |
| 1006 | + throw new Exception("Missing required property"); | |
| 1007 | + } | |
| 1008 | + if (!property_exists($obj, 'closureBegin')) { | |
| 1009 | + throw new Exception("Missing required property"); | |
| 1010 | + } | |
| 1011 | + if (!property_exists($obj, 'closureEnd')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'endTime')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 1017 | + if (!property_exists($obj, 'maxDelay')) { | |
| 1018 | + throw new Exception("Missing required property"); | |
| 1019 | + } | |
| 1020 | + if (!property_exists($obj, 'minDelay')) { | |
| 1021 | + throw new Exception("Missing required property"); | |
| 1022 | + } | |
| 1023 | + if (!property_exists($obj, 'reason')) { | |
| 1024 | + throw new Exception("Missing required property"); | |
| 1025 | + } | |
| 1026 | + if (!property_exists($obj, 'trend')) { | |
| 1027 | + throw new Exception("Missing required property"); | |
| 1028 | + } | |
| 1029 | + if (!property_exists($obj, 'type')) { | |
| 1030 | + throw new Exception("Missing required property"); | |
| 1031 | + } | |
| 981 | 1032 | return new Status( |
| 982 | 1033 | Status::fromAvgDelay($obj->{'avgDelay'}) |
| 983 | 1034 | ,Status::fromClosureBegin($obj->{'closureBegin'}) |
| @@ -1301,6 +1352,21 @@ class Weather { | ||
| 1301 | 1352 | * @throws Exception |
| 1302 | 1353 | */ |
| 1303 | 1354 | public static function from(stdClass $obj): Weather { |
| 1355 | + if (!property_exists($obj, 'meta')) { | |
| 1356 | + throw new Exception("Missing required property"); | |
| 1357 | + } | |
| 1358 | + if (!property_exists($obj, 'temp')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1361 | + if (!property_exists($obj, 'visibility')) { | |
| 1362 | + throw new Exception("Missing required property"); | |
| 1363 | + } | |
| 1364 | + if (!property_exists($obj, 'weather')) { | |
| 1365 | + throw new Exception("Missing required property"); | |
| 1366 | + } | |
| 1367 | + if (!property_exists($obj, 'wind')) { | |
| 1368 | + throw new Exception("Missing required property"); | |
| 1369 | + } | |
| 1304 | 1370 | return new Weather( |
| 1305 | 1371 | Weather::fromMeta($obj->{'meta'}) |
| 1306 | 1372 | ,Weather::fromTemp($obj->{'temp'}) |
| @@ -1511,6 +1577,15 @@ class Meta { | ||
| 1511 | 1577 | * @throws Exception |
| 1512 | 1578 | */ |
| 1513 | 1579 | public static function from(stdClass $obj): Meta { |
| 1580 | + if (!property_exists($obj, 'credit')) { | |
| 1581 | + throw new Exception("Missing required property"); | |
| 1582 | + } | |
| 1583 | + if (!property_exists($obj, 'updated')) { | |
| 1584 | + throw new Exception("Missing required property"); | |
| 1585 | + } | |
| 1586 | + if (!property_exists($obj, 'url')) { | |
| 1587 | + throw new Exception("Missing required property"); | |
| 1588 | + } | |
| 1514 | 1589 | return new Meta( |
| 1515 | 1590 | Meta::fromCredit($obj->{'credit'}) |
| 1516 | 1591 | ,Meta::fromUpdated($obj->{'updated'}) |
Test case
1 generated file · +204 −0test/inputs/json/misc/c3303.json
Mphpdefault / TopLevel.php+204 −0
| @@ -202,6 +202,15 @@ class TopLevel { | ||
| 202 | 202 | * @throws Exception |
| 203 | 203 | */ |
| 204 | 204 | public static function from(stdClass $obj): TopLevel { |
| 205 | + if (!property_exists($obj, 'data')) { | |
| 206 | + throw new Exception("Missing required property"); | |
| 207 | + } | |
| 208 | + if (!property_exists($obj, 'meta')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'pagination')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 205 | 214 | return new TopLevel( |
| 206 | 215 | TopLevel::fromData($obj->{'data'}) |
| 207 | 216 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -1203,6 +1212,57 @@ class Datum { | ||
| 1203 | 1212 | * @throws Exception |
| 1204 | 1213 | */ |
| 1205 | 1214 | public static function from(stdClass $obj): Datum { |
| 1215 | + if (!property_exists($obj, 'bitly_gif_url')) { | |
| 1216 | + throw new Exception("Missing required property"); | |
| 1217 | + } | |
| 1218 | + if (!property_exists($obj, 'bitly_url')) { | |
| 1219 | + throw new Exception("Missing required property"); | |
| 1220 | + } | |
| 1221 | + if (!property_exists($obj, 'content_url')) { | |
| 1222 | + throw new Exception("Missing required property"); | |
| 1223 | + } | |
| 1224 | + if (!property_exists($obj, 'embed_url')) { | |
| 1225 | + throw new Exception("Missing required property"); | |
| 1226 | + } | |
| 1227 | + if (!property_exists($obj, 'id')) { | |
| 1228 | + throw new Exception("Missing required property"); | |
| 1229 | + } | |
| 1230 | + if (!property_exists($obj, 'images')) { | |
| 1231 | + throw new Exception("Missing required property"); | |
| 1232 | + } | |
| 1233 | + if (!property_exists($obj, 'import_datetime')) { | |
| 1234 | + throw new Exception("Missing required property"); | |
| 1235 | + } | |
| 1236 | + if (!property_exists($obj, 'is_indexable')) { | |
| 1237 | + throw new Exception("Missing required property"); | |
| 1238 | + } | |
| 1239 | + if (!property_exists($obj, 'rating')) { | |
| 1240 | + throw new Exception("Missing required property"); | |
| 1241 | + } | |
| 1242 | + if (!property_exists($obj, 'slug')) { | |
| 1243 | + throw new Exception("Missing required property"); | |
| 1244 | + } | |
| 1245 | + if (!property_exists($obj, 'source')) { | |
| 1246 | + throw new Exception("Missing required property"); | |
| 1247 | + } | |
| 1248 | + if (!property_exists($obj, 'source_post_url')) { | |
| 1249 | + throw new Exception("Missing required property"); | |
| 1250 | + } | |
| 1251 | + if (!property_exists($obj, 'source_tld')) { | |
| 1252 | + throw new Exception("Missing required property"); | |
| 1253 | + } | |
| 1254 | + if (!property_exists($obj, 'trending_datetime')) { | |
| 1255 | + throw new Exception("Missing required property"); | |
| 1256 | + } | |
| 1257 | + if (!property_exists($obj, 'type')) { | |
| 1258 | + throw new Exception("Missing required property"); | |
| 1259 | + } | |
| 1260 | + if (!property_exists($obj, 'url')) { | |
| 1261 | + throw new Exception("Missing required property"); | |
| 1262 | + } | |
| 1263 | + if (!property_exists($obj, 'username')) { | |
| 1264 | + throw new Exception("Missing required property"); | |
| 1265 | + } | |
| 1206 | 1266 | return new Datum( |
| 1207 | 1267 | Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'}) |
| 1208 | 1268 | ,Datum::fromBitlyURL($obj->{'bitly_url'}) |
| @@ -2512,6 +2572,72 @@ class Images { | ||
| 2512 | 2572 | * @throws Exception |
| 2513 | 2573 | */ |
| 2514 | 2574 | public static function from(stdClass $obj): Images { |
| 2575 | + if (!property_exists($obj, 'downsized')) { | |
| 2576 | + throw new Exception("Missing required property"); | |
| 2577 | + } | |
| 2578 | + if (!property_exists($obj, 'downsized_large')) { | |
| 2579 | + throw new Exception("Missing required property"); | |
| 2580 | + } | |
| 2581 | + if (!property_exists($obj, 'downsized_medium')) { | |
| 2582 | + throw new Exception("Missing required property"); | |
| 2583 | + } | |
| 2584 | + if (!property_exists($obj, 'downsized_small')) { | |
| 2585 | + throw new Exception("Missing required property"); | |
| 2586 | + } | |
| 2587 | + if (!property_exists($obj, 'downsized_still')) { | |
| 2588 | + throw new Exception("Missing required property"); | |
| 2589 | + } | |
| 2590 | + if (!property_exists($obj, 'fixed_height')) { | |
| 2591 | + throw new Exception("Missing required property"); | |
| 2592 | + } | |
| 2593 | + if (!property_exists($obj, 'fixed_height_downsampled')) { | |
| 2594 | + throw new Exception("Missing required property"); | |
| 2595 | + } | |
| 2596 | + if (!property_exists($obj, 'fixed_height_small')) { | |
| 2597 | + throw new Exception("Missing required property"); | |
| 2598 | + } | |
| 2599 | + if (!property_exists($obj, 'fixed_height_small_still')) { | |
| 2600 | + throw new Exception("Missing required property"); | |
| 2601 | + } | |
| 2602 | + if (!property_exists($obj, 'fixed_height_still')) { | |
| 2603 | + throw new Exception("Missing required property"); | |
| 2604 | + } | |
| 2605 | + if (!property_exists($obj, 'fixed_width')) { | |
| 2606 | + throw new Exception("Missing required property"); | |
| 2607 | + } | |
| 2608 | + if (!property_exists($obj, 'fixed_width_downsampled')) { | |
| 2609 | + throw new Exception("Missing required property"); | |
| 2610 | + } | |
| 2611 | + if (!property_exists($obj, 'fixed_width_small')) { | |
| 2612 | + throw new Exception("Missing required property"); | |
| 2613 | + } | |
| 2614 | + if (!property_exists($obj, 'fixed_width_small_still')) { | |
| 2615 | + throw new Exception("Missing required property"); | |
| 2616 | + } | |
| 2617 | + if (!property_exists($obj, 'fixed_width_still')) { | |
| 2618 | + throw new Exception("Missing required property"); | |
| 2619 | + } | |
| 2620 | + if (!property_exists($obj, 'looping')) { | |
| 2621 | + throw new Exception("Missing required property"); | |
| 2622 | + } | |
| 2623 | + if (!property_exists($obj, 'original')) { | |
| 2624 | + throw new Exception("Missing required property"); | |
| 2625 | + } | |
| 2626 | + if (!property_exists($obj, 'original_mp4')) { | |
| 2627 | + throw new Exception("Missing required property"); | |
| 2628 | + } | |
| 2629 | + if (!property_exists($obj, 'original_still')) { | |
| 2630 | + throw new Exception("Missing required property"); | |
| 2631 | + } | |
| 2632 | + if (!property_exists($obj, 'preview')) { | |
| 2633 | + throw new Exception("Missing required property"); | |
| 2634 | + } | |
| 2635 | + if (!property_exists($obj, 'preview_gif')) { | |
| 2636 | + throw new Exception("Missing required property"); | |
| 2637 | + } | |
| 2638 | + if (!property_exists($obj, 'preview_webp')) { | |
| 2639 | + throw new Exception("Missing required property"); | |
| 2640 | + } | |
| 2515 | 2641 | return new Images( |
| 2516 | 2642 | Images::fromDownsized($obj->{'downsized'}) |
| 2517 | 2643 | ,Images::fromDownsizedLarge($obj->{'downsized_large'}) |
| @@ -2820,6 +2946,15 @@ class Downsized { | ||
| 2820 | 2946 | * @throws Exception |
| 2821 | 2947 | */ |
| 2822 | 2948 | public static function from(stdClass $obj): Downsized { |
| 2949 | + if (!property_exists($obj, 'height')) { | |
| 2950 | + throw new Exception("Missing required property"); | |
| 2951 | + } | |
| 2952 | + if (!property_exists($obj, 'url')) { | |
| 2953 | + throw new Exception("Missing required property"); | |
| 2954 | + } | |
| 2955 | + if (!property_exists($obj, 'width')) { | |
| 2956 | + throw new Exception("Missing required property"); | |
| 2957 | + } | |
| 2823 | 2958 | return new Downsized( |
| 2824 | 2959 | Downsized::fromHeight($obj->{'height'}) |
| 2825 | 2960 | ,Downsized::fromSize($obj->{'size'}) |
| @@ -3080,6 +3215,18 @@ class DownsizedSmall { | ||
| 3080 | 3215 | * @throws Exception |
| 3081 | 3216 | */ |
| 3082 | 3217 | public static function from(stdClass $obj): DownsizedSmall { |
| 3218 | + if (!property_exists($obj, 'height')) { | |
| 3219 | + throw new Exception("Missing required property"); | |
| 3220 | + } | |
| 3221 | + if (!property_exists($obj, 'mp4')) { | |
| 3222 | + throw new Exception("Missing required property"); | |
| 3223 | + } | |
| 3224 | + if (!property_exists($obj, 'mp4_size')) { | |
| 3225 | + throw new Exception("Missing required property"); | |
| 3226 | + } | |
| 3227 | + if (!property_exists($obj, 'width')) { | |
| 3228 | + throw new Exception("Missing required property"); | |
| 3229 | + } | |
| 3083 | 3230 | return new DownsizedSmall( |
| 3084 | 3231 | DownsizedSmall::fromHeight($obj->{'height'}) |
| 3085 | 3232 | ,DownsizedSmall::fromMp4($obj->{'mp4'}) |
| @@ -3692,6 +3839,24 @@ class FixedHeight { | ||
| 3692 | 3839 | * @throws Exception |
| 3693 | 3840 | */ |
| 3694 | 3841 | public static function from(stdClass $obj): FixedHeight { |
| 3842 | + if (!property_exists($obj, 'height')) { | |
| 3843 | + throw new Exception("Missing required property"); | |
| 3844 | + } | |
| 3845 | + if (!property_exists($obj, 'size')) { | |
| 3846 | + throw new Exception("Missing required property"); | |
| 3847 | + } | |
| 3848 | + if (!property_exists($obj, 'url')) { | |
| 3849 | + throw new Exception("Missing required property"); | |
| 3850 | + } | |
| 3851 | + if (!property_exists($obj, 'webp')) { | |
| 3852 | + throw new Exception("Missing required property"); | |
| 3853 | + } | |
| 3854 | + if (!property_exists($obj, 'webp_size')) { | |
| 3855 | + throw new Exception("Missing required property"); | |
| 3856 | + } | |
| 3857 | + if (!property_exists($obj, 'width')) { | |
| 3858 | + throw new Exception("Missing required property"); | |
| 3859 | + } | |
| 3695 | 3860 | return new FixedHeight( |
| 3696 | 3861 | FixedHeight::fromFrames($obj->{'frames'}) |
| 3697 | 3862 | ,FixedHeight::fromHash($obj->{'hash'}) |
| @@ -3860,6 +4025,12 @@ class Looping { | ||
| 3860 | 4025 | * @throws Exception |
| 3861 | 4026 | */ |
| 3862 | 4027 | public static function from(stdClass $obj): Looping { |
| 4028 | + if (!property_exists($obj, 'mp4')) { | |
| 4029 | + throw new Exception("Missing required property"); | |
| 4030 | + } | |
| 4031 | + if (!property_exists($obj, 'mp4_size')) { | |
| 4032 | + throw new Exception("Missing required property"); | |
| 4033 | + } | |
| 3863 | 4034 | return new Looping( |
| 3864 | 4035 | Looping::fromMp4($obj->{'mp4'}) |
| 3865 | 4036 | ,Looping::fromMp4Size($obj->{'mp4_size'}) |
| @@ -4267,6 +4438,21 @@ class User { | ||
| 4267 | 4438 | * @throws Exception |
| 4268 | 4439 | */ |
| 4269 | 4440 | public static function from(stdClass $obj): User { |
| 4441 | + if (!property_exists($obj, 'avatar_url')) { | |
| 4442 | + throw new Exception("Missing required property"); | |
| 4443 | + } | |
| 4444 | + if (!property_exists($obj, 'banner_url')) { | |
| 4445 | + throw new Exception("Missing required property"); | |
| 4446 | + } | |
| 4447 | + if (!property_exists($obj, 'display_name')) { | |
| 4448 | + throw new Exception("Missing required property"); | |
| 4449 | + } | |
| 4450 | + if (!property_exists($obj, 'profile_url')) { | |
| 4451 | + throw new Exception("Missing required property"); | |
| 4452 | + } | |
| 4453 | + if (!property_exists($obj, 'username')) { | |
| 4454 | + throw new Exception("Missing required property"); | |
| 4455 | + } | |
| 4270 | 4456 | return new User( |
| 4271 | 4457 | User::fromAvatarURL($obj->{'avatar_url'}) |
| 4272 | 4458 | ,User::fromBannerURL($obj->{'banner_url'}) |
| @@ -4526,6 +4712,15 @@ class Meta { | ||
| 4526 | 4712 | * @throws Exception |
| 4527 | 4713 | */ |
| 4528 | 4714 | public static function from(stdClass $obj): Meta { |
| 4715 | + if (!property_exists($obj, 'msg')) { | |
| 4716 | + throw new Exception("Missing required property"); | |
| 4717 | + } | |
| 4718 | + if (!property_exists($obj, 'response_id')) { | |
| 4719 | + throw new Exception("Missing required property"); | |
| 4720 | + } | |
| 4721 | + if (!property_exists($obj, 'status')) { | |
| 4722 | + throw new Exception("Missing required property"); | |
| 4723 | + } | |
| 4529 | 4724 | return new Meta( |
| 4530 | 4725 | Meta::fromMsg($obj->{'msg'}) |
| 4531 | 4726 | ,Meta::fromResponseID($obj->{'response_id'}) |
| @@ -4732,6 +4927,15 @@ class Pagination { | ||
| 4732 | 4927 | * @throws Exception |
| 4733 | 4928 | */ |
| 4734 | 4929 | public static function from(stdClass $obj): Pagination { |
| 4930 | + if (!property_exists($obj, 'count')) { | |
| 4931 | + throw new Exception("Missing required property"); | |
| 4932 | + } | |
| 4933 | + if (!property_exists($obj, 'offset')) { | |
| 4934 | + throw new Exception("Missing required property"); | |
| 4935 | + } | |
| 4936 | + if (!property_exists($obj, 'total_count')) { | |
| 4937 | + throw new Exception("Missing required property"); | |
| 4938 | + } | |
| 4735 | 4939 | return new Pagination( |
| 4736 | 4940 | Pagination::fromCount($obj->{'count'}) |
| 4737 | 4941 | ,Pagination::fromOffset($obj->{'offset'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/c6cfd.json
Mphpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'countries')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromCountries($obj->{'countries'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class Country { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): Country { |
| 252 | + if (!property_exists($obj, 'code')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'name')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new Country( |
| 250 | 259 | Country::fromCode($obj->{'code'}) |
| 251 | 260 | ,Country::fromName($obj->{'name'}) |
Test case
1 generated file · +24 −0test/inputs/json/misc/cb0cc.json
Mphpdefault / TopLevel.php+24 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'prizes')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromPrizes($obj->{'prizes'}) |
| 101 | 104 | ); |
| @@ -373,6 +376,15 @@ class Prize { | ||
| 373 | 376 | * @throws Exception |
| 374 | 377 | */ |
| 375 | 378 | public static function from(stdClass $obj): Prize { |
| 379 | + if (!property_exists($obj, 'category')) { | |
| 380 | + throw new Exception("Missing required property"); | |
| 381 | + } | |
| 382 | + if (!property_exists($obj, 'laureates')) { | |
| 383 | + throw new Exception("Missing required property"); | |
| 384 | + } | |
| 385 | + if (!property_exists($obj, 'year')) { | |
| 386 | + throw new Exception("Missing required property"); | |
| 387 | + } | |
| 376 | 388 | return new Prize( |
| 377 | 389 | Prize::fromCategory($obj->{'category'}) |
| 378 | 390 | ,Prize::fromLaureates($obj->{'laureates'}) |
| @@ -760,6 +772,18 @@ class Laureate { | ||
| 760 | 772 | * @throws Exception |
| 761 | 773 | */ |
| 762 | 774 | public static function from(stdClass $obj): Laureate { |
| 775 | + if (!property_exists($obj, 'firstname')) { | |
| 776 | + throw new Exception("Missing required property"); | |
| 777 | + } | |
| 778 | + if (!property_exists($obj, 'id')) { | |
| 779 | + throw new Exception("Missing required property"); | |
| 780 | + } | |
| 781 | + if (!property_exists($obj, 'share')) { | |
| 782 | + throw new Exception("Missing required property"); | |
| 783 | + } | |
| 784 | + if (!property_exists($obj, 'surname')) { | |
| 785 | + throw new Exception("Missing required property"); | |
| 786 | + } | |
| 763 | 787 | return new Laureate( |
| 764 | 788 | Laureate::fromFirstname($obj->{'firstname'}) |
| 765 | 789 | ,Laureate::fromID($obj->{'id'}) |
Test case
1 generated file · +18 −0test/inputs/json/misc/cb81e.json
Mphpdefault / TopLevel.php+18 −0
| @@ -154,6 +154,12 @@ class TopLevel { | ||
| 154 | 154 | * @throws Exception |
| 155 | 155 | */ |
| 156 | 156 | public static function from(stdClass $obj): TopLevel { |
| 157 | + if (!property_exists($obj, 'data')) { | |
| 158 | + throw new Exception("Missing required property"); | |
| 159 | + } | |
| 160 | + if (!property_exists($obj, 'description')) { | |
| 161 | + throw new Exception("Missing required property"); | |
| 162 | + } | |
| 157 | 163 | return new TopLevel( |
| 158 | 164 | TopLevel::fromData($obj->{'data'}) |
| 159 | 165 | ,TopLevel::fromDescription($obj->{'description'}) |
| @@ -410,6 +416,18 @@ class Description { | ||
| 410 | 416 | * @throws Exception |
| 411 | 417 | */ |
| 412 | 418 | public static function from(stdClass $obj): Description { |
| 419 | + if (!property_exists($obj, 'base_period')) { | |
| 420 | + throw new Exception("Missing required property"); | |
| 421 | + } | |
| 422 | + if (!property_exists($obj, 'missing')) { | |
| 423 | + throw new Exception("Missing required property"); | |
| 424 | + } | |
| 425 | + if (!property_exists($obj, 'title')) { | |
| 426 | + throw new Exception("Missing required property"); | |
| 427 | + } | |
| 428 | + if (!property_exists($obj, 'units')) { | |
| 429 | + throw new Exception("Missing required property"); | |
| 430 | + } | |
| 413 | 431 | return new Description( |
| 414 | 432 | Description::fromBasePeriod($obj->{'base_period'}) |
| 415 | 433 | ,Description::fromMissing($obj->{'missing'}) |
Test case
1 generated file · +75 −0test/inputs/json/misc/ccd18.json
Mphpdefault / TopLevel.php+75 −0
| @@ -450,6 +450,30 @@ class TopLevel { | ||
| 450 | 450 | * @throws Exception |
| 451 | 451 | */ |
| 452 | 452 | public static function from(stdClass $obj): TopLevel { |
| 453 | + if (!property_exists($obj, 'city')) { | |
| 454 | + throw new Exception("Missing required property"); | |
| 455 | + } | |
| 456 | + if (!property_exists($obj, 'delay')) { | |
| 457 | + throw new Exception("Missing required property"); | |
| 458 | + } | |
| 459 | + if (!property_exists($obj, 'IATA')) { | |
| 460 | + throw new Exception("Missing required property"); | |
| 461 | + } | |
| 462 | + if (!property_exists($obj, 'ICAO')) { | |
| 463 | + throw new Exception("Missing required property"); | |
| 464 | + } | |
| 465 | + if (!property_exists($obj, 'name')) { | |
| 466 | + throw new Exception("Missing required property"); | |
| 467 | + } | |
| 468 | + if (!property_exists($obj, 'state')) { | |
| 469 | + throw new Exception("Missing required property"); | |
| 470 | + } | |
| 471 | + if (!property_exists($obj, 'status')) { | |
| 472 | + throw new Exception("Missing required property"); | |
| 473 | + } | |
| 474 | + if (!property_exists($obj, 'weather')) { | |
| 475 | + throw new Exception("Missing required property"); | |
| 476 | + } | |
| 453 | 477 | return new TopLevel( |
| 454 | 478 | TopLevel::fromCity($obj->{'city'}) |
| 455 | 479 | ,TopLevel::fromDelay($obj->{'delay'}) |
| @@ -978,6 +1002,33 @@ class Status { | ||
| 978 | 1002 | * @throws Exception |
| 979 | 1003 | */ |
| 980 | 1004 | public static function from(stdClass $obj): Status { |
| 1005 | + if (!property_exists($obj, 'avgDelay')) { | |
| 1006 | + throw new Exception("Missing required property"); | |
| 1007 | + } | |
| 1008 | + if (!property_exists($obj, 'closureBegin')) { | |
| 1009 | + throw new Exception("Missing required property"); | |
| 1010 | + } | |
| 1011 | + if (!property_exists($obj, 'closureEnd')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'endTime')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 1017 | + if (!property_exists($obj, 'maxDelay')) { | |
| 1018 | + throw new Exception("Missing required property"); | |
| 1019 | + } | |
| 1020 | + if (!property_exists($obj, 'minDelay')) { | |
| 1021 | + throw new Exception("Missing required property"); | |
| 1022 | + } | |
| 1023 | + if (!property_exists($obj, 'reason')) { | |
| 1024 | + throw new Exception("Missing required property"); | |
| 1025 | + } | |
| 1026 | + if (!property_exists($obj, 'trend')) { | |
| 1027 | + throw new Exception("Missing required property"); | |
| 1028 | + } | |
| 1029 | + if (!property_exists($obj, 'type')) { | |
| 1030 | + throw new Exception("Missing required property"); | |
| 1031 | + } | |
| 981 | 1032 | return new Status( |
| 982 | 1033 | Status::fromAvgDelay($obj->{'avgDelay'}) |
| 983 | 1034 | ,Status::fromClosureBegin($obj->{'closureBegin'}) |
| @@ -1301,6 +1352,21 @@ class Weather { | ||
| 1301 | 1352 | * @throws Exception |
| 1302 | 1353 | */ |
| 1303 | 1354 | public static function from(stdClass $obj): Weather { |
| 1355 | + if (!property_exists($obj, 'meta')) { | |
| 1356 | + throw new Exception("Missing required property"); | |
| 1357 | + } | |
| 1358 | + if (!property_exists($obj, 'temp')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1361 | + if (!property_exists($obj, 'visibility')) { | |
| 1362 | + throw new Exception("Missing required property"); | |
| 1363 | + } | |
| 1364 | + if (!property_exists($obj, 'weather')) { | |
| 1365 | + throw new Exception("Missing required property"); | |
| 1366 | + } | |
| 1367 | + if (!property_exists($obj, 'wind')) { | |
| 1368 | + throw new Exception("Missing required property"); | |
| 1369 | + } | |
| 1304 | 1370 | return new Weather( |
| 1305 | 1371 | Weather::fromMeta($obj->{'meta'}) |
| 1306 | 1372 | ,Weather::fromTemp($obj->{'temp'}) |
| @@ -1511,6 +1577,15 @@ class Meta { | ||
| 1511 | 1577 | * @throws Exception |
| 1512 | 1578 | */ |
| 1513 | 1579 | public static function from(stdClass $obj): Meta { |
| 1580 | + if (!property_exists($obj, 'credit')) { | |
| 1581 | + throw new Exception("Missing required property"); | |
| 1582 | + } | |
| 1583 | + if (!property_exists($obj, 'updated')) { | |
| 1584 | + throw new Exception("Missing required property"); | |
| 1585 | + } | |
| 1586 | + if (!property_exists($obj, 'url')) { | |
| 1587 | + throw new Exception("Missing required property"); | |
| 1588 | + } | |
| 1514 | 1589 | return new Meta( |
| 1515 | 1590 | Meta::fromCredit($obj->{'credit'}) |
| 1516 | 1591 | ,Meta::fromUpdated($obj->{'updated'}) |
Test case
1 generated file · +75 −0test/inputs/json/misc/cd238.json
Mphpdefault / TopLevel.php+75 −0
| @@ -450,6 +450,30 @@ class TopLevel { | ||
| 450 | 450 | * @throws Exception |
| 451 | 451 | */ |
| 452 | 452 | public static function from(stdClass $obj): TopLevel { |
| 453 | + if (!property_exists($obj, 'city')) { | |
| 454 | + throw new Exception("Missing required property"); | |
| 455 | + } | |
| 456 | + if (!property_exists($obj, 'delay')) { | |
| 457 | + throw new Exception("Missing required property"); | |
| 458 | + } | |
| 459 | + if (!property_exists($obj, 'IATA')) { | |
| 460 | + throw new Exception("Missing required property"); | |
| 461 | + } | |
| 462 | + if (!property_exists($obj, 'ICAO')) { | |
| 463 | + throw new Exception("Missing required property"); | |
| 464 | + } | |
| 465 | + if (!property_exists($obj, 'name')) { | |
| 466 | + throw new Exception("Missing required property"); | |
| 467 | + } | |
| 468 | + if (!property_exists($obj, 'state')) { | |
| 469 | + throw new Exception("Missing required property"); | |
| 470 | + } | |
| 471 | + if (!property_exists($obj, 'status')) { | |
| 472 | + throw new Exception("Missing required property"); | |
| 473 | + } | |
| 474 | + if (!property_exists($obj, 'weather')) { | |
| 475 | + throw new Exception("Missing required property"); | |
| 476 | + } | |
| 453 | 477 | return new TopLevel( |
| 454 | 478 | TopLevel::fromCity($obj->{'city'}) |
| 455 | 479 | ,TopLevel::fromDelay($obj->{'delay'}) |
| @@ -978,6 +1002,33 @@ class Status { | ||
| 978 | 1002 | * @throws Exception |
| 979 | 1003 | */ |
| 980 | 1004 | public static function from(stdClass $obj): Status { |
| 1005 | + if (!property_exists($obj, 'avgDelay')) { | |
| 1006 | + throw new Exception("Missing required property"); | |
| 1007 | + } | |
| 1008 | + if (!property_exists($obj, 'closureBegin')) { | |
| 1009 | + throw new Exception("Missing required property"); | |
| 1010 | + } | |
| 1011 | + if (!property_exists($obj, 'closureEnd')) { | |
| 1012 | + throw new Exception("Missing required property"); | |
| 1013 | + } | |
| 1014 | + if (!property_exists($obj, 'endTime')) { | |
| 1015 | + throw new Exception("Missing required property"); | |
| 1016 | + } | |
| 1017 | + if (!property_exists($obj, 'maxDelay')) { | |
| 1018 | + throw new Exception("Missing required property"); | |
| 1019 | + } | |
| 1020 | + if (!property_exists($obj, 'minDelay')) { | |
| 1021 | + throw new Exception("Missing required property"); | |
| 1022 | + } | |
| 1023 | + if (!property_exists($obj, 'reason')) { | |
| 1024 | + throw new Exception("Missing required property"); | |
| 1025 | + } | |
| 1026 | + if (!property_exists($obj, 'trend')) { | |
| 1027 | + throw new Exception("Missing required property"); | |
| 1028 | + } | |
| 1029 | + if (!property_exists($obj, 'type')) { | |
| 1030 | + throw new Exception("Missing required property"); | |
| 1031 | + } | |
| 981 | 1032 | return new Status( |
| 982 | 1033 | Status::fromAvgDelay($obj->{'avgDelay'}) |
| 983 | 1034 | ,Status::fromClosureBegin($obj->{'closureBegin'}) |
| @@ -1301,6 +1352,21 @@ class Weather { | ||
| 1301 | 1352 | * @throws Exception |
| 1302 | 1353 | */ |
| 1303 | 1354 | public static function from(stdClass $obj): Weather { |
| 1355 | + if (!property_exists($obj, 'meta')) { | |
| 1356 | + throw new Exception("Missing required property"); | |
| 1357 | + } | |
| 1358 | + if (!property_exists($obj, 'temp')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1361 | + if (!property_exists($obj, 'visibility')) { | |
| 1362 | + throw new Exception("Missing required property"); | |
| 1363 | + } | |
| 1364 | + if (!property_exists($obj, 'weather')) { | |
| 1365 | + throw new Exception("Missing required property"); | |
| 1366 | + } | |
| 1367 | + if (!property_exists($obj, 'wind')) { | |
| 1368 | + throw new Exception("Missing required property"); | |
| 1369 | + } | |
| 1304 | 1370 | return new Weather( |
| 1305 | 1371 | Weather::fromMeta($obj->{'meta'}) |
| 1306 | 1372 | ,Weather::fromTemp($obj->{'temp'}) |
| @@ -1511,6 +1577,15 @@ class Meta { | ||
| 1511 | 1577 | * @throws Exception |
| 1512 | 1578 | */ |
| 1513 | 1579 | public static function from(stdClass $obj): Meta { |
| 1580 | + if (!property_exists($obj, 'credit')) { | |
| 1581 | + throw new Exception("Missing required property"); | |
| 1582 | + } | |
| 1583 | + if (!property_exists($obj, 'updated')) { | |
| 1584 | + throw new Exception("Missing required property"); | |
| 1585 | + } | |
| 1586 | + if (!property_exists($obj, 'url')) { | |
| 1587 | + throw new Exception("Missing required property"); | |
| 1588 | + } | |
| 1514 | 1589 | return new Meta( |
| 1515 | 1590 | Meta::fromCredit($obj->{'credit'}) |
| 1516 | 1591 | ,Meta::fromUpdated($obj->{'updated'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/cd463.json
Mphpdefault / TopLevel.php+9 −0
| @@ -205,6 +205,15 @@ class TopLevel { | ||
| 205 | 205 | * @throws Exception |
| 206 | 206 | */ |
| 207 | 207 | public static function from(stdClass $obj): TopLevel { |
| 208 | + if (!property_exists($obj, 'base')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'date')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 214 | + if (!property_exists($obj, 'rates')) { | |
| 215 | + throw new Exception("Missing required property"); | |
| 216 | + } | |
| 208 | 217 | return new TopLevel( |
| 209 | 218 | TopLevel::fromBase($obj->{'base'}) |
| 210 | 219 | ,TopLevel::fromDate($obj->{'date'}) |
Test case
1 generated file · +180 −0test/inputs/json/misc/cf0d8.json
Mphpdefault / TopLevel.php+180 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'query')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromQuery($obj->{'query'}) |
| 90 | 93 | ); |
| @@ -347,6 +350,18 @@ class Query { | ||
| 347 | 350 | * @throws Exception |
| 348 | 351 | */ |
| 349 | 352 | public static function from(stdClass $obj): Query { |
| 353 | + if (!property_exists($obj, 'count')) { | |
| 354 | + throw new Exception("Missing required property"); | |
| 355 | + } | |
| 356 | + if (!property_exists($obj, 'created')) { | |
| 357 | + throw new Exception("Missing required property"); | |
| 358 | + } | |
| 359 | + if (!property_exists($obj, 'lang')) { | |
| 360 | + throw new Exception("Missing required property"); | |
| 361 | + } | |
| 362 | + if (!property_exists($obj, 'results')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 350 | 365 | return new Query( |
| 351 | 366 | Query::fromCount($obj->{'count'}) |
| 352 | 367 | ,Query::fromCreated($obj->{'created'}) |
| @@ -452,6 +467,9 @@ class Results { | ||
| 452 | 467 | * @throws Exception |
| 453 | 468 | */ |
| 454 | 469 | public static function from(stdClass $obj): Results { |
| 470 | + if (!property_exists($obj, 'channel')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 455 | 473 | return new Results( |
| 456 | 474 | Results::fromChannel($obj->{'channel'}) |
| 457 | 475 | ); |
| @@ -1181,6 +1199,45 @@ class Channel { | ||
| 1181 | 1199 | * @throws Exception |
| 1182 | 1200 | */ |
| 1183 | 1201 | public static function from(stdClass $obj): Channel { |
| 1202 | + if (!property_exists($obj, 'astronomy')) { | |
| 1203 | + throw new Exception("Missing required property"); | |
| 1204 | + } | |
| 1205 | + if (!property_exists($obj, 'atmosphere')) { | |
| 1206 | + throw new Exception("Missing required property"); | |
| 1207 | + } | |
| 1208 | + if (!property_exists($obj, 'description')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'image')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1214 | + if (!property_exists($obj, 'item')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'language')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'lastBuildDate')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'link')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'location')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'title')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'ttl')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'units')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'wind')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1184 | 1241 | return new Channel( |
| 1185 | 1242 | Channel::fromAstronomy($obj->{'astronomy'}) |
| 1186 | 1243 | ,Channel::fromAtmosphere($obj->{'atmosphere'}) |
| @@ -1355,6 +1412,12 @@ class Astronomy { | ||
| 1355 | 1412 | * @throws Exception |
| 1356 | 1413 | */ |
| 1357 | 1414 | public static function from(stdClass $obj): Astronomy { |
| 1415 | + if (!property_exists($obj, 'sunrise')) { | |
| 1416 | + throw new Exception("Missing required property"); | |
| 1417 | + } | |
| 1418 | + if (!property_exists($obj, 'sunset')) { | |
| 1419 | + throw new Exception("Missing required property"); | |
| 1420 | + } | |
| 1358 | 1421 | return new Astronomy( |
| 1359 | 1422 | Astronomy::fromSunrise($obj->{'sunrise'}) |
| 1360 | 1423 | ,Astronomy::fromSunset($obj->{'sunset'}) |
| @@ -1611,6 +1674,18 @@ class Atmosphere { | ||
| 1611 | 1674 | * @throws Exception |
| 1612 | 1675 | */ |
| 1613 | 1676 | public static function from(stdClass $obj): Atmosphere { |
| 1677 | + if (!property_exists($obj, 'humidity')) { | |
| 1678 | + throw new Exception("Missing required property"); | |
| 1679 | + } | |
| 1680 | + if (!property_exists($obj, 'pressure')) { | |
| 1681 | + throw new Exception("Missing required property"); | |
| 1682 | + } | |
| 1683 | + if (!property_exists($obj, 'rising')) { | |
| 1684 | + throw new Exception("Missing required property"); | |
| 1685 | + } | |
| 1686 | + if (!property_exists($obj, 'visibility')) { | |
| 1687 | + throw new Exception("Missing required property"); | |
| 1688 | + } | |
| 1614 | 1689 | return new Atmosphere( |
| 1615 | 1690 | Atmosphere::fromHumidity($obj->{'humidity'}) |
| 1616 | 1691 | ,Atmosphere::fromPressure($obj->{'pressure'}) |
| @@ -1923,6 +1998,21 @@ class Image { | ||
| 1923 | 1998 | * @throws Exception |
| 1924 | 1999 | */ |
| 1925 | 2000 | public static function from(stdClass $obj): Image { |
| 2001 | + if (!property_exists($obj, 'height')) { | |
| 2002 | + throw new Exception("Missing required property"); | |
| 2003 | + } | |
| 2004 | + if (!property_exists($obj, 'link')) { | |
| 2005 | + throw new Exception("Missing required property"); | |
| 2006 | + } | |
| 2007 | + if (!property_exists($obj, 'title')) { | |
| 2008 | + throw new Exception("Missing required property"); | |
| 2009 | + } | |
| 2010 | + if (!property_exists($obj, 'url')) { | |
| 2011 | + throw new Exception("Missing required property"); | |
| 2012 | + } | |
| 2013 | + if (!property_exists($obj, 'width')) { | |
| 2014 | + throw new Exception("Missing required property"); | |
| 2015 | + } | |
| 1926 | 2016 | return new Image( |
| 1927 | 2017 | Image::fromHeight($obj->{'height'}) |
| 1928 | 2018 | ,Image::fromLink($obj->{'link'}) |
| @@ -2459,6 +2549,33 @@ class Item { | ||
| 2459 | 2549 | * @throws Exception |
| 2460 | 2550 | */ |
| 2461 | 2551 | public static function from(stdClass $obj): Item { |
| 2552 | + if (!property_exists($obj, 'condition')) { | |
| 2553 | + throw new Exception("Missing required property"); | |
| 2554 | + } | |
| 2555 | + if (!property_exists($obj, 'description')) { | |
| 2556 | + throw new Exception("Missing required property"); | |
| 2557 | + } | |
| 2558 | + if (!property_exists($obj, 'forecast')) { | |
| 2559 | + throw new Exception("Missing required property"); | |
| 2560 | + } | |
| 2561 | + if (!property_exists($obj, 'guid')) { | |
| 2562 | + throw new Exception("Missing required property"); | |
| 2563 | + } | |
| 2564 | + if (!property_exists($obj, 'lat')) { | |
| 2565 | + throw new Exception("Missing required property"); | |
| 2566 | + } | |
| 2567 | + if (!property_exists($obj, 'link')) { | |
| 2568 | + throw new Exception("Missing required property"); | |
| 2569 | + } | |
| 2570 | + if (!property_exists($obj, 'long')) { | |
| 2571 | + throw new Exception("Missing required property"); | |
| 2572 | + } | |
| 2573 | + if (!property_exists($obj, 'pubDate')) { | |
| 2574 | + throw new Exception("Missing required property"); | |
| 2575 | + } | |
| 2576 | + if (!property_exists($obj, 'title')) { | |
| 2577 | + throw new Exception("Missing required property"); | |
| 2578 | + } | |
| 2462 | 2579 | return new Item( |
| 2463 | 2580 | Item::fromCondition($obj->{'condition'}) |
| 2464 | 2581 | ,Item::fromDescription($obj->{'description'}) |
| @@ -2729,6 +2846,18 @@ class Condition { | ||
| 2729 | 2846 | * @throws Exception |
| 2730 | 2847 | */ |
| 2731 | 2848 | public static function from(stdClass $obj): Condition { |
| 2849 | + if (!property_exists($obj, 'code')) { | |
| 2850 | + throw new Exception("Missing required property"); | |
| 2851 | + } | |
| 2852 | + if (!property_exists($obj, 'date')) { | |
| 2853 | + throw new Exception("Missing required property"); | |
| 2854 | + } | |
| 2855 | + if (!property_exists($obj, 'temp')) { | |
| 2856 | + throw new Exception("Missing required property"); | |
| 2857 | + } | |
| 2858 | + if (!property_exists($obj, 'text')) { | |
| 2859 | + throw new Exception("Missing required property"); | |
| 2860 | + } | |
| 2732 | 2861 | return new Condition( |
| 2733 | 2862 | Condition::fromCode($obj->{'code'}) |
| 2734 | 2863 | ,Condition::fromDate($obj->{'date'}) |
| @@ -3093,6 +3222,24 @@ class Forecast { | ||
| 3093 | 3222 | * @throws Exception |
| 3094 | 3223 | */ |
| 3095 | 3224 | public static function from(stdClass $obj): Forecast { |
| 3225 | + if (!property_exists($obj, 'code')) { | |
| 3226 | + throw new Exception("Missing required property"); | |
| 3227 | + } | |
| 3228 | + if (!property_exists($obj, 'date')) { | |
| 3229 | + throw new Exception("Missing required property"); | |
| 3230 | + } | |
| 3231 | + if (!property_exists($obj, 'day')) { | |
| 3232 | + throw new Exception("Missing required property"); | |
| 3233 | + } | |
| 3234 | + if (!property_exists($obj, 'high')) { | |
| 3235 | + throw new Exception("Missing required property"); | |
| 3236 | + } | |
| 3237 | + if (!property_exists($obj, 'low')) { | |
| 3238 | + throw new Exception("Missing required property"); | |
| 3239 | + } | |
| 3240 | + if (!property_exists($obj, 'text')) { | |
| 3241 | + throw new Exception("Missing required property"); | |
| 3242 | + } | |
| 3096 | 3243 | return new Forecast( |
| 3097 | 3244 | Forecast::fromCode($obj->{'code'}) |
| 3098 | 3245 | ,Forecast::fromDate($obj->{'date'}) |
| @@ -3201,6 +3348,9 @@ class GUID { | ||
| 3201 | 3348 | * @throws Exception |
| 3202 | 3349 | */ |
| 3203 | 3350 | public static function from(stdClass $obj): GUID { |
| 3351 | + if (!property_exists($obj, 'isPermaLink')) { | |
| 3352 | + throw new Exception("Missing required property"); | |
| 3353 | + } | |
| 3204 | 3354 | return new GUID( |
| 3205 | 3355 | GUID::fromIsPermaLink($obj->{'isPermaLink'}) |
| 3206 | 3356 | ); |
| @@ -3403,6 +3553,15 @@ class Location { | ||
| 3403 | 3553 | * @throws Exception |
| 3404 | 3554 | */ |
| 3405 | 3555 | public static function from(stdClass $obj): Location { |
| 3556 | + if (!property_exists($obj, 'city')) { | |
| 3557 | + throw new Exception("Missing required property"); | |
| 3558 | + } | |
| 3559 | + if (!property_exists($obj, 'country')) { | |
| 3560 | + throw new Exception("Missing required property"); | |
| 3561 | + } | |
| 3562 | + if (!property_exists($obj, 'region')) { | |
| 3563 | + throw new Exception("Missing required property"); | |
| 3564 | + } | |
| 3406 | 3565 | return new Location( |
| 3407 | 3566 | Location::fromCity($obj->{'city'}) |
| 3408 | 3567 | ,Location::fromCountry($obj->{'country'}) |
| @@ -3661,6 +3820,18 @@ class Units { | ||
| 3661 | 3820 | * @throws Exception |
| 3662 | 3821 | */ |
| 3663 | 3822 | public static function from(stdClass $obj): Units { |
| 3823 | + if (!property_exists($obj, 'distance')) { | |
| 3824 | + throw new Exception("Missing required property"); | |
| 3825 | + } | |
| 3826 | + if (!property_exists($obj, 'pressure')) { | |
| 3827 | + throw new Exception("Missing required property"); | |
| 3828 | + } | |
| 3829 | + if (!property_exists($obj, 'speed')) { | |
| 3830 | + throw new Exception("Missing required property"); | |
| 3831 | + } | |
| 3832 | + if (!property_exists($obj, 'temperature')) { | |
| 3833 | + throw new Exception("Missing required property"); | |
| 3834 | + } | |
| 3664 | 3835 | return new Units( |
| 3665 | 3836 | Units::fromDistance($obj->{'distance'}) |
| 3666 | 3837 | ,Units::fromPressure($obj->{'pressure'}) |
| @@ -3869,6 +4040,15 @@ class Wind { | ||
| 3869 | 4040 | * @throws Exception |
| 3870 | 4041 | */ |
| 3871 | 4042 | public static function from(stdClass $obj): Wind { |
| 4043 | + if (!property_exists($obj, 'chill')) { | |
| 4044 | + throw new Exception("Missing required property"); | |
| 4045 | + } | |
| 4046 | + if (!property_exists($obj, 'direction')) { | |
| 4047 | + throw new Exception("Missing required property"); | |
| 4048 | + } | |
| 4049 | + if (!property_exists($obj, 'speed')) { | |
| 4050 | + throw new Exception("Missing required property"); | |
| 4051 | + } | |
| 3872 | 4052 | return new Wind( |
| 3873 | 4053 | Wind::fromChill($obj->{'chill'}) |
| 3874 | 4054 | ,Wind::fromDirection($obj->{'direction'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/cfbce.json
Mphpdefault / TopLevel.php+9 −0
| @@ -205,6 +205,15 @@ class TopLevel { | ||
| 205 | 205 | * @throws Exception |
| 206 | 206 | */ |
| 207 | 207 | public static function from(stdClass $obj): TopLevel { |
| 208 | + if (!property_exists($obj, 'base')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'date')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 214 | + if (!property_exists($obj, 'rates')) { | |
| 215 | + throw new Exception("Missing required property"); | |
| 216 | + } | |
| 208 | 217 | return new TopLevel( |
| 209 | 218 | TopLevel::fromBase($obj->{'base'}) |
| 210 | 219 | ,TopLevel::fromDate($obj->{'date'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/d0908.json
Mphpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'total_population')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromTotalPopulation($obj->{'total_population'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class TotalPopulation { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): TotalPopulation { |
| 252 | + if (!property_exists($obj, 'date')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'population')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new TotalPopulation( |
| 250 | 259 | TotalPopulation::fromDate($obj->{'date'}) |
| 251 | 260 | ,TotalPopulation::fromPopulation($obj->{'population'}) |
Test case
1 generated file · +39 −0test/inputs/json/misc/d23d5.json
Mphpdefault / TopLevel.php+39 −0
| @@ -409,6 +409,27 @@ class TopLevel { | ||
| 409 | 409 | * @throws Exception |
| 410 | 410 | */ |
| 411 | 411 | public static function from(stdClass $obj): TopLevel { |
| 412 | + if (!property_exists($obj, 'count')) { | |
| 413 | + throw new Exception("Missing required property"); | |
| 414 | + } | |
| 415 | + if (!property_exists($obj, 'facets')) { | |
| 416 | + throw new Exception("Missing required property"); | |
| 417 | + } | |
| 418 | + if (!property_exists($obj, 'limit')) { | |
| 419 | + throw new Exception("Missing required property"); | |
| 420 | + } | |
| 421 | + if (!property_exists($obj, 'next')) { | |
| 422 | + throw new Exception("Missing required property"); | |
| 423 | + } | |
| 424 | + if (!property_exists($obj, 'offset')) { | |
| 425 | + throw new Exception("Missing required property"); | |
| 426 | + } | |
| 427 | + if (!property_exists($obj, 'previous')) { | |
| 428 | + throw new Exception("Missing required property"); | |
| 429 | + } | |
| 430 | + if (!property_exists($obj, 'results')) { | |
| 431 | + throw new Exception("Missing required property"); | |
| 432 | + } | |
| 412 | 433 | return new TopLevel( |
| 413 | 434 | TopLevel::fromCount($obj->{'count'}) |
| 414 | 435 | ,TopLevel::fromFacets($obj->{'facets'}) |
| @@ -848,6 +869,24 @@ class Result { | ||
| 848 | 869 | * @throws Exception |
| 849 | 870 | */ |
| 850 | 871 | public static function from(stdClass $obj): Result { |
| 872 | + if (!property_exists($obj, 'acronym')) { | |
| 873 | + throw new Exception("Missing required property"); | |
| 874 | + } | |
| 875 | + if (!property_exists($obj, 'created_at')) { | |
| 876 | + throw new Exception("Missing required property"); | |
| 877 | + } | |
| 878 | + if (!property_exists($obj, 'id')) { | |
| 879 | + throw new Exception("Missing required property"); | |
| 880 | + } | |
| 881 | + if (!property_exists($obj, 'name')) { | |
| 882 | + throw new Exception("Missing required property"); | |
| 883 | + } | |
| 884 | + if (!property_exists($obj, 'updated_at')) { | |
| 885 | + throw new Exception("Missing required property"); | |
| 886 | + } | |
| 887 | + if (!property_exists($obj, 'uri')) { | |
| 888 | + throw new Exception("Missing required property"); | |
| 889 | + } | |
| 851 | 890 | return new Result( |
| 852 | 891 | Result::fromAcronym($obj->{'acronym'}) |
| 853 | 892 | ,Result::fromCreatedAt($obj->{'created_at'}) |
Test case
1 generated file · +180 −0test/inputs/json/misc/dbfb3.json
Mphpdefault / TopLevel.php+180 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'query')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromQuery($obj->{'query'}) |
| 90 | 93 | ); |
| @@ -347,6 +350,18 @@ class Query { | ||
| 347 | 350 | * @throws Exception |
| 348 | 351 | */ |
| 349 | 352 | public static function from(stdClass $obj): Query { |
| 353 | + if (!property_exists($obj, 'count')) { | |
| 354 | + throw new Exception("Missing required property"); | |
| 355 | + } | |
| 356 | + if (!property_exists($obj, 'created')) { | |
| 357 | + throw new Exception("Missing required property"); | |
| 358 | + } | |
| 359 | + if (!property_exists($obj, 'lang')) { | |
| 360 | + throw new Exception("Missing required property"); | |
| 361 | + } | |
| 362 | + if (!property_exists($obj, 'results')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 350 | 365 | return new Query( |
| 351 | 366 | Query::fromCount($obj->{'count'}) |
| 352 | 367 | ,Query::fromCreated($obj->{'created'}) |
| @@ -452,6 +467,9 @@ class Results { | ||
| 452 | 467 | * @throws Exception |
| 453 | 468 | */ |
| 454 | 469 | public static function from(stdClass $obj): Results { |
| 470 | + if (!property_exists($obj, 'channel')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 455 | 473 | return new Results( |
| 456 | 474 | Results::fromChannel($obj->{'channel'}) |
| 457 | 475 | ); |
| @@ -1181,6 +1199,45 @@ class Channel { | ||
| 1181 | 1199 | * @throws Exception |
| 1182 | 1200 | */ |
| 1183 | 1201 | public static function from(stdClass $obj): Channel { |
| 1202 | + if (!property_exists($obj, 'astronomy')) { | |
| 1203 | + throw new Exception("Missing required property"); | |
| 1204 | + } | |
| 1205 | + if (!property_exists($obj, 'atmosphere')) { | |
| 1206 | + throw new Exception("Missing required property"); | |
| 1207 | + } | |
| 1208 | + if (!property_exists($obj, 'description')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'image')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1214 | + if (!property_exists($obj, 'item')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'language')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'lastBuildDate')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'link')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'location')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'title')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'ttl')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'units')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'wind')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1184 | 1241 | return new Channel( |
| 1185 | 1242 | Channel::fromAstronomy($obj->{'astronomy'}) |
| 1186 | 1243 | ,Channel::fromAtmosphere($obj->{'atmosphere'}) |
| @@ -1355,6 +1412,12 @@ class Astronomy { | ||
| 1355 | 1412 | * @throws Exception |
| 1356 | 1413 | */ |
| 1357 | 1414 | public static function from(stdClass $obj): Astronomy { |
| 1415 | + if (!property_exists($obj, 'sunrise')) { | |
| 1416 | + throw new Exception("Missing required property"); | |
| 1417 | + } | |
| 1418 | + if (!property_exists($obj, 'sunset')) { | |
| 1419 | + throw new Exception("Missing required property"); | |
| 1420 | + } | |
| 1358 | 1421 | return new Astronomy( |
| 1359 | 1422 | Astronomy::fromSunrise($obj->{'sunrise'}) |
| 1360 | 1423 | ,Astronomy::fromSunset($obj->{'sunset'}) |
| @@ -1611,6 +1674,18 @@ class Atmosphere { | ||
| 1611 | 1674 | * @throws Exception |
| 1612 | 1675 | */ |
| 1613 | 1676 | public static function from(stdClass $obj): Atmosphere { |
| 1677 | + if (!property_exists($obj, 'humidity')) { | |
| 1678 | + throw new Exception("Missing required property"); | |
| 1679 | + } | |
| 1680 | + if (!property_exists($obj, 'pressure')) { | |
| 1681 | + throw new Exception("Missing required property"); | |
| 1682 | + } | |
| 1683 | + if (!property_exists($obj, 'rising')) { | |
| 1684 | + throw new Exception("Missing required property"); | |
| 1685 | + } | |
| 1686 | + if (!property_exists($obj, 'visibility')) { | |
| 1687 | + throw new Exception("Missing required property"); | |
| 1688 | + } | |
| 1614 | 1689 | return new Atmosphere( |
| 1615 | 1690 | Atmosphere::fromHumidity($obj->{'humidity'}) |
| 1616 | 1691 | ,Atmosphere::fromPressure($obj->{'pressure'}) |
| @@ -1923,6 +1998,21 @@ class Image { | ||
| 1923 | 1998 | * @throws Exception |
| 1924 | 1999 | */ |
| 1925 | 2000 | public static function from(stdClass $obj): Image { |
| 2001 | + if (!property_exists($obj, 'height')) { | |
| 2002 | + throw new Exception("Missing required property"); | |
| 2003 | + } | |
| 2004 | + if (!property_exists($obj, 'link')) { | |
| 2005 | + throw new Exception("Missing required property"); | |
| 2006 | + } | |
| 2007 | + if (!property_exists($obj, 'title')) { | |
| 2008 | + throw new Exception("Missing required property"); | |
| 2009 | + } | |
| 2010 | + if (!property_exists($obj, 'url')) { | |
| 2011 | + throw new Exception("Missing required property"); | |
| 2012 | + } | |
| 2013 | + if (!property_exists($obj, 'width')) { | |
| 2014 | + throw new Exception("Missing required property"); | |
| 2015 | + } | |
| 1926 | 2016 | return new Image( |
| 1927 | 2017 | Image::fromHeight($obj->{'height'}) |
| 1928 | 2018 | ,Image::fromLink($obj->{'link'}) |
| @@ -2459,6 +2549,33 @@ class Item { | ||
| 2459 | 2549 | * @throws Exception |
| 2460 | 2550 | */ |
| 2461 | 2551 | public static function from(stdClass $obj): Item { |
| 2552 | + if (!property_exists($obj, 'condition')) { | |
| 2553 | + throw new Exception("Missing required property"); | |
| 2554 | + } | |
| 2555 | + if (!property_exists($obj, 'description')) { | |
| 2556 | + throw new Exception("Missing required property"); | |
| 2557 | + } | |
| 2558 | + if (!property_exists($obj, 'forecast')) { | |
| 2559 | + throw new Exception("Missing required property"); | |
| 2560 | + } | |
| 2561 | + if (!property_exists($obj, 'guid')) { | |
| 2562 | + throw new Exception("Missing required property"); | |
| 2563 | + } | |
| 2564 | + if (!property_exists($obj, 'lat')) { | |
| 2565 | + throw new Exception("Missing required property"); | |
| 2566 | + } | |
| 2567 | + if (!property_exists($obj, 'link')) { | |
| 2568 | + throw new Exception("Missing required property"); | |
| 2569 | + } | |
| 2570 | + if (!property_exists($obj, 'long')) { | |
| 2571 | + throw new Exception("Missing required property"); | |
| 2572 | + } | |
| 2573 | + if (!property_exists($obj, 'pubDate')) { | |
| 2574 | + throw new Exception("Missing required property"); | |
| 2575 | + } | |
| 2576 | + if (!property_exists($obj, 'title')) { | |
| 2577 | + throw new Exception("Missing required property"); | |
| 2578 | + } | |
| 2462 | 2579 | return new Item( |
| 2463 | 2580 | Item::fromCondition($obj->{'condition'}) |
| 2464 | 2581 | ,Item::fromDescription($obj->{'description'}) |
| @@ -2730,6 +2847,18 @@ class Condition { | ||
| 2730 | 2847 | * @throws Exception |
| 2731 | 2848 | */ |
| 2732 | 2849 | public static function from(stdClass $obj): Condition { |
| 2850 | + if (!property_exists($obj, 'code')) { | |
| 2851 | + throw new Exception("Missing required property"); | |
| 2852 | + } | |
| 2853 | + if (!property_exists($obj, 'date')) { | |
| 2854 | + throw new Exception("Missing required property"); | |
| 2855 | + } | |
| 2856 | + if (!property_exists($obj, 'temp')) { | |
| 2857 | + throw new Exception("Missing required property"); | |
| 2858 | + } | |
| 2859 | + if (!property_exists($obj, 'text')) { | |
| 2860 | + throw new Exception("Missing required property"); | |
| 2861 | + } | |
| 2733 | 2862 | return new Condition( |
| 2734 | 2863 | Condition::fromCode($obj->{'code'}) |
| 2735 | 2864 | ,Condition::fromDate($obj->{'date'}) |
| @@ -3144,6 +3273,24 @@ class Forecast { | ||
| 3144 | 3273 | * @throws Exception |
| 3145 | 3274 | */ |
| 3146 | 3275 | public static function from(stdClass $obj): Forecast { |
| 3276 | + if (!property_exists($obj, 'code')) { | |
| 3277 | + throw new Exception("Missing required property"); | |
| 3278 | + } | |
| 3279 | + if (!property_exists($obj, 'date')) { | |
| 3280 | + throw new Exception("Missing required property"); | |
| 3281 | + } | |
| 3282 | + if (!property_exists($obj, 'day')) { | |
| 3283 | + throw new Exception("Missing required property"); | |
| 3284 | + } | |
| 3285 | + if (!property_exists($obj, 'high')) { | |
| 3286 | + throw new Exception("Missing required property"); | |
| 3287 | + } | |
| 3288 | + if (!property_exists($obj, 'low')) { | |
| 3289 | + throw new Exception("Missing required property"); | |
| 3290 | + } | |
| 3291 | + if (!property_exists($obj, 'text')) { | |
| 3292 | + throw new Exception("Missing required property"); | |
| 3293 | + } | |
| 3147 | 3294 | return new Forecast( |
| 3148 | 3295 | Forecast::fromCode($obj->{'code'}) |
| 3149 | 3296 | ,Forecast::fromDate($obj->{'date'}) |
| @@ -3252,6 +3399,9 @@ class GUID { | ||
| 3252 | 3399 | * @throws Exception |
| 3253 | 3400 | */ |
| 3254 | 3401 | public static function from(stdClass $obj): GUID { |
| 3402 | + if (!property_exists($obj, 'isPermaLink')) { | |
| 3403 | + throw new Exception("Missing required property"); | |
| 3404 | + } | |
| 3255 | 3405 | return new GUID( |
| 3256 | 3406 | GUID::fromIsPermaLink($obj->{'isPermaLink'}) |
| 3257 | 3407 | ); |
| @@ -3454,6 +3604,15 @@ class Location { | ||
| 3454 | 3604 | * @throws Exception |
| 3455 | 3605 | */ |
| 3456 | 3606 | public static function from(stdClass $obj): Location { |
| 3607 | + if (!property_exists($obj, 'city')) { | |
| 3608 | + throw new Exception("Missing required property"); | |
| 3609 | + } | |
| 3610 | + if (!property_exists($obj, 'country')) { | |
| 3611 | + throw new Exception("Missing required property"); | |
| 3612 | + } | |
| 3613 | + if (!property_exists($obj, 'region')) { | |
| 3614 | + throw new Exception("Missing required property"); | |
| 3615 | + } | |
| 3457 | 3616 | return new Location( |
| 3458 | 3617 | Location::fromCity($obj->{'city'}) |
| 3459 | 3618 | ,Location::fromCountry($obj->{'country'}) |
| @@ -3712,6 +3871,18 @@ class Units { | ||
| 3712 | 3871 | * @throws Exception |
| 3713 | 3872 | */ |
| 3714 | 3873 | public static function from(stdClass $obj): Units { |
| 3874 | + if (!property_exists($obj, 'distance')) { | |
| 3875 | + throw new Exception("Missing required property"); | |
| 3876 | + } | |
| 3877 | + if (!property_exists($obj, 'pressure')) { | |
| 3878 | + throw new Exception("Missing required property"); | |
| 3879 | + } | |
| 3880 | + if (!property_exists($obj, 'speed')) { | |
| 3881 | + throw new Exception("Missing required property"); | |
| 3882 | + } | |
| 3883 | + if (!property_exists($obj, 'temperature')) { | |
| 3884 | + throw new Exception("Missing required property"); | |
| 3885 | + } | |
| 3715 | 3886 | return new Units( |
| 3716 | 3887 | Units::fromDistance($obj->{'distance'}) |
| 3717 | 3888 | ,Units::fromPressure($obj->{'pressure'}) |
| @@ -3920,6 +4091,15 @@ class Wind { | ||
| 3920 | 4091 | * @throws Exception |
| 3921 | 4092 | */ |
| 3922 | 4093 | public static function from(stdClass $obj): Wind { |
| 4094 | + if (!property_exists($obj, 'chill')) { | |
| 4095 | + throw new Exception("Missing required property"); | |
| 4096 | + } | |
| 4097 | + if (!property_exists($obj, 'direction')) { | |
| 4098 | + throw new Exception("Missing required property"); | |
| 4099 | + } | |
| 4100 | + if (!property_exists($obj, 'speed')) { | |
| 4101 | + throw new Exception("Missing required property"); | |
| 4102 | + } | |
| 3923 | 4103 | return new Wind( |
| 3924 | 4104 | Wind::fromChill($obj->{'chill'}) |
| 3925 | 4105 | ,Wind::fromDirection($obj->{'direction'}) |
Test case
1 generated file · +84 −0test/inputs/json/misc/dc44f.json
Mphpdefault / TopLevel.php+84 −0
| @@ -628,6 +628,39 @@ class TopLevel { | ||
| 628 | 628 | * @throws Exception |
| 629 | 629 | */ |
| 630 | 630 | public static function from(stdClass $obj): TopLevel { |
| 631 | + if (!property_exists($obj, 'booster')) { | |
| 632 | + throw new Exception("Missing required property"); | |
| 633 | + } | |
| 634 | + if (!property_exists($obj, 'border')) { | |
| 635 | + throw new Exception("Missing required property"); | |
| 636 | + } | |
| 637 | + if (!property_exists($obj, 'cards')) { | |
| 638 | + throw new Exception("Missing required property"); | |
| 639 | + } | |
| 640 | + if (!property_exists($obj, 'code')) { | |
| 641 | + throw new Exception("Missing required property"); | |
| 642 | + } | |
| 643 | + if (!property_exists($obj, 'gathererCode')) { | |
| 644 | + throw new Exception("Missing required property"); | |
| 645 | + } | |
| 646 | + if (!property_exists($obj, 'magicCardsInfoCode')) { | |
| 647 | + throw new Exception("Missing required property"); | |
| 648 | + } | |
| 649 | + if (!property_exists($obj, 'mkm_id')) { | |
| 650 | + throw new Exception("Missing required property"); | |
| 651 | + } | |
| 652 | + if (!property_exists($obj, 'mkm_name')) { | |
| 653 | + throw new Exception("Missing required property"); | |
| 654 | + } | |
| 655 | + if (!property_exists($obj, 'name')) { | |
| 656 | + throw new Exception("Missing required property"); | |
| 657 | + } | |
| 658 | + if (!property_exists($obj, 'releaseDate')) { | |
| 659 | + throw new Exception("Missing required property"); | |
| 660 | + } | |
| 661 | + if (!property_exists($obj, 'type')) { | |
| 662 | + throw new Exception("Missing required property"); | |
| 663 | + } | |
| 631 | 664 | return new TopLevel( |
| 632 | 665 | TopLevel::fromBooster($obj->{'booster'}) |
| 633 | 666 | ,TopLevel::fromBorder($obj->{'border'}) |
| @@ -2407,6 +2440,45 @@ class Card { | ||
| 2407 | 2440 | * @throws Exception |
| 2408 | 2441 | */ |
| 2409 | 2442 | public static function from(stdClass $obj): Card { |
| 2443 | + if (!property_exists($obj, 'artist')) { | |
| 2444 | + throw new Exception("Missing required property"); | |
| 2445 | + } | |
| 2446 | + if (!property_exists($obj, 'cmc')) { | |
| 2447 | + throw new Exception("Missing required property"); | |
| 2448 | + } | |
| 2449 | + if (!property_exists($obj, 'id')) { | |
| 2450 | + throw new Exception("Missing required property"); | |
| 2451 | + } | |
| 2452 | + if (!property_exists($obj, 'imageName')) { | |
| 2453 | + throw new Exception("Missing required property"); | |
| 2454 | + } | |
| 2455 | + if (!property_exists($obj, 'layout')) { | |
| 2456 | + throw new Exception("Missing required property"); | |
| 2457 | + } | |
| 2458 | + if (!property_exists($obj, 'legalities')) { | |
| 2459 | + throw new Exception("Missing required property"); | |
| 2460 | + } | |
| 2461 | + if (!property_exists($obj, 'multiverseid')) { | |
| 2462 | + throw new Exception("Missing required property"); | |
| 2463 | + } | |
| 2464 | + if (!property_exists($obj, 'name')) { | |
| 2465 | + throw new Exception("Missing required property"); | |
| 2466 | + } | |
| 2467 | + if (!property_exists($obj, 'originalType')) { | |
| 2468 | + throw new Exception("Missing required property"); | |
| 2469 | + } | |
| 2470 | + if (!property_exists($obj, 'printings')) { | |
| 2471 | + throw new Exception("Missing required property"); | |
| 2472 | + } | |
| 2473 | + if (!property_exists($obj, 'rarity')) { | |
| 2474 | + throw new Exception("Missing required property"); | |
| 2475 | + } | |
| 2476 | + if (!property_exists($obj, 'type')) { | |
| 2477 | + throw new Exception("Missing required property"); | |
| 2478 | + } | |
| 2479 | + if (!property_exists($obj, 'types')) { | |
| 2480 | + throw new Exception("Missing required property"); | |
| 2481 | + } | |
| 2410 | 2482 | return new Card( |
| 2411 | 2483 | Card::fromArtist($obj->{'artist'}) |
| 2412 | 2484 | ,Card::fromCmc($obj->{'cmc'}) |
| @@ -2778,6 +2850,12 @@ class LegalityElement { | ||
| 2778 | 2850 | * @throws Exception |
| 2779 | 2851 | */ |
| 2780 | 2852 | public static function from(stdClass $obj): LegalityElement { |
| 2853 | + if (!property_exists($obj, 'format')) { | |
| 2854 | + throw new Exception("Missing required property"); | |
| 2855 | + } | |
| 2856 | + if (!property_exists($obj, 'legality')) { | |
| 2857 | + throw new Exception("Missing required property"); | |
| 2858 | + } | |
| 2781 | 2859 | return new LegalityElement( |
| 2782 | 2860 | LegalityElement::fromFormat($obj->{'format'}) |
| 2783 | 2861 | ,LegalityElement::fromLegality($obj->{'legality'}) |
| @@ -3201,6 +3279,12 @@ class Ruling { | ||
| 3201 | 3279 | * @throws Exception |
| 3202 | 3280 | */ |
| 3203 | 3281 | public static function from(stdClass $obj): Ruling { |
| 3282 | + if (!property_exists($obj, 'date')) { | |
| 3283 | + throw new Exception("Missing required property"); | |
| 3284 | + } | |
| 3285 | + if (!property_exists($obj, 'text')) { | |
| 3286 | + throw new Exception("Missing required property"); | |
| 3287 | + } | |
| 3204 | 3288 | return new Ruling( |
| 3205 | 3289 | Ruling::fromDate($obj->{'date'}) |
| 3206 | 3290 | ,Ruling::fromText($obj->{'text'}) |
Test case
1 generated file · +84 −0test/inputs/json/misc/dd1ce.json
Mphpdefault / TopLevel.php+84 −0
| @@ -628,6 +628,39 @@ class TopLevel { | ||
| 628 | 628 | * @throws Exception |
| 629 | 629 | */ |
| 630 | 630 | public static function from(stdClass $obj): TopLevel { |
| 631 | + if (!property_exists($obj, 'booster')) { | |
| 632 | + throw new Exception("Missing required property"); | |
| 633 | + } | |
| 634 | + if (!property_exists($obj, 'border')) { | |
| 635 | + throw new Exception("Missing required property"); | |
| 636 | + } | |
| 637 | + if (!property_exists($obj, 'cards')) { | |
| 638 | + throw new Exception("Missing required property"); | |
| 639 | + } | |
| 640 | + if (!property_exists($obj, 'code')) { | |
| 641 | + throw new Exception("Missing required property"); | |
| 642 | + } | |
| 643 | + if (!property_exists($obj, 'gathererCode')) { | |
| 644 | + throw new Exception("Missing required property"); | |
| 645 | + } | |
| 646 | + if (!property_exists($obj, 'magicCardsInfoCode')) { | |
| 647 | + throw new Exception("Missing required property"); | |
| 648 | + } | |
| 649 | + if (!property_exists($obj, 'mkm_id')) { | |
| 650 | + throw new Exception("Missing required property"); | |
| 651 | + } | |
| 652 | + if (!property_exists($obj, 'mkm_name')) { | |
| 653 | + throw new Exception("Missing required property"); | |
| 654 | + } | |
| 655 | + if (!property_exists($obj, 'name')) { | |
| 656 | + throw new Exception("Missing required property"); | |
| 657 | + } | |
| 658 | + if (!property_exists($obj, 'releaseDate')) { | |
| 659 | + throw new Exception("Missing required property"); | |
| 660 | + } | |
| 661 | + if (!property_exists($obj, 'type')) { | |
| 662 | + throw new Exception("Missing required property"); | |
| 663 | + } | |
| 631 | 664 | return new TopLevel( |
| 632 | 665 | TopLevel::fromBooster($obj->{'booster'}) |
| 633 | 666 | ,TopLevel::fromBorder($obj->{'border'}) |
| @@ -2407,6 +2440,45 @@ class Card { | ||
| 2407 | 2440 | * @throws Exception |
| 2408 | 2441 | */ |
| 2409 | 2442 | public static function from(stdClass $obj): Card { |
| 2443 | + if (!property_exists($obj, 'artist')) { | |
| 2444 | + throw new Exception("Missing required property"); | |
| 2445 | + } | |
| 2446 | + if (!property_exists($obj, 'cmc')) { | |
| 2447 | + throw new Exception("Missing required property"); | |
| 2448 | + } | |
| 2449 | + if (!property_exists($obj, 'id')) { | |
| 2450 | + throw new Exception("Missing required property"); | |
| 2451 | + } | |
| 2452 | + if (!property_exists($obj, 'imageName')) { | |
| 2453 | + throw new Exception("Missing required property"); | |
| 2454 | + } | |
| 2455 | + if (!property_exists($obj, 'layout')) { | |
| 2456 | + throw new Exception("Missing required property"); | |
| 2457 | + } | |
| 2458 | + if (!property_exists($obj, 'legalities')) { | |
| 2459 | + throw new Exception("Missing required property"); | |
| 2460 | + } | |
| 2461 | + if (!property_exists($obj, 'multiverseid')) { | |
| 2462 | + throw new Exception("Missing required property"); | |
| 2463 | + } | |
| 2464 | + if (!property_exists($obj, 'name')) { | |
| 2465 | + throw new Exception("Missing required property"); | |
| 2466 | + } | |
| 2467 | + if (!property_exists($obj, 'originalType')) { | |
| 2468 | + throw new Exception("Missing required property"); | |
| 2469 | + } | |
| 2470 | + if (!property_exists($obj, 'printings')) { | |
| 2471 | + throw new Exception("Missing required property"); | |
| 2472 | + } | |
| 2473 | + if (!property_exists($obj, 'rarity')) { | |
| 2474 | + throw new Exception("Missing required property"); | |
| 2475 | + } | |
| 2476 | + if (!property_exists($obj, 'type')) { | |
| 2477 | + throw new Exception("Missing required property"); | |
| 2478 | + } | |
| 2479 | + if (!property_exists($obj, 'types')) { | |
| 2480 | + throw new Exception("Missing required property"); | |
| 2481 | + } | |
| 2410 | 2482 | return new Card( |
| 2411 | 2483 | Card::fromArtist($obj->{'artist'}) |
| 2412 | 2484 | ,Card::fromCmc($obj->{'cmc'}) |
| @@ -2778,6 +2850,12 @@ class LegalityElement { | ||
| 2778 | 2850 | * @throws Exception |
| 2779 | 2851 | */ |
| 2780 | 2852 | public static function from(stdClass $obj): LegalityElement { |
| 2853 | + if (!property_exists($obj, 'format')) { | |
| 2854 | + throw new Exception("Missing required property"); | |
| 2855 | + } | |
| 2856 | + if (!property_exists($obj, 'legality')) { | |
| 2857 | + throw new Exception("Missing required property"); | |
| 2858 | + } | |
| 2781 | 2859 | return new LegalityElement( |
| 2782 | 2860 | LegalityElement::fromFormat($obj->{'format'}) |
| 2783 | 2861 | ,LegalityElement::fromLegality($obj->{'legality'}) |
| @@ -3201,6 +3279,12 @@ class Ruling { | ||
| 3201 | 3279 | * @throws Exception |
| 3202 | 3280 | */ |
| 3203 | 3281 | public static function from(stdClass $obj): Ruling { |
| 3282 | + if (!property_exists($obj, 'date')) { | |
| 3283 | + throw new Exception("Missing required property"); | |
| 3284 | + } | |
| 3285 | + if (!property_exists($obj, 'text')) { | |
| 3286 | + throw new Exception("Missing required property"); | |
| 3287 | + } | |
| 3204 | 3288 | return new Ruling( |
| 3205 | 3289 | Ruling::fromDate($obj->{'date'}) |
| 3206 | 3290 | ,Ruling::fromText($obj->{'text'}) |
Test case
1 generated file · +132 −0test/inputs/json/misc/dec3a.json
Mphpdefault / TopLevel.php+132 −0
| @@ -149,6 +149,12 @@ class TopLevel { | ||
| 149 | 149 | * @throws Exception |
| 150 | 150 | */ |
| 151 | 151 | public static function from(stdClass $obj): TopLevel { |
| 152 | + if (!property_exists($obj, 'metadata')) { | |
| 153 | + throw new Exception("Missing required property"); | |
| 154 | + } | |
| 155 | + if (!property_exists($obj, 'results')) { | |
| 156 | + throw new Exception("Missing required property"); | |
| 157 | + } | |
| 152 | 158 | return new TopLevel( |
| 153 | 159 | TopLevel::fromMetadata($obj->{'metadata'}) |
| 154 | 160 | ,TopLevel::fromResults($obj->{'results'}) |
| @@ -355,6 +361,15 @@ class Metadata { | ||
| 355 | 361 | * @throws Exception |
| 356 | 362 | */ |
| 357 | 363 | public static function from(stdClass $obj): Metadata { |
| 364 | + if (!property_exists($obj, 'executionTime')) { | |
| 365 | + throw new Exception("Missing required property"); | |
| 366 | + } | |
| 367 | + if (!property_exists($obj, 'responseInfo')) { | |
| 368 | + throw new Exception("Missing required property"); | |
| 369 | + } | |
| 370 | + if (!property_exists($obj, 'resultset')) { | |
| 371 | + throw new Exception("Missing required property"); | |
| 372 | + } | |
| 358 | 373 | return new Metadata( |
| 359 | 374 | Metadata::fromExecutionTime($obj->{'executionTime'}) |
| 360 | 375 | ,Metadata::fromResponseInfo($obj->{'responseInfo'}) |
| @@ -509,6 +524,12 @@ class ResponseInfo { | ||
| 509 | 524 | * @throws Exception |
| 510 | 525 | */ |
| 511 | 526 | public static function from(stdClass $obj): ResponseInfo { |
| 527 | + if (!property_exists($obj, 'developerMessage')) { | |
| 528 | + throw new Exception("Missing required property"); | |
| 529 | + } | |
| 530 | + if (!property_exists($obj, 'status')) { | |
| 531 | + throw new Exception("Missing required property"); | |
| 532 | + } | |
| 512 | 533 | return new ResponseInfo( |
| 513 | 534 | ResponseInfo::fromDeveloperMessage($obj->{'developerMessage'}) |
| 514 | 535 | ,ResponseInfo::fromStatus($obj->{'status'}) |
| @@ -713,6 +734,15 @@ class Resultset { | ||
| 713 | 734 | * @throws Exception |
| 714 | 735 | */ |
| 715 | 736 | public static function from(stdClass $obj): Resultset { |
| 737 | + if (!property_exists($obj, 'count')) { | |
| 738 | + throw new Exception("Missing required property"); | |
| 739 | + } | |
| 740 | + if (!property_exists($obj, 'page')) { | |
| 741 | + throw new Exception("Missing required property"); | |
| 742 | + } | |
| 743 | + if (!property_exists($obj, 'pagesize')) { | |
| 744 | + throw new Exception("Missing required property"); | |
| 745 | + } | |
| 716 | 746 | return new Resultset( |
| 717 | 747 | Resultset::fromCount($obj->{'count'}) |
| 718 | 748 | ,Resultset::fromPage($obj->{'page'}) |
| @@ -1927,6 +1957,72 @@ class Result { | ||
| 1927 | 1957 | * @throws Exception |
| 1928 | 1958 | */ |
| 1929 | 1959 | public static function from(stdClass $obj): Result { |
| 1960 | + if (!property_exists($obj, 'about_office')) { | |
| 1961 | + throw new Exception("Missing required property"); | |
| 1962 | + } | |
| 1963 | + if (!property_exists($obj, 'application_process')) { | |
| 1964 | + throw new Exception("Missing required property"); | |
| 1965 | + } | |
| 1966 | + if (!property_exists($obj, 'body')) { | |
| 1967 | + throw new Exception("Missing required property"); | |
| 1968 | + } | |
| 1969 | + if (!property_exists($obj, 'changed')) { | |
| 1970 | + throw new Exception("Missing required property"); | |
| 1971 | + } | |
| 1972 | + if (!property_exists($obj, 'created')) { | |
| 1973 | + throw new Exception("Missing required property"); | |
| 1974 | + } | |
| 1975 | + if (!property_exists($obj, 'deadline')) { | |
| 1976 | + throw new Exception("Missing required property"); | |
| 1977 | + } | |
| 1978 | + if (!property_exists($obj, 'hiring_office')) { | |
| 1979 | + throw new Exception("Missing required property"); | |
| 1980 | + } | |
| 1981 | + if (!property_exists($obj, 'hiring_org')) { | |
| 1982 | + throw new Exception("Missing required property"); | |
| 1983 | + } | |
| 1984 | + if (!property_exists($obj, 'job_id')) { | |
| 1985 | + throw new Exception("Missing required property"); | |
| 1986 | + } | |
| 1987 | + if (!property_exists($obj, 'language')) { | |
| 1988 | + throw new Exception("Missing required property"); | |
| 1989 | + } | |
| 1990 | + if (!property_exists($obj, 'location')) { | |
| 1991 | + throw new Exception("Missing required property"); | |
| 1992 | + } | |
| 1993 | + if (!property_exists($obj, 'num_positions')) { | |
| 1994 | + throw new Exception("Missing required property"); | |
| 1995 | + } | |
| 1996 | + if (!property_exists($obj, 'position')) { | |
| 1997 | + throw new Exception("Missing required property"); | |
| 1998 | + } | |
| 1999 | + if (!property_exists($obj, 'practice_area')) { | |
| 2000 | + throw new Exception("Missing required property"); | |
| 2001 | + } | |
| 2002 | + if (!property_exists($obj, 'qualifications')) { | |
| 2003 | + throw new Exception("Missing required property"); | |
| 2004 | + } | |
| 2005 | + if (!property_exists($obj, 'relocation_expenses')) { | |
| 2006 | + throw new Exception("Missing required property"); | |
| 2007 | + } | |
| 2008 | + if (!property_exists($obj, 'salary')) { | |
| 2009 | + throw new Exception("Missing required property"); | |
| 2010 | + } | |
| 2011 | + if (!property_exists($obj, 'title')) { | |
| 2012 | + throw new Exception("Missing required property"); | |
| 2013 | + } | |
| 2014 | + if (!property_exists($obj, 'travel')) { | |
| 2015 | + throw new Exception("Missing required property"); | |
| 2016 | + } | |
| 2017 | + if (!property_exists($obj, 'url')) { | |
| 2018 | + throw new Exception("Missing required property"); | |
| 2019 | + } | |
| 2020 | + if (!property_exists($obj, 'uuid')) { | |
| 2021 | + throw new Exception("Missing required property"); | |
| 2022 | + } | |
| 2023 | + if (!property_exists($obj, 'vuuid')) { | |
| 2024 | + throw new Exception("Missing required property"); | |
| 2025 | + } | |
| 1930 | 2026 | return new Result( |
| 1931 | 2027 | Result::fromAboutOffice($obj->{'about_office'}) |
| 1932 | 2028 | ,Result::fromApplicationProcess($obj->{'application_process'}) |
| @@ -2122,6 +2218,12 @@ class HiringOrg { | ||
| 2122 | 2218 | * @throws Exception |
| 2123 | 2219 | */ |
| 2124 | 2220 | public static function from(stdClass $obj): HiringOrg { |
| 2221 | + if (!property_exists($obj, 'name')) { | |
| 2222 | + throw new Exception("Missing required property"); | |
| 2223 | + } | |
| 2224 | + if (!property_exists($obj, 'uuid')) { | |
| 2225 | + throw new Exception("Missing required property"); | |
| 2226 | + } | |
| 2125 | 2227 | return new HiringOrg( |
| 2126 | 2228 | HiringOrg::fromName($obj->{'name'}) |
| 2127 | 2229 | ,HiringOrg::fromUUID($obj->{'uuid'}) |
| @@ -2693,6 +2795,36 @@ class Location { | ||
| 2693 | 2795 | * @throws Exception |
| 2694 | 2796 | */ |
| 2695 | 2797 | public static function from(stdClass $obj): Location { |
| 2798 | + if (!property_exists($obj, 'administrative_area')) { | |
| 2799 | + throw new Exception("Missing required property"); | |
| 2800 | + } | |
| 2801 | + if (!property_exists($obj, 'country')) { | |
| 2802 | + throw new Exception("Missing required property"); | |
| 2803 | + } | |
| 2804 | + if (!property_exists($obj, 'fax_number')) { | |
| 2805 | + throw new Exception("Missing required property"); | |
| 2806 | + } | |
| 2807 | + if (!property_exists($obj, 'locality')) { | |
| 2808 | + throw new Exception("Missing required property"); | |
| 2809 | + } | |
| 2810 | + if (!property_exists($obj, 'mobile_number')) { | |
| 2811 | + throw new Exception("Missing required property"); | |
| 2812 | + } | |
| 2813 | + if (!property_exists($obj, 'phone_number')) { | |
| 2814 | + throw new Exception("Missing required property"); | |
| 2815 | + } | |
| 2816 | + if (!property_exists($obj, 'phone_number_extension')) { | |
| 2817 | + throw new Exception("Missing required property"); | |
| 2818 | + } | |
| 2819 | + if (!property_exists($obj, 'postal_code')) { | |
| 2820 | + throw new Exception("Missing required property"); | |
| 2821 | + } | |
| 2822 | + if (!property_exists($obj, 'sub_premise')) { | |
| 2823 | + throw new Exception("Missing required property"); | |
| 2824 | + } | |
| 2825 | + if (!property_exists($obj, 'thoroughfare')) { | |
| 2826 | + throw new Exception("Missing required property"); | |
| 2827 | + } | |
| 2696 | 2828 | return new Location( |
| 2697 | 2829 | Location::fromAdministrativeArea($obj->{'administrative_area'}) |
| 2698 | 2830 | ,Location::fromCountry($obj->{'country'}) |
Test case
1 generated file · +180 −0test/inputs/json/misc/df957.json
Mphpdefault / TopLevel.php+180 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'query')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromQuery($obj->{'query'}) |
| 90 | 93 | ); |
| @@ -347,6 +350,18 @@ class Query { | ||
| 347 | 350 | * @throws Exception |
| 348 | 351 | */ |
| 349 | 352 | public static function from(stdClass $obj): Query { |
| 353 | + if (!property_exists($obj, 'count')) { | |
| 354 | + throw new Exception("Missing required property"); | |
| 355 | + } | |
| 356 | + if (!property_exists($obj, 'created')) { | |
| 357 | + throw new Exception("Missing required property"); | |
| 358 | + } | |
| 359 | + if (!property_exists($obj, 'lang')) { | |
| 360 | + throw new Exception("Missing required property"); | |
| 361 | + } | |
| 362 | + if (!property_exists($obj, 'results')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 350 | 365 | return new Query( |
| 351 | 366 | Query::fromCount($obj->{'count'}) |
| 352 | 367 | ,Query::fromCreated($obj->{'created'}) |
| @@ -452,6 +467,9 @@ class Results { | ||
| 452 | 467 | * @throws Exception |
| 453 | 468 | */ |
| 454 | 469 | public static function from(stdClass $obj): Results { |
| 470 | + if (!property_exists($obj, 'channel')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 455 | 473 | return new Results( |
| 456 | 474 | Results::fromChannel($obj->{'channel'}) |
| 457 | 475 | ); |
| @@ -1181,6 +1199,45 @@ class Channel { | ||
| 1181 | 1199 | * @throws Exception |
| 1182 | 1200 | */ |
| 1183 | 1201 | public static function from(stdClass $obj): Channel { |
| 1202 | + if (!property_exists($obj, 'astronomy')) { | |
| 1203 | + throw new Exception("Missing required property"); | |
| 1204 | + } | |
| 1205 | + if (!property_exists($obj, 'atmosphere')) { | |
| 1206 | + throw new Exception("Missing required property"); | |
| 1207 | + } | |
| 1208 | + if (!property_exists($obj, 'description')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'image')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1214 | + if (!property_exists($obj, 'item')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'language')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'lastBuildDate')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'link')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'location')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'title')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'ttl')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'units')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'wind')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1184 | 1241 | return new Channel( |
| 1185 | 1242 | Channel::fromAstronomy($obj->{'astronomy'}) |
| 1186 | 1243 | ,Channel::fromAtmosphere($obj->{'atmosphere'}) |
| @@ -1355,6 +1412,12 @@ class Astronomy { | ||
| 1355 | 1412 | * @throws Exception |
| 1356 | 1413 | */ |
| 1357 | 1414 | public static function from(stdClass $obj): Astronomy { |
| 1415 | + if (!property_exists($obj, 'sunrise')) { | |
| 1416 | + throw new Exception("Missing required property"); | |
| 1417 | + } | |
| 1418 | + if (!property_exists($obj, 'sunset')) { | |
| 1419 | + throw new Exception("Missing required property"); | |
| 1420 | + } | |
| 1358 | 1421 | return new Astronomy( |
| 1359 | 1422 | Astronomy::fromSunrise($obj->{'sunrise'}) |
| 1360 | 1423 | ,Astronomy::fromSunset($obj->{'sunset'}) |
| @@ -1611,6 +1674,18 @@ class Atmosphere { | ||
| 1611 | 1674 | * @throws Exception |
| 1612 | 1675 | */ |
| 1613 | 1676 | public static function from(stdClass $obj): Atmosphere { |
| 1677 | + if (!property_exists($obj, 'humidity')) { | |
| 1678 | + throw new Exception("Missing required property"); | |
| 1679 | + } | |
| 1680 | + if (!property_exists($obj, 'pressure')) { | |
| 1681 | + throw new Exception("Missing required property"); | |
| 1682 | + } | |
| 1683 | + if (!property_exists($obj, 'rising')) { | |
| 1684 | + throw new Exception("Missing required property"); | |
| 1685 | + } | |
| 1686 | + if (!property_exists($obj, 'visibility')) { | |
| 1687 | + throw new Exception("Missing required property"); | |
| 1688 | + } | |
| 1614 | 1689 | return new Atmosphere( |
| 1615 | 1690 | Atmosphere::fromHumidity($obj->{'humidity'}) |
| 1616 | 1691 | ,Atmosphere::fromPressure($obj->{'pressure'}) |
| @@ -1923,6 +1998,21 @@ class Image { | ||
| 1923 | 1998 | * @throws Exception |
| 1924 | 1999 | */ |
| 1925 | 2000 | public static function from(stdClass $obj): Image { |
| 2001 | + if (!property_exists($obj, 'height')) { | |
| 2002 | + throw new Exception("Missing required property"); | |
| 2003 | + } | |
| 2004 | + if (!property_exists($obj, 'link')) { | |
| 2005 | + throw new Exception("Missing required property"); | |
| 2006 | + } | |
| 2007 | + if (!property_exists($obj, 'title')) { | |
| 2008 | + throw new Exception("Missing required property"); | |
| 2009 | + } | |
| 2010 | + if (!property_exists($obj, 'url')) { | |
| 2011 | + throw new Exception("Missing required property"); | |
| 2012 | + } | |
| 2013 | + if (!property_exists($obj, 'width')) { | |
| 2014 | + throw new Exception("Missing required property"); | |
| 2015 | + } | |
| 1926 | 2016 | return new Image( |
| 1927 | 2017 | Image::fromHeight($obj->{'height'}) |
| 1928 | 2018 | ,Image::fromLink($obj->{'link'}) |
| @@ -2459,6 +2549,33 @@ class Item { | ||
| 2459 | 2549 | * @throws Exception |
| 2460 | 2550 | */ |
| 2461 | 2551 | public static function from(stdClass $obj): Item { |
| 2552 | + if (!property_exists($obj, 'condition')) { | |
| 2553 | + throw new Exception("Missing required property"); | |
| 2554 | + } | |
| 2555 | + if (!property_exists($obj, 'description')) { | |
| 2556 | + throw new Exception("Missing required property"); | |
| 2557 | + } | |
| 2558 | + if (!property_exists($obj, 'forecast')) { | |
| 2559 | + throw new Exception("Missing required property"); | |
| 2560 | + } | |
| 2561 | + if (!property_exists($obj, 'guid')) { | |
| 2562 | + throw new Exception("Missing required property"); | |
| 2563 | + } | |
| 2564 | + if (!property_exists($obj, 'lat')) { | |
| 2565 | + throw new Exception("Missing required property"); | |
| 2566 | + } | |
| 2567 | + if (!property_exists($obj, 'link')) { | |
| 2568 | + throw new Exception("Missing required property"); | |
| 2569 | + } | |
| 2570 | + if (!property_exists($obj, 'long')) { | |
| 2571 | + throw new Exception("Missing required property"); | |
| 2572 | + } | |
| 2573 | + if (!property_exists($obj, 'pubDate')) { | |
| 2574 | + throw new Exception("Missing required property"); | |
| 2575 | + } | |
| 2576 | + if (!property_exists($obj, 'title')) { | |
| 2577 | + throw new Exception("Missing required property"); | |
| 2578 | + } | |
| 2462 | 2579 | return new Item( |
| 2463 | 2580 | Item::fromCondition($obj->{'condition'}) |
| 2464 | 2581 | ,Item::fromDescription($obj->{'description'}) |
| @@ -2729,6 +2846,18 @@ class Condition { | ||
| 2729 | 2846 | * @throws Exception |
| 2730 | 2847 | */ |
| 2731 | 2848 | public static function from(stdClass $obj): Condition { |
| 2849 | + if (!property_exists($obj, 'code')) { | |
| 2850 | + throw new Exception("Missing required property"); | |
| 2851 | + } | |
| 2852 | + if (!property_exists($obj, 'date')) { | |
| 2853 | + throw new Exception("Missing required property"); | |
| 2854 | + } | |
| 2855 | + if (!property_exists($obj, 'temp')) { | |
| 2856 | + throw new Exception("Missing required property"); | |
| 2857 | + } | |
| 2858 | + if (!property_exists($obj, 'text')) { | |
| 2859 | + throw new Exception("Missing required property"); | |
| 2860 | + } | |
| 2732 | 2861 | return new Condition( |
| 2733 | 2862 | Condition::fromCode($obj->{'code'}) |
| 2734 | 2863 | ,Condition::fromDate($obj->{'date'}) |
| @@ -3093,6 +3222,24 @@ class Forecast { | ||
| 3093 | 3222 | * @throws Exception |
| 3094 | 3223 | */ |
| 3095 | 3224 | public static function from(stdClass $obj): Forecast { |
| 3225 | + if (!property_exists($obj, 'code')) { | |
| 3226 | + throw new Exception("Missing required property"); | |
| 3227 | + } | |
| 3228 | + if (!property_exists($obj, 'date')) { | |
| 3229 | + throw new Exception("Missing required property"); | |
| 3230 | + } | |
| 3231 | + if (!property_exists($obj, 'day')) { | |
| 3232 | + throw new Exception("Missing required property"); | |
| 3233 | + } | |
| 3234 | + if (!property_exists($obj, 'high')) { | |
| 3235 | + throw new Exception("Missing required property"); | |
| 3236 | + } | |
| 3237 | + if (!property_exists($obj, 'low')) { | |
| 3238 | + throw new Exception("Missing required property"); | |
| 3239 | + } | |
| 3240 | + if (!property_exists($obj, 'text')) { | |
| 3241 | + throw new Exception("Missing required property"); | |
| 3242 | + } | |
| 3096 | 3243 | return new Forecast( |
| 3097 | 3244 | Forecast::fromCode($obj->{'code'}) |
| 3098 | 3245 | ,Forecast::fromDate($obj->{'date'}) |
| @@ -3201,6 +3348,9 @@ class GUID { | ||
| 3201 | 3348 | * @throws Exception |
| 3202 | 3349 | */ |
| 3203 | 3350 | public static function from(stdClass $obj): GUID { |
| 3351 | + if (!property_exists($obj, 'isPermaLink')) { | |
| 3352 | + throw new Exception("Missing required property"); | |
| 3353 | + } | |
| 3204 | 3354 | return new GUID( |
| 3205 | 3355 | GUID::fromIsPermaLink($obj->{'isPermaLink'}) |
| 3206 | 3356 | ); |
| @@ -3403,6 +3553,15 @@ class Location { | ||
| 3403 | 3553 | * @throws Exception |
| 3404 | 3554 | */ |
| 3405 | 3555 | public static function from(stdClass $obj): Location { |
| 3556 | + if (!property_exists($obj, 'city')) { | |
| 3557 | + throw new Exception("Missing required property"); | |
| 3558 | + } | |
| 3559 | + if (!property_exists($obj, 'country')) { | |
| 3560 | + throw new Exception("Missing required property"); | |
| 3561 | + } | |
| 3562 | + if (!property_exists($obj, 'region')) { | |
| 3563 | + throw new Exception("Missing required property"); | |
| 3564 | + } | |
| 3406 | 3565 | return new Location( |
| 3407 | 3566 | Location::fromCity($obj->{'city'}) |
| 3408 | 3567 | ,Location::fromCountry($obj->{'country'}) |
| @@ -3661,6 +3820,18 @@ class Units { | ||
| 3661 | 3820 | * @throws Exception |
| 3662 | 3821 | */ |
| 3663 | 3822 | public static function from(stdClass $obj): Units { |
| 3823 | + if (!property_exists($obj, 'distance')) { | |
| 3824 | + throw new Exception("Missing required property"); | |
| 3825 | + } | |
| 3826 | + if (!property_exists($obj, 'pressure')) { | |
| 3827 | + throw new Exception("Missing required property"); | |
| 3828 | + } | |
| 3829 | + if (!property_exists($obj, 'speed')) { | |
| 3830 | + throw new Exception("Missing required property"); | |
| 3831 | + } | |
| 3832 | + if (!property_exists($obj, 'temperature')) { | |
| 3833 | + throw new Exception("Missing required property"); | |
| 3834 | + } | |
| 3664 | 3835 | return new Units( |
| 3665 | 3836 | Units::fromDistance($obj->{'distance'}) |
| 3666 | 3837 | ,Units::fromPressure($obj->{'pressure'}) |
| @@ -3869,6 +4040,15 @@ class Wind { | ||
| 3869 | 4040 | * @throws Exception |
| 3870 | 4041 | */ |
| 3871 | 4042 | public static function from(stdClass $obj): Wind { |
| 4043 | + if (!property_exists($obj, 'chill')) { | |
| 4044 | + throw new Exception("Missing required property"); | |
| 4045 | + } | |
| 4046 | + if (!property_exists($obj, 'direction')) { | |
| 4047 | + throw new Exception("Missing required property"); | |
| 4048 | + } | |
| 4049 | + if (!property_exists($obj, 'speed')) { | |
| 4050 | + throw new Exception("Missing required property"); | |
| 4051 | + } | |
| 3872 | 4052 | return new Wind( |
| 3873 | 4053 | Wind::fromChill($obj->{'chill'}) |
| 3874 | 4054 | ,Wind::fromDirection($obj->{'direction'}) |
Test case
1 generated file · +207 −0test/inputs/json/misc/e0ac7.json
Mphpdefault / TopLevel.php+207 −0
| @@ -202,6 +202,15 @@ class TopLevel { | ||
| 202 | 202 | * @throws Exception |
| 203 | 203 | */ |
| 204 | 204 | public static function from(stdClass $obj): TopLevel { |
| 205 | + if (!property_exists($obj, 'data')) { | |
| 206 | + throw new Exception("Missing required property"); | |
| 207 | + } | |
| 208 | + if (!property_exists($obj, 'meta')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'pagination')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 205 | 214 | return new TopLevel( |
| 206 | 215 | TopLevel::fromData($obj->{'data'}) |
| 207 | 216 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -1202,6 +1211,57 @@ class Datum { | ||
| 1202 | 1211 | * @throws Exception |
| 1203 | 1212 | */ |
| 1204 | 1213 | public static function from(stdClass $obj): Datum { |
| 1214 | + if (!property_exists($obj, 'bitly_gif_url')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'bitly_url')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'content_url')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'embed_url')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'id')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'images')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'import_datetime')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'is_indexable')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'rating')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1241 | + if (!property_exists($obj, 'slug')) { | |
| 1242 | + throw new Exception("Missing required property"); | |
| 1243 | + } | |
| 1244 | + if (!property_exists($obj, 'source')) { | |
| 1245 | + throw new Exception("Missing required property"); | |
| 1246 | + } | |
| 1247 | + if (!property_exists($obj, 'source_post_url')) { | |
| 1248 | + throw new Exception("Missing required property"); | |
| 1249 | + } | |
| 1250 | + if (!property_exists($obj, 'source_tld')) { | |
| 1251 | + throw new Exception("Missing required property"); | |
| 1252 | + } | |
| 1253 | + if (!property_exists($obj, 'trending_datetime')) { | |
| 1254 | + throw new Exception("Missing required property"); | |
| 1255 | + } | |
| 1256 | + if (!property_exists($obj, 'type')) { | |
| 1257 | + throw new Exception("Missing required property"); | |
| 1258 | + } | |
| 1259 | + if (!property_exists($obj, 'url')) { | |
| 1260 | + throw new Exception("Missing required property"); | |
| 1261 | + } | |
| 1262 | + if (!property_exists($obj, 'username')) { | |
| 1263 | + throw new Exception("Missing required property"); | |
| 1264 | + } | |
| 1205 | 1265 | return new Datum( |
| 1206 | 1266 | Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'}) |
| 1207 | 1267 | ,Datum::fromBitlyURL($obj->{'bitly_url'}) |
| @@ -2511,6 +2571,72 @@ class Images { | ||
| 2511 | 2571 | * @throws Exception |
| 2512 | 2572 | */ |
| 2513 | 2573 | public static function from(stdClass $obj): Images { |
| 2574 | + if (!property_exists($obj, 'downsized')) { | |
| 2575 | + throw new Exception("Missing required property"); | |
| 2576 | + } | |
| 2577 | + if (!property_exists($obj, 'downsized_large')) { | |
| 2578 | + throw new Exception("Missing required property"); | |
| 2579 | + } | |
| 2580 | + if (!property_exists($obj, 'downsized_medium')) { | |
| 2581 | + throw new Exception("Missing required property"); | |
| 2582 | + } | |
| 2583 | + if (!property_exists($obj, 'downsized_small')) { | |
| 2584 | + throw new Exception("Missing required property"); | |
| 2585 | + } | |
| 2586 | + if (!property_exists($obj, 'downsized_still')) { | |
| 2587 | + throw new Exception("Missing required property"); | |
| 2588 | + } | |
| 2589 | + if (!property_exists($obj, 'fixed_height')) { | |
| 2590 | + throw new Exception("Missing required property"); | |
| 2591 | + } | |
| 2592 | + if (!property_exists($obj, 'fixed_height_downsampled')) { | |
| 2593 | + throw new Exception("Missing required property"); | |
| 2594 | + } | |
| 2595 | + if (!property_exists($obj, 'fixed_height_small')) { | |
| 2596 | + throw new Exception("Missing required property"); | |
| 2597 | + } | |
| 2598 | + if (!property_exists($obj, 'fixed_height_small_still')) { | |
| 2599 | + throw new Exception("Missing required property"); | |
| 2600 | + } | |
| 2601 | + if (!property_exists($obj, 'fixed_height_still')) { | |
| 2602 | + throw new Exception("Missing required property"); | |
| 2603 | + } | |
| 2604 | + if (!property_exists($obj, 'fixed_width')) { | |
| 2605 | + throw new Exception("Missing required property"); | |
| 2606 | + } | |
| 2607 | + if (!property_exists($obj, 'fixed_width_downsampled')) { | |
| 2608 | + throw new Exception("Missing required property"); | |
| 2609 | + } | |
| 2610 | + if (!property_exists($obj, 'fixed_width_small')) { | |
| 2611 | + throw new Exception("Missing required property"); | |
| 2612 | + } | |
| 2613 | + if (!property_exists($obj, 'fixed_width_small_still')) { | |
| 2614 | + throw new Exception("Missing required property"); | |
| 2615 | + } | |
| 2616 | + if (!property_exists($obj, 'fixed_width_still')) { | |
| 2617 | + throw new Exception("Missing required property"); | |
| 2618 | + } | |
| 2619 | + if (!property_exists($obj, 'looping')) { | |
| 2620 | + throw new Exception("Missing required property"); | |
| 2621 | + } | |
| 2622 | + if (!property_exists($obj, 'original')) { | |
| 2623 | + throw new Exception("Missing required property"); | |
| 2624 | + } | |
| 2625 | + if (!property_exists($obj, 'original_mp4')) { | |
| 2626 | + throw new Exception("Missing required property"); | |
| 2627 | + } | |
| 2628 | + if (!property_exists($obj, 'original_still')) { | |
| 2629 | + throw new Exception("Missing required property"); | |
| 2630 | + } | |
| 2631 | + if (!property_exists($obj, 'preview')) { | |
| 2632 | + throw new Exception("Missing required property"); | |
| 2633 | + } | |
| 2634 | + if (!property_exists($obj, 'preview_gif')) { | |
| 2635 | + throw new Exception("Missing required property"); | |
| 2636 | + } | |
| 2637 | + if (!property_exists($obj, 'preview_webp')) { | |
| 2638 | + throw new Exception("Missing required property"); | |
| 2639 | + } | |
| 2514 | 2640 | return new Images( |
| 2515 | 2641 | Images::fromDownsized($obj->{'downsized'}) |
| 2516 | 2642 | ,Images::fromDownsizedLarge($obj->{'downsized_large'}) |
| @@ -2819,6 +2945,15 @@ class Downsized { | ||
| 2819 | 2945 | * @throws Exception |
| 2820 | 2946 | */ |
| 2821 | 2947 | public static function from(stdClass $obj): Downsized { |
| 2948 | + if (!property_exists($obj, 'height')) { | |
| 2949 | + throw new Exception("Missing required property"); | |
| 2950 | + } | |
| 2951 | + if (!property_exists($obj, 'url')) { | |
| 2952 | + throw new Exception("Missing required property"); | |
| 2953 | + } | |
| 2954 | + if (!property_exists($obj, 'width')) { | |
| 2955 | + throw new Exception("Missing required property"); | |
| 2956 | + } | |
| 2822 | 2957 | return new Downsized( |
| 2823 | 2958 | Downsized::fromHeight($obj->{'height'}) |
| 2824 | 2959 | ,Downsized::fromSize($obj->{'size'}) |
| @@ -3079,6 +3214,18 @@ class DownsizedSmall { | ||
| 3079 | 3214 | * @throws Exception |
| 3080 | 3215 | */ |
| 3081 | 3216 | public static function from(stdClass $obj): DownsizedSmall { |
| 3217 | + if (!property_exists($obj, 'height')) { | |
| 3218 | + throw new Exception("Missing required property"); | |
| 3219 | + } | |
| 3220 | + if (!property_exists($obj, 'mp4')) { | |
| 3221 | + throw new Exception("Missing required property"); | |
| 3222 | + } | |
| 3223 | + if (!property_exists($obj, 'mp4_size')) { | |
| 3224 | + throw new Exception("Missing required property"); | |
| 3225 | + } | |
| 3226 | + if (!property_exists($obj, 'width')) { | |
| 3227 | + throw new Exception("Missing required property"); | |
| 3228 | + } | |
| 3082 | 3229 | return new DownsizedSmall( |
| 3083 | 3230 | DownsizedSmall::fromHeight($obj->{'height'}) |
| 3084 | 3231 | ,DownsizedSmall::fromMp4($obj->{'mp4'}) |
| @@ -3691,6 +3838,24 @@ class FixedHeight { | ||
| 3691 | 3838 | * @throws Exception |
| 3692 | 3839 | */ |
| 3693 | 3840 | public static function from(stdClass $obj): FixedHeight { |
| 3841 | + if (!property_exists($obj, 'height')) { | |
| 3842 | + throw new Exception("Missing required property"); | |
| 3843 | + } | |
| 3844 | + if (!property_exists($obj, 'size')) { | |
| 3845 | + throw new Exception("Missing required property"); | |
| 3846 | + } | |
| 3847 | + if (!property_exists($obj, 'url')) { | |
| 3848 | + throw new Exception("Missing required property"); | |
| 3849 | + } | |
| 3850 | + if (!property_exists($obj, 'webp')) { | |
| 3851 | + throw new Exception("Missing required property"); | |
| 3852 | + } | |
| 3853 | + if (!property_exists($obj, 'webp_size')) { | |
| 3854 | + throw new Exception("Missing required property"); | |
| 3855 | + } | |
| 3856 | + if (!property_exists($obj, 'width')) { | |
| 3857 | + throw new Exception("Missing required property"); | |
| 3858 | + } | |
| 3694 | 3859 | return new FixedHeight( |
| 3695 | 3860 | FixedHeight::fromFrames($obj->{'frames'}) |
| 3696 | 3861 | ,FixedHeight::fromHash($obj->{'hash'}) |
| @@ -3859,6 +4024,12 @@ class Looping { | ||
| 3859 | 4024 | * @throws Exception |
| 3860 | 4025 | */ |
| 3861 | 4026 | public static function from(stdClass $obj): Looping { |
| 4027 | + if (!property_exists($obj, 'mp4')) { | |
| 4028 | + throw new Exception("Missing required property"); | |
| 4029 | + } | |
| 4030 | + if (!property_exists($obj, 'mp4_size')) { | |
| 4031 | + throw new Exception("Missing required property"); | |
| 4032 | + } | |
| 3862 | 4033 | return new Looping( |
| 3863 | 4034 | Looping::fromMp4($obj->{'mp4'}) |
| 3864 | 4035 | ,Looping::fromMp4Size($obj->{'mp4_size'}) |
| @@ -4317,6 +4488,24 @@ class User { | ||
| 4317 | 4488 | * @throws Exception |
| 4318 | 4489 | */ |
| 4319 | 4490 | public static function from(stdClass $obj): User { |
| 4491 | + if (!property_exists($obj, 'avatar_url')) { | |
| 4492 | + throw new Exception("Missing required property"); | |
| 4493 | + } | |
| 4494 | + if (!property_exists($obj, 'banner_url')) { | |
| 4495 | + throw new Exception("Missing required property"); | |
| 4496 | + } | |
| 4497 | + if (!property_exists($obj, 'display_name')) { | |
| 4498 | + throw new Exception("Missing required property"); | |
| 4499 | + } | |
| 4500 | + if (!property_exists($obj, 'profile_url')) { | |
| 4501 | + throw new Exception("Missing required property"); | |
| 4502 | + } | |
| 4503 | + if (!property_exists($obj, 'twitter')) { | |
| 4504 | + throw new Exception("Missing required property"); | |
| 4505 | + } | |
| 4506 | + if (!property_exists($obj, 'username')) { | |
| 4507 | + throw new Exception("Missing required property"); | |
| 4508 | + } | |
| 4320 | 4509 | return new User( |
| 4321 | 4510 | User::fromAvatarURL($obj->{'avatar_url'}) |
| 4322 | 4511 | ,User::fromBannerURL($obj->{'banner_url'}) |
| @@ -4529,6 +4718,15 @@ class Meta { | ||
| 4529 | 4718 | * @throws Exception |
| 4530 | 4719 | */ |
| 4531 | 4720 | public static function from(stdClass $obj): Meta { |
| 4721 | + if (!property_exists($obj, 'msg')) { | |
| 4722 | + throw new Exception("Missing required property"); | |
| 4723 | + } | |
| 4724 | + if (!property_exists($obj, 'response_id')) { | |
| 4725 | + throw new Exception("Missing required property"); | |
| 4726 | + } | |
| 4727 | + if (!property_exists($obj, 'status')) { | |
| 4728 | + throw new Exception("Missing required property"); | |
| 4729 | + } | |
| 4532 | 4730 | return new Meta( |
| 4533 | 4731 | Meta::fromMsg($obj->{'msg'}) |
| 4534 | 4732 | ,Meta::fromResponseID($obj->{'response_id'}) |
| @@ -4735,6 +4933,15 @@ class Pagination { | ||
| 4735 | 4933 | * @throws Exception |
| 4736 | 4934 | */ |
| 4737 | 4935 | public static function from(stdClass $obj): Pagination { |
| 4936 | + if (!property_exists($obj, 'count')) { | |
| 4937 | + throw new Exception("Missing required property"); | |
| 4938 | + } | |
| 4939 | + if (!property_exists($obj, 'offset')) { | |
| 4940 | + throw new Exception("Missing required property"); | |
| 4941 | + } | |
| 4942 | + if (!property_exists($obj, 'total_count')) { | |
| 4943 | + throw new Exception("Missing required property"); | |
| 4944 | + } | |
| 4738 | 4945 | return new Pagination( |
| 4739 | 4946 | Pagination::fromCount($obj->{'count'}) |
| 4740 | 4947 | ,Pagination::fromOffset($obj->{'offset'}) |
Test case
1 generated file · +180 −0test/inputs/json/misc/e2915.json
Mphpdefault / TopLevel.php+180 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'query')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromQuery($obj->{'query'}) |
| 90 | 93 | ); |
| @@ -347,6 +350,18 @@ class Query { | ||
| 347 | 350 | * @throws Exception |
| 348 | 351 | */ |
| 349 | 352 | public static function from(stdClass $obj): Query { |
| 353 | + if (!property_exists($obj, 'count')) { | |
| 354 | + throw new Exception("Missing required property"); | |
| 355 | + } | |
| 356 | + if (!property_exists($obj, 'created')) { | |
| 357 | + throw new Exception("Missing required property"); | |
| 358 | + } | |
| 359 | + if (!property_exists($obj, 'lang')) { | |
| 360 | + throw new Exception("Missing required property"); | |
| 361 | + } | |
| 362 | + if (!property_exists($obj, 'results')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 350 | 365 | return new Query( |
| 351 | 366 | Query::fromCount($obj->{'count'}) |
| 352 | 367 | ,Query::fromCreated($obj->{'created'}) |
| @@ -452,6 +467,9 @@ class Results { | ||
| 452 | 467 | * @throws Exception |
| 453 | 468 | */ |
| 454 | 469 | public static function from(stdClass $obj): Results { |
| 470 | + if (!property_exists($obj, 'channel')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 455 | 473 | return new Results( |
| 456 | 474 | Results::fromChannel($obj->{'channel'}) |
| 457 | 475 | ); |
| @@ -1181,6 +1199,45 @@ class Channel { | ||
| 1181 | 1199 | * @throws Exception |
| 1182 | 1200 | */ |
| 1183 | 1201 | public static function from(stdClass $obj): Channel { |
| 1202 | + if (!property_exists($obj, 'astronomy')) { | |
| 1203 | + throw new Exception("Missing required property"); | |
| 1204 | + } | |
| 1205 | + if (!property_exists($obj, 'atmosphere')) { | |
| 1206 | + throw new Exception("Missing required property"); | |
| 1207 | + } | |
| 1208 | + if (!property_exists($obj, 'description')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'image')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1214 | + if (!property_exists($obj, 'item')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'language')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'lastBuildDate')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'link')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'location')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'title')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'ttl')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'units')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'wind')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1184 | 1241 | return new Channel( |
| 1185 | 1242 | Channel::fromAstronomy($obj->{'astronomy'}) |
| 1186 | 1243 | ,Channel::fromAtmosphere($obj->{'atmosphere'}) |
| @@ -1355,6 +1412,12 @@ class Astronomy { | ||
| 1355 | 1412 | * @throws Exception |
| 1356 | 1413 | */ |
| 1357 | 1414 | public static function from(stdClass $obj): Astronomy { |
| 1415 | + if (!property_exists($obj, 'sunrise')) { | |
| 1416 | + throw new Exception("Missing required property"); | |
| 1417 | + } | |
| 1418 | + if (!property_exists($obj, 'sunset')) { | |
| 1419 | + throw new Exception("Missing required property"); | |
| 1420 | + } | |
| 1358 | 1421 | return new Astronomy( |
| 1359 | 1422 | Astronomy::fromSunrise($obj->{'sunrise'}) |
| 1360 | 1423 | ,Astronomy::fromSunset($obj->{'sunset'}) |
| @@ -1611,6 +1674,18 @@ class Atmosphere { | ||
| 1611 | 1674 | * @throws Exception |
| 1612 | 1675 | */ |
| 1613 | 1676 | public static function from(stdClass $obj): Atmosphere { |
| 1677 | + if (!property_exists($obj, 'humidity')) { | |
| 1678 | + throw new Exception("Missing required property"); | |
| 1679 | + } | |
| 1680 | + if (!property_exists($obj, 'pressure')) { | |
| 1681 | + throw new Exception("Missing required property"); | |
| 1682 | + } | |
| 1683 | + if (!property_exists($obj, 'rising')) { | |
| 1684 | + throw new Exception("Missing required property"); | |
| 1685 | + } | |
| 1686 | + if (!property_exists($obj, 'visibility')) { | |
| 1687 | + throw new Exception("Missing required property"); | |
| 1688 | + } | |
| 1614 | 1689 | return new Atmosphere( |
| 1615 | 1690 | Atmosphere::fromHumidity($obj->{'humidity'}) |
| 1616 | 1691 | ,Atmosphere::fromPressure($obj->{'pressure'}) |
| @@ -1923,6 +1998,21 @@ class Image { | ||
| 1923 | 1998 | * @throws Exception |
| 1924 | 1999 | */ |
| 1925 | 2000 | public static function from(stdClass $obj): Image { |
| 2001 | + if (!property_exists($obj, 'height')) { | |
| 2002 | + throw new Exception("Missing required property"); | |
| 2003 | + } | |
| 2004 | + if (!property_exists($obj, 'link')) { | |
| 2005 | + throw new Exception("Missing required property"); | |
| 2006 | + } | |
| 2007 | + if (!property_exists($obj, 'title')) { | |
| 2008 | + throw new Exception("Missing required property"); | |
| 2009 | + } | |
| 2010 | + if (!property_exists($obj, 'url')) { | |
| 2011 | + throw new Exception("Missing required property"); | |
| 2012 | + } | |
| 2013 | + if (!property_exists($obj, 'width')) { | |
| 2014 | + throw new Exception("Missing required property"); | |
| 2015 | + } | |
| 1926 | 2016 | return new Image( |
| 1927 | 2017 | Image::fromHeight($obj->{'height'}) |
| 1928 | 2018 | ,Image::fromLink($obj->{'link'}) |
| @@ -2459,6 +2549,33 @@ class Item { | ||
| 2459 | 2549 | * @throws Exception |
| 2460 | 2550 | */ |
| 2461 | 2551 | public static function from(stdClass $obj): Item { |
| 2552 | + if (!property_exists($obj, 'condition')) { | |
| 2553 | + throw new Exception("Missing required property"); | |
| 2554 | + } | |
| 2555 | + if (!property_exists($obj, 'description')) { | |
| 2556 | + throw new Exception("Missing required property"); | |
| 2557 | + } | |
| 2558 | + if (!property_exists($obj, 'forecast')) { | |
| 2559 | + throw new Exception("Missing required property"); | |
| 2560 | + } | |
| 2561 | + if (!property_exists($obj, 'guid')) { | |
| 2562 | + throw new Exception("Missing required property"); | |
| 2563 | + } | |
| 2564 | + if (!property_exists($obj, 'lat')) { | |
| 2565 | + throw new Exception("Missing required property"); | |
| 2566 | + } | |
| 2567 | + if (!property_exists($obj, 'link')) { | |
| 2568 | + throw new Exception("Missing required property"); | |
| 2569 | + } | |
| 2570 | + if (!property_exists($obj, 'long')) { | |
| 2571 | + throw new Exception("Missing required property"); | |
| 2572 | + } | |
| 2573 | + if (!property_exists($obj, 'pubDate')) { | |
| 2574 | + throw new Exception("Missing required property"); | |
| 2575 | + } | |
| 2576 | + if (!property_exists($obj, 'title')) { | |
| 2577 | + throw new Exception("Missing required property"); | |
| 2578 | + } | |
| 2462 | 2579 | return new Item( |
| 2463 | 2580 | Item::fromCondition($obj->{'condition'}) |
| 2464 | 2581 | ,Item::fromDescription($obj->{'description'}) |
| @@ -2729,6 +2846,18 @@ class Condition { | ||
| 2729 | 2846 | * @throws Exception |
| 2730 | 2847 | */ |
| 2731 | 2848 | public static function from(stdClass $obj): Condition { |
| 2849 | + if (!property_exists($obj, 'code')) { | |
| 2850 | + throw new Exception("Missing required property"); | |
| 2851 | + } | |
| 2852 | + if (!property_exists($obj, 'date')) { | |
| 2853 | + throw new Exception("Missing required property"); | |
| 2854 | + } | |
| 2855 | + if (!property_exists($obj, 'temp')) { | |
| 2856 | + throw new Exception("Missing required property"); | |
| 2857 | + } | |
| 2858 | + if (!property_exists($obj, 'text')) { | |
| 2859 | + throw new Exception("Missing required property"); | |
| 2860 | + } | |
| 2732 | 2861 | return new Condition( |
| 2733 | 2862 | Condition::fromCode($obj->{'code'}) |
| 2734 | 2863 | ,Condition::fromDate($obj->{'date'}) |
| @@ -3094,6 +3223,24 @@ class Forecast { | ||
| 3094 | 3223 | * @throws Exception |
| 3095 | 3224 | */ |
| 3096 | 3225 | public static function from(stdClass $obj): Forecast { |
| 3226 | + if (!property_exists($obj, 'code')) { | |
| 3227 | + throw new Exception("Missing required property"); | |
| 3228 | + } | |
| 3229 | + if (!property_exists($obj, 'date')) { | |
| 3230 | + throw new Exception("Missing required property"); | |
| 3231 | + } | |
| 3232 | + if (!property_exists($obj, 'day')) { | |
| 3233 | + throw new Exception("Missing required property"); | |
| 3234 | + } | |
| 3235 | + if (!property_exists($obj, 'high')) { | |
| 3236 | + throw new Exception("Missing required property"); | |
| 3237 | + } | |
| 3238 | + if (!property_exists($obj, 'low')) { | |
| 3239 | + throw new Exception("Missing required property"); | |
| 3240 | + } | |
| 3241 | + if (!property_exists($obj, 'text')) { | |
| 3242 | + throw new Exception("Missing required property"); | |
| 3243 | + } | |
| 3097 | 3244 | return new Forecast( |
| 3098 | 3245 | Forecast::fromCode($obj->{'code'}) |
| 3099 | 3246 | ,Forecast::fromDate($obj->{'date'}) |
| @@ -3247,6 +3394,9 @@ class GUID { | ||
| 3247 | 3394 | * @throws Exception |
| 3248 | 3395 | */ |
| 3249 | 3396 | public static function from(stdClass $obj): GUID { |
| 3397 | + if (!property_exists($obj, 'isPermaLink')) { | |
| 3398 | + throw new Exception("Missing required property"); | |
| 3399 | + } | |
| 3250 | 3400 | return new GUID( |
| 3251 | 3401 | GUID::fromIsPermaLink($obj->{'isPermaLink'}) |
| 3252 | 3402 | ); |
| @@ -3449,6 +3599,15 @@ class Location { | ||
| 3449 | 3599 | * @throws Exception |
| 3450 | 3600 | */ |
| 3451 | 3601 | public static function from(stdClass $obj): Location { |
| 3602 | + if (!property_exists($obj, 'city')) { | |
| 3603 | + throw new Exception("Missing required property"); | |
| 3604 | + } | |
| 3605 | + if (!property_exists($obj, 'country')) { | |
| 3606 | + throw new Exception("Missing required property"); | |
| 3607 | + } | |
| 3608 | + if (!property_exists($obj, 'region')) { | |
| 3609 | + throw new Exception("Missing required property"); | |
| 3610 | + } | |
| 3452 | 3611 | return new Location( |
| 3453 | 3612 | Location::fromCity($obj->{'city'}) |
| 3454 | 3613 | ,Location::fromCountry($obj->{'country'}) |
| @@ -3707,6 +3866,18 @@ class Units { | ||
| 3707 | 3866 | * @throws Exception |
| 3708 | 3867 | */ |
| 3709 | 3868 | public static function from(stdClass $obj): Units { |
| 3869 | + if (!property_exists($obj, 'distance')) { | |
| 3870 | + throw new Exception("Missing required property"); | |
| 3871 | + } | |
| 3872 | + if (!property_exists($obj, 'pressure')) { | |
| 3873 | + throw new Exception("Missing required property"); | |
| 3874 | + } | |
| 3875 | + if (!property_exists($obj, 'speed')) { | |
| 3876 | + throw new Exception("Missing required property"); | |
| 3877 | + } | |
| 3878 | + if (!property_exists($obj, 'temperature')) { | |
| 3879 | + throw new Exception("Missing required property"); | |
| 3880 | + } | |
| 3710 | 3881 | return new Units( |
| 3711 | 3882 | Units::fromDistance($obj->{'distance'}) |
| 3712 | 3883 | ,Units::fromPressure($obj->{'pressure'}) |
| @@ -3915,6 +4086,15 @@ class Wind { | ||
| 3915 | 4086 | * @throws Exception |
| 3916 | 4087 | */ |
| 3917 | 4088 | public static function from(stdClass $obj): Wind { |
| 4089 | + if (!property_exists($obj, 'chill')) { | |
| 4090 | + throw new Exception("Missing required property"); | |
| 4091 | + } | |
| 4092 | + if (!property_exists($obj, 'direction')) { | |
| 4093 | + throw new Exception("Missing required property"); | |
| 4094 | + } | |
| 4095 | + if (!property_exists($obj, 'speed')) { | |
| 4096 | + throw new Exception("Missing required property"); | |
| 4097 | + } | |
| 3918 | 4098 | return new Wind( |
| 3919 | 4099 | Wind::fromChill($obj->{'chill'}) |
| 3920 | 4100 | ,Wind::fromDirection($obj->{'direction'}) |
Test case
1 generated file · +6 −0test/inputs/json/misc/e2a58.json
Mphpdefault / TopLevel.php+6 −0
| @@ -150,6 +150,12 @@ class TopLevel { | ||
| 150 | 150 | * @throws Exception |
| 151 | 151 | */ |
| 152 | 152 | public static function from(stdClass $obj): TopLevel { |
| 153 | + if (!property_exists($obj, 'date')) { | |
| 154 | + throw new Exception("Missing required property"); | |
| 155 | + } | |
| 156 | + if (!property_exists($obj, 'stop-and-search')) { | |
| 157 | + throw new Exception("Missing required property"); | |
| 158 | + } | |
| 153 | 159 | return new TopLevel( |
| 154 | 160 | TopLevel::fromDate($obj->{'date'}) |
| 155 | 161 | ,TopLevel::fromStopAndSearch($obj->{'stop-and-search'}) |
Test case
1 generated file · +102 −0test/inputs/json/misc/e324e.json
Mphpdefault / TopLevel.php+102 −0
| @@ -479,6 +479,30 @@ class TopLevel { | ||
| 479 | 479 | * @throws Exception |
| 480 | 480 | */ |
| 481 | 481 | public static function from(stdClass $obj): TopLevel { |
| 482 | + if (!property_exists($obj, 'basePath')) { | |
| 483 | + throw new Exception("Missing required property"); | |
| 484 | + } | |
| 485 | + if (!property_exists($obj, 'definitions')) { | |
| 486 | + throw new Exception("Missing required property"); | |
| 487 | + } | |
| 488 | + if (!property_exists($obj, 'host')) { | |
| 489 | + throw new Exception("Missing required property"); | |
| 490 | + } | |
| 491 | + if (!property_exists($obj, 'info')) { | |
| 492 | + throw new Exception("Missing required property"); | |
| 493 | + } | |
| 494 | + if (!property_exists($obj, 'paths')) { | |
| 495 | + throw new Exception("Missing required property"); | |
| 496 | + } | |
| 497 | + if (!property_exists($obj, 'produces')) { | |
| 498 | + throw new Exception("Missing required property"); | |
| 499 | + } | |
| 500 | + if (!property_exists($obj, 'schemes')) { | |
| 501 | + throw new Exception("Missing required property"); | |
| 502 | + } | |
| 503 | + if (!property_exists($obj, 'swagger')) { | |
| 504 | + throw new Exception("Missing required property"); | |
| 505 | + } | |
| 482 | 506 | return new TopLevel( |
| 483 | 507 | TopLevel::fromBasePath($obj->{'basePath'}) |
| 484 | 508 | ,TopLevel::fromDefinitions($obj->{'definitions'}) |
| @@ -592,6 +616,9 @@ class Definitions { | ||
| 592 | 616 | * @throws Exception |
| 593 | 617 | */ |
| 594 | 618 | public static function from(stdClass $obj): Definitions { |
| 619 | + if (!property_exists($obj, 'Rate')) { | |
| 620 | + throw new Exception("Missing required property"); | |
| 621 | + } | |
| 595 | 622 | return new Definitions( |
| 596 | 623 | Definitions::fromRate($obj->{'Rate'}) |
| 597 | 624 | ); |
| @@ -705,6 +732,9 @@ class Rate { | ||
| 705 | 732 | * @throws Exception |
| 706 | 733 | */ |
| 707 | 734 | public static function from(stdClass $obj): Rate { |
| 735 | + if (!property_exists($obj, 'properties')) { | |
| 736 | + throw new Exception("Missing required property"); | |
| 737 | + } | |
| 708 | 738 | return new Rate( |
| 709 | 739 | Rate::fromProperties($obj->{'properties'}) |
| 710 | 740 | ); |
| @@ -856,6 +886,12 @@ class Property { | ||
| 856 | 886 | * @throws Exception |
| 857 | 887 | */ |
| 858 | 888 | public static function from(stdClass $obj): Property { |
| 889 | + if (!property_exists($obj, 'description')) { | |
| 890 | + throw new Exception("Missing required property"); | |
| 891 | + } | |
| 892 | + if (!property_exists($obj, 'type')) { | |
| 893 | + throw new Exception("Missing required property"); | |
| 894 | + } | |
| 859 | 895 | return new Property( |
| 860 | 896 | Property::fromDescription($obj->{'description'}) |
| 861 | 897 | ,Property::fromType($obj->{'type'}) |
| @@ -1105,6 +1141,15 @@ class Info { | ||
| 1105 | 1141 | * @throws Exception |
| 1106 | 1142 | */ |
| 1107 | 1143 | public static function from(stdClass $obj): Info { |
| 1144 | + if (!property_exists($obj, 'description')) { | |
| 1145 | + throw new Exception("Missing required property"); | |
| 1146 | + } | |
| 1147 | + if (!property_exists($obj, 'title')) { | |
| 1148 | + throw new Exception("Missing required property"); | |
| 1149 | + } | |
| 1150 | + if (!property_exists($obj, 'version')) { | |
| 1151 | + throw new Exception("Missing required property"); | |
| 1152 | + } | |
| 1108 | 1153 | return new Info( |
| 1109 | 1154 | Info::fromDescription($obj->{'description'}) |
| 1110 | 1155 | ,Info::fromTitle($obj->{'title'}) |
| @@ -1208,6 +1253,9 @@ class Paths { | ||
| 1208 | 1253 | * @throws Exception |
| 1209 | 1254 | */ |
| 1210 | 1255 | public static function from(stdClass $obj): Paths { |
| 1256 | + if (!property_exists($obj, '/tariff_rates/search')) { | |
| 1257 | + throw new Exception("Missing required property"); | |
| 1258 | + } | |
| 1211 | 1259 | return new Paths( |
| 1212 | 1260 | Paths::fromTariffRatesSearch($obj->{'/tariff_rates/search'}) |
| 1213 | 1261 | ); |
| @@ -1307,6 +1355,9 @@ class TariffRatesSearch { | ||
| 1307 | 1355 | * @throws Exception |
| 1308 | 1356 | */ |
| 1309 | 1357 | public static function from(stdClass $obj): TariffRatesSearch { |
| 1358 | + if (!property_exists($obj, 'get')) { | |
| 1359 | + throw new Exception("Missing required property"); | |
| 1360 | + } | |
| 1310 | 1361 | return new TariffRatesSearch( |
| 1311 | 1362 | TariffRatesSearch::fromGet($obj->{'get'}) |
| 1312 | 1363 | ); |
| @@ -1640,6 +1691,21 @@ class Get { | ||
| 1640 | 1691 | * @throws Exception |
| 1641 | 1692 | */ |
| 1642 | 1693 | public static function from(stdClass $obj): Get { |
| 1694 | + if (!property_exists($obj, 'description')) { | |
| 1695 | + throw new Exception("Missing required property"); | |
| 1696 | + } | |
| 1697 | + if (!property_exists($obj, 'parameters')) { | |
| 1698 | + throw new Exception("Missing required property"); | |
| 1699 | + } | |
| 1700 | + if (!property_exists($obj, 'responses')) { | |
| 1701 | + throw new Exception("Missing required property"); | |
| 1702 | + } | |
| 1703 | + if (!property_exists($obj, 'summary')) { | |
| 1704 | + throw new Exception("Missing required property"); | |
| 1705 | + } | |
| 1706 | + if (!property_exists($obj, 'tags')) { | |
| 1707 | + throw new Exception("Missing required property"); | |
| 1708 | + } | |
| 1643 | 1709 | return new Get( |
| 1644 | 1710 | Get::fromDescription($obj->{'description'}) |
| 1645 | 1711 | ,Get::fromParameters($obj->{'parameters'}) |
| @@ -2008,6 +2074,24 @@ class Parameter { | ||
| 2008 | 2074 | * @throws Exception |
| 2009 | 2075 | */ |
| 2010 | 2076 | public static function from(stdClass $obj): Parameter { |
| 2077 | + if (!property_exists($obj, 'description')) { | |
| 2078 | + throw new Exception("Missing required property"); | |
| 2079 | + } | |
| 2080 | + if (!property_exists($obj, 'format')) { | |
| 2081 | + throw new Exception("Missing required property"); | |
| 2082 | + } | |
| 2083 | + if (!property_exists($obj, 'in')) { | |
| 2084 | + throw new Exception("Missing required property"); | |
| 2085 | + } | |
| 2086 | + if (!property_exists($obj, 'name')) { | |
| 2087 | + throw new Exception("Missing required property"); | |
| 2088 | + } | |
| 2089 | + if (!property_exists($obj, 'required')) { | |
| 2090 | + throw new Exception("Missing required property"); | |
| 2091 | + } | |
| 2092 | + if (!property_exists($obj, 'type')) { | |
| 2093 | + throw new Exception("Missing required property"); | |
| 2094 | + } | |
| 2011 | 2095 | return new Parameter( |
| 2012 | 2096 | Parameter::fromDescription($obj->{'description'}) |
| 2013 | 2097 | ,Parameter::fromFormat($obj->{'format'}) |
| @@ -2117,6 +2201,9 @@ class Responses { | ||
| 2117 | 2201 | * @throws Exception |
| 2118 | 2202 | */ |
| 2119 | 2203 | public static function from(stdClass $obj): Responses { |
| 2204 | + if (!property_exists($obj, '200')) { | |
| 2205 | + throw new Exception("Missing required property"); | |
| 2206 | + } | |
| 2120 | 2207 | return new Responses( |
| 2121 | 2208 | Responses::fromThe200($obj->{'200'}) |
| 2122 | 2209 | ); |
| @@ -2268,6 +2355,12 @@ class The200 { | ||
| 2268 | 2355 | * @throws Exception |
| 2269 | 2356 | */ |
| 2270 | 2357 | public static function from(stdClass $obj): The200 { |
| 2358 | + if (!property_exists($obj, 'description')) { | |
| 2359 | + throw new Exception("Missing required property"); | |
| 2360 | + } | |
| 2361 | + if (!property_exists($obj, 'schema')) { | |
| 2362 | + throw new Exception("Missing required property"); | |
| 2363 | + } | |
| 2271 | 2364 | return new The200( |
| 2272 | 2365 | The200::fromDescription($obj->{'description'}) |
| 2273 | 2366 | ,The200::fromSchema($obj->{'schema'}) |
| @@ -2421,6 +2514,12 @@ class Schema { | ||
| 2421 | 2514 | * @throws Exception |
| 2422 | 2515 | */ |
| 2423 | 2516 | public static function from(stdClass $obj): Schema { |
| 2517 | + if (!property_exists($obj, 'items')) { | |
| 2518 | + throw new Exception("Missing required property"); | |
| 2519 | + } | |
| 2520 | + if (!property_exists($obj, 'type')) { | |
| 2521 | + throw new Exception("Missing required property"); | |
| 2522 | + } | |
| 2424 | 2523 | return new Schema( |
| 2425 | 2524 | Schema::fromItems($obj->{'items'}) |
| 2426 | 2525 | ,Schema::fromType($obj->{'type'}) |
| @@ -2521,6 +2620,9 @@ class Items { | ||
| 2521 | 2620 | * @throws Exception |
| 2522 | 2621 | */ |
| 2523 | 2622 | public static function from(stdClass $obj): Items { |
| 2623 | + if (!property_exists($obj, '$ref')) { | |
| 2624 | + throw new Exception("Missing required property"); | |
| 2625 | + } | |
| 2524 | 2626 | return new Items( |
| 2525 | 2627 | Items::fromRef($obj->{'$ref'}) |
| 2526 | 2628 | ); |
Test case
1 generated file · +24 −0test/inputs/json/misc/e64a0.json
Mphpdefault / TopLevel.php+24 −0
| @@ -242,6 +242,18 @@ class TopLevel { | ||
| 242 | 242 | * @throws Exception |
| 243 | 243 | */ |
| 244 | 244 | public static function from(stdClass $obj): TopLevel { |
| 245 | + if (!property_exists($obj, 'args')) { | |
| 246 | + throw new Exception("Missing required property"); | |
| 247 | + } | |
| 248 | + if (!property_exists($obj, 'headers')) { | |
| 249 | + throw new Exception("Missing required property"); | |
| 250 | + } | |
| 251 | + if (!property_exists($obj, 'origin')) { | |
| 252 | + throw new Exception("Missing required property"); | |
| 253 | + } | |
| 254 | + if (!property_exists($obj, 'url')) { | |
| 255 | + throw new Exception("Missing required property"); | |
| 256 | + } | |
| 245 | 257 | return new TopLevel( |
| 246 | 258 | TopLevel::fromArgs($obj->{'args'}) |
| 247 | 259 | ,TopLevel::fromHeaders($obj->{'headers'}) |
| @@ -547,6 +559,18 @@ class Headers { | ||
| 547 | 559 | * @throws Exception |
| 548 | 560 | */ |
| 549 | 561 | public static function from(stdClass $obj): Headers { |
| 562 | + if (!property_exists($obj, 'Accept-Encoding')) { | |
| 563 | + throw new Exception("Missing required property"); | |
| 564 | + } | |
| 565 | + if (!property_exists($obj, 'Connection')) { | |
| 566 | + throw new Exception("Missing required property"); | |
| 567 | + } | |
| 568 | + if (!property_exists($obj, 'Host')) { | |
| 569 | + throw new Exception("Missing required property"); | |
| 570 | + } | |
| 571 | + if (!property_exists($obj, 'User-Agent')) { | |
| 572 | + throw new Exception("Missing required property"); | |
| 573 | + } | |
| 550 | 574 | return new Headers( |
| 551 | 575 | Headers::fromAcceptEncoding($obj->{'Accept-Encoding'}) |
| 552 | 576 | ,Headers::fromConnection($obj->{'Connection'}) |
Test case
1 generated file · +18 −0test/inputs/json/misc/e8a0b.json
Mphpdefault / TopLevel.php+18 −0
| @@ -345,6 +345,24 @@ class TopLevel { | ||
| 345 | 345 | * @throws Exception |
| 346 | 346 | */ |
| 347 | 347 | public static function from(stdClass $obj): TopLevel { |
| 348 | + if (!property_exists($obj, 'age')) { | |
| 349 | + throw new Exception("Missing required property"); | |
| 350 | + } | |
| 351 | + if (!property_exists($obj, 'country')) { | |
| 352 | + throw new Exception("Missing required property"); | |
| 353 | + } | |
| 354 | + if (!property_exists($obj, 'females')) { | |
| 355 | + throw new Exception("Missing required property"); | |
| 356 | + } | |
| 357 | + if (!property_exists($obj, 'males')) { | |
| 358 | + throw new Exception("Missing required property"); | |
| 359 | + } | |
| 360 | + if (!property_exists($obj, 'total')) { | |
| 361 | + throw new Exception("Missing required property"); | |
| 362 | + } | |
| 363 | + if (!property_exists($obj, 'year')) { | |
| 364 | + throw new Exception("Missing required property"); | |
| 365 | + } | |
| 348 | 366 | return new TopLevel( |
| 349 | 367 | TopLevel::fromAge($obj->{'age'}) |
| 350 | 368 | ,TopLevel::fromCountry($obj->{'country'}) |
Test case
1 generated file · +180 −0test/inputs/json/misc/e8b04.json
Mphpdefault / TopLevel.php+180 −0
| @@ -2322,6 +2322,81 @@ class TopLevel { | ||
| 2322 | 2322 | * @throws Exception |
| 2323 | 2323 | */ |
| 2324 | 2324 | public static function from(stdClass $obj): TopLevel { |
| 2325 | + if (!property_exists($obj, 'averageRating')) { | |
| 2326 | + throw new Exception("Missing required property"); | |
| 2327 | + } | |
| 2328 | + if (!property_exists($obj, 'createdAt')) { | |
| 2329 | + throw new Exception("Missing required property"); | |
| 2330 | + } | |
| 2331 | + if (!property_exists($obj, 'downloadCount')) { | |
| 2332 | + throw new Exception("Missing required property"); | |
| 2333 | + } | |
| 2334 | + if (!property_exists($obj, 'grants')) { | |
| 2335 | + throw new Exception("Missing required property"); | |
| 2336 | + } | |
| 2337 | + if (!property_exists($obj, 'hideFromCatalog')) { | |
| 2338 | + throw new Exception("Missing required property"); | |
| 2339 | + } | |
| 2340 | + if (!property_exists($obj, 'hideFromDataJson')) { | |
| 2341 | + throw new Exception("Missing required property"); | |
| 2342 | + } | |
| 2343 | + if (!property_exists($obj, 'id')) { | |
| 2344 | + throw new Exception("Missing required property"); | |
| 2345 | + } | |
| 2346 | + if (!property_exists($obj, 'locale')) { | |
| 2347 | + throw new Exception("Missing required property"); | |
| 2348 | + } | |
| 2349 | + if (!property_exists($obj, 'metadata')) { | |
| 2350 | + throw new Exception("Missing required property"); | |
| 2351 | + } | |
| 2352 | + if (!property_exists($obj, 'name')) { | |
| 2353 | + throw new Exception("Missing required property"); | |
| 2354 | + } | |
| 2355 | + if (!property_exists($obj, 'newBackend')) { | |
| 2356 | + throw new Exception("Missing required property"); | |
| 2357 | + } | |
| 2358 | + if (!property_exists($obj, 'numberOfComments')) { | |
| 2359 | + throw new Exception("Missing required property"); | |
| 2360 | + } | |
| 2361 | + if (!property_exists($obj, 'oid')) { | |
| 2362 | + throw new Exception("Missing required property"); | |
| 2363 | + } | |
| 2364 | + if (!property_exists($obj, 'owner')) { | |
| 2365 | + throw new Exception("Missing required property"); | |
| 2366 | + } | |
| 2367 | + if (!property_exists($obj, 'provenance')) { | |
| 2368 | + throw new Exception("Missing required property"); | |
| 2369 | + } | |
| 2370 | + if (!property_exists($obj, 'publicationAppendEnabled')) { | |
| 2371 | + throw new Exception("Missing required property"); | |
| 2372 | + } | |
| 2373 | + if (!property_exists($obj, 'publicationGroup')) { | |
| 2374 | + throw new Exception("Missing required property"); | |
| 2375 | + } | |
| 2376 | + if (!property_exists($obj, 'publicationStage')) { | |
| 2377 | + throw new Exception("Missing required property"); | |
| 2378 | + } | |
| 2379 | + if (!property_exists($obj, 'rights')) { | |
| 2380 | + throw new Exception("Missing required property"); | |
| 2381 | + } | |
| 2382 | + if (!property_exists($obj, 'tableAuthor')) { | |
| 2383 | + throw new Exception("Missing required property"); | |
| 2384 | + } | |
| 2385 | + if (!property_exists($obj, 'tableId')) { | |
| 2386 | + throw new Exception("Missing required property"); | |
| 2387 | + } | |
| 2388 | + if (!property_exists($obj, 'totalTimesRated')) { | |
| 2389 | + throw new Exception("Missing required property"); | |
| 2390 | + } | |
| 2391 | + if (!property_exists($obj, 'viewCount')) { | |
| 2392 | + throw new Exception("Missing required property"); | |
| 2393 | + } | |
| 2394 | + if (!property_exists($obj, 'viewLastModified')) { | |
| 2395 | + throw new Exception("Missing required property"); | |
| 2396 | + } | |
| 2397 | + if (!property_exists($obj, 'viewType')) { | |
| 2398 | + throw new Exception("Missing required property"); | |
| 2399 | + } | |
| 2325 | 2400 | return new TopLevel( |
| 2326 | 2401 | TopLevel::fromAverageRating($obj->{'averageRating'}) |
| 2327 | 2402 | ,TopLevel::fromCategory($obj->{'category'}) |
| @@ -2725,6 +2800,15 @@ class Grant { | ||
| 2725 | 2800 | * @throws Exception |
| 2726 | 2801 | */ |
| 2727 | 2802 | public static function from(stdClass $obj): Grant { |
| 2803 | + if (!property_exists($obj, 'flags')) { | |
| 2804 | + throw new Exception("Missing required property"); | |
| 2805 | + } | |
| 2806 | + if (!property_exists($obj, 'inherited')) { | |
| 2807 | + throw new Exception("Missing required property"); | |
| 2808 | + } | |
| 2809 | + if (!property_exists($obj, 'type')) { | |
| 2810 | + throw new Exception("Missing required property"); | |
| 2811 | + } | |
| 2728 | 2812 | return new Grant( |
| 2729 | 2813 | Grant::fromFlags($obj->{'flags'}) |
| 2730 | 2814 | ,Grant::fromInherited($obj->{'inherited'}) |
| @@ -3619,6 +3703,9 @@ class CustomFields { | ||
| 3619 | 3703 | * @throws Exception |
| 3620 | 3704 | */ |
| 3621 | 3705 | public static function from(stdClass $obj): CustomFields { |
| 3706 | + if (!property_exists($obj, 'TEST')) { | |
| 3707 | + throw new Exception("Missing required property"); | |
| 3708 | + } | |
| 3622 | 3709 | return new CustomFields( |
| 3623 | 3710 | CustomFields::fromTest($obj->{'TEST'}) |
| 3624 | 3711 | ); |
| @@ -3717,6 +3804,9 @@ class Test { | ||
| 3717 | 3804 | * @throws Exception |
| 3718 | 3805 | */ |
| 3719 | 3806 | public static function from(stdClass $obj): Test { |
| 3807 | + if (!property_exists($obj, 'CFPB1')) { | |
| 3808 | + throw new Exception("Missing required property"); | |
| 3809 | + } | |
| 3720 | 3810 | return new Test( |
| 3721 | 3811 | Test::fromCfpb1($obj->{'CFPB1'}) |
| 3722 | 3812 | ); |
| @@ -4152,6 +4242,9 @@ class Group { | ||
| 4152 | 4242 | * @throws Exception |
| 4153 | 4243 | */ |
| 4154 | 4244 | public static function from(stdClass $obj): Group { |
| 4245 | + if (!property_exists($obj, 'columnFieldName')) { | |
| 4246 | + throw new Exception("Missing required property"); | |
| 4247 | + } | |
| 4155 | 4248 | return new Group( |
| 4156 | 4249 | Group::fromColumnFieldName($obj->{'columnFieldName'}) |
| 4157 | 4250 | ); |
| @@ -4303,6 +4396,12 @@ class Order { | ||
| 4303 | 4396 | * @throws Exception |
| 4304 | 4397 | */ |
| 4305 | 4398 | public static function from(stdClass $obj): Order { |
| 4399 | + if (!property_exists($obj, 'ascending')) { | |
| 4400 | + throw new Exception("Missing required property"); | |
| 4401 | + } | |
| 4402 | + if (!property_exists($obj, 'columnFieldName')) { | |
| 4403 | + throw new Exception("Missing required property"); | |
| 4404 | + } | |
| 4306 | 4405 | return new Order( |
| 4307 | 4406 | Order::fromAscending($obj->{'ascending'}) |
| 4308 | 4407 | ,Order::fromColumnFieldName($obj->{'columnFieldName'}) |
| @@ -4518,6 +4617,9 @@ class Select { | ||
| 4518 | 4617 | * @throws Exception |
| 4519 | 4618 | */ |
| 4520 | 4619 | public static function from(stdClass $obj): Select { |
| 4620 | + if (!property_exists($obj, 'columnFieldName')) { | |
| 4621 | + throw new Exception("Missing required property"); | |
| 4622 | + } | |
| 4521 | 4623 | return new Select( |
| 4522 | 4624 | Select::fromAggregate($obj->{'aggregate'}) |
| 4523 | 4625 | ,Select::fromColumnFieldName($obj->{'columnFieldName'}) |
| @@ -4881,6 +4983,9 @@ class Where { | ||
| 4881 | 4983 | * @throws Exception |
| 4882 | 4984 | */ |
| 4883 | 4985 | public static function from(stdClass $obj): Where { |
| 4986 | + if (!property_exists($obj, 'operator')) { | |
| 4987 | + throw new Exception("Missing required property"); | |
| 4988 | + } | |
| 4884 | 4989 | return new Where( |
| 4885 | 4990 | Where::fromChildren($obj->{'children'}) |
| 4886 | 4991 | ,Where::fromColumnFieldName($obj->{'columnFieldName'}) |
| @@ -5166,6 +5271,12 @@ class Child { | ||
| 5166 | 5271 | * @throws Exception |
| 5167 | 5272 | */ |
| 5168 | 5273 | public static function from(stdClass $obj): Child { |
| 5274 | + if (!property_exists($obj, 'columnFieldName')) { | |
| 5275 | + throw new Exception("Missing required property"); | |
| 5276 | + } | |
| 5277 | + if (!property_exists($obj, 'operator')) { | |
| 5278 | + throw new Exception("Missing required property"); | |
| 5279 | + } | |
| 5169 | 5280 | return new Child( |
| 5170 | 5281 | Child::fromColumnFieldName($obj->{'columnFieldName'}) |
| 5171 | 5282 | ,Child::fromMetadata($obj->{'metadata'}) |
| @@ -5820,6 +5931,9 @@ class TableColumnID { | ||
| 5820 | 5931 | * @throws Exception |
| 5821 | 5932 | */ |
| 5822 | 5933 | public static function from(stdClass $obj): TableColumnID { |
| 5934 | + if (!property_exists($obj, '2819740')) { | |
| 5935 | + throw new Exception("Missing required property"); | |
| 5936 | + } | |
| 5823 | 5937 | return new TableColumnID( |
| 5824 | 5938 | TableColumnID::fromThe2819740($obj->{'2819740'}) |
| 5825 | 5939 | ); |
| @@ -6017,6 +6131,9 @@ class MetadataRenderTypeConfig { | ||
| 6017 | 6131 | * @throws Exception |
| 6018 | 6132 | */ |
| 6019 | 6133 | public static function from(stdClass $obj): MetadataRenderTypeConfig { |
| 6134 | + if (!property_exists($obj, 'visible')) { | |
| 6135 | + throw new Exception("Missing required property"); | |
| 6136 | + } | |
| 6020 | 6137 | return new MetadataRenderTypeConfig( |
| 6021 | 6138 | MetadataRenderTypeConfig::fromVisible($obj->{'visible'}) |
| 6022 | 6139 | ); |
| @@ -6288,6 +6405,9 @@ class RichRendererConfigs { | ||
| 6288 | 6405 | * @throws Exception |
| 6289 | 6406 | */ |
| 6290 | 6407 | public static function from(stdClass $obj): RichRendererConfigs { |
| 6408 | + if (!property_exists($obj, 'fatRow')) { | |
| 6409 | + throw new Exception("Missing required property"); | |
| 6410 | + } | |
| 6291 | 6411 | return new RichRendererConfigs( |
| 6292 | 6412 | RichRendererConfigs::fromFatRow($obj->{'fatRow'}) |
| 6293 | 6413 | ); |
| @@ -6398,6 +6518,9 @@ class FatRow { | ||
| 6398 | 6518 | * @throws Exception |
| 6399 | 6519 | */ |
| 6400 | 6520 | public static function from(stdClass $obj): FatRow { |
| 6521 | + if (!property_exists($obj, 'columns')) { | |
| 6522 | + throw new Exception("Missing required property"); | |
| 6523 | + } | |
| 6401 | 6524 | return new FatRow( |
| 6402 | 6525 | FatRow::fromColumns($obj->{'columns'}) |
| 6403 | 6526 | ); |
| @@ -6561,6 +6684,12 @@ class Column { | ||
| 6561 | 6684 | * @throws Exception |
| 6562 | 6685 | */ |
| 6563 | 6686 | public static function from(stdClass $obj): Column { |
| 6687 | + if (!property_exists($obj, 'rows')) { | |
| 6688 | + throw new Exception("Missing required property"); | |
| 6689 | + } | |
| 6690 | + if (!property_exists($obj, 'styles')) { | |
| 6691 | + throw new Exception("Missing required property"); | |
| 6692 | + } | |
| 6564 | 6693 | return new Column( |
| 6565 | 6694 | Column::fromRows($obj->{'rows'}) |
| 6566 | 6695 | ,Column::fromStyles($obj->{'styles'}) |
| @@ -6673,6 +6802,9 @@ class Row { | ||
| 6673 | 6802 | * @throws Exception |
| 6674 | 6803 | */ |
| 6675 | 6804 | public static function from(stdClass $obj): Row { |
| 6805 | + if (!property_exists($obj, 'fields')) { | |
| 6806 | + throw new Exception("Missing required property"); | |
| 6807 | + } | |
| 6676 | 6808 | return new Row( |
| 6677 | 6809 | Row::fromFields($obj->{'fields'}) |
| 6678 | 6810 | ); |
| @@ -6824,6 +6956,12 @@ class Field { | ||
| 6824 | 6956 | * @throws Exception |
| 6825 | 6957 | */ |
| 6826 | 6958 | public static function from(stdClass $obj): Field { |
| 6959 | + if (!property_exists($obj, 'tableColumnId')) { | |
| 6960 | + throw new Exception("Missing required property"); | |
| 6961 | + } | |
| 6962 | + if (!property_exists($obj, 'type')) { | |
| 6963 | + throw new Exception("Missing required property"); | |
| 6964 | + } | |
| 6827 | 6965 | return new Field( |
| 6828 | 6966 | Field::fromTableColumnID($obj->{'tableColumnId'}) |
| 6829 | 6967 | ,Field::fromType($obj->{'type'}) |
| @@ -6974,6 +7112,9 @@ class Styles { | ||
| 6974 | 7112 | * @throws Exception |
| 6975 | 7113 | */ |
| 6976 | 7114 | public static function from(stdClass $obj): Styles { |
| 7115 | + if (!property_exists($obj, 'width')) { | |
| 7116 | + throw new Exception("Missing required property"); | |
| 7117 | + } | |
| 6977 | 7118 | return new Styles( |
| 6978 | 7119 | Styles::fromWidth($obj->{'width'}) |
| 6979 | 7120 | ); |
| @@ -7235,6 +7376,15 @@ class V1ArchivedProperties { | ||
| 7235 | 7376 | * @throws Exception |
| 7236 | 7377 | */ |
| 7237 | 7378 | public static function from(stdClass $obj): V1ArchivedProperties { |
| 7379 | + if (!property_exists($obj, 'accessPoints')) { | |
| 7380 | + throw new Exception("Missing required property"); | |
| 7381 | + } | |
| 7382 | + if (!property_exists($obj, 'blist_id')) { | |
| 7383 | + throw new Exception("Missing required property"); | |
| 7384 | + } | |
| 7385 | + if (!property_exists($obj, 'renderTypeConfig')) { | |
| 7386 | + throw new Exception("Missing required property"); | |
| 7387 | + } | |
| 7238 | 7388 | return new V1ArchivedProperties( |
| 7239 | 7389 | V1ArchivedProperties::fromAccessPoints($obj->{'accessPoints'}) |
| 7240 | 7390 | ,V1ArchivedProperties::fromBlistID($obj->{'blist_id'}) |
| @@ -7337,6 +7487,9 @@ class AccessPoints { | ||
| 7337 | 7487 | * @throws Exception |
| 7338 | 7488 | */ |
| 7339 | 7489 | public static function from(stdClass $obj): AccessPoints { |
| 7490 | + if (!property_exists($obj, 'new_view')) { | |
| 7491 | + throw new Exception("Missing required property"); | |
| 7492 | + } | |
| 7340 | 7493 | return new AccessPoints( |
| 7341 | 7494 | AccessPoints::fromNewView($obj->{'new_view'}) |
| 7342 | 7495 | ); |
| @@ -7436,6 +7589,9 @@ class V1ArchivedPropertiesRenderTypeConfig { | ||
| 7436 | 7589 | * @throws Exception |
| 7437 | 7590 | */ |
| 7438 | 7591 | public static function from(stdClass $obj): V1ArchivedPropertiesRenderTypeConfig { |
| 7592 | + if (!property_exists($obj, 'visible')) { | |
| 7593 | + throw new Exception("Missing required property"); | |
| 7594 | + } | |
| 7439 | 7595 | return new V1ArchivedPropertiesRenderTypeConfig( |
| 7440 | 7596 | V1ArchivedPropertiesRenderTypeConfig::fromVisible($obj->{'visible'}) |
| 7441 | 7597 | ); |
| @@ -7534,6 +7690,9 @@ class FluffyVisible { | ||
| 7534 | 7690 | * @throws Exception |
| 7535 | 7691 | */ |
| 7536 | 7692 | public static function from(stdClass $obj): FluffyVisible { |
| 7693 | + if (!property_exists($obj, 'href')) { | |
| 7694 | + throw new Exception("Missing required property"); | |
| 7695 | + } | |
| 7537 | 7696 | return new FluffyVisible( |
| 7538 | 7697 | FluffyVisible::fromHref($obj->{'href'}) |
| 7539 | 7698 | ); |
| @@ -8244,6 +8403,15 @@ class Owner { | ||
| 8244 | 8403 | * @throws Exception |
| 8245 | 8404 | */ |
| 8246 | 8405 | public static function from(stdClass $obj): Owner { |
| 8406 | + if (!property_exists($obj, 'displayName')) { | |
| 8407 | + throw new Exception("Missing required property"); | |
| 8408 | + } | |
| 8409 | + if (!property_exists($obj, 'id')) { | |
| 8410 | + throw new Exception("Missing required property"); | |
| 8411 | + } | |
| 8412 | + if (!property_exists($obj, 'screenName')) { | |
| 8413 | + throw new Exception("Missing required property"); | |
| 8414 | + } | |
| 8247 | 8415 | return new Owner( |
| 8248 | 8416 | Owner::fromDisplayName($obj->{'displayName'}) |
| 8249 | 8417 | ,Owner::fromFlags($obj->{'flags'}) |
| @@ -8499,6 +8667,9 @@ class Ratings { | ||
| 8499 | 8667 | * @throws Exception |
| 8500 | 8668 | */ |
| 8501 | 8669 | public static function from(stdClass $obj): Ratings { |
| 8670 | + if (!property_exists($obj, 'rating')) { | |
| 8671 | + throw new Exception("Missing required property"); | |
| 8672 | + } | |
| 8502 | 8673 | return new Ratings( |
| 8503 | 8674 | Ratings::fromRating($obj->{'rating'}) |
| 8504 | 8675 | ); |
| @@ -8942,6 +9113,15 @@ class TableAuthor { | ||
| 8942 | 9113 | * @throws Exception |
| 8943 | 9114 | */ |
| 8944 | 9115 | public static function from(stdClass $obj): TableAuthor { |
| 9116 | + if (!property_exists($obj, 'displayName')) { | |
| 9117 | + throw new Exception("Missing required property"); | |
| 9118 | + } | |
| 9119 | + if (!property_exists($obj, 'id')) { | |
| 9120 | + throw new Exception("Missing required property"); | |
| 9121 | + } | |
| 9122 | + if (!property_exists($obj, 'screenName')) { | |
| 9123 | + throw new Exception("Missing required property"); | |
| 9124 | + } | |
| 8945 | 9125 | return new TableAuthor( |
| 8946 | 9126 | TableAuthor::fromDisplayName($obj->{'displayName'}) |
| 8947 | 9127 | ,TableAuthor::fromID($obj->{'id'}) |
Test case
1 generated file · +204 −0test/inputs/json/misc/f22f5.json
Mphpdefault / TopLevel.php+204 −0
| @@ -137,6 +137,12 @@ class TopLevel { | ||
| 137 | 137 | * @throws Exception |
| 138 | 138 | */ |
| 139 | 139 | public static function from(stdClass $obj): TopLevel { |
| 140 | + if (!property_exists($obj, 'data')) { | |
| 141 | + throw new Exception("Missing required property"); | |
| 142 | + } | |
| 143 | + if (!property_exists($obj, 'kind')) { | |
| 144 | + throw new Exception("Missing required property"); | |
| 145 | + } | |
| 140 | 146 | return new TopLevel( |
| 141 | 147 | TopLevel::fromData($obj->{'data'}) |
| 142 | 148 | ,TopLevel::fromKind($obj->{'kind'}) |
| @@ -408,6 +414,18 @@ class TopLevelData { | ||
| 408 | 414 | * @throws Exception |
| 409 | 415 | */ |
| 410 | 416 | public static function from(stdClass $obj): TopLevelData { |
| 417 | + if (!property_exists($obj, 'after')) { | |
| 418 | + throw new Exception("Missing required property"); | |
| 419 | + } | |
| 420 | + if (!property_exists($obj, 'before')) { | |
| 421 | + throw new Exception("Missing required property"); | |
| 422 | + } | |
| 423 | + if (!property_exists($obj, 'children')) { | |
| 424 | + throw new Exception("Missing required property"); | |
| 425 | + } | |
| 426 | + if (!property_exists($obj, 'modhash')) { | |
| 427 | + throw new Exception("Missing required property"); | |
| 428 | + } | |
| 411 | 429 | return new TopLevelData( |
| 412 | 430 | TopLevelData::fromAfter($obj->{'after'}) |
| 413 | 431 | ,TopLevelData::fromBefore($obj->{'before'}) |
| @@ -566,6 +584,12 @@ class Child { | ||
| 566 | 584 | * @throws Exception |
| 567 | 585 | */ |
| 568 | 586 | public static function from(stdClass $obj): Child { |
| 587 | + if (!property_exists($obj, 'data')) { | |
| 588 | + throw new Exception("Missing required property"); | |
| 589 | + } | |
| 590 | + if (!property_exists($obj, 'kind')) { | |
| 591 | + throw new Exception("Missing required property"); | |
| 592 | + } | |
| 569 | 593 | return new Child( |
| 570 | 594 | Child::fromData($obj->{'data'}) |
| 571 | 595 | ,Child::fromKind($obj->{'kind'}) |
| @@ -3830,6 +3854,186 @@ class ChildData { | ||
| 3830 | 3854 | * @throws Exception |
| 3831 | 3855 | */ |
| 3832 | 3856 | public static function from(stdClass $obj): ChildData { |
| 3857 | + if (!property_exists($obj, 'approved_at_utc')) { | |
| 3858 | + throw new Exception("Missing required property"); | |
| 3859 | + } | |
| 3860 | + if (!property_exists($obj, 'approved_by')) { | |
| 3861 | + throw new Exception("Missing required property"); | |
| 3862 | + } | |
| 3863 | + if (!property_exists($obj, 'archived')) { | |
| 3864 | + throw new Exception("Missing required property"); | |
| 3865 | + } | |
| 3866 | + if (!property_exists($obj, 'author')) { | |
| 3867 | + throw new Exception("Missing required property"); | |
| 3868 | + } | |
| 3869 | + if (!property_exists($obj, 'author_flair_css_class')) { | |
| 3870 | + throw new Exception("Missing required property"); | |
| 3871 | + } | |
| 3872 | + if (!property_exists($obj, 'author_flair_text')) { | |
| 3873 | + throw new Exception("Missing required property"); | |
| 3874 | + } | |
| 3875 | + if (!property_exists($obj, 'banned_at_utc')) { | |
| 3876 | + throw new Exception("Missing required property"); | |
| 3877 | + } | |
| 3878 | + if (!property_exists($obj, 'banned_by')) { | |
| 3879 | + throw new Exception("Missing required property"); | |
| 3880 | + } | |
| 3881 | + if (!property_exists($obj, 'brand_safe')) { | |
| 3882 | + throw new Exception("Missing required property"); | |
| 3883 | + } | |
| 3884 | + if (!property_exists($obj, 'can_gild')) { | |
| 3885 | + throw new Exception("Missing required property"); | |
| 3886 | + } | |
| 3887 | + if (!property_exists($obj, 'can_mod_post')) { | |
| 3888 | + throw new Exception("Missing required property"); | |
| 3889 | + } | |
| 3890 | + if (!property_exists($obj, 'clicked')) { | |
| 3891 | + throw new Exception("Missing required property"); | |
| 3892 | + } | |
| 3893 | + if (!property_exists($obj, 'contest_mode')) { | |
| 3894 | + throw new Exception("Missing required property"); | |
| 3895 | + } | |
| 3896 | + if (!property_exists($obj, 'created')) { | |
| 3897 | + throw new Exception("Missing required property"); | |
| 3898 | + } | |
| 3899 | + if (!property_exists($obj, 'created_utc')) { | |
| 3900 | + throw new Exception("Missing required property"); | |
| 3901 | + } | |
| 3902 | + if (!property_exists($obj, 'distinguished')) { | |
| 3903 | + throw new Exception("Missing required property"); | |
| 3904 | + } | |
| 3905 | + if (!property_exists($obj, 'domain')) { | |
| 3906 | + throw new Exception("Missing required property"); | |
| 3907 | + } | |
| 3908 | + if (!property_exists($obj, 'downs')) { | |
| 3909 | + throw new Exception("Missing required property"); | |
| 3910 | + } | |
| 3911 | + if (!property_exists($obj, 'edited')) { | |
| 3912 | + throw new Exception("Missing required property"); | |
| 3913 | + } | |
| 3914 | + if (!property_exists($obj, 'gilded')) { | |
| 3915 | + throw new Exception("Missing required property"); | |
| 3916 | + } | |
| 3917 | + if (!property_exists($obj, 'hidden')) { | |
| 3918 | + throw new Exception("Missing required property"); | |
| 3919 | + } | |
| 3920 | + if (!property_exists($obj, 'hide_score')) { | |
| 3921 | + throw new Exception("Missing required property"); | |
| 3922 | + } | |
| 3923 | + if (!property_exists($obj, 'id')) { | |
| 3924 | + throw new Exception("Missing required property"); | |
| 3925 | + } | |
| 3926 | + if (!property_exists($obj, 'is_self')) { | |
| 3927 | + throw new Exception("Missing required property"); | |
| 3928 | + } | |
| 3929 | + if (!property_exists($obj, 'is_video')) { | |
| 3930 | + throw new Exception("Missing required property"); | |
| 3931 | + } | |
| 3932 | + if (!property_exists($obj, 'likes')) { | |
| 3933 | + throw new Exception("Missing required property"); | |
| 3934 | + } | |
| 3935 | + if (!property_exists($obj, 'link_flair_css_class')) { | |
| 3936 | + throw new Exception("Missing required property"); | |
| 3937 | + } | |
| 3938 | + if (!property_exists($obj, 'link_flair_text')) { | |
| 3939 | + throw new Exception("Missing required property"); | |
| 3940 | + } | |
| 3941 | + if (!property_exists($obj, 'locked')) { | |
| 3942 | + throw new Exception("Missing required property"); | |
| 3943 | + } | |
| 3944 | + if (!property_exists($obj, 'media')) { | |
| 3945 | + throw new Exception("Missing required property"); | |
| 3946 | + } | |
| 3947 | + if (!property_exists($obj, 'media_embed')) { | |
| 3948 | + throw new Exception("Missing required property"); | |
| 3949 | + } | |
| 3950 | + if (!property_exists($obj, 'mod_reports')) { | |
| 3951 | + throw new Exception("Missing required property"); | |
| 3952 | + } | |
| 3953 | + if (!property_exists($obj, 'name')) { | |
| 3954 | + throw new Exception("Missing required property"); | |
| 3955 | + } | |
| 3956 | + if (!property_exists($obj, 'num_comments')) { | |
| 3957 | + throw new Exception("Missing required property"); | |
| 3958 | + } | |
| 3959 | + if (!property_exists($obj, 'num_reports')) { | |
| 3960 | + throw new Exception("Missing required property"); | |
| 3961 | + } | |
| 3962 | + if (!property_exists($obj, 'over_18')) { | |
| 3963 | + throw new Exception("Missing required property"); | |
| 3964 | + } | |
| 3965 | + if (!property_exists($obj, 'permalink')) { | |
| 3966 | + throw new Exception("Missing required property"); | |
| 3967 | + } | |
| 3968 | + if (!property_exists($obj, 'quarantine')) { | |
| 3969 | + throw new Exception("Missing required property"); | |
| 3970 | + } | |
| 3971 | + if (!property_exists($obj, 'removal_reason')) { | |
| 3972 | + throw new Exception("Missing required property"); | |
| 3973 | + } | |
| 3974 | + if (!property_exists($obj, 'report_reasons')) { | |
| 3975 | + throw new Exception("Missing required property"); | |
| 3976 | + } | |
| 3977 | + if (!property_exists($obj, 'saved')) { | |
| 3978 | + throw new Exception("Missing required property"); | |
| 3979 | + } | |
| 3980 | + if (!property_exists($obj, 'score')) { | |
| 3981 | + throw new Exception("Missing required property"); | |
| 3982 | + } | |
| 3983 | + if (!property_exists($obj, 'secure_media')) { | |
| 3984 | + throw new Exception("Missing required property"); | |
| 3985 | + } | |
| 3986 | + if (!property_exists($obj, 'secure_media_embed')) { | |
| 3987 | + throw new Exception("Missing required property"); | |
| 3988 | + } | |
| 3989 | + if (!property_exists($obj, 'selftext')) { | |
| 3990 | + throw new Exception("Missing required property"); | |
| 3991 | + } | |
| 3992 | + if (!property_exists($obj, 'selftext_html')) { | |
| 3993 | + throw new Exception("Missing required property"); | |
| 3994 | + } | |
| 3995 | + if (!property_exists($obj, 'spoiler')) { | |
| 3996 | + throw new Exception("Missing required property"); | |
| 3997 | + } | |
| 3998 | + if (!property_exists($obj, 'stickied')) { | |
| 3999 | + throw new Exception("Missing required property"); | |
| 4000 | + } | |
| 4001 | + if (!property_exists($obj, 'subreddit')) { | |
| 4002 | + throw new Exception("Missing required property"); | |
| 4003 | + } | |
| 4004 | + if (!property_exists($obj, 'subreddit_id')) { | |
| 4005 | + throw new Exception("Missing required property"); | |
| 4006 | + } | |
| 4007 | + if (!property_exists($obj, 'subreddit_name_prefixed')) { | |
| 4008 | + throw new Exception("Missing required property"); | |
| 4009 | + } | |
| 4010 | + if (!property_exists($obj, 'subreddit_type')) { | |
| 4011 | + throw new Exception("Missing required property"); | |
| 4012 | + } | |
| 4013 | + if (!property_exists($obj, 'suggested_sort')) { | |
| 4014 | + throw new Exception("Missing required property"); | |
| 4015 | + } | |
| 4016 | + if (!property_exists($obj, 'thumbnail')) { | |
| 4017 | + throw new Exception("Missing required property"); | |
| 4018 | + } | |
| 4019 | + if (!property_exists($obj, 'title')) { | |
| 4020 | + throw new Exception("Missing required property"); | |
| 4021 | + } | |
| 4022 | + if (!property_exists($obj, 'ups')) { | |
| 4023 | + throw new Exception("Missing required property"); | |
| 4024 | + } | |
| 4025 | + if (!property_exists($obj, 'url')) { | |
| 4026 | + throw new Exception("Missing required property"); | |
| 4027 | + } | |
| 4028 | + if (!property_exists($obj, 'user_reports')) { | |
| 4029 | + throw new Exception("Missing required property"); | |
| 4030 | + } | |
| 4031 | + if (!property_exists($obj, 'view_count')) { | |
| 4032 | + throw new Exception("Missing required property"); | |
| 4033 | + } | |
| 4034 | + if (!property_exists($obj, 'visited')) { | |
| 4035 | + throw new Exception("Missing required property"); | |
| 4036 | + } | |
| 3833 | 4037 | return new ChildData( |
| 3834 | 4038 | ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'}) |
| 3835 | 4039 | ,ChildData::fromApprovedBy($obj->{'approved_by'}) |
Test case
1 generated file · +6 −0test/inputs/json/misc/f3139.json
Mphpdefault / TopLevel.php+6 −0
| @@ -136,6 +136,12 @@ class TopLevel { | ||
| 136 | 136 | * @throws Exception |
| 137 | 137 | */ |
| 138 | 138 | public static function from(stdClass $obj): TopLevel { |
| 139 | + if (!property_exists($obj, 'id')) { | |
| 140 | + throw new Exception("Missing required property"); | |
| 141 | + } | |
| 142 | + if (!property_exists($obj, 'name')) { | |
| 143 | + throw new Exception("Missing required property"); | |
| 144 | + } | |
| 139 | 145 | return new TopLevel( |
| 140 | 146 | TopLevel::fromID($obj->{'id'}) |
| 141 | 147 | ,TopLevel::fromName($obj->{'name'}) |
Test case
1 generated file · +18 −0test/inputs/json/misc/f3edf.json
Mphpdefault / TopLevel.php+18 −0
| @@ -345,6 +345,24 @@ class TopLevel { | ||
| 345 | 345 | * @throws Exception |
| 346 | 346 | */ |
| 347 | 347 | public static function from(stdClass $obj): TopLevel { |
| 348 | + if (!property_exists($obj, 'age')) { | |
| 349 | + throw new Exception("Missing required property"); | |
| 350 | + } | |
| 351 | + if (!property_exists($obj, 'country')) { | |
| 352 | + throw new Exception("Missing required property"); | |
| 353 | + } | |
| 354 | + if (!property_exists($obj, 'females')) { | |
| 355 | + throw new Exception("Missing required property"); | |
| 356 | + } | |
| 357 | + if (!property_exists($obj, 'males')) { | |
| 358 | + throw new Exception("Missing required property"); | |
| 359 | + } | |
| 360 | + if (!property_exists($obj, 'total')) { | |
| 361 | + throw new Exception("Missing required property"); | |
| 362 | + } | |
| 363 | + if (!property_exists($obj, 'year')) { | |
| 364 | + throw new Exception("Missing required property"); | |
| 365 | + } | |
| 348 | 366 | return new TopLevel( |
| 349 | 367 | TopLevel::fromAge($obj->{'age'}) |
| 350 | 368 | ,TopLevel::fromCountry($obj->{'country'}) |
Test case
1 generated file · +18 −0test/inputs/json/misc/f466a.json
Mphpdefault / TopLevel.php+18 −0
| @@ -345,6 +345,24 @@ class TopLevel { | ||
| 345 | 345 | * @throws Exception |
| 346 | 346 | */ |
| 347 | 347 | public static function from(stdClass $obj): TopLevel { |
| 348 | + if (!property_exists($obj, 'age')) { | |
| 349 | + throw new Exception("Missing required property"); | |
| 350 | + } | |
| 351 | + if (!property_exists($obj, 'country')) { | |
| 352 | + throw new Exception("Missing required property"); | |
| 353 | + } | |
| 354 | + if (!property_exists($obj, 'females')) { | |
| 355 | + throw new Exception("Missing required property"); | |
| 356 | + } | |
| 357 | + if (!property_exists($obj, 'males')) { | |
| 358 | + throw new Exception("Missing required property"); | |
| 359 | + } | |
| 360 | + if (!property_exists($obj, 'total')) { | |
| 361 | + throw new Exception("Missing required property"); | |
| 362 | + } | |
| 363 | + if (!property_exists($obj, 'year')) { | |
| 364 | + throw new Exception("Missing required property"); | |
| 365 | + } | |
| 348 | 366 | return new TopLevel( |
| 349 | 367 | TopLevel::fromAge($obj->{'age'}) |
| 350 | 368 | ,TopLevel::fromCountry($obj->{'country'}) |
Test case
1 generated file · +207 −0test/inputs/json/misc/f6a65.json
Mphpdefault / TopLevel.php+207 −0
| @@ -202,6 +202,15 @@ class TopLevel { | ||
| 202 | 202 | * @throws Exception |
| 203 | 203 | */ |
| 204 | 204 | public static function from(stdClass $obj): TopLevel { |
| 205 | + if (!property_exists($obj, 'data')) { | |
| 206 | + throw new Exception("Missing required property"); | |
| 207 | + } | |
| 208 | + if (!property_exists($obj, 'meta')) { | |
| 209 | + throw new Exception("Missing required property"); | |
| 210 | + } | |
| 211 | + if (!property_exists($obj, 'pagination')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 205 | 214 | return new TopLevel( |
| 206 | 215 | TopLevel::fromData($obj->{'data'}) |
| 207 | 216 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -1203,6 +1212,57 @@ class Datum { | ||
| 1203 | 1212 | * @throws Exception |
| 1204 | 1213 | */ |
| 1205 | 1214 | public static function from(stdClass $obj): Datum { |
| 1215 | + if (!property_exists($obj, 'bitly_gif_url')) { | |
| 1216 | + throw new Exception("Missing required property"); | |
| 1217 | + } | |
| 1218 | + if (!property_exists($obj, 'bitly_url')) { | |
| 1219 | + throw new Exception("Missing required property"); | |
| 1220 | + } | |
| 1221 | + if (!property_exists($obj, 'content_url')) { | |
| 1222 | + throw new Exception("Missing required property"); | |
| 1223 | + } | |
| 1224 | + if (!property_exists($obj, 'embed_url')) { | |
| 1225 | + throw new Exception("Missing required property"); | |
| 1226 | + } | |
| 1227 | + if (!property_exists($obj, 'id')) { | |
| 1228 | + throw new Exception("Missing required property"); | |
| 1229 | + } | |
| 1230 | + if (!property_exists($obj, 'images')) { | |
| 1231 | + throw new Exception("Missing required property"); | |
| 1232 | + } | |
| 1233 | + if (!property_exists($obj, 'import_datetime')) { | |
| 1234 | + throw new Exception("Missing required property"); | |
| 1235 | + } | |
| 1236 | + if (!property_exists($obj, 'is_indexable')) { | |
| 1237 | + throw new Exception("Missing required property"); | |
| 1238 | + } | |
| 1239 | + if (!property_exists($obj, 'rating')) { | |
| 1240 | + throw new Exception("Missing required property"); | |
| 1241 | + } | |
| 1242 | + if (!property_exists($obj, 'slug')) { | |
| 1243 | + throw new Exception("Missing required property"); | |
| 1244 | + } | |
| 1245 | + if (!property_exists($obj, 'source')) { | |
| 1246 | + throw new Exception("Missing required property"); | |
| 1247 | + } | |
| 1248 | + if (!property_exists($obj, 'source_post_url')) { | |
| 1249 | + throw new Exception("Missing required property"); | |
| 1250 | + } | |
| 1251 | + if (!property_exists($obj, 'source_tld')) { | |
| 1252 | + throw new Exception("Missing required property"); | |
| 1253 | + } | |
| 1254 | + if (!property_exists($obj, 'trending_datetime')) { | |
| 1255 | + throw new Exception("Missing required property"); | |
| 1256 | + } | |
| 1257 | + if (!property_exists($obj, 'type')) { | |
| 1258 | + throw new Exception("Missing required property"); | |
| 1259 | + } | |
| 1260 | + if (!property_exists($obj, 'url')) { | |
| 1261 | + throw new Exception("Missing required property"); | |
| 1262 | + } | |
| 1263 | + if (!property_exists($obj, 'username')) { | |
| 1264 | + throw new Exception("Missing required property"); | |
| 1265 | + } | |
| 1206 | 1266 | return new Datum( |
| 1207 | 1267 | Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'}) |
| 1208 | 1268 | ,Datum::fromBitlyURL($obj->{'bitly_url'}) |
| @@ -2512,6 +2572,72 @@ class Images { | ||
| 2512 | 2572 | * @throws Exception |
| 2513 | 2573 | */ |
| 2514 | 2574 | public static function from(stdClass $obj): Images { |
| 2575 | + if (!property_exists($obj, 'downsized')) { | |
| 2576 | + throw new Exception("Missing required property"); | |
| 2577 | + } | |
| 2578 | + if (!property_exists($obj, 'downsized_large')) { | |
| 2579 | + throw new Exception("Missing required property"); | |
| 2580 | + } | |
| 2581 | + if (!property_exists($obj, 'downsized_medium')) { | |
| 2582 | + throw new Exception("Missing required property"); | |
| 2583 | + } | |
| 2584 | + if (!property_exists($obj, 'downsized_small')) { | |
| 2585 | + throw new Exception("Missing required property"); | |
| 2586 | + } | |
| 2587 | + if (!property_exists($obj, 'downsized_still')) { | |
| 2588 | + throw new Exception("Missing required property"); | |
| 2589 | + } | |
| 2590 | + if (!property_exists($obj, 'fixed_height')) { | |
| 2591 | + throw new Exception("Missing required property"); | |
| 2592 | + } | |
| 2593 | + if (!property_exists($obj, 'fixed_height_downsampled')) { | |
| 2594 | + throw new Exception("Missing required property"); | |
| 2595 | + } | |
| 2596 | + if (!property_exists($obj, 'fixed_height_small')) { | |
| 2597 | + throw new Exception("Missing required property"); | |
| 2598 | + } | |
| 2599 | + if (!property_exists($obj, 'fixed_height_small_still')) { | |
| 2600 | + throw new Exception("Missing required property"); | |
| 2601 | + } | |
| 2602 | + if (!property_exists($obj, 'fixed_height_still')) { | |
| 2603 | + throw new Exception("Missing required property"); | |
| 2604 | + } | |
| 2605 | + if (!property_exists($obj, 'fixed_width')) { | |
| 2606 | + throw new Exception("Missing required property"); | |
| 2607 | + } | |
| 2608 | + if (!property_exists($obj, 'fixed_width_downsampled')) { | |
| 2609 | + throw new Exception("Missing required property"); | |
| 2610 | + } | |
| 2611 | + if (!property_exists($obj, 'fixed_width_small')) { | |
| 2612 | + throw new Exception("Missing required property"); | |
| 2613 | + } | |
| 2614 | + if (!property_exists($obj, 'fixed_width_small_still')) { | |
| 2615 | + throw new Exception("Missing required property"); | |
| 2616 | + } | |
| 2617 | + if (!property_exists($obj, 'fixed_width_still')) { | |
| 2618 | + throw new Exception("Missing required property"); | |
| 2619 | + } | |
| 2620 | + if (!property_exists($obj, 'looping')) { | |
| 2621 | + throw new Exception("Missing required property"); | |
| 2622 | + } | |
| 2623 | + if (!property_exists($obj, 'original')) { | |
| 2624 | + throw new Exception("Missing required property"); | |
| 2625 | + } | |
| 2626 | + if (!property_exists($obj, 'original_mp4')) { | |
| 2627 | + throw new Exception("Missing required property"); | |
| 2628 | + } | |
| 2629 | + if (!property_exists($obj, 'original_still')) { | |
| 2630 | + throw new Exception("Missing required property"); | |
| 2631 | + } | |
| 2632 | + if (!property_exists($obj, 'preview')) { | |
| 2633 | + throw new Exception("Missing required property"); | |
| 2634 | + } | |
| 2635 | + if (!property_exists($obj, 'preview_gif')) { | |
| 2636 | + throw new Exception("Missing required property"); | |
| 2637 | + } | |
| 2638 | + if (!property_exists($obj, 'preview_webp')) { | |
| 2639 | + throw new Exception("Missing required property"); | |
| 2640 | + } | |
| 2515 | 2641 | return new Images( |
| 2516 | 2642 | Images::fromDownsized($obj->{'downsized'}) |
| 2517 | 2643 | ,Images::fromDownsizedLarge($obj->{'downsized_large'}) |
| @@ -2820,6 +2946,15 @@ class Downsized { | ||
| 2820 | 2946 | * @throws Exception |
| 2821 | 2947 | */ |
| 2822 | 2948 | public static function from(stdClass $obj): Downsized { |
| 2949 | + if (!property_exists($obj, 'height')) { | |
| 2950 | + throw new Exception("Missing required property"); | |
| 2951 | + } | |
| 2952 | + if (!property_exists($obj, 'url')) { | |
| 2953 | + throw new Exception("Missing required property"); | |
| 2954 | + } | |
| 2955 | + if (!property_exists($obj, 'width')) { | |
| 2956 | + throw new Exception("Missing required property"); | |
| 2957 | + } | |
| 2823 | 2958 | return new Downsized( |
| 2824 | 2959 | Downsized::fromHeight($obj->{'height'}) |
| 2825 | 2960 | ,Downsized::fromSize($obj->{'size'}) |
| @@ -3080,6 +3215,18 @@ class DownsizedSmall { | ||
| 3080 | 3215 | * @throws Exception |
| 3081 | 3216 | */ |
| 3082 | 3217 | public static function from(stdClass $obj): DownsizedSmall { |
| 3218 | + if (!property_exists($obj, 'height')) { | |
| 3219 | + throw new Exception("Missing required property"); | |
| 3220 | + } | |
| 3221 | + if (!property_exists($obj, 'mp4')) { | |
| 3222 | + throw new Exception("Missing required property"); | |
| 3223 | + } | |
| 3224 | + if (!property_exists($obj, 'mp4_size')) { | |
| 3225 | + throw new Exception("Missing required property"); | |
| 3226 | + } | |
| 3227 | + if (!property_exists($obj, 'width')) { | |
| 3228 | + throw new Exception("Missing required property"); | |
| 3229 | + } | |
| 3083 | 3230 | return new DownsizedSmall( |
| 3084 | 3231 | DownsizedSmall::fromHeight($obj->{'height'}) |
| 3085 | 3232 | ,DownsizedSmall::fromMp4($obj->{'mp4'}) |
| @@ -3692,6 +3839,24 @@ class FixedHeight { | ||
| 3692 | 3839 | * @throws Exception |
| 3693 | 3840 | */ |
| 3694 | 3841 | public static function from(stdClass $obj): FixedHeight { |
| 3842 | + if (!property_exists($obj, 'height')) { | |
| 3843 | + throw new Exception("Missing required property"); | |
| 3844 | + } | |
| 3845 | + if (!property_exists($obj, 'size')) { | |
| 3846 | + throw new Exception("Missing required property"); | |
| 3847 | + } | |
| 3848 | + if (!property_exists($obj, 'url')) { | |
| 3849 | + throw new Exception("Missing required property"); | |
| 3850 | + } | |
| 3851 | + if (!property_exists($obj, 'webp')) { | |
| 3852 | + throw new Exception("Missing required property"); | |
| 3853 | + } | |
| 3854 | + if (!property_exists($obj, 'webp_size')) { | |
| 3855 | + throw new Exception("Missing required property"); | |
| 3856 | + } | |
| 3857 | + if (!property_exists($obj, 'width')) { | |
| 3858 | + throw new Exception("Missing required property"); | |
| 3859 | + } | |
| 3695 | 3860 | return new FixedHeight( |
| 3696 | 3861 | FixedHeight::fromFrames($obj->{'frames'}) |
| 3697 | 3862 | ,FixedHeight::fromHash($obj->{'hash'}) |
| @@ -3860,6 +4025,12 @@ class Looping { | ||
| 3860 | 4025 | * @throws Exception |
| 3861 | 4026 | */ |
| 3862 | 4027 | public static function from(stdClass $obj): Looping { |
| 4028 | + if (!property_exists($obj, 'mp4')) { | |
| 4029 | + throw new Exception("Missing required property"); | |
| 4030 | + } | |
| 4031 | + if (!property_exists($obj, 'mp4_size')) { | |
| 4032 | + throw new Exception("Missing required property"); | |
| 4033 | + } | |
| 3863 | 4034 | return new Looping( |
| 3864 | 4035 | Looping::fromMp4($obj->{'mp4'}) |
| 3865 | 4036 | ,Looping::fromMp4Size($obj->{'mp4_size'}) |
| @@ -4323,6 +4494,24 @@ class User { | ||
| 4323 | 4494 | * @throws Exception |
| 4324 | 4495 | */ |
| 4325 | 4496 | public static function from(stdClass $obj): User { |
| 4497 | + if (!property_exists($obj, 'avatar_url')) { | |
| 4498 | + throw new Exception("Missing required property"); | |
| 4499 | + } | |
| 4500 | + if (!property_exists($obj, 'banner_url')) { | |
| 4501 | + throw new Exception("Missing required property"); | |
| 4502 | + } | |
| 4503 | + if (!property_exists($obj, 'display_name')) { | |
| 4504 | + throw new Exception("Missing required property"); | |
| 4505 | + } | |
| 4506 | + if (!property_exists($obj, 'profile_url')) { | |
| 4507 | + throw new Exception("Missing required property"); | |
| 4508 | + } | |
| 4509 | + if (!property_exists($obj, 'twitter')) { | |
| 4510 | + throw new Exception("Missing required property"); | |
| 4511 | + } | |
| 4512 | + if (!property_exists($obj, 'username')) { | |
| 4513 | + throw new Exception("Missing required property"); | |
| 4514 | + } | |
| 4326 | 4515 | return new User( |
| 4327 | 4516 | User::fromAvatarURL($obj->{'avatar_url'}) |
| 4328 | 4517 | ,User::fromBannerURL($obj->{'banner_url'}) |
| @@ -4592,6 +4781,15 @@ class Meta { | ||
| 4592 | 4781 | * @throws Exception |
| 4593 | 4782 | */ |
| 4594 | 4783 | public static function from(stdClass $obj): Meta { |
| 4784 | + if (!property_exists($obj, 'msg')) { | |
| 4785 | + throw new Exception("Missing required property"); | |
| 4786 | + } | |
| 4787 | + if (!property_exists($obj, 'response_id')) { | |
| 4788 | + throw new Exception("Missing required property"); | |
| 4789 | + } | |
| 4790 | + if (!property_exists($obj, 'status')) { | |
| 4791 | + throw new Exception("Missing required property"); | |
| 4792 | + } | |
| 4595 | 4793 | return new Meta( |
| 4596 | 4794 | Meta::fromMsg($obj->{'msg'}) |
| 4597 | 4795 | ,Meta::fromResponseID($obj->{'response_id'}) |
| @@ -4798,6 +4996,15 @@ class Pagination { | ||
| 4798 | 4996 | * @throws Exception |
| 4799 | 4997 | */ |
| 4800 | 4998 | public static function from(stdClass $obj): Pagination { |
| 4999 | + if (!property_exists($obj, 'count')) { | |
| 5000 | + throw new Exception("Missing required property"); | |
| 5001 | + } | |
| 5002 | + if (!property_exists($obj, 'offset')) { | |
| 5003 | + throw new Exception("Missing required property"); | |
| 5004 | + } | |
| 5005 | + if (!property_exists($obj, 'total_count')) { | |
| 5006 | + throw new Exception("Missing required property"); | |
| 5007 | + } | |
| 4801 | 5008 | return new Pagination( |
| 4802 | 5009 | Pagination::fromCount($obj->{'count'}) |
| 4803 | 5010 | ,Pagination::fromOffset($obj->{'offset'}) |
Test case
1 generated file · +204 −0test/inputs/json/misc/f74d5.json
Mphpdefault / TopLevel.php+204 −0
| @@ -182,6 +182,12 @@ class TopLevel { | ||
| 182 | 182 | * @throws Exception |
| 183 | 183 | */ |
| 184 | 184 | public static function from(stdClass $obj): TopLevel { |
| 185 | + if (!property_exists($obj, 'data')) { | |
| 186 | + throw new Exception("Missing required property"); | |
| 187 | + } | |
| 188 | + if (!property_exists($obj, 'meta')) { | |
| 189 | + throw new Exception("Missing required property"); | |
| 190 | + } | |
| 185 | 191 | return new TopLevel( |
| 186 | 192 | TopLevel::fromData($obj->{'data'}) |
| 187 | 193 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -283,6 +289,9 @@ class Meta { | ||
| 283 | 289 | * @throws Exception |
| 284 | 290 | */ |
| 285 | 291 | public static function from(stdClass $obj): Meta { |
| 292 | + if (!property_exists($obj, 'view')) { | |
| 293 | + throw new Exception("Missing required property"); | |
| 294 | + } | |
| 286 | 295 | return new Meta( |
| 287 | 296 | Meta::fromView($obj->{'view'}) |
| 288 | 297 | ); |
| @@ -2310,6 +2319,117 @@ class View { | ||
| 2310 | 2319 | * @throws Exception |
| 2311 | 2320 | */ |
| 2312 | 2321 | public static function from(stdClass $obj): View { |
| 2322 | + if (!property_exists($obj, 'averageRating')) { | |
| 2323 | + throw new Exception("Missing required property"); | |
| 2324 | + } | |
| 2325 | + if (!property_exists($obj, 'category')) { | |
| 2326 | + throw new Exception("Missing required property"); | |
| 2327 | + } | |
| 2328 | + if (!property_exists($obj, 'columns')) { | |
| 2329 | + throw new Exception("Missing required property"); | |
| 2330 | + } | |
| 2331 | + if (!property_exists($obj, 'createdAt')) { | |
| 2332 | + throw new Exception("Missing required property"); | |
| 2333 | + } | |
| 2334 | + if (!property_exists($obj, 'displayType')) { | |
| 2335 | + throw new Exception("Missing required property"); | |
| 2336 | + } | |
| 2337 | + if (!property_exists($obj, 'downloadCount')) { | |
| 2338 | + throw new Exception("Missing required property"); | |
| 2339 | + } | |
| 2340 | + if (!property_exists($obj, 'flags')) { | |
| 2341 | + throw new Exception("Missing required property"); | |
| 2342 | + } | |
| 2343 | + if (!property_exists($obj, 'grants')) { | |
| 2344 | + throw new Exception("Missing required property"); | |
| 2345 | + } | |
| 2346 | + if (!property_exists($obj, 'hideFromCatalog')) { | |
| 2347 | + throw new Exception("Missing required property"); | |
| 2348 | + } | |
| 2349 | + if (!property_exists($obj, 'hideFromDataJson')) { | |
| 2350 | + throw new Exception("Missing required property"); | |
| 2351 | + } | |
| 2352 | + if (!property_exists($obj, 'id')) { | |
| 2353 | + throw new Exception("Missing required property"); | |
| 2354 | + } | |
| 2355 | + if (!property_exists($obj, 'indexUpdatedAt')) { | |
| 2356 | + throw new Exception("Missing required property"); | |
| 2357 | + } | |
| 2358 | + if (!property_exists($obj, 'license')) { | |
| 2359 | + throw new Exception("Missing required property"); | |
| 2360 | + } | |
| 2361 | + if (!property_exists($obj, 'licenseId')) { | |
| 2362 | + throw new Exception("Missing required property"); | |
| 2363 | + } | |
| 2364 | + if (!property_exists($obj, 'locale')) { | |
| 2365 | + throw new Exception("Missing required property"); | |
| 2366 | + } | |
| 2367 | + if (!property_exists($obj, 'metadata')) { | |
| 2368 | + throw new Exception("Missing required property"); | |
| 2369 | + } | |
| 2370 | + if (!property_exists($obj, 'name')) { | |
| 2371 | + throw new Exception("Missing required property"); | |
| 2372 | + } | |
| 2373 | + if (!property_exists($obj, 'newBackend')) { | |
| 2374 | + throw new Exception("Missing required property"); | |
| 2375 | + } | |
| 2376 | + if (!property_exists($obj, 'numberOfComments')) { | |
| 2377 | + throw new Exception("Missing required property"); | |
| 2378 | + } | |
| 2379 | + if (!property_exists($obj, 'oid')) { | |
| 2380 | + throw new Exception("Missing required property"); | |
| 2381 | + } | |
| 2382 | + if (!property_exists($obj, 'owner')) { | |
| 2383 | + throw new Exception("Missing required property"); | |
| 2384 | + } | |
| 2385 | + if (!property_exists($obj, 'provenance')) { | |
| 2386 | + throw new Exception("Missing required property"); | |
| 2387 | + } | |
| 2388 | + if (!property_exists($obj, 'publicationAppendEnabled')) { | |
| 2389 | + throw new Exception("Missing required property"); | |
| 2390 | + } | |
| 2391 | + if (!property_exists($obj, 'publicationDate')) { | |
| 2392 | + throw new Exception("Missing required property"); | |
| 2393 | + } | |
| 2394 | + if (!property_exists($obj, 'publicationGroup')) { | |
| 2395 | + throw new Exception("Missing required property"); | |
| 2396 | + } | |
| 2397 | + if (!property_exists($obj, 'publicationStage')) { | |
| 2398 | + throw new Exception("Missing required property"); | |
| 2399 | + } | |
| 2400 | + if (!property_exists($obj, 'query')) { | |
| 2401 | + throw new Exception("Missing required property"); | |
| 2402 | + } | |
| 2403 | + if (!property_exists($obj, 'rights')) { | |
| 2404 | + throw new Exception("Missing required property"); | |
| 2405 | + } | |
| 2406 | + if (!property_exists($obj, 'rowClass')) { | |
| 2407 | + throw new Exception("Missing required property"); | |
| 2408 | + } | |
| 2409 | + if (!property_exists($obj, 'rowsUpdatedAt')) { | |
| 2410 | + throw new Exception("Missing required property"); | |
| 2411 | + } | |
| 2412 | + if (!property_exists($obj, 'rowsUpdatedBy')) { | |
| 2413 | + throw new Exception("Missing required property"); | |
| 2414 | + } | |
| 2415 | + if (!property_exists($obj, 'tableAuthor')) { | |
| 2416 | + throw new Exception("Missing required property"); | |
| 2417 | + } | |
| 2418 | + if (!property_exists($obj, 'tableId')) { | |
| 2419 | + throw new Exception("Missing required property"); | |
| 2420 | + } | |
| 2421 | + if (!property_exists($obj, 'totalTimesRated')) { | |
| 2422 | + throw new Exception("Missing required property"); | |
| 2423 | + } | |
| 2424 | + if (!property_exists($obj, 'viewCount')) { | |
| 2425 | + throw new Exception("Missing required property"); | |
| 2426 | + } | |
| 2427 | + if (!property_exists($obj, 'viewLastModified')) { | |
| 2428 | + throw new Exception("Missing required property"); | |
| 2429 | + } | |
| 2430 | + if (!property_exists($obj, 'viewType')) { | |
| 2431 | + throw new Exception("Missing required property"); | |
| 2432 | + } | |
| 2313 | 2433 | return new View( |
| 2314 | 2434 | View::fromAverageRating($obj->{'averageRating'}) |
| 2315 | 2435 | ,View::fromCategory($obj->{'category'}) |
| @@ -3058,6 +3178,27 @@ class Column { | ||
| 3058 | 3178 | * @throws Exception |
| 3059 | 3179 | */ |
| 3060 | 3180 | public static function from(stdClass $obj): Column { |
| 3181 | + if (!property_exists($obj, 'dataTypeName')) { | |
| 3182 | + throw new Exception("Missing required property"); | |
| 3183 | + } | |
| 3184 | + if (!property_exists($obj, 'fieldName')) { | |
| 3185 | + throw new Exception("Missing required property"); | |
| 3186 | + } | |
| 3187 | + if (!property_exists($obj, 'format')) { | |
| 3188 | + throw new Exception("Missing required property"); | |
| 3189 | + } | |
| 3190 | + if (!property_exists($obj, 'id')) { | |
| 3191 | + throw new Exception("Missing required property"); | |
| 3192 | + } | |
| 3193 | + if (!property_exists($obj, 'name')) { | |
| 3194 | + throw new Exception("Missing required property"); | |
| 3195 | + } | |
| 3196 | + if (!property_exists($obj, 'position')) { | |
| 3197 | + throw new Exception("Missing required property"); | |
| 3198 | + } | |
| 3199 | + if (!property_exists($obj, 'renderTypeName')) { | |
| 3200 | + throw new Exception("Missing required property"); | |
| 3201 | + } | |
| 3061 | 3202 | return new Column( |
| 3062 | 3203 | Column::fromCachedContents($obj->{'cachedContents'}) |
| 3063 | 3204 | ,Column::fromDataTypeName($obj->{'dataTypeName'}) |
| @@ -3520,6 +3661,21 @@ class CachedContents { | ||
| 3520 | 3661 | * @throws Exception |
| 3521 | 3662 | */ |
| 3522 | 3663 | public static function from(stdClass $obj): CachedContents { |
| 3664 | + if (!property_exists($obj, 'largest')) { | |
| 3665 | + throw new Exception("Missing required property"); | |
| 3666 | + } | |
| 3667 | + if (!property_exists($obj, 'non_null')) { | |
| 3668 | + throw new Exception("Missing required property"); | |
| 3669 | + } | |
| 3670 | + if (!property_exists($obj, 'null')) { | |
| 3671 | + throw new Exception("Missing required property"); | |
| 3672 | + } | |
| 3673 | + if (!property_exists($obj, 'smallest')) { | |
| 3674 | + throw new Exception("Missing required property"); | |
| 3675 | + } | |
| 3676 | + if (!property_exists($obj, 'top')) { | |
| 3677 | + throw new Exception("Missing required property"); | |
| 3678 | + } | |
| 3523 | 3679 | return new CachedContents( |
| 3524 | 3680 | CachedContents::fromAverage($obj->{'average'}) |
| 3525 | 3681 | ,CachedContents::fromLargest($obj->{'largest'}) |
| @@ -3682,6 +3838,12 @@ class Top { | ||
| 3682 | 3838 | * @throws Exception |
| 3683 | 3839 | */ |
| 3684 | 3840 | public static function from(stdClass $obj): Top { |
| 3841 | + if (!property_exists($obj, 'count')) { | |
| 3842 | + throw new Exception("Missing required property"); | |
| 3843 | + } | |
| 3844 | + if (!property_exists($obj, 'item')) { | |
| 3845 | + throw new Exception("Missing required property"); | |
| 3846 | + } | |
| 3685 | 3847 | return new Top( |
| 3686 | 3848 | Top::fromCount($obj->{'count'}) |
| 3687 | 3849 | ,Top::fromItem($obj->{'item'}) |
| @@ -3998,6 +4160,15 @@ class Grant { | ||
| 3998 | 4160 | * @throws Exception |
| 3999 | 4161 | */ |
| 4000 | 4162 | public static function from(stdClass $obj): Grant { |
| 4163 | + if (!property_exists($obj, 'flags')) { | |
| 4164 | + throw new Exception("Missing required property"); | |
| 4165 | + } | |
| 4166 | + if (!property_exists($obj, 'inherited')) { | |
| 4167 | + throw new Exception("Missing required property"); | |
| 4168 | + } | |
| 4169 | + if (!property_exists($obj, 'type')) { | |
| 4170 | + throw new Exception("Missing required property"); | |
| 4171 | + } | |
| 4001 | 4172 | return new Grant( |
| 4002 | 4173 | Grant::fromFlags($obj->{'flags'}) |
| 4003 | 4174 | ,Grant::fromInherited($obj->{'inherited'}) |
| @@ -4100,6 +4271,9 @@ class License { | ||
| 4100 | 4271 | * @throws Exception |
| 4101 | 4272 | */ |
| 4102 | 4273 | public static function from(stdClass $obj): License { |
| 4274 | + if (!property_exists($obj, 'name')) { | |
| 4275 | + throw new Exception("Missing required property"); | |
| 4276 | + } | |
| 4103 | 4277 | return new License( |
| 4104 | 4278 | License::fromName($obj->{'name'}) |
| 4105 | 4279 | ); |
| @@ -4421,6 +4595,21 @@ class Metadata { | ||
| 4421 | 4595 | * @throws Exception |
| 4422 | 4596 | */ |
| 4423 | 4597 | public static function from(stdClass $obj): Metadata { |
| 4598 | + if (!property_exists($obj, 'availableDisplayTypes')) { | |
| 4599 | + throw new Exception("Missing required property"); | |
| 4600 | + } | |
| 4601 | + if (!property_exists($obj, 'rdfClass')) { | |
| 4602 | + throw new Exception("Missing required property"); | |
| 4603 | + } | |
| 4604 | + if (!property_exists($obj, 'rdfSubject')) { | |
| 4605 | + throw new Exception("Missing required property"); | |
| 4606 | + } | |
| 4607 | + if (!property_exists($obj, 'renderTypeConfig')) { | |
| 4608 | + throw new Exception("Missing required property"); | |
| 4609 | + } | |
| 4610 | + if (!property_exists($obj, 'rowIdentifier')) { | |
| 4611 | + throw new Exception("Missing required property"); | |
| 4612 | + } | |
| 4424 | 4613 | return new Metadata( |
| 4425 | 4614 | Metadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'}) |
| 4426 | 4615 | ,Metadata::fromRDFClass($obj->{'rdfClass'}) |
| @@ -4528,6 +4717,9 @@ class RenderTypeConfig { | ||
| 4528 | 4717 | * @throws Exception |
| 4529 | 4718 | */ |
| 4530 | 4719 | public static function from(stdClass $obj): RenderTypeConfig { |
| 4720 | + if (!property_exists($obj, 'visible')) { | |
| 4721 | + throw new Exception("Missing required property"); | |
| 4722 | + } | |
| 4531 | 4723 | return new RenderTypeConfig( |
| 4532 | 4724 | RenderTypeConfig::fromVisible($obj->{'visible'}) |
| 4533 | 4725 | ); |
| @@ -4626,6 +4818,9 @@ class Visible { | ||
| 4626 | 4818 | * @throws Exception |
| 4627 | 4819 | */ |
| 4628 | 4820 | public static function from(stdClass $obj): Visible { |
| 4821 | + if (!property_exists($obj, 'table')) { | |
| 4822 | + throw new Exception("Missing required property"); | |
| 4823 | + } | |
| 4629 | 4824 | return new Visible( |
| 4630 | 4825 | Visible::fromTable($obj->{'table'}) |
| 4631 | 4826 | ); |
| @@ -4828,6 +5023,15 @@ class Owner { | ||
| 4828 | 5023 | * @throws Exception |
| 4829 | 5024 | */ |
| 4830 | 5025 | public static function from(stdClass $obj): Owner { |
| 5026 | + if (!property_exists($obj, 'displayName')) { | |
| 5027 | + throw new Exception("Missing required property"); | |
| 5028 | + } | |
| 5029 | + if (!property_exists($obj, 'id')) { | |
| 5030 | + throw new Exception("Missing required property"); | |
| 5031 | + } | |
| 5032 | + if (!property_exists($obj, 'screenName')) { | |
| 5033 | + throw new Exception("Missing required property"); | |
| 5034 | + } | |
| 4831 | 5035 | return new Owner( |
| 4832 | 5036 | Owner::fromDisplayName($obj->{'displayName'}) |
| 4833 | 5037 | ,Owner::fromID($obj->{'id'}) |
Test case
1 generated file · +132 −0test/inputs/json/misc/f82d9.json
Mphpdefault / TopLevel.php+132 −0
| @@ -479,6 +479,30 @@ class TopLevel { | ||
| 479 | 479 | * @throws Exception |
| 480 | 480 | */ |
| 481 | 481 | public static function from(stdClass $obj): TopLevel { |
| 482 | + if (!property_exists($obj, 'basePath')) { | |
| 483 | + throw new Exception("Missing required property"); | |
| 484 | + } | |
| 485 | + if (!property_exists($obj, 'definitions')) { | |
| 486 | + throw new Exception("Missing required property"); | |
| 487 | + } | |
| 488 | + if (!property_exists($obj, 'host')) { | |
| 489 | + throw new Exception("Missing required property"); | |
| 490 | + } | |
| 491 | + if (!property_exists($obj, 'info')) { | |
| 492 | + throw new Exception("Missing required property"); | |
| 493 | + } | |
| 494 | + if (!property_exists($obj, 'paths')) { | |
| 495 | + throw new Exception("Missing required property"); | |
| 496 | + } | |
| 497 | + if (!property_exists($obj, 'produces')) { | |
| 498 | + throw new Exception("Missing required property"); | |
| 499 | + } | |
| 500 | + if (!property_exists($obj, 'schemes')) { | |
| 501 | + throw new Exception("Missing required property"); | |
| 502 | + } | |
| 503 | + if (!property_exists($obj, 'swagger')) { | |
| 504 | + throw new Exception("Missing required property"); | |
| 505 | + } | |
| 482 | 506 | return new TopLevel( |
| 483 | 507 | TopLevel::fromBasePath($obj->{'basePath'}) |
| 484 | 508 | ,TopLevel::fromDefinitions($obj->{'definitions'}) |
| @@ -592,6 +616,9 @@ class Definitions { | ||
| 592 | 616 | * @throws Exception |
| 593 | 617 | */ |
| 594 | 618 | public static function from(stdClass $obj): Definitions { |
| 619 | + if (!property_exists($obj, 'Report')) { | |
| 620 | + throw new Exception("Missing required property"); | |
| 621 | + } | |
| 595 | 622 | return new Definitions( |
| 596 | 623 | Definitions::fromReport($obj->{'Report'}) |
| 597 | 624 | ); |
| @@ -691,6 +718,9 @@ class Report { | ||
| 691 | 718 | * @throws Exception |
| 692 | 719 | */ |
| 693 | 720 | public static function from(stdClass $obj): Report { |
| 721 | + if (!property_exists($obj, 'properties')) { | |
| 722 | + throw new Exception("Missing required property"); | |
| 723 | + } | |
| 694 | 724 | return new Report( |
| 695 | 725 | Report::fromProperties($obj->{'properties'}) |
| 696 | 726 | ); |
| @@ -1267,6 +1297,36 @@ class Properties { | ||
| 1267 | 1297 | * @throws Exception |
| 1268 | 1298 | */ |
| 1269 | 1299 | public static function from(stdClass $obj): Properties { |
| 1300 | + if (!property_exists($obj, 'click_url')) { | |
| 1301 | + throw new Exception("Missing required property"); | |
| 1302 | + } | |
| 1303 | + if (!property_exists($obj, 'country')) { | |
| 1304 | + throw new Exception("Missing required property"); | |
| 1305 | + } | |
| 1306 | + if (!property_exists($obj, 'description')) { | |
| 1307 | + throw new Exception("Missing required property"); | |
| 1308 | + } | |
| 1309 | + if (!property_exists($obj, 'expiration_date')) { | |
| 1310 | + throw new Exception("Missing required property"); | |
| 1311 | + } | |
| 1312 | + if (!property_exists($obj, 'id')) { | |
| 1313 | + throw new Exception("Missing required property"); | |
| 1314 | + } | |
| 1315 | + if (!property_exists($obj, 'industry')) { | |
| 1316 | + throw new Exception("Missing required property"); | |
| 1317 | + } | |
| 1318 | + if (!property_exists($obj, 'report_type')) { | |
| 1319 | + throw new Exception("Missing required property"); | |
| 1320 | + } | |
| 1321 | + if (!property_exists($obj, 'source_industry')) { | |
| 1322 | + throw new Exception("Missing required property"); | |
| 1323 | + } | |
| 1324 | + if (!property_exists($obj, 'title')) { | |
| 1325 | + throw new Exception("Missing required property"); | |
| 1326 | + } | |
| 1327 | + if (!property_exists($obj, 'url')) { | |
| 1328 | + throw new Exception("Missing required property"); | |
| 1329 | + } | |
| 1270 | 1330 | return new Properties( |
| 1271 | 1331 | Properties::fromClickURL($obj->{'click_url'}) |
| 1272 | 1332 | ,Properties::fromCountry($obj->{'country'}) |
| @@ -1436,6 +1496,12 @@ class ClickURL { | ||
| 1436 | 1496 | * @throws Exception |
| 1437 | 1497 | */ |
| 1438 | 1498 | public static function from(stdClass $obj): ClickURL { |
| 1499 | + if (!property_exists($obj, 'description')) { | |
| 1500 | + throw new Exception("Missing required property"); | |
| 1501 | + } | |
| 1502 | + if (!property_exists($obj, 'type')) { | |
| 1503 | + throw new Exception("Missing required property"); | |
| 1504 | + } | |
| 1439 | 1505 | return new ClickURL( |
| 1440 | 1506 | ClickURL::fromDescription($obj->{'description'}) |
| 1441 | 1507 | ,ClickURL::fromType($obj->{'type'}) |
| @@ -1685,6 +1751,15 @@ class Info { | ||
| 1685 | 1751 | * @throws Exception |
| 1686 | 1752 | */ |
| 1687 | 1753 | public static function from(stdClass $obj): Info { |
| 1754 | + if (!property_exists($obj, 'description')) { | |
| 1755 | + throw new Exception("Missing required property"); | |
| 1756 | + } | |
| 1757 | + if (!property_exists($obj, 'title')) { | |
| 1758 | + throw new Exception("Missing required property"); | |
| 1759 | + } | |
| 1760 | + if (!property_exists($obj, 'version')) { | |
| 1761 | + throw new Exception("Missing required property"); | |
| 1762 | + } | |
| 1688 | 1763 | return new Info( |
| 1689 | 1764 | Info::fromDescription($obj->{'description'}) |
| 1690 | 1765 | ,Info::fromTitle($obj->{'title'}) |
| @@ -1788,6 +1863,9 @@ class Paths { | ||
| 1788 | 1863 | * @throws Exception |
| 1789 | 1864 | */ |
| 1790 | 1865 | public static function from(stdClass $obj): Paths { |
| 1866 | + if (!property_exists($obj, '/market_research_library/search')) { | |
| 1867 | + throw new Exception("Missing required property"); | |
| 1868 | + } | |
| 1791 | 1869 | return new Paths( |
| 1792 | 1870 | Paths::fromMarketResearchLibrarySearch($obj->{'/market_research_library/search'}) |
| 1793 | 1871 | ); |
| @@ -1887,6 +1965,9 @@ class MarketResearchLibrarySearch { | ||
| 1887 | 1965 | * @throws Exception |
| 1888 | 1966 | */ |
| 1889 | 1967 | public static function from(stdClass $obj): MarketResearchLibrarySearch { |
| 1968 | + if (!property_exists($obj, 'get')) { | |
| 1969 | + throw new Exception("Missing required property"); | |
| 1970 | + } | |
| 1890 | 1971 | return new MarketResearchLibrarySearch( |
| 1891 | 1972 | MarketResearchLibrarySearch::fromGet($obj->{'get'}) |
| 1892 | 1973 | ); |
| @@ -2220,6 +2301,21 @@ class Get { | ||
| 2220 | 2301 | * @throws Exception |
| 2221 | 2302 | */ |
| 2222 | 2303 | public static function from(stdClass $obj): Get { |
| 2304 | + if (!property_exists($obj, 'description')) { | |
| 2305 | + throw new Exception("Missing required property"); | |
| 2306 | + } | |
| 2307 | + if (!property_exists($obj, 'parameters')) { | |
| 2308 | + throw new Exception("Missing required property"); | |
| 2309 | + } | |
| 2310 | + if (!property_exists($obj, 'responses')) { | |
| 2311 | + throw new Exception("Missing required property"); | |
| 2312 | + } | |
| 2313 | + if (!property_exists($obj, 'summary')) { | |
| 2314 | + throw new Exception("Missing required property"); | |
| 2315 | + } | |
| 2316 | + if (!property_exists($obj, 'tags')) { | |
| 2317 | + throw new Exception("Missing required property"); | |
| 2318 | + } | |
| 2223 | 2319 | return new Get( |
| 2224 | 2320 | Get::fromDescription($obj->{'description'}) |
| 2225 | 2321 | ,Get::fromParameters($obj->{'parameters'}) |
| @@ -2588,6 +2684,24 @@ class Parameter { | ||
| 2588 | 2684 | * @throws Exception |
| 2589 | 2685 | */ |
| 2590 | 2686 | public static function from(stdClass $obj): Parameter { |
| 2687 | + if (!property_exists($obj, 'description')) { | |
| 2688 | + throw new Exception("Missing required property"); | |
| 2689 | + } | |
| 2690 | + if (!property_exists($obj, 'format')) { | |
| 2691 | + throw new Exception("Missing required property"); | |
| 2692 | + } | |
| 2693 | + if (!property_exists($obj, 'in')) { | |
| 2694 | + throw new Exception("Missing required property"); | |
| 2695 | + } | |
| 2696 | + if (!property_exists($obj, 'name')) { | |
| 2697 | + throw new Exception("Missing required property"); | |
| 2698 | + } | |
| 2699 | + if (!property_exists($obj, 'required')) { | |
| 2700 | + throw new Exception("Missing required property"); | |
| 2701 | + } | |
| 2702 | + if (!property_exists($obj, 'type')) { | |
| 2703 | + throw new Exception("Missing required property"); | |
| 2704 | + } | |
| 2591 | 2705 | return new Parameter( |
| 2592 | 2706 | Parameter::fromDescription($obj->{'description'}) |
| 2593 | 2707 | ,Parameter::fromFormat($obj->{'format'}) |
| @@ -2697,6 +2811,9 @@ class Responses { | ||
| 2697 | 2811 | * @throws Exception |
| 2698 | 2812 | */ |
| 2699 | 2813 | public static function from(stdClass $obj): Responses { |
| 2814 | + if (!property_exists($obj, '200')) { | |
| 2815 | + throw new Exception("Missing required property"); | |
| 2816 | + } | |
| 2700 | 2817 | return new Responses( |
| 2701 | 2818 | Responses::fromThe200($obj->{'200'}) |
| 2702 | 2819 | ); |
| @@ -2848,6 +2965,12 @@ class The200 { | ||
| 2848 | 2965 | * @throws Exception |
| 2849 | 2966 | */ |
| 2850 | 2967 | public static function from(stdClass $obj): The200 { |
| 2968 | + if (!property_exists($obj, 'description')) { | |
| 2969 | + throw new Exception("Missing required property"); | |
| 2970 | + } | |
| 2971 | + if (!property_exists($obj, 'schema')) { | |
| 2972 | + throw new Exception("Missing required property"); | |
| 2973 | + } | |
| 2851 | 2974 | return new The200( |
| 2852 | 2975 | The200::fromDescription($obj->{'description'}) |
| 2853 | 2976 | ,The200::fromSchema($obj->{'schema'}) |
| @@ -3001,6 +3124,12 @@ class Schema { | ||
| 3001 | 3124 | * @throws Exception |
| 3002 | 3125 | */ |
| 3003 | 3126 | public static function from(stdClass $obj): Schema { |
| 3127 | + if (!property_exists($obj, 'items')) { | |
| 3128 | + throw new Exception("Missing required property"); | |
| 3129 | + } | |
| 3130 | + if (!property_exists($obj, 'type')) { | |
| 3131 | + throw new Exception("Missing required property"); | |
| 3132 | + } | |
| 3004 | 3133 | return new Schema( |
| 3005 | 3134 | Schema::fromItems($obj->{'items'}) |
| 3006 | 3135 | ,Schema::fromType($obj->{'type'}) |
| @@ -3101,6 +3230,9 @@ class Items { | ||
| 3101 | 3230 | * @throws Exception |
| 3102 | 3231 | */ |
| 3103 | 3232 | public static function from(stdClass $obj): Items { |
| 3233 | + if (!property_exists($obj, '$ref')) { | |
| 3234 | + throw new Exception("Missing required property"); | |
| 3235 | + } | |
| 3104 | 3236 | return new Items( |
| 3105 | 3237 | Items::fromRef($obj->{'$ref'}) |
| 3106 | 3238 | ); |
Test case
1 generated file · +15 −0test/inputs/json/misc/f974d.json
Mphpdefault / TopLevel.php+15 −0
| @@ -306,6 +306,21 @@ class TopLevel { | ||
| 306 | 306 | * @throws Exception |
| 307 | 307 | */ |
| 308 | 308 | public static function from(stdClass $obj): TopLevel { |
| 309 | + if (!property_exists($obj, 'block_index')) { | |
| 310 | + throw new Exception("Missing required property"); | |
| 311 | + } | |
| 312 | + if (!property_exists($obj, 'hash')) { | |
| 313 | + throw new Exception("Missing required property"); | |
| 314 | + } | |
| 315 | + if (!property_exists($obj, 'height')) { | |
| 316 | + throw new Exception("Missing required property"); | |
| 317 | + } | |
| 318 | + if (!property_exists($obj, 'time')) { | |
| 319 | + throw new Exception("Missing required property"); | |
| 320 | + } | |
| 321 | + if (!property_exists($obj, 'txIndexes')) { | |
| 322 | + throw new Exception("Missing required property"); | |
| 323 | + } | |
| 309 | 324 | return new TopLevel( |
| 310 | 325 | TopLevel::fromBlockIndex($obj->{'block_index'}) |
| 311 | 326 | ,TopLevel::fromHash($obj->{'hash'}) |
Test case
1 generated file · +9 −0test/inputs/json/misc/faff5.json
Mphpdefault / TopLevel.php+9 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'response')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromResponse($obj->{'response'}) |
| 90 | 93 | ); |
| @@ -235,6 +238,12 @@ class Response { | ||
| 235 | 238 | * @throws Exception |
| 236 | 239 | */ |
| 237 | 240 | public static function from(stdClass $obj): Response { |
| 241 | + if (!property_exists($obj, 'player_count')) { | |
| 242 | + throw new Exception("Missing required property"); | |
| 243 | + } | |
| 244 | + if (!property_exists($obj, 'result')) { | |
| 245 | + throw new Exception("Missing required property"); | |
| 246 | + } | |
| 238 | 247 | return new Response( |
| 239 | 248 | Response::fromPlayerCount($obj->{'player_count'}) |
| 240 | 249 | ,Response::fromResult($obj->{'result'}) |
Test case
1 generated file · +348 −0test/inputs/json/misc/fcca3.json
Mphpdefault / TopLevel.php+348 −0
| @@ -190,6 +190,12 @@ class TopLevel { | ||
| 190 | 190 | * @throws Exception |
| 191 | 191 | */ |
| 192 | 192 | public static function from(stdClass $obj): TopLevel { |
| 193 | + if (!property_exists($obj, 'data')) { | |
| 194 | + throw new Exception("Missing required property"); | |
| 195 | + } | |
| 196 | + if (!property_exists($obj, 'meta')) { | |
| 197 | + throw new Exception("Missing required property"); | |
| 198 | + } | |
| 193 | 199 | return new TopLevel( |
| 194 | 200 | TopLevel::fromData($obj->{'data'}) |
| 195 | 201 | ,TopLevel::fromMeta($obj->{'meta'}) |
| @@ -291,6 +297,9 @@ class Meta { | ||
| 291 | 297 | * @throws Exception |
| 292 | 298 | */ |
| 293 | 299 | public static function from(stdClass $obj): Meta { |
| 300 | + if (!property_exists($obj, 'view')) { | |
| 301 | + throw new Exception("Missing required property"); | |
| 302 | + } | |
| 294 | 303 | return new Meta( |
| 295 | 304 | Meta::fromView($obj->{'view'}) |
| 296 | 305 | ); |
| @@ -2331,6 +2340,117 @@ class View { | ||
| 2331 | 2340 | * @throws Exception |
| 2332 | 2341 | */ |
| 2333 | 2342 | public static function from(stdClass $obj): View { |
| 2343 | + if (!property_exists($obj, 'attribution')) { | |
| 2344 | + throw new Exception("Missing required property"); | |
| 2345 | + } | |
| 2346 | + if (!property_exists($obj, 'averageRating')) { | |
| 2347 | + throw new Exception("Missing required property"); | |
| 2348 | + } | |
| 2349 | + if (!property_exists($obj, 'category')) { | |
| 2350 | + throw new Exception("Missing required property"); | |
| 2351 | + } | |
| 2352 | + if (!property_exists($obj, 'columns')) { | |
| 2353 | + throw new Exception("Missing required property"); | |
| 2354 | + } | |
| 2355 | + if (!property_exists($obj, 'createdAt')) { | |
| 2356 | + throw new Exception("Missing required property"); | |
| 2357 | + } | |
| 2358 | + if (!property_exists($obj, 'description')) { | |
| 2359 | + throw new Exception("Missing required property"); | |
| 2360 | + } | |
| 2361 | + if (!property_exists($obj, 'displayType')) { | |
| 2362 | + throw new Exception("Missing required property"); | |
| 2363 | + } | |
| 2364 | + if (!property_exists($obj, 'downloadCount')) { | |
| 2365 | + throw new Exception("Missing required property"); | |
| 2366 | + } | |
| 2367 | + if (!property_exists($obj, 'flags')) { | |
| 2368 | + throw new Exception("Missing required property"); | |
| 2369 | + } | |
| 2370 | + if (!property_exists($obj, 'grants')) { | |
| 2371 | + throw new Exception("Missing required property"); | |
| 2372 | + } | |
| 2373 | + if (!property_exists($obj, 'hideFromCatalog')) { | |
| 2374 | + throw new Exception("Missing required property"); | |
| 2375 | + } | |
| 2376 | + if (!property_exists($obj, 'hideFromDataJson')) { | |
| 2377 | + throw new Exception("Missing required property"); | |
| 2378 | + } | |
| 2379 | + if (!property_exists($obj, 'id')) { | |
| 2380 | + throw new Exception("Missing required property"); | |
| 2381 | + } | |
| 2382 | + if (!property_exists($obj, 'indexUpdatedAt')) { | |
| 2383 | + throw new Exception("Missing required property"); | |
| 2384 | + } | |
| 2385 | + if (!property_exists($obj, 'locale')) { | |
| 2386 | + throw new Exception("Missing required property"); | |
| 2387 | + } | |
| 2388 | + if (!property_exists($obj, 'metadata')) { | |
| 2389 | + throw new Exception("Missing required property"); | |
| 2390 | + } | |
| 2391 | + if (!property_exists($obj, 'name')) { | |
| 2392 | + throw new Exception("Missing required property"); | |
| 2393 | + } | |
| 2394 | + if (!property_exists($obj, 'newBackend')) { | |
| 2395 | + throw new Exception("Missing required property"); | |
| 2396 | + } | |
| 2397 | + if (!property_exists($obj, 'numberOfComments')) { | |
| 2398 | + throw new Exception("Missing required property"); | |
| 2399 | + } | |
| 2400 | + if (!property_exists($obj, 'oid')) { | |
| 2401 | + throw new Exception("Missing required property"); | |
| 2402 | + } | |
| 2403 | + if (!property_exists($obj, 'owner')) { | |
| 2404 | + throw new Exception("Missing required property"); | |
| 2405 | + } | |
| 2406 | + if (!property_exists($obj, 'provenance')) { | |
| 2407 | + throw new Exception("Missing required property"); | |
| 2408 | + } | |
| 2409 | + if (!property_exists($obj, 'publicationAppendEnabled')) { | |
| 2410 | + throw new Exception("Missing required property"); | |
| 2411 | + } | |
| 2412 | + if (!property_exists($obj, 'publicationDate')) { | |
| 2413 | + throw new Exception("Missing required property"); | |
| 2414 | + } | |
| 2415 | + if (!property_exists($obj, 'publicationGroup')) { | |
| 2416 | + throw new Exception("Missing required property"); | |
| 2417 | + } | |
| 2418 | + if (!property_exists($obj, 'publicationStage')) { | |
| 2419 | + throw new Exception("Missing required property"); | |
| 2420 | + } | |
| 2421 | + if (!property_exists($obj, 'query')) { | |
| 2422 | + throw new Exception("Missing required property"); | |
| 2423 | + } | |
| 2424 | + if (!property_exists($obj, 'rights')) { | |
| 2425 | + throw new Exception("Missing required property"); | |
| 2426 | + } | |
| 2427 | + if (!property_exists($obj, 'rowsUpdatedAt')) { | |
| 2428 | + throw new Exception("Missing required property"); | |
| 2429 | + } | |
| 2430 | + if (!property_exists($obj, 'rowsUpdatedBy')) { | |
| 2431 | + throw new Exception("Missing required property"); | |
| 2432 | + } | |
| 2433 | + if (!property_exists($obj, 'tableAuthor')) { | |
| 2434 | + throw new Exception("Missing required property"); | |
| 2435 | + } | |
| 2436 | + if (!property_exists($obj, 'tableId')) { | |
| 2437 | + throw new Exception("Missing required property"); | |
| 2438 | + } | |
| 2439 | + if (!property_exists($obj, 'tags')) { | |
| 2440 | + throw new Exception("Missing required property"); | |
| 2441 | + } | |
| 2442 | + if (!property_exists($obj, 'totalTimesRated')) { | |
| 2443 | + throw new Exception("Missing required property"); | |
| 2444 | + } | |
| 2445 | + if (!property_exists($obj, 'viewCount')) { | |
| 2446 | + throw new Exception("Missing required property"); | |
| 2447 | + } | |
| 2448 | + if (!property_exists($obj, 'viewLastModified')) { | |
| 2449 | + throw new Exception("Missing required property"); | |
| 2450 | + } | |
| 2451 | + if (!property_exists($obj, 'viewType')) { | |
| 2452 | + throw new Exception("Missing required property"); | |
| 2453 | + } | |
| 2334 | 2454 | return new View( |
| 2335 | 2455 | View::fromAttribution($obj->{'attribution'}) |
| 2336 | 2456 | ,View::fromAverageRating($obj->{'averageRating'}) |
| @@ -3141,6 +3261,27 @@ class Column { | ||
| 3141 | 3261 | * @throws Exception |
| 3142 | 3262 | */ |
| 3143 | 3263 | public static function from(stdClass $obj): Column { |
| 3264 | + if (!property_exists($obj, 'dataTypeName')) { | |
| 3265 | + throw new Exception("Missing required property"); | |
| 3266 | + } | |
| 3267 | + if (!property_exists($obj, 'fieldName')) { | |
| 3268 | + throw new Exception("Missing required property"); | |
| 3269 | + } | |
| 3270 | + if (!property_exists($obj, 'format')) { | |
| 3271 | + throw new Exception("Missing required property"); | |
| 3272 | + } | |
| 3273 | + if (!property_exists($obj, 'id')) { | |
| 3274 | + throw new Exception("Missing required property"); | |
| 3275 | + } | |
| 3276 | + if (!property_exists($obj, 'name')) { | |
| 3277 | + throw new Exception("Missing required property"); | |
| 3278 | + } | |
| 3279 | + if (!property_exists($obj, 'position')) { | |
| 3280 | + throw new Exception("Missing required property"); | |
| 3281 | + } | |
| 3282 | + if (!property_exists($obj, 'renderTypeName')) { | |
| 3283 | + throw new Exception("Missing required property"); | |
| 3284 | + } | |
| 3144 | 3285 | return new Column( |
| 3145 | 3286 | Column::fromCachedContents($obj->{'cachedContents'}) |
| 3146 | 3287 | ,Column::fromDataTypeName($obj->{'dataTypeName'}) |
| @@ -3605,6 +3746,21 @@ class CachedContents { | ||
| 3605 | 3746 | * @throws Exception |
| 3606 | 3747 | */ |
| 3607 | 3748 | public static function from(stdClass $obj): CachedContents { |
| 3749 | + if (!property_exists($obj, 'largest')) { | |
| 3750 | + throw new Exception("Missing required property"); | |
| 3751 | + } | |
| 3752 | + if (!property_exists($obj, 'non_null')) { | |
| 3753 | + throw new Exception("Missing required property"); | |
| 3754 | + } | |
| 3755 | + if (!property_exists($obj, 'null')) { | |
| 3756 | + throw new Exception("Missing required property"); | |
| 3757 | + } | |
| 3758 | + if (!property_exists($obj, 'smallest')) { | |
| 3759 | + throw new Exception("Missing required property"); | |
| 3760 | + } | |
| 3761 | + if (!property_exists($obj, 'top')) { | |
| 3762 | + throw new Exception("Missing required property"); | |
| 3763 | + } | |
| 3608 | 3764 | return new CachedContents( |
| 3609 | 3765 | CachedContents::fromAverage($obj->{'average'}) |
| 3610 | 3766 | ,CachedContents::fromLargest($obj->{'largest'}) |
| @@ -3767,6 +3923,12 @@ class Top { | ||
| 3767 | 3923 | * @throws Exception |
| 3768 | 3924 | */ |
| 3769 | 3925 | public static function from(stdClass $obj): Top { |
| 3926 | + if (!property_exists($obj, 'count')) { | |
| 3927 | + throw new Exception("Missing required property"); | |
| 3928 | + } | |
| 3929 | + if (!property_exists($obj, 'item')) { | |
| 3930 | + throw new Exception("Missing required property"); | |
| 3931 | + } | |
| 3770 | 3932 | return new Top( |
| 3771 | 3933 | Top::fromCount($obj->{'count'}) |
| 3772 | 3934 | ,Top::fromItem($obj->{'item'}) |
| @@ -4274,6 +4436,15 @@ class Grant { | ||
| 4274 | 4436 | * @throws Exception |
| 4275 | 4437 | */ |
| 4276 | 4438 | public static function from(stdClass $obj): Grant { |
| 4439 | + if (!property_exists($obj, 'flags')) { | |
| 4440 | + throw new Exception("Missing required property"); | |
| 4441 | + } | |
| 4442 | + if (!property_exists($obj, 'inherited')) { | |
| 4443 | + throw new Exception("Missing required property"); | |
| 4444 | + } | |
| 4445 | + if (!property_exists($obj, 'type')) { | |
| 4446 | + throw new Exception("Missing required property"); | |
| 4447 | + } | |
| 4277 | 4448 | return new Grant( |
| 4278 | 4449 | Grant::fromFlags($obj->{'flags'}) |
| 4279 | 4450 | ,Grant::fromInherited($obj->{'inherited'}) |
| @@ -4770,6 +4941,30 @@ class ViewMetadata { | ||
| 4770 | 4941 | * @throws Exception |
| 4771 | 4942 | */ |
| 4772 | 4943 | public static function from(stdClass $obj): ViewMetadata { |
| 4944 | + if (!property_exists($obj, 'attachments')) { | |
| 4945 | + throw new Exception("Missing required property"); | |
| 4946 | + } | |
| 4947 | + if (!property_exists($obj, 'availableDisplayTypes')) { | |
| 4948 | + throw new Exception("Missing required property"); | |
| 4949 | + } | |
| 4950 | + if (!property_exists($obj, 'custom_fields')) { | |
| 4951 | + throw new Exception("Missing required property"); | |
| 4952 | + } | |
| 4953 | + if (!property_exists($obj, 'filterCondition')) { | |
| 4954 | + throw new Exception("Missing required property"); | |
| 4955 | + } | |
| 4956 | + if (!property_exists($obj, 'jsonQuery')) { | |
| 4957 | + throw new Exception("Missing required property"); | |
| 4958 | + } | |
| 4959 | + if (!property_exists($obj, 'rdfSubject')) { | |
| 4960 | + throw new Exception("Missing required property"); | |
| 4961 | + } | |
| 4962 | + if (!property_exists($obj, 'renderTypeConfig')) { | |
| 4963 | + throw new Exception("Missing required property"); | |
| 4964 | + } | |
| 4965 | + if (!property_exists($obj, 'rowLabel')) { | |
| 4966 | + throw new Exception("Missing required property"); | |
| 4967 | + } | |
| 4773 | 4968 | return new ViewMetadata( |
| 4774 | 4969 | ViewMetadata::fromAttachments($obj->{'attachments'}) |
| 4775 | 4970 | ,ViewMetadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'}) |
| @@ -5038,6 +5233,18 @@ class Attachment { | ||
| 5038 | 5233 | * @throws Exception |
| 5039 | 5234 | */ |
| 5040 | 5235 | public static function from(stdClass $obj): Attachment { |
| 5236 | + if (!property_exists($obj, 'assetId')) { | |
| 5237 | + throw new Exception("Missing required property"); | |
| 5238 | + } | |
| 5239 | + if (!property_exists($obj, 'blobId')) { | |
| 5240 | + throw new Exception("Missing required property"); | |
| 5241 | + } | |
| 5242 | + if (!property_exists($obj, 'filename')) { | |
| 5243 | + throw new Exception("Missing required property"); | |
| 5244 | + } | |
| 5245 | + if (!property_exists($obj, 'name')) { | |
| 5246 | + throw new Exception("Missing required property"); | |
| 5247 | + } | |
| 5041 | 5248 | return new Attachment( |
| 5042 | 5249 | Attachment::fromAssetID($obj->{'assetId'}) |
| 5043 | 5250 | ,Attachment::fromBlobID($obj->{'blobId'}) |
| @@ -5302,6 +5509,18 @@ class CustomFields { | ||
| 5302 | 5509 | * @throws Exception |
| 5303 | 5510 | */ |
| 5304 | 5511 | public static function from(stdClass $obj): CustomFields { |
| 5512 | + if (!property_exists($obj, 'Common Core')) { | |
| 5513 | + throw new Exception("Missing required property"); | |
| 5514 | + } | |
| 5515 | + if (!property_exists($obj, 'Dataset Information')) { | |
| 5516 | + throw new Exception("Missing required property"); | |
| 5517 | + } | |
| 5518 | + if (!property_exists($obj, 'Dataset Summary')) { | |
| 5519 | + throw new Exception("Missing required property"); | |
| 5520 | + } | |
| 5521 | + if (!property_exists($obj, 'Disclaimers')) { | |
| 5522 | + throw new Exception("Missing required property"); | |
| 5523 | + } | |
| 5305 | 5524 | return new CustomFields( |
| 5306 | 5525 | CustomFields::fromCommonCore($obj->{'Common Core'}) |
| 5307 | 5526 | ,CustomFields::fromDatasetInformation($obj->{'Dataset Information'}) |
| @@ -5510,6 +5729,15 @@ class CommonCore { | ||
| 5510 | 5729 | * @throws Exception |
| 5511 | 5730 | */ |
| 5512 | 5731 | public static function from(stdClass $obj): CommonCore { |
| 5732 | + if (!property_exists($obj, 'Contact Email')) { | |
| 5733 | + throw new Exception("Missing required property"); | |
| 5734 | + } | |
| 5735 | + if (!property_exists($obj, 'Contact Name')) { | |
| 5736 | + throw new Exception("Missing required property"); | |
| 5737 | + } | |
| 5738 | + if (!property_exists($obj, 'Publisher')) { | |
| 5739 | + throw new Exception("Missing required property"); | |
| 5740 | + } | |
| 5513 | 5741 | return new CommonCore( |
| 5514 | 5742 | CommonCore::fromContactEmail($obj->{'Contact Email'}) |
| 5515 | 5743 | ,CommonCore::fromContactName($obj->{'Contact Name'}) |
| @@ -5612,6 +5840,9 @@ class DatasetInformation { | ||
| 5612 | 5840 | * @throws Exception |
| 5613 | 5841 | */ |
| 5614 | 5842 | public static function from(stdClass $obj): DatasetInformation { |
| 5843 | + if (!property_exists($obj, 'Agency')) { | |
| 5844 | + throw new Exception("Missing required property"); | |
| 5845 | + } | |
| 5615 | 5846 | return new DatasetInformation( |
| 5616 | 5847 | DatasetInformation::fromAgency($obj->{'Agency'}) |
| 5617 | 5848 | ); |
| @@ -5970,6 +6201,24 @@ class DatasetSummary { | ||
| 5970 | 6201 | * @throws Exception |
| 5971 | 6202 | */ |
| 5972 | 6203 | public static function from(stdClass $obj): DatasetSummary { |
| 6204 | + if (!property_exists($obj, 'Contact Information')) { | |
| 6205 | + throw new Exception("Missing required property"); | |
| 6206 | + } | |
| 6207 | + if (!property_exists($obj, 'Coverage')) { | |
| 6208 | + throw new Exception("Missing required property"); | |
| 6209 | + } | |
| 6210 | + if (!property_exists($obj, 'Granularity')) { | |
| 6211 | + throw new Exception("Missing required property"); | |
| 6212 | + } | |
| 6213 | + if (!property_exists($obj, 'Organization')) { | |
| 6214 | + throw new Exception("Missing required property"); | |
| 6215 | + } | |
| 6216 | + if (!property_exists($obj, 'Posting Frequency')) { | |
| 6217 | + throw new Exception("Missing required property"); | |
| 6218 | + } | |
| 6219 | + if (!property_exists($obj, 'Time Period')) { | |
| 6220 | + throw new Exception("Missing required property"); | |
| 6221 | + } | |
| 5973 | 6222 | return new DatasetSummary( |
| 5974 | 6223 | DatasetSummary::fromContactInformation($obj->{'Contact Information'}) |
| 5975 | 6224 | ,DatasetSummary::fromCoverage($obj->{'Coverage'}) |
| @@ -6130,6 +6379,12 @@ class Disclaimers { | ||
| 6130 | 6379 | * @throws Exception |
| 6131 | 6380 | */ |
| 6132 | 6381 | public static function from(stdClass $obj): Disclaimers { |
| 6382 | + if (!property_exists($obj, 'Disclaimer')) { | |
| 6383 | + throw new Exception("Missing required property"); | |
| 6384 | + } | |
| 6385 | + if (!property_exists($obj, 'Limitations')) { | |
| 6386 | + throw new Exception("Missing required property"); | |
| 6387 | + } | |
| 6133 | 6388 | return new Disclaimers( |
| 6134 | 6389 | Disclaimers::fromDisclaimer($obj->{'Disclaimer'}) |
| 6135 | 6390 | ,Disclaimers::fromLimitations($obj->{'Limitations'}) |
| @@ -6399,6 +6654,18 @@ class FilterCondition { | ||
| 6399 | 6654 | * @throws Exception |
| 6400 | 6655 | */ |
| 6401 | 6656 | public static function from(stdClass $obj): FilterCondition { |
| 6657 | + if (!property_exists($obj, 'children')) { | |
| 6658 | + throw new Exception("Missing required property"); | |
| 6659 | + } | |
| 6660 | + if (!property_exists($obj, 'metadata')) { | |
| 6661 | + throw new Exception("Missing required property"); | |
| 6662 | + } | |
| 6663 | + if (!property_exists($obj, 'type')) { | |
| 6664 | + throw new Exception("Missing required property"); | |
| 6665 | + } | |
| 6666 | + if (!property_exists($obj, 'value')) { | |
| 6667 | + throw new Exception("Missing required property"); | |
| 6668 | + } | |
| 6402 | 6669 | return new FilterCondition( |
| 6403 | 6670 | FilterCondition::fromChildren($obj->{'children'}) |
| 6404 | 6671 | ,FilterCondition::fromMetadata($obj->{'metadata'}) |
| @@ -6608,6 +6875,15 @@ class Child { | ||
| 6608 | 6875 | * @throws Exception |
| 6609 | 6876 | */ |
| 6610 | 6877 | public static function from(stdClass $obj): Child { |
| 6878 | + if (!property_exists($obj, 'metadata')) { | |
| 6879 | + throw new Exception("Missing required property"); | |
| 6880 | + } | |
| 6881 | + if (!property_exists($obj, 'type')) { | |
| 6882 | + throw new Exception("Missing required property"); | |
| 6883 | + } | |
| 6884 | + if (!property_exists($obj, 'value')) { | |
| 6885 | + throw new Exception("Missing required property"); | |
| 6886 | + } | |
| 6611 | 6887 | return new Child( |
| 6612 | 6888 | Child::fromMetadata($obj->{'metadata'}) |
| 6613 | 6889 | ,Child::fromType($obj->{'type'}) |
| @@ -6840,6 +7116,15 @@ class ChildMetadata { | ||
| 6840 | 7116 | * @throws Exception |
| 6841 | 7117 | */ |
| 6842 | 7118 | public static function from(stdClass $obj): ChildMetadata { |
| 7119 | + if (!property_exists($obj, 'customValues')) { | |
| 7120 | + throw new Exception("Missing required property"); | |
| 7121 | + } | |
| 7122 | + if (!property_exists($obj, 'operator')) { | |
| 7123 | + throw new Exception("Missing required property"); | |
| 7124 | + } | |
| 7125 | + if (!property_exists($obj, 'tableColumnId')) { | |
| 7126 | + throw new Exception("Missing required property"); | |
| 7127 | + } | |
| 6843 | 7128 | return new ChildMetadata( |
| 6844 | 7129 | ChildMetadata::fromCustomValues($obj->{'customValues'}) |
| 6845 | 7130 | ,ChildMetadata::fromOperator($obj->{'operator'}) |
| @@ -6942,6 +7227,9 @@ class TableColumnID { | ||
| 6942 | 7227 | * @throws Exception |
| 6943 | 7228 | */ |
| 6944 | 7229 | public static function from(stdClass $obj): TableColumnID { |
| 7230 | + if (!property_exists($obj, '703610')) { | |
| 7231 | + throw new Exception("Missing required property"); | |
| 7232 | + } | |
| 6945 | 7233 | return new TableColumnID( |
| 6946 | 7234 | TableColumnID::fromThe703610($obj->{'703610'}) |
| 6947 | 7235 | ); |
| @@ -7092,6 +7380,12 @@ class FilterConditionMetadata { | ||
| 7092 | 7380 | * @throws Exception |
| 7093 | 7381 | */ |
| 7094 | 7382 | public static function from(stdClass $obj): FilterConditionMetadata { |
| 7383 | + if (!property_exists($obj, 'advanced')) { | |
| 7384 | + throw new Exception("Missing required property"); | |
| 7385 | + } | |
| 7386 | + if (!property_exists($obj, 'unifiedVersion')) { | |
| 7387 | + throw new Exception("Missing required property"); | |
| 7388 | + } | |
| 7095 | 7389 | return new FilterConditionMetadata( |
| 7096 | 7390 | FilterConditionMetadata::fromAdvanced($obj->{'advanced'}) |
| 7097 | 7391 | ,FilterConditionMetadata::fromUnifiedVersion($obj->{'unifiedVersion'}) |
| @@ -7204,6 +7498,9 @@ class JSONQuery { | ||
| 7204 | 7498 | * @throws Exception |
| 7205 | 7499 | */ |
| 7206 | 7500 | public static function from(stdClass $obj): JSONQuery { |
| 7501 | + if (!property_exists($obj, 'order')) { | |
| 7502 | + throw new Exception("Missing required property"); | |
| 7503 | + } | |
| 7207 | 7504 | return new JSONQuery( |
| 7208 | 7505 | JSONQuery::fromOrder($obj->{'order'}) |
| 7209 | 7506 | ); |
| @@ -7354,6 +7651,12 @@ class Order { | ||
| 7354 | 7651 | * @throws Exception |
| 7355 | 7652 | */ |
| 7356 | 7653 | public static function from(stdClass $obj): Order { |
| 7654 | + if (!property_exists($obj, 'ascending')) { | |
| 7655 | + throw new Exception("Missing required property"); | |
| 7656 | + } | |
| 7657 | + if (!property_exists($obj, 'columnFieldName')) { | |
| 7658 | + throw new Exception("Missing required property"); | |
| 7659 | + } | |
| 7357 | 7660 | return new Order( |
| 7358 | 7661 | Order::fromAscending($obj->{'ascending'}) |
| 7359 | 7662 | ,Order::fromColumnFieldName($obj->{'columnFieldName'}) |
| @@ -7455,6 +7758,9 @@ class RenderTypeConfig { | ||
| 7455 | 7758 | * @throws Exception |
| 7456 | 7759 | */ |
| 7457 | 7760 | public static function from(stdClass $obj): RenderTypeConfig { |
| 7761 | + if (!property_exists($obj, 'visible')) { | |
| 7762 | + throw new Exception("Missing required property"); | |
| 7763 | + } | |
| 7458 | 7764 | return new RenderTypeConfig( |
| 7459 | 7765 | RenderTypeConfig::fromVisible($obj->{'visible'}) |
| 7460 | 7766 | ); |
| @@ -7553,6 +7859,9 @@ class Visible { | ||
| 7553 | 7859 | * @throws Exception |
| 7554 | 7860 | */ |
| 7555 | 7861 | public static function from(stdClass $obj): Visible { |
| 7862 | + if (!property_exists($obj, 'table')) { | |
| 7863 | + throw new Exception("Missing required property"); | |
| 7864 | + } | |
| 7556 | 7865 | return new Visible( |
| 7557 | 7866 | Visible::fromTable($obj->{'table'}) |
| 7558 | 7867 | ); |
| @@ -8029,6 +8338,30 @@ class Owner { | ||
| 8029 | 8338 | * @throws Exception |
| 8030 | 8339 | */ |
| 8031 | 8340 | public static function from(stdClass $obj): Owner { |
| 8341 | + if (!property_exists($obj, 'displayName')) { | |
| 8342 | + throw new Exception("Missing required property"); | |
| 8343 | + } | |
| 8344 | + if (!property_exists($obj, 'id')) { | |
| 8345 | + throw new Exception("Missing required property"); | |
| 8346 | + } | |
| 8347 | + if (!property_exists($obj, 'profileImageUrlLarge')) { | |
| 8348 | + throw new Exception("Missing required property"); | |
| 8349 | + } | |
| 8350 | + if (!property_exists($obj, 'profileImageUrlMedium')) { | |
| 8351 | + throw new Exception("Missing required property"); | |
| 8352 | + } | |
| 8353 | + if (!property_exists($obj, 'profileImageUrlSmall')) { | |
| 8354 | + throw new Exception("Missing required property"); | |
| 8355 | + } | |
| 8356 | + if (!property_exists($obj, 'rights')) { | |
| 8357 | + throw new Exception("Missing required property"); | |
| 8358 | + } | |
| 8359 | + if (!property_exists($obj, 'roleName')) { | |
| 8360 | + throw new Exception("Missing required property"); | |
| 8361 | + } | |
| 8362 | + if (!property_exists($obj, 'screenName')) { | |
| 8363 | + throw new Exception("Missing required property"); | |
| 8364 | + } | |
| 8032 | 8365 | return new Owner( |
| 8033 | 8366 | Owner::fromDisplayName($obj->{'displayName'}) |
| 8034 | 8367 | ,Owner::fromID($obj->{'id'}) |
| @@ -8153,6 +8486,9 @@ class Query { | ||
| 8153 | 8486 | * @throws Exception |
| 8154 | 8487 | */ |
| 8155 | 8488 | public static function from(stdClass $obj): Query { |
| 8489 | + if (!property_exists($obj, 'orderBys')) { | |
| 8490 | + throw new Exception("Missing required property"); | |
| 8491 | + } | |
| 8156 | 8492 | return new Query( |
| 8157 | 8493 | Query::fromOrderBys($obj->{'orderBys'}) |
| 8158 | 8494 | ); |
| @@ -8304,6 +8640,12 @@ class OrderBy { | ||
| 8304 | 8640 | * @throws Exception |
| 8305 | 8641 | */ |
| 8306 | 8642 | public static function from(stdClass $obj): OrderBy { |
| 8643 | + if (!property_exists($obj, 'ascending')) { | |
| 8644 | + throw new Exception("Missing required property"); | |
| 8645 | + } | |
| 8646 | + if (!property_exists($obj, 'expression')) { | |
| 8647 | + throw new Exception("Missing required property"); | |
| 8648 | + } | |
| 8307 | 8649 | return new OrderBy( |
| 8308 | 8650 | OrderBy::fromAscending($obj->{'ascending'}) |
| 8309 | 8651 | ,OrderBy::fromExpression($obj->{'expression'}) |
| @@ -8456,6 +8798,12 @@ class Expression { | ||
| 8456 | 8798 | * @throws Exception |
| 8457 | 8799 | */ |
| 8458 | 8800 | public static function from(stdClass $obj): Expression { |
| 8801 | + if (!property_exists($obj, 'columnId')) { | |
| 8802 | + throw new Exception("Missing required property"); | |
| 8803 | + } | |
| 8804 | + if (!property_exists($obj, 'type')) { | |
| 8805 | + throw new Exception("Missing required property"); | |
| 8806 | + } | |
| 8459 | 8807 | return new Expression( |
| 8460 | 8808 | Expression::fromColumnID($obj->{'columnId'}) |
| 8461 | 8809 | ,Expression::fromType($obj->{'type'}) |
Test case
1 generated file · +24 −0test/inputs/json/misc/fd329.json
Mphpdefault / TopLevel.php+24 −0
| @@ -152,6 +152,12 @@ class TopLevel { | ||
| 152 | 152 | * @throws Exception |
| 153 | 153 | */ |
| 154 | 154 | public static function from(stdClass $obj): TopLevel { |
| 155 | + if (!property_exists($obj, 'data')) { | |
| 156 | + throw new Exception("Missing required property"); | |
| 157 | + } | |
| 158 | + if (!property_exists($obj, 'description')) { | |
| 159 | + throw new Exception("Missing required property"); | |
| 160 | + } | |
| 155 | 161 | return new TopLevel( |
| 156 | 162 | TopLevel::fromData($obj->{'data'}) |
| 157 | 163 | ,TopLevel::fromDescription($obj->{'description'}) |
| @@ -304,6 +310,12 @@ class Datum { | ||
| 304 | 310 | * @throws Exception |
| 305 | 311 | */ |
| 306 | 312 | public static function from(stdClass $obj): Datum { |
| 313 | + if (!property_exists($obj, 'anomaly')) { | |
| 314 | + throw new Exception("Missing required property"); | |
| 315 | + } | |
| 316 | + if (!property_exists($obj, 'value')) { | |
| 317 | + throw new Exception("Missing required property"); | |
| 318 | + } | |
| 307 | 319 | return new Datum( |
| 308 | 320 | Datum::fromAnomaly($obj->{'anomaly'}) |
| 309 | 321 | ,Datum::fromValue($obj->{'value'}) |
| @@ -560,6 +572,18 @@ class Description { | ||
| 560 | 572 | * @throws Exception |
| 561 | 573 | */ |
| 562 | 574 | public static function from(stdClass $obj): Description { |
| 575 | + if (!property_exists($obj, 'base_period')) { | |
| 576 | + throw new Exception("Missing required property"); | |
| 577 | + } | |
| 578 | + if (!property_exists($obj, 'missing')) { | |
| 579 | + throw new Exception("Missing required property"); | |
| 580 | + } | |
| 581 | + if (!property_exists($obj, 'title')) { | |
| 582 | + throw new Exception("Missing required property"); | |
| 583 | + } | |
| 584 | + if (!property_exists($obj, 'units')) { | |
| 585 | + throw new Exception("Missing required property"); | |
| 586 | + } | |
| 563 | 587 | return new Description( |
| 564 | 588 | Description::fromBasePeriod($obj->{'base_period'}) |
| 565 | 589 | ,Description::fromMissing($obj->{'missing'}) |
Test case
1 generated file · +1,784 −23test/inputs/json/priority/blns-object.json
Mphpdefault / TopLevel.php+1,784 −23
| @@ -191,6 +191,15 @@ class TopLevel { | ||
| 191 | 191 | * @throws Exception |
| 192 | 192 | */ |
| 193 | 193 | public static function from(stdClass $obj): TopLevel { |
| 194 | + if (!property_exists($obj, 'a')) { | |
| 195 | + throw new Exception("Missing required property"); | |
| 196 | + } | |
| 197 | + if (!property_exists($obj, 'b')) { | |
| 198 | + throw new Exception("Missing required property"); | |
| 199 | + } | |
| 200 | + if (!property_exists($obj, 'c')) { | |
| 201 | + throw new Exception("Missing required property"); | |
| 202 | + } | |
| 194 | 203 | return new TopLevel( |
| 195 | 204 | TopLevel::fromA($obj->{'a'}) |
| 196 | 205 | ,TopLevel::fromB($obj->{'b'}) |
| @@ -12201,6 +12210,696 @@ class A { | ||
| 12201 | 12210 | * @throws Exception |
| 12202 | 12211 | */ |
| 12203 | 12212 | public static function from(stdClass $obj): A { |
| 12213 | + if (!property_exists($obj, 'ثم نفس سقطت وبالتحديد،, جزيرتي باستخدام أن دنو. إذ هنا؟ الستار وتنصيب كان. أهّل ايطاليا، بريطانيا-فرنسا قد أخذ. سليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو.')) { | |
| 12214 | + throw new Exception("Missing required property"); | |
| 12215 | + } | |
| 12216 | + if (!property_exists($obj, '٠١٢٣٤٥٦٧٨٩')) { | |
| 12217 | + throw new Exception("Missing required property"); | |
| 12218 | + } | |
| 12219 | + if (!property_exists($obj, 'ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็ ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็')) { | |
| 12220 | + throw new Exception("Missing required property"); | |
| 12221 | + } | |
| 12222 | + if (!property_exists($obj, 'パーティーへ行かないか')) { | |
| 12223 | + throw new Exception("Missing required property"); | |
| 12224 | + } | |
| 12225 | + if (!property_exists($obj, '和製漢語')) { | |
| 12226 | + throw new Exception("Missing required property"); | |
| 12227 | + } | |
| 12228 | + if (!property_exists($obj, '田中さんにあげて下さい')) { | |
| 12229 | + throw new Exception("Missing required property"); | |
| 12230 | + } | |
| 12231 | + if (!property_exists($obj, '`ィ(´∀`∩')) { | |
| 12232 | + throw new Exception("Missing required property"); | |
| 12233 | + } | |
| 12234 | + if (!property_exists($obj, '!@#$%^&*()`~')) { | |
| 12235 | + throw new Exception("Missing required property"); | |
| 12236 | + } | |
| 12237 | + if (!property_exists($obj, '-0')) { | |
| 12238 | + throw new Exception("Missing required property"); | |
| 12239 | + } | |
| 12240 | + if (!property_exists($obj, '00˙Ɩ$-')) { | |
| 12241 | + throw new Exception("Missing required property"); | |
| 12242 | + } | |
| 12243 | + if (!property_exists($obj, '0,00')) { | |
| 12244 | + throw new Exception("Missing required property"); | |
| 12245 | + } | |
| 12246 | + if (!property_exists($obj, '0.0/0.0')) { | |
| 12247 | + throw new Exception("Missing required property"); | |
| 12248 | + } | |
| 12249 | + if (!property_exists($obj, '1')) { | |
| 12250 | + throw new Exception("Missing required property"); | |
| 12251 | + } | |
| 12252 | + if (!property_exists($obj, '1\'000\'000.00')) { | |
| 12253 | + throw new Exception("Missing required property"); | |
| 12254 | + } | |
| 12255 | + if (!property_exists($obj, '1E02')) { | |
| 12256 | + throw new Exception("Missing required property"); | |
| 12257 | + } | |
| 12258 | + if (!property_exists($obj, '\';alert(123);t=\'')) { | |
| 12259 | + throw new Exception("Missing required property"); | |
| 12260 | + } | |
| 12261 | + if (!property_exists($obj, 'false')) { | |
| 12262 | + throw new Exception("Missing required property"); | |
| 12263 | + } | |
| 12264 | + if (!property_exists($obj, '<a href=javascript:javascript:alert(1)>XXX</a>')) { | |
| 12265 | + throw new Exception("Missing required property"); | |
| 12266 | + } | |
| 12267 | + if (!property_exists($obj, '<a href="javascript\\x09:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12268 | + throw new Exception("Missing required property"); | |
| 12269 | + } | |
| 12270 | + if (!property_exists($obj, '<a href="javascript\\x0A:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12271 | + throw new Exception("Missing required property"); | |
| 12272 | + } | |
| 12273 | + if (!property_exists($obj, '<a href="javascript\\x3A:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12274 | + throw new Exception("Missing required property"); | |
| 12275 | + } | |
| 12276 | + if (!property_exists($obj, '<a href="\\x01javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12277 | + throw new Exception("Missing required property"); | |
| 12278 | + } | |
| 12279 | + if (!property_exists($obj, '<a href="\\x05javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12280 | + throw new Exception("Missing required property"); | |
| 12281 | + } | |
| 12282 | + if (!property_exists($obj, '<a href="\\x08javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12283 | + throw new Exception("Missing required property"); | |
| 12284 | + } | |
| 12285 | + if (!property_exists($obj, '<a href="\\x09javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12286 | + throw new Exception("Missing required property"); | |
| 12287 | + } | |
| 12288 | + if (!property_exists($obj, '<a href="\\x0Cjavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12289 | + throw new Exception("Missing required property"); | |
| 12290 | + } | |
| 12291 | + if (!property_exists($obj, '<a href="\\x10javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12292 | + throw new Exception("Missing required property"); | |
| 12293 | + } | |
| 12294 | + if (!property_exists($obj, '<a href="\\x11javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12295 | + throw new Exception("Missing required property"); | |
| 12296 | + } | |
| 12297 | + if (!property_exists($obj, '<a href="\\x13javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12298 | + throw new Exception("Missing required property"); | |
| 12299 | + } | |
| 12300 | + if (!property_exists($obj, '<a href="\\x17javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12301 | + throw new Exception("Missing required property"); | |
| 12302 | + } | |
| 12303 | + if (!property_exists($obj, '<a href="\\x1Fjavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12304 | + throw new Exception("Missing required property"); | |
| 12305 | + } | |
| 12306 | + if (!property_exists($obj, '<a href="\\xC2\\xA0javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12307 | + throw new Exception("Missing required property"); | |
| 12308 | + } | |
| 12309 | + if (!property_exists($obj, '<a href="\\xE1\\x9A\\x80javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12310 | + throw new Exception("Missing required property"); | |
| 12311 | + } | |
| 12312 | + if (!property_exists($obj, '<a href="\\xE1\\xA0\\x8Ejavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12313 | + throw new Exception("Missing required property"); | |
| 12314 | + } | |
| 12315 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\x83javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12316 | + throw new Exception("Missing required property"); | |
| 12317 | + } | |
| 12318 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\x84javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12319 | + throw new Exception("Missing required property"); | |
| 12320 | + } | |
| 12321 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\x86javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12322 | + throw new Exception("Missing required property"); | |
| 12323 | + } | |
| 12324 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\x87javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12325 | + throw new Exception("Missing required property"); | |
| 12326 | + } | |
| 12327 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\xA8javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 12328 | + throw new Exception("Missing required property"); | |
| 12329 | + } | |
| 12330 | + if (!property_exists($obj, 'test')) { | |
| 12331 | + throw new Exception("Missing required property"); | |
| 12332 | + } | |
| 12333 | + if (!property_exists($obj, 'True')) { | |
| 12334 | + throw new Exception("Missing required property"); | |
| 12335 | + } | |
| 12336 | + if (!property_exists($obj, 'ABC<div style="x:exp\\x00ression(javascript:alert(1)">DEF')) { | |
| 12337 | + throw new Exception("Missing required property"); | |
| 12338 | + } | |
| 12339 | + if (!property_exists($obj, 'ABC<div style="x:exp\\x5Cression(javascript:alert(1)">DEF')) { | |
| 12340 | + throw new Exception("Missing required property"); | |
| 12341 | + } | |
| 12342 | + if (!property_exists($obj, 'ABC<div style="x:\\x09expression(javascript:alert(1)">DEF')) { | |
| 12343 | + throw new Exception("Missing required property"); | |
| 12344 | + } | |
| 12345 | + if (!property_exists($obj, 'ABC<div style="x:\\x0Bexpression(javascript:alert(1)">DEF')) { | |
| 12346 | + throw new Exception("Missing required property"); | |
| 12347 | + } | |
| 12348 | + if (!property_exists($obj, 'ABC<div style="x:\\x20expression(javascript:alert(1)">DEF')) { | |
| 12349 | + throw new Exception("Missing required property"); | |
| 12350 | + } | |
| 12351 | + if (!property_exists($obj, 'ABC<div style="x\\x3Aexpression(javascript:alert(1)">DEF')) { | |
| 12352 | + throw new Exception("Missing required property"); | |
| 12353 | + } | |
| 12354 | + if (!property_exists($obj, 'ABC<div style="x:\\xC2\\xA0expression(javascript:alert(1)">DEF')) { | |
| 12355 | + throw new Exception("Missing required property"); | |
| 12356 | + } | |
| 12357 | + if (!property_exists($obj, 'ABC<div style="x:\\xE2\\x80\\x80expression(javascript:alert(1)">DEF')) { | |
| 12358 | + throw new Exception("Missing required property"); | |
| 12359 | + } | |
| 12360 | + if (!property_exists($obj, 'ABC<div style="x:\\xE2\\x80\\x84expression(javascript:alert(1)">DEF')) { | |
| 12361 | + throw new Exception("Missing required property"); | |
| 12362 | + } | |
| 12363 | + if (!property_exists($obj, 'ABC<div style="x:\\xE2\\x80\\x89expression(javascript:alert(1)">DEF')) { | |
| 12364 | + throw new Exception("Missing required property"); | |
| 12365 | + } | |
| 12366 | + if (!property_exists($obj, 'ABC<div style="x:\\xE2\\x80\\x8Bexpression(javascript:alert(1)">DEF')) { | |
| 12367 | + throw new Exception("Missing required property"); | |
| 12368 | + } | |
| 12369 | + if (!property_exists($obj, ';alert(123);')) { | |
| 12370 | + throw new Exception("Missing required property"); | |
| 12371 | + } | |
| 12372 | + if (!property_exists($obj, '";alert(123);t="')) { | |
| 12373 | + throw new Exception("Missing required property"); | |
| 12374 | + } | |
| 12375 | + if (!property_exists($obj, '\\";alert(\'XSS\');//')) { | |
| 12376 | + throw new Exception("Missing required property"); | |
| 12377 | + } | |
| 12378 | + if (!property_exists($obj, '-.')) { | |
| 12379 | + throw new Exception("Missing required property"); | |
| 12380 | + } | |
| 12381 | + if (!property_exists($obj, '# and U+200B (ZERO WIDTH SPACE), which are in the C categories but are often')) { | |
| 12382 | + throw new Exception("Missing required property"); | |
| 12383 | + } | |
| 12384 | + if (!property_exists($obj, 'Arsenal canal')) { | |
| 12385 | + throw new Exception("Missing required property"); | |
| 12386 | + } | |
| 12387 | + if (!property_exists($obj, '" autofocus onkeyup="javascript:alert(123)')) { | |
| 12388 | + throw new Exception("Missing required property"); | |
| 12389 | + } | |
| 12390 | + if (!property_exists($obj, 'AUX')) { | |
| 12391 | + throw new Exception("Missing required property"); | |
| 12392 | + } | |
| 12393 | + if (!property_exists($obj, '¡™£¢∞§¶•ªº–≠')) { | |
| 12394 | + throw new Exception("Missing required property"); | |
| 12395 | + } | |
| 12396 | + if (!property_exists($obj, '# Changing length when lowercased')) { | |
| 12397 | + throw new Exception("Missing required property"); | |
| 12398 | + } | |
| 12399 | + if (!property_exists($obj, '# Characters which increase in length (2 to 3 bytes) when lowercased')) { | |
| 12400 | + throw new Exception("Missing required property"); | |
| 12401 | + } | |
| 12402 | + if (!property_exists($obj, 'classic')) { | |
| 12403 | + throw new Exception("Missing required property"); | |
| 12404 | + } | |
| 12405 | + if (!property_exists($obj, '# Command Injection (Ruby)')) { | |
| 12406 | + throw new Exception("Missing required property"); | |
| 12407 | + } | |
| 12408 | + if (!property_exists($obj, '<>?:"{}|_+')) { | |
| 12409 | + throw new Exception("Missing required property"); | |
| 12410 | + } | |
| 12411 | + if (!property_exists($obj, '%d')) { | |
| 12412 | + throw new Exception("Missing required property"); | |
| 12413 | + } | |
| 12414 | + if (!property_exists($obj, 'Dick Van Dyke')) { | |
| 12415 | + throw new Exception("Missing required property"); | |
| 12416 | + } | |
| 12417 | + if (!property_exists($obj, 'dontMakeAMap')) { | |
| 12418 | + throw new Exception("Missing required property"); | |
| 12419 | + } | |
| 12420 | + if (!property_exists($obj, 'Dr. Herman I. Libshitz')) { | |
| 12421 | + throw new Exception("Missing required property"); | |
| 12422 | + } | |
| 12423 | + if (!property_exists($obj, ' ')) { | |
| 12424 | + throw new Exception("Missing required property"); | |
| 12425 | + } | |
| 12426 | + if (!property_exists($obj, '$ENV{\'HOME\'}')) { | |
| 12427 | + throw new Exception("Missing required property"); | |
| 12428 | + } | |
| 12429 | + if (!property_exists($obj, '../../../../../../../../../../../etc/hosts')) { | |
| 12430 | + throw new Exception("Missing required property"); | |
| 12431 | + } | |
| 12432 | + if (!property_exists($obj, '../../../../../../../../../../../etc/passwd%00')) { | |
| 12433 | + throw new Exception("Missing required property"); | |
| 12434 | + } | |
| 12435 | + if (!property_exists($obj, 'False')) { | |
| 12436 | + throw new Exception("Missing required property"); | |
| 12437 | + } | |
| 12438 | + if (!property_exists($obj, '\'"\'')) { | |
| 12439 | + throw new Exception("Missing required property"); | |
| 12440 | + } | |
| 12441 | + if (!property_exists($obj, '{0}')) { | |
| 12442 | + throw new Exception("Missing required property"); | |
| 12443 | + } | |
| 12444 | + if (!property_exists($obj, 'test')) { | |
| 12445 | + throw new Exception("Missing required property"); | |
| 12446 | + } | |
| 12447 | + if (!property_exists($obj, '# fonts, and have a number of special behaviors')) { | |
| 12448 | + throw new Exception("Missing required property"); | |
| 12449 | + } | |
| 12450 | + if (!property_exists($obj, '<foo val=`bar\' />')) { | |
| 12451 | + throw new Exception("Missing required property"); | |
| 12452 | + } | |
| 12453 | + if (!property_exists($obj, '`⁄€‹›fifl‡°·‚—±')) { | |
| 12454 | + throw new Exception("Missing required property"); | |
| 12455 | + } | |
| 12456 | + if (!property_exists($obj, '-,')) { | |
| 12457 | + throw new Exception("Missing required property"); | |
| 12458 | + } | |
| 12459 | + if (!property_exists($obj, '$HOME')) { | |
| 12460 | + throw new Exception("Missing required property"); | |
| 12461 | + } | |
| 12462 | + if (!property_exists($obj, '# Human injection')) { | |
| 12463 | + throw new Exception("Missing required property"); | |
| 12464 | + } | |
| 12465 | + if (!property_exists($obj, '̡͓̞ͅI̗̘̦͝n͇͇͙v̮̫ok̲̫̙͈i̖͙̭̹̠̞n̡̻̮̣̺g̲͈͙̭͙̬͎ ̰t͔̦h̞̲e̢̤ ͍̬̲͖f̴̘͕̣è͖ẹ̥̩l͖͔͚i͓͚̦͠n͖͍̗͓̳̮g͍ ̨o͚̪͡f̘̣̬ ̖̘͖̟͙̮c҉͔̫͖͓͇͖ͅh̵̤̣͚͔á̗̼͕ͅo̼̣̥s̱͈̺̖̦̻͢.̛̖̞̠̫̰')) { | |
| 12466 | + throw new Exception("Missing required property"); | |
| 12467 | + } | |
| 12468 | + if (!property_exists($obj, '<!--[if<img src=x onerror=javascript:alert(1)//]> -->')) { | |
| 12469 | + throw new Exception("Missing required property"); | |
| 12470 | + } | |
| 12471 | + if (!property_exists($obj, '<!--[if]><script>javascript:alert(1)</script -->')) { | |
| 12472 | + throw new Exception("Missing required property"); | |
| 12473 | + } | |
| 12474 | + if (!property_exists($obj, '<IMG SRC="jav ascript:alert(\'XSS\');">')) { | |
| 12475 | + throw new Exception("Missing required property"); | |
| 12476 | + } | |
| 12477 | + if (!property_exists($obj, '<IMG SRC="jav
ascript:alert(\'XSS\');">')) { | |
| 12478 | + throw new Exception("Missing required property"); | |
| 12479 | + } | |
| 12480 | + if (!property_exists($obj, '<IMG SRC="jav
ascript:alert(\'XSS\');">')) { | |
| 12481 | + throw new Exception("Missing required property"); | |
| 12482 | + } | |
| 12483 | + if (!property_exists($obj, '<IMG SRC=javascript:alert('XSS')>')) { | |
| 12484 | + throw new Exception("Missing required property"); | |
| 12485 | + } | |
| 12486 | + if (!property_exists($obj, '<img src\\x09=x onerror="javascript:alert(1)">')) { | |
| 12487 | + throw new Exception("Missing required property"); | |
| 12488 | + } | |
| 12489 | + if (!property_exists($obj, '<img src\\x11=x onerror="javascript:alert(1)">')) { | |
| 12490 | + throw new Exception("Missing required property"); | |
| 12491 | + } | |
| 12492 | + if (!property_exists($obj, '<img src=x onerror=\\x00"javascript:alert(1)">')) { | |
| 12493 | + throw new Exception("Missing required property"); | |
| 12494 | + } | |
| 12495 | + if (!property_exists($obj, '<img src=x onerror=\\x09"javascript:alert(1)">')) { | |
| 12496 | + throw new Exception("Missing required property"); | |
| 12497 | + } | |
| 12498 | + if (!property_exists($obj, '<img src=x\\x09onerror="javascript:alert(1)">')) { | |
| 12499 | + throw new Exception("Missing required property"); | |
| 12500 | + } | |
| 12501 | + if (!property_exists($obj, '<img src=x\\x10onerror="javascript:alert(1)">')) { | |
| 12502 | + throw new Exception("Missing required property"); | |
| 12503 | + } | |
| 12504 | + if (!property_exists($obj, '<img src=x\\x11onerror="javascript:alert(1)">')) { | |
| 12505 | + throw new Exception("Missing required property"); | |
| 12506 | + } | |
| 12507 | + if (!property_exists($obj, '<img src=x\\x12onerror="javascript:alert(1)">')) { | |
| 12508 | + throw new Exception("Missing required property"); | |
| 12509 | + } | |
| 12510 | + if (!property_exists($obj, '<img src=x\\x13onerror="javascript:alert(1)">')) { | |
| 12511 | + throw new Exception("Missing required property"); | |
| 12512 | + } | |
| 12513 | + if (!property_exists($obj, '`"\'><img src=xxx:x \\x00onerror=javascript:alert(1)>')) { | |
| 12514 | + throw new Exception("Missing required property"); | |
| 12515 | + } | |
| 12516 | + if (!property_exists($obj, '`"\'><img src=xxx:x \\x0Bonerror=javascript:alert(1)>')) { | |
| 12517 | + throw new Exception("Missing required property"); | |
| 12518 | + } | |
| 12519 | + if (!property_exists($obj, '`"\'><img src=xxx:x \\x2Fonerror=javascript:alert(1)>')) { | |
| 12520 | + throw new Exception("Missing required property"); | |
| 12521 | + } | |
| 12522 | + if (!property_exists($obj, '<img \\x00src=x onerror="alert(1)">')) { | |
| 12523 | + throw new Exception("Missing required property"); | |
| 12524 | + } | |
| 12525 | + if (!property_exists($obj, '<img\\x10src=x onerror="javascript:alert(1)">')) { | |
| 12526 | + throw new Exception("Missing required property"); | |
| 12527 | + } | |
| 12528 | + if (!property_exists($obj, '<img\\x13src=x onerror="javascript:alert(1)">')) { | |
| 12529 | + throw new Exception("Missing required property"); | |
| 12530 | + } | |
| 12531 | + if (!property_exists($obj, '<img\\x32src=x onerror="javascript:alert(1)">')) { | |
| 12532 | + throw new Exception("Missing required property"); | |
| 12533 | + } | |
| 12534 | + if (!property_exists($obj, '<img \\x39src=x onerror="javascript:alert(1)">')) { | |
| 12535 | + throw new Exception("Missing required property"); | |
| 12536 | + } | |
| 12537 | + if (!property_exists($obj, ',./;\'[]\\-=')) { | |
| 12538 | + throw new Exception("Missing required property"); | |
| 12539 | + } | |
| 12540 | + if (!property_exists($obj, ',')) { | |
| 12541 | + throw new Exception("Missing required property"); | |
| 12542 | + } | |
| 12543 | + if (!property_exists($obj, 'INF')) { | |
| 12544 | + throw new Exception("Missing required property"); | |
| 12545 | + } | |
| 12546 | + if (!property_exists($obj, '-Infinity')) { | |
| 12547 | + throw new Exception("Missing required property"); | |
| 12548 | + } | |
| 12549 | + if (!property_exists($obj, '# Innocuous strings which may be blocked by profanity filters (https://en.wikipedia.org/wiki/Scunthorpe_problem)')) { | |
| 12550 | + throw new Exception("Missing required property"); | |
| 12551 | + } | |
| 12552 | + if (!property_exists($obj, 'Jimmy Clitheroe')) { | |
| 12553 | + throw new Exception("Missing required property"); | |
| 12554 | + } | |
| 12555 | + if (!property_exists($obj, 'Kernel.exit(1)')) { | |
| 12556 | + throw new Exception("Missing required property"); | |
| 12557 | + } | |
| 12558 | + if (!property_exists($obj, '# Known CVEs and Vulnerabilities')) { | |
| 12559 | + throw new Exception("Missing required property"); | |
| 12560 | + } | |
| 12561 | + if (!property_exists($obj, 'Lightwater Country Park')) { | |
| 12562 | + throw new Exception("Missing required property"); | |
| 12563 | + } | |
| 12564 | + if (!property_exists($obj, 'LPT2')) { | |
| 12565 | + throw new Exception("Missing required property"); | |
| 12566 | + } | |
| 12567 | + if (!property_exists($obj, 'LPT3')) { | |
| 12568 | + throw new Exception("Missing required property"); | |
| 12569 | + } | |
| 12570 | + if (!property_exists($obj, '`ls -al /`')) { | |
| 12571 | + throw new Exception("Missing required property"); | |
| 12572 | + } | |
| 12573 | + if (!property_exists($obj, '\\')) { | |
| 12574 | + throw new Exception("Missing required property"); | |
| 12575 | + } | |
| 12576 | + if (!property_exists($obj, '')) { | |
| 12577 | + throw new Exception("Missing required property"); | |
| 12578 | + } | |
| 12579 | + if (!property_exists($obj, '# MSDOS/Windows Special Filenames')) { | |
| 12580 | + throw new Exception("Missing required property"); | |
| 12581 | + } | |
| 12582 | + if (!property_exists($obj, 'nil')) { | |
| 12583 | + throw new Exception("Missing required property"); | |
| 12584 | + } | |
| 12585 | + if (!property_exists($obj, '# Non-whitespace C1 controls: U+0080 through U+0084 and U+0086 through U+009F.')) { | |
| 12586 | + throw new Exception("Missing required property"); | |
| 12587 | + } | |
| 12588 | + if (!property_exists($obj, 'None')) { | |
| 12589 | + throw new Exception("Missing required property"); | |
| 12590 | + } | |
| 12591 | + if (!property_exists($obj, '(null)')) { | |
| 12592 | + throw new Exception("Missing required property"); | |
| 12593 | + } | |
| 12594 | + if (!property_exists($obj, ' onfocus=JaVaSCript:alert(123) autofocus')) { | |
| 12595 | + throw new Exception("Missing required property"); | |
| 12596 | + } | |
| 12597 | + if (!property_exists($obj, '\' OR \'1\'=\'1')) { | |
| 12598 | + throw new Exception("Missing required property"); | |
| 12599 | + } | |
| 12600 | + if (!property_exists($obj, 'Penistone Community Church')) { | |
| 12601 | + throw new Exception("Missing required property"); | |
| 12602 | + } | |
| 12603 | + if (!property_exists($obj, 'perl -e \'print "<IMG SRC=java\\0script:alert(\\"XSS\\")>";\' > out')) { | |
| 12604 | + throw new Exception("Missing required property"); | |
| 12605 | + } | |
| 12606 | + if (!property_exists($obj, 'PRN')) { | |
| 12607 | + throw new Exception("Missing required property"); | |
| 12608 | + } | |
| 12609 | + if (!property_exists($obj, '\'')) { | |
| 12610 | + throw new Exception("Missing required property"); | |
| 12611 | + } | |
| 12612 | + if (!property_exists($obj, '0')) { | |
| 12613 | + throw new Exception("Missing required property"); | |
| 12614 | + } | |
| 12615 | + if (!property_exists($obj, 'test')) { | |
| 12616 | + throw new Exception("Missing required property"); | |
| 12617 | + } | |
| 12618 | + if (!property_exists($obj, 'RomansInSussex.co.uk')) { | |
| 12619 | + throw new Exception("Missing required property"); | |
| 12620 | + } | |
| 12621 | + if (!property_exists($obj, '%s')) { | |
| 12622 | + throw new Exception("Missing required property"); | |
| 12623 | + } | |
| 12624 | + if (!property_exists($obj, '<<< %s(un=\'%s\') = %u')) { | |
| 12625 | + throw new Exception("Missing required property"); | |
| 12626 | + } | |
| 12627 | + if (!property_exists($obj, '<sc<script>ript>alert(123)</sc</script>ript>')) { | |
| 12628 | + throw new Exception("Missing required property"); | |
| 12629 | + } | |
| 12630 | + if (!property_exists($obj, '"><script>alert(123);</script x="')) { | |
| 12631 | + throw new Exception("Missing required property"); | |
| 12632 | + } | |
| 12633 | + if (!property_exists($obj, '# Script Injection')) { | |
| 12634 | + throw new Exception("Missing required property"); | |
| 12635 | + } | |
| 12636 | + if (!property_exists($obj, '<SCRIPT SRC=http://ha.ckers.org/xss.js?< B >')) { | |
| 12637 | + throw new Exception("Missing required property"); | |
| 12638 | + } | |
| 12639 | + if (!property_exists($obj, '<SCRIPT/SRC="http://ha.ckers.org/xss.js"></SCRIPT>')) { | |
| 12640 | + throw new Exception("Missing required property"); | |
| 12641 | + } | |
| 12642 | + if (!property_exists($obj, '</script><script>alert(123)</script>')) { | |
| 12643 | + throw new Exception("Missing required property"); | |
| 12644 | + } | |
| 12645 | + if (!property_exists($obj, '"`\'><script>\\x00javascript:alert(1)</script>')) { | |
| 12646 | + throw new Exception("Missing required property"); | |
| 12647 | + } | |
| 12648 | + if (!property_exists($obj, '<script\\x09type="text/javascript">javascript:alert(1);</script>')) { | |
| 12649 | + throw new Exception("Missing required property"); | |
| 12650 | + } | |
| 12651 | + if (!property_exists($obj, '"`\'><script>\\x0Cjavascript:alert(1)</script>')) { | |
| 12652 | + throw new Exception("Missing required property"); | |
| 12653 | + } | |
| 12654 | + if (!property_exists($obj, '"`\'><script>\\x0Djavascript:alert(1)</script>')) { | |
| 12655 | + throw new Exception("Missing required property"); | |
| 12656 | + } | |
| 12657 | + if (!property_exists($obj, '<script\\x20type="text/javascript">javascript:alert(1);</script>')) { | |
| 12658 | + throw new Exception("Missing required property"); | |
| 12659 | + } | |
| 12660 | + if (!property_exists($obj, '<script\\x3Etype="text/javascript">javascript:alert(1);</script>')) { | |
| 12661 | + throw new Exception("Missing required property"); | |
| 12662 | + } | |
| 12663 | + if (!property_exists($obj, '"`\'><script>\\xC2\\x85javascript:alert(1)</script>')) { | |
| 12664 | + throw new Exception("Missing required property"); | |
| 12665 | + } | |
| 12666 | + if (!property_exists($obj, '"`\'><script>\\xC2\\xA0javascript:alert(1)</script>')) { | |
| 12667 | + throw new Exception("Missing required property"); | |
| 12668 | + } | |
| 12669 | + if (!property_exists($obj, '"`\'><script>\\xE1\\x9A\\x80javascript:alert(1)</script>')) { | |
| 12670 | + throw new Exception("Missing required property"); | |
| 12671 | + } | |
| 12672 | + if (!property_exists($obj, '"`\'><script>\\xE1\\xA0\\x8Ejavascript:alert(1)</script>')) { | |
| 12673 | + throw new Exception("Missing required property"); | |
| 12674 | + } | |
| 12675 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\x81javascript:alert(1)</script>')) { | |
| 12676 | + throw new Exception("Missing required property"); | |
| 12677 | + } | |
| 12678 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\x86javascript:alert(1)</script>')) { | |
| 12679 | + throw new Exception("Missing required property"); | |
| 12680 | + } | |
| 12681 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\x89javascript:alert(1)</script>')) { | |
| 12682 | + throw new Exception("Missing required property"); | |
| 12683 | + } | |
| 12684 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x81\\x9Fjavascript:alert(1)</script>')) { | |
| 12685 | + throw new Exception("Missing required property"); | |
| 12686 | + } | |
| 12687 | + if (!property_exists($obj, '"`\'><script>\\xEF\\xBB\\xBFjavascript:alert(1)</script>')) { | |
| 12688 | + throw new Exception("Missing required property"); | |
| 12689 | + } | |
| 12690 | + if (!property_exists($obj, '"`\'><script>\\xF0\\x90\\x96\\x9Ajavascript:alert(1)</script>')) { | |
| 12691 | + throw new Exception("Missing required property"); | |
| 12692 | + } | |
| 12693 | + if (!property_exists($obj, '<SCRIPT/XSS SRC="http://ha.ckers.org/xss.js"></SCRIPT>')) { | |
| 12694 | + throw new Exception("Missing required property"); | |
| 12695 | + } | |
| 12696 | + if (!property_exists($obj, '# SQL Injection')) { | |
| 12697 | + throw new Exception("Missing required property"); | |
| 12698 | + } | |
| 12699 | + if (!property_exists($obj, '(╯°□°)╯︵ ┻━┻)')) { | |
| 12700 | + throw new Exception("Missing required property"); | |
| 12701 | + } | |
| 12702 | + if (!property_exists($obj, '# String which can reveal system files when parsed by a badly configured XML parser')) { | |
| 12703 | + throw new Exception("Missing required property"); | |
| 12704 | + } | |
| 12705 | + if (!property_exists($obj, '# Strings that test for known vulnerabilities')) { | |
| 12706 | + throw new Exception("Missing required property"); | |
| 12707 | + } | |
| 12708 | + if (!property_exists($obj, '# Strings which can be accidentally expanded into different strings if evaluated in the wrong context, e.g. used as a printf format string or via Perl or shell eval. Might expose sensitive data from the program doing the interpolation, or might just represent the wrong string.')) { | |
| 12709 | + throw new Exception("Missing required property"); | |
| 12710 | + } | |
| 12711 | + if (!property_exists($obj, '# Strings which can call system commands within Ruby/Rails applications')) { | |
| 12712 | + throw new Exception("Missing required property"); | |
| 12713 | + } | |
| 12714 | + if (!property_exists($obj, '# Strings which consists of Japanese-style emoticons which are popular on the web')) { | |
| 12715 | + throw new Exception("Missing required property"); | |
| 12716 | + } | |
| 12717 | + if (!property_exists($obj, '# Strings which contain bold/italic/etc. versions of normal characters')) { | |
| 12718 | + throw new Exception("Missing required property"); | |
| 12719 | + } | |
| 12720 | + if (!property_exists($obj, '# Strings which contain common unicode symbols (e.g. smart quotes)')) { | |
| 12721 | + throw new Exception("Missing required property"); | |
| 12722 | + } | |
| 12723 | + if (!property_exists($obj, '# Strings which contain Emoji; should be the same behavior as two-byte characters, but not always')) { | |
| 12724 | + throw new Exception("Missing required property"); | |
| 12725 | + } | |
| 12726 | + if (!property_exists($obj, '# Strings which contain misplaced quotation marks; can cause encoding errors')) { | |
| 12727 | + throw new Exception("Missing required property"); | |
| 12728 | + } | |
| 12729 | + if (!property_exists($obj, '# Strings which contain unicode subscripts/superscripts; can cause rendering issues')) { | |
| 12730 | + throw new Exception("Missing required property"); | |
| 12731 | + } | |
| 12732 | + if (!property_exists($obj, '# Strings which crashed iMessage in various versions of iOS')) { | |
| 12733 | + throw new Exception("Missing required property"); | |
| 12734 | + } | |
| 12735 | + if (!property_exists($obj, '# Strings which may cause human to reinterpret worldview')) { | |
| 12736 | + throw new Exception("Missing required property"); | |
| 12737 | + } | |
| 12738 | + if (!property_exists($obj, 'Super Bowl XXX')) { | |
| 12739 | + throw new Exception("Missing required property"); | |
| 12740 | + } | |
| 12741 | + if (!property_exists($obj, '( ͡° ͜ʖ ͡°)')) { | |
| 12742 | + throw new Exception("Missing required property"); | |
| 12743 | + } | |
| 12744 | + if (!property_exists($obj, 'הָיְתָהtestالصفحات التّحول')) { | |
| 12745 | + throw new Exception("Missing required property"); | |
| 12746 | + } | |
| 12747 | + if (!property_exists($obj, '</textarea><script>alert(123)</script>')) { | |
| 12748 | + throw new Exception("Missing required property"); | |
| 12749 | + } | |
| 12750 | + if (!property_exists($obj, '+0')) { | |
| 12751 | + throw new Exception("Missing required property"); | |
| 12752 | + } | |
| 12753 | + if (!property_exists($obj, '0..0')) { | |
| 12754 | + throw new Exception("Missing required property"); | |
| 12755 | + } | |
| 12756 | + if (!property_exists($obj, '0,0,0')) { | |
| 12757 | + throw new Exception("Missing required property"); | |
| 12758 | + } | |
| 12759 | + if (!property_exists($obj, '0,0/0,0')) { | |
| 12760 | + throw new Exception("Missing required property"); | |
| 12761 | + } | |
| 12762 | + if (!property_exists($obj, '0x0')) { | |
| 12763 | + throw new Exception("Missing required property"); | |
| 12764 | + } | |
| 12765 | + if (!property_exists($obj, '-1')) { | |
| 12766 | + throw new Exception("Missing required property"); | |
| 12767 | + } | |
| 12768 | + if (!property_exists($obj, '1/0')) { | |
| 12769 | + throw new Exception("Missing required property"); | |
| 12770 | + } | |
| 12771 | + if (!property_exists($obj, '1.00')) { | |
| 12772 | + throw new Exception("Missing required property"); | |
| 12773 | + } | |
| 12774 | + if (!property_exists($obj, '1.0/0.0')) { | |
| 12775 | + throw new Exception("Missing required property"); | |
| 12776 | + } | |
| 12777 | + if (!property_exists($obj, '1\'000,00')) { | |
| 12778 | + throw new Exception("Missing required property"); | |
| 12779 | + } | |
| 12780 | + if (!property_exists($obj, '1 000 000.00')) { | |
| 12781 | + throw new Exception("Missing required property"); | |
| 12782 | + } | |
| 12783 | + if (!property_exists($obj, '𝑻𝒉𝒆 𝒒𝒖𝒊𝒄𝒌 𝒃𝒓𝒐𝒘𝒏 𝒇𝒐𝒙 𝒋𝒖𝒎𝒑𝒔 𝒐𝒗𝒆𝒓 𝒕𝒉𝒆 𝒍𝒂𝒛𝒚 𝒅𝒐𝒈')) { | |
| 12784 | + throw new Exception("Missing required property"); | |
| 12785 | + } | |
| 12786 | + if (!property_exists($obj, '1/2')) { | |
| 12787 | + throw new Exception("Missing required property"); | |
| 12788 | + } | |
| 12789 | + if (!property_exists($obj, '123456789012345678901234567890123456789')) { | |
| 12790 | + throw new Exception("Missing required property"); | |
| 12791 | + } | |
| 12792 | + if (!property_exists($obj, '𝓣𝓱𝓮 𝓺𝓾𝓲𝓬𝓴 𝓫𝓻𝓸𝔀𝓷 𝓯𝓸𝔁 𝓳𝓾𝓶𝓹𝓼 𝓸𝓿𝓮𝓻 𝓽𝓱𝓮 𝓵𝓪𝔃𝔂 𝓭𝓸𝓰')) { | |
| 12793 | + throw new Exception("Missing required property"); | |
| 12794 | + } | |
| 12795 | + if (!property_exists($obj, '𝕿𝖍𝖊 𝖖𝖚𝖎𝖈𝖐 𝖇𝖗𝖔𝖜𝖓 𝖋𝖔𝖝 𝖏𝖚𝖒𝖕𝖘 𝖔𝖛𝖊𝖗 𝖙𝖍𝖊 𝖑𝖆𝖟𝖞 𝖉𝖔𝖌')) { | |
| 12796 | + throw new Exception("Missing required property"); | |
| 12797 | + } | |
| 12798 | + if (!property_exists($obj, '🇺🇸🇷🇺🇸 🇦🇫🇦🇲🇸')) { | |
| 12799 | + throw new Exception("Missing required property"); | |
| 12800 | + } | |
| 12801 | + if (!property_exists($obj, '🇺🇸🇷🇺🇸🇦')) { | |
| 12802 | + throw new Exception("Missing required property"); | |
| 12803 | + } | |
| 12804 | + if (!property_exists($obj, '🇺🇸🇷🇺🇸🇦🇫🇦🇲')) { | |
| 12805 | + throw new Exception("Missing required property"); | |
| 12806 | + } | |
| 12807 | + if (!property_exists($obj, '👩🏽')) { | |
| 12808 | + throw new Exception("Missing required property"); | |
| 12809 | + } | |
| 12810 | + if (!property_exists($obj, '🚾 🆒 🆓 🆕 🆖 🆗 🆙 🏧')) { | |
| 12811 | + throw new Exception("Missing required property"); | |
| 12812 | + } | |
| 12813 | + if (!property_exists($obj, '1;DROP TABLE users')) { | |
| 12814 | + throw new Exception("Missing required property"); | |
| 12815 | + } | |
| 12816 | + if (!property_exists($obj, '-1E02')) { | |
| 12817 | + throw new Exception("Missing required property"); | |
| 12818 | + } | |
| 12819 | + if (!property_exists($obj, '1E2')) { | |
| 12820 | + throw new Exception("Missing required property"); | |
| 12821 | + } | |
| 12822 | + if (!property_exists($obj, '1#QNAN')) { | |
| 12823 | + throw new Exception("Missing required property"); | |
| 12824 | + } | |
| 12825 | + if (!property_exists($obj, '1#SNAN')) { | |
| 12826 | + throw new Exception("Missing required property"); | |
| 12827 | + } | |
| 12828 | + if (!property_exists($obj, '')) { | |
| 12829 | + throw new Exception("Missing required property"); | |
| 12830 | + } | |
| 12831 | + if (!property_exists($obj, '﷽')) { | |
| 12832 | + throw new Exception("Missing required property"); | |
| 12833 | + } | |
| 12834 | + if (!property_exists($obj, '')) { | |
| 12835 | + throw new Exception("Missing required property"); | |
| 12836 | + } | |
| 12837 | + if (!property_exists($obj, '゚・✿ヾ╲(。◕‿◕。)╱✿・゚')) { | |
| 12838 | + throw new Exception("Missing required property"); | |
| 12839 | + } | |
| 12840 | + if (!property_exists($obj, '')) { | |
| 12841 | + throw new Exception("Missing required property"); | |
| 12842 | + } | |
| 12843 | + if (!property_exists($obj, '¸˛Ç◊ı˜Â¯˘¿')) { | |
| 12844 | + throw new Exception("Missing required property"); | |
| 12845 | + } | |
| 12846 | + if (!property_exists($obj, 'Œ„´‰ˇÁ¨ˆØ∏”’')) { | |
| 12847 | + throw new Exception("Missing required property"); | |
| 12848 | + } | |
| 12849 | + if (!property_exists($obj, 'œ∑´®†¥¨ˆøπ“‘')) { | |
| 12850 | + throw new Exception("Missing required property"); | |
| 12851 | + } | |
| 12852 | + if (!property_exists($obj, 'Ⱥ')) { | |
| 12853 | + throw new Exception("Missing required property"); | |
| 12854 | + } | |
| 12855 | + if (!property_exists($obj, 'Ⱦ')) { | |
| 12856 | + throw new Exception("Missing required property"); | |
| 12857 | + } | |
| 12858 | + if (!property_exists($obj, '₀₁₂')) { | |
| 12859 | + throw new Exception("Missing required property"); | |
| 12860 | + } | |
| 12861 | + if (!property_exists($obj, '⒯⒣⒠ ⒬⒰⒤⒞⒦ ⒝⒭⒪⒲⒩ ⒡⒪⒳ ⒥⒰⒨⒫⒮ ⒪⒱⒠⒭ ⒯⒣⒠ ⒧⒜⒵⒴ ⒟⒪⒢')) { | |
| 12862 | + throw new Exception("Missing required property"); | |
| 12863 | + } | |
| 12864 | + if (!property_exists($obj, '999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999')) { | |
| 12865 | + throw new Exception("Missing required property"); | |
| 12866 | + } | |
| 12867 | + if (!property_exists($obj, '# The next two lines may appear to be blank or mojibake in some viewers.')) { | |
| 12868 | + throw new Exception("Missing required property"); | |
| 12869 | + } | |
| 12870 | + if (!property_exists($obj, 'The quick brown fox... [Beeeep]')) { | |
| 12871 | + throw new Exception("Missing required property"); | |
| 12872 | + } | |
| 12873 | + if (!property_exists($obj, 'TRUE')) { | |
| 12874 | + throw new Exception("Missing required property"); | |
| 12875 | + } | |
| 12876 | + if (!property_exists($obj, '# Two-Byte Characters')) { | |
| 12877 | + throw new Exception("Missing required property"); | |
| 12878 | + } | |
| 12879 | + if (!property_exists($obj, '# U+0000, U+000A, or U+000D (NUL, LF, CR).')) { | |
| 12880 | + throw new Exception("Missing required property"); | |
| 12881 | + } | |
| 12882 | + if (!property_exists($obj, '<u oncopy=alert()> Copy me</u>')) { | |
| 12883 | + throw new Exception("Missing required property"); | |
| 12884 | + } | |
| 12885 | + if (!property_exists($obj, 'undef')) { | |
| 12886 | + throw new Exception("Missing required property"); | |
| 12887 | + } | |
| 12888 | + if (!property_exists($obj, '# Unicode font')) { | |
| 12889 | + throw new Exception("Missing required property"); | |
| 12890 | + } | |
| 12891 | + if (!property_exists($obj, '# Unicode Numbers')) { | |
| 12892 | + throw new Exception("Missing required property"); | |
| 12893 | + } | |
| 12894 | + if (!property_exists($obj, '# Unwanted Interpolation')) { | |
| 12895 | + throw new Exception("Missing required property"); | |
| 12896 | + } | |
| 12897 | + if (!property_exists($obj, '%x(\'ls -al /\')')) { | |
| 12898 | + throw new Exception("Missing required property"); | |
| 12899 | + } | |
| 12900 | + if (!property_exists($obj, 'Z̮̞̠͙͔ͅḀ̗̞͈̻̗Ḷ͙͎̯̹̞͓G̻O̭̗̮')) { | |
| 12901 | + throw new Exception("Missing required property"); | |
| 12902 | + } | |
| 12204 | 12903 | return new A( |
| 12205 | 12904 | A::from1($obj->{'ثم نفس سقطت وبالتحديد،, جزيرتي باستخدام أن دنو. إذ هنا؟ الستار وتنصيب كان. أهّل ايطاليا، بريطانيا-فرنسا قد أخذ. سليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو.'}) |
| 12206 | 12905 | ,A::from2($obj->{'٠١٢٣٤٥٦٧٨٩'}) |
| @@ -20973,29 +21672,506 @@ class B { | ||
| 20973 | 21672 | * @throws Exception |
| 20974 | 21673 | */ |
| 20975 | 21674 | public static function from(stdClass $obj): B { |
| 20976 | - return new B( | |
| 20977 | - B::from1($obj->{'ﷺ'}) | |
| 20978 | - ,B::from2($obj->{'123'}) | |
| 20979 | - ,B::fromAHrefHTTPFooBarXYAImgAltImgSrcXXOnerrorJavascriptAlert1A($obj->{'<a href=http://foo.bar/#x=`y></a><img alt="`><img src=x:x onerror=javascript:alert(1)></a>">'}) | |
| 20980 | - ,B::fromAHrefJavascriptX00JavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="javascript\\x00:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20981 | - ,B::fromAHrefJavascriptX0DJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="javascript\\x0D:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20982 | - ,B::fromAHrefX02JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x02javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20983 | - ,B::fromAHrefX04JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x04javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20984 | - ,B::fromAHrefX0AjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x0Ajavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20985 | - ,B::fromAHrefX0DjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x0Djavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20986 | - ,B::fromAHrefX0EjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x0Ejavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20987 | - ,B::fromAHrefX0FjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x0Fjavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20988 | - ,B::fromAHrefX16JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x16javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20989 | - ,B::fromAHrefX19JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x19javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20990 | - ,B::fromAHrefX1AjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x1Ajavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20991 | - ,B::fromAHrefX1DjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x1Djavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20992 | - ,B::fromAHrefX1EjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x1Ejavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20993 | - ,B::fromAHrefXE2X80X81JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\xE2\\x80\\x81javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20994 | - ,B::fromAHrefXE2X80X82JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\xE2\\x80\\x82javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20995 | - ,B::fromAHrefXE2X80XA9JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\xE2\\x80\\xA9javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20996 | - ,B::fromAHrefXE2X80XAFjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\xE2\\x80\\xAFjavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 20997 | - ,B::fromAbcDivStyleXExpressionX5CJavascriptAlert1DEF($obj->{'ABC<div style="x:expression\\x5C(javascript:alert(1)">DEF'}) | |
| 20998 | - ,B::fromAbcDivStyleXX0AexpressionJavascriptAlert1DEF($obj->{'ABC<div style="x:\\x0Aexpression(javascript:alert(1)">DEF'}) | |
| 21675 | + if (!property_exists($obj, 'ﷺ')) { | |
| 21676 | + throw new Exception("Missing required property"); | |
| 21677 | + } | |
| 21678 | + if (!property_exists($obj, '123')) { | |
| 21679 | + throw new Exception("Missing required property"); | |
| 21680 | + } | |
| 21681 | + if (!property_exists($obj, '<a href=http://foo.bar/#x=`y></a><img alt="`><img src=x:x onerror=javascript:alert(1)></a>">')) { | |
| 21682 | + throw new Exception("Missing required property"); | |
| 21683 | + } | |
| 21684 | + if (!property_exists($obj, '<a href="javascript\\x00:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21685 | + throw new Exception("Missing required property"); | |
| 21686 | + } | |
| 21687 | + if (!property_exists($obj, '<a href="javascript\\x0D:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21688 | + throw new Exception("Missing required property"); | |
| 21689 | + } | |
| 21690 | + if (!property_exists($obj, '<a href="\\x02javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21691 | + throw new Exception("Missing required property"); | |
| 21692 | + } | |
| 21693 | + if (!property_exists($obj, '<a href="\\x04javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21694 | + throw new Exception("Missing required property"); | |
| 21695 | + } | |
| 21696 | + if (!property_exists($obj, '<a href="\\x0Ajavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21697 | + throw new Exception("Missing required property"); | |
| 21698 | + } | |
| 21699 | + if (!property_exists($obj, '<a href="\\x0Djavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21700 | + throw new Exception("Missing required property"); | |
| 21701 | + } | |
| 21702 | + if (!property_exists($obj, '<a href="\\x0Ejavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21703 | + throw new Exception("Missing required property"); | |
| 21704 | + } | |
| 21705 | + if (!property_exists($obj, '<a href="\\x0Fjavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21706 | + throw new Exception("Missing required property"); | |
| 21707 | + } | |
| 21708 | + if (!property_exists($obj, '<a href="\\x16javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21709 | + throw new Exception("Missing required property"); | |
| 21710 | + } | |
| 21711 | + if (!property_exists($obj, '<a href="\\x19javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21712 | + throw new Exception("Missing required property"); | |
| 21713 | + } | |
| 21714 | + if (!property_exists($obj, '<a href="\\x1Ajavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21715 | + throw new Exception("Missing required property"); | |
| 21716 | + } | |
| 21717 | + if (!property_exists($obj, '<a href="\\x1Djavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21718 | + throw new Exception("Missing required property"); | |
| 21719 | + } | |
| 21720 | + if (!property_exists($obj, '<a href="\\x1Ejavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21721 | + throw new Exception("Missing required property"); | |
| 21722 | + } | |
| 21723 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\x81javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21724 | + throw new Exception("Missing required property"); | |
| 21725 | + } | |
| 21726 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\x82javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21727 | + throw new Exception("Missing required property"); | |
| 21728 | + } | |
| 21729 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\xA9javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21730 | + throw new Exception("Missing required property"); | |
| 21731 | + } | |
| 21732 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\xAFjavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 21733 | + throw new Exception("Missing required property"); | |
| 21734 | + } | |
| 21735 | + if (!property_exists($obj, 'ABC<div style="x:expression\\x5C(javascript:alert(1)">DEF')) { | |
| 21736 | + throw new Exception("Missing required property"); | |
| 21737 | + } | |
| 21738 | + if (!property_exists($obj, 'ABC<div style="x:\\x0Aexpression(javascript:alert(1)">DEF')) { | |
| 21739 | + throw new Exception("Missing required property"); | |
| 21740 | + } | |
| 21741 | + if (!property_exists($obj, 'ABC<div style="x:\\x0Dexpression(javascript:alert(1)">DEF')) { | |
| 21742 | + throw new Exception("Missing required property"); | |
| 21743 | + } | |
| 21744 | + if (!property_exists($obj, 'ABC<div style="x:\\xE2\\x80\\x82expression(javascript:alert(1)">DEF')) { | |
| 21745 | + throw new Exception("Missing required property"); | |
| 21746 | + } | |
| 21747 | + if (!property_exists($obj, 'ABC<div style="x:\\xE2\\x80\\x83expression(javascript:alert(1)">DEF')) { | |
| 21748 | + throw new Exception("Missing required property"); | |
| 21749 | + } | |
| 21750 | + if (!property_exists($obj, 'ABC<div style="x:\\xE2\\x80\\x85expression(javascript:alert(1)">DEF')) { | |
| 21751 | + throw new Exception("Missing required property"); | |
| 21752 | + } | |
| 21753 | + if (!property_exists($obj, 'ABC<div style="x:\\xE2\\x80\\x87expression(javascript:alert(1)">DEF')) { | |
| 21754 | + throw new Exception("Missing required property"); | |
| 21755 | + } | |
| 21756 | + if (!property_exists($obj, 'ABC<div style="x:\\xE2\\x80\\x8Aexpression(javascript:alert(1)">DEF')) { | |
| 21757 | + throw new Exception("Missing required property"); | |
| 21758 | + } | |
| 21759 | + if (!property_exists($obj, 'ヽ༼ຈل͜ຈ༽ノ ヽ༼ຈل͜ຈ༽ノ')) { | |
| 21760 | + throw new Exception("Missing required property"); | |
| 21761 | + } | |
| 21762 | + if (!property_exists($obj, '# appear in input.')) { | |
| 21763 | + throw new Exception("Missing required property"); | |
| 21764 | + } | |
| 21765 | + if (!property_exists($obj, '+++ATH0')) { | |
| 21766 | + throw new Exception("Missing required property"); | |
| 21767 | + } | |
| 21768 | + if (!property_exists($obj, '\' autofocus onkeyup=\'javascript:alert(123)')) { | |
| 21769 | + throw new Exception("Missing required property"); | |
| 21770 | + } | |
| 21771 | + if (!property_exists($obj, ' ')) { | |
| 21772 | + throw new Exception("Missing required property"); | |
| 21773 | + } | |
| 21774 | + if (!property_exists($obj, '1\'000.00')) { | |
| 21775 | + throw new Exception("Missing required property"); | |
| 21776 | + } | |
| 21777 | + if (!property_exists($obj, '<IMG SRC=# onmouseover="alert(\'xxs\')">')) { | |
| 21778 | + throw new Exception("Missing required property"); | |
| 21779 | + } | |
| 21780 | + if (!property_exists($obj, '--><script>alert(123)</script>')) { | |
| 21781 | + throw new Exception("Missing required property"); | |
| 21782 | + } | |
| 21783 | + if (!property_exists($obj, '`touch /tmp/blns.fail`')) { | |
| 21784 | + throw new Exception("Missing required property"); | |
| 21785 | + } | |
| 21786 | + if (!property_exists($obj, '__ロ(,_,*)')) { | |
| 21787 | + throw new Exception("Missing required property"); | |
| 21788 | + } | |
| 21789 | + if (!property_exists($obj, 'basement')) { | |
| 21790 | + throw new Exception("Missing required property"); | |
| 21791 | + } | |
| 21792 | + if (!property_exists($obj, '𝕋𝕙𝕖 𝕢𝕦𝕚𝕔𝕜 𝕓𝕣𝕠𝕨𝕟 𝕗𝕠𝕩 𝕛𝕦𝕞𝕡𝕤 𝕠𝕧𝕖𝕣 𝕥𝕙𝕖 𝕝𝕒𝕫𝕪 𝕕𝕠𝕘')) { | |
| 21793 | + throw new Exception("Missing required property"); | |
| 21794 | + } | |
| 21795 | + if (!property_exists($obj, 'But now...[20Cfor my greatest trick...[8m')) { | |
| 21796 | + throw new Exception("Missing required property"); | |
| 21797 | + } | |
| 21798 | + if (!property_exists($obj, '# "Byte order marks", U+FEFF and U+FFFE, each on its own line.')) { | |
| 21799 | + throw new Exception("Missing required property"); | |
| 21800 | + } | |
| 21801 | + if (!property_exists($obj, 'COM1')) { | |
| 21802 | + throw new Exception("Missing required property"); | |
| 21803 | + } | |
| 21804 | + if (!property_exists($obj, 'COM3')) { | |
| 21805 | + throw new Exception("Missing required property"); | |
| 21806 | + } | |
| 21807 | + if (!property_exists($obj, '# Commonly misinterpreted as additional graphic characters.')) { | |
| 21808 | + throw new Exception("Missing required property"); | |
| 21809 | + } | |
| 21810 | + if (!property_exists($obj, 'CON')) { | |
| 21811 | + throw new Exception("Missing required property"); | |
| 21812 | + } | |
| 21813 | + if (!property_exists($obj, '# contexts. Divided into three groups based on (US-layout) keyboard position.')) { | |
| 21814 | + throw new Exception("Missing required property"); | |
| 21815 | + } | |
| 21816 | + if (!property_exists($obj, '# Credit: https://twitter.com/jifa/status/625776454479970304')) { | |
| 21817 | + throw new Exception("Missing required property"); | |
| 21818 | + } | |
| 21819 | + if (!property_exists($obj, '社會科學院語學研究所')) { | |
| 21820 | + throw new Exception("Missing required property"); | |
| 21821 | + } | |
| 21822 | + if (!property_exists($obj, '/dev/null; touch /tmp/blns.fail ; echo')) { | |
| 21823 | + throw new Exception("Missing required property"); | |
| 21824 | + } | |
| 21825 | + if (!property_exists($obj, 'dontMakeAMap')) { | |
| 21826 | + throw new Exception("Missing required property"); | |
| 21827 | + } | |
| 21828 | + if (!property_exists($obj, '')) { | |
| 21829 | + throw new Exception("Missing required property"); | |
| 21830 | + } | |
| 21831 | + if (!property_exists($obj, 'eval("puts \'hello world\'")')) { | |
| 21832 | + throw new Exception("Missing required property"); | |
| 21833 | + } | |
| 21834 | + if (!property_exists($obj, 'expression')) { | |
| 21835 | + throw new Exception("Missing required property"); | |
| 21836 | + } | |
| 21837 | + if (!property_exists($obj, 'FALSE')) { | |
| 21838 | + throw new Exception("Missing required property"); | |
| 21839 | + } | |
| 21840 | + if (!property_exists($obj, 'File:///')) { | |
| 21841 | + throw new Exception("Missing required property"); | |
| 21842 | + } | |
| 21843 | + if (!property_exists($obj, '# File Inclusion')) { | |
| 21844 | + throw new Exception("Missing required property"); | |
| 21845 | + } | |
| 21846 | + if (!property_exists($obj, '#')) { | |
| 21847 | + throw new Exception("Missing required property"); | |
| 21848 | + } | |
| 21849 | + if (!property_exists($obj, '<foo val=”bar“ />')) { | |
| 21850 | + throw new Exception("Missing required property"); | |
| 21851 | + } | |
| 21852 | + if (!property_exists($obj, '사회과학원 어학연구소')) { | |
| 21853 | + throw new Exception("Missing required property"); | |
| 21854 | + } | |
| 21855 | + if (!property_exists($obj, '# general category Cf (in Unicode 8.0.0).')) { | |
| 21856 | + throw new Exception("Missing required property"); | |
| 21857 | + } | |
| 21858 | + if (!property_exists($obj, '̦H̬̤̗̤͝e͜ ̜̥̝̻͍̟́w̕h̖̯͓o̝͙̖͎̱̮ ҉̺̙̞̟͈W̷̼̭a̺̪͍į͈͕̭͙̯̜t̶̼̮s̘͙͖̕ ̠̫̠B̻͍͙͉̳ͅe̵h̵̬͇̫͙i̹͓̳̳̮͎̫̕n͟d̴̪̜̖ ̰͉̩͇͙̲͞ͅT͖̼͓̪͢h͏͓̮̻e̬̝̟ͅ ̤̹̝W͙̞̝͔͇͝ͅa͏͓͔̹̼̣l̴͔̰̤̟͔ḽ̫.͕')) { | |
| 21859 | + throw new Exception("Missing required property"); | |
| 21860 | + } | |
| 21861 | + if (!property_exists($obj, '--help')) { | |
| 21862 | + throw new Exception("Missing required property"); | |
| 21863 | + } | |
| 21864 | + if (!property_exists($obj, '❤️ 💔 💌 💕 💞 💓 💗 💖 💘 💝 💟 💜 💛 💚 💙')) { | |
| 21865 | + throw new Exception("Missing required property"); | |
| 21866 | + } | |
| 21867 | + if (!property_exists($obj, 'http://a/%%30%30')) { | |
| 21868 | + throw new Exception("Missing required property"); | |
| 21869 | + } | |
| 21870 | + if (!property_exists($obj, '# iOS Vulnerabilities')) { | |
| 21871 | + throw new Exception("Missing required property"); | |
| 21872 | + } | |
| 21873 | + if (!property_exists($obj, 'If you\'re reading this, you\'ve been in a coma for almost 20 years now. We\'re trying a new technique. We don\'t know where this message will end up in your dream, but we hope it works. Please wake up, we miss you.')) { | |
| 21874 | + throw new Exception("Missing required property"); | |
| 21875 | + } | |
| 21876 | + if (!property_exists($obj, '<iframe src=http://ha.ckers.org/scriptlet.html <')) { | |
| 21877 | + throw new Exception("Missing required property"); | |
| 21878 | + } | |
| 21879 | + if (!property_exists($obj, '<IMG SRC="  javascript:alert(\'XSS\');">')) { | |
| 21880 | + throw new Exception("Missing required property"); | |
| 21881 | + } | |
| 21882 | + if (!property_exists($obj, '<IMG SRC="jav	ascript:alert(\'XSS\');">')) { | |
| 21883 | + throw new Exception("Missing required property"); | |
| 21884 | + } | |
| 21885 | + if (!property_exists($obj, '<IMG SRC= onmouseover="alert(\'xxs\')">')) { | |
| 21886 | + throw new Exception("Missing required property"); | |
| 21887 | + } | |
| 21888 | + if (!property_exists($obj, '<IMG SRC=javascript:alert('XSS')>')) { | |
| 21889 | + throw new Exception("Missing required property"); | |
| 21890 | + } | |
| 21891 | + if (!property_exists($obj, '<IMG SRC=javascript:alert('XSS')>')) { | |
| 21892 | + throw new Exception("Missing required property"); | |
| 21893 | + } | |
| 21894 | + if (!property_exists($obj, '<img src\\x00=x onerror="javascript:alert(1)">')) { | |
| 21895 | + throw new Exception("Missing required property"); | |
| 21896 | + } | |
| 21897 | + if (!property_exists($obj, '<img src=x onerror=\\x11"javascript:alert(1)">')) { | |
| 21898 | + throw new Exception("Missing required property"); | |
| 21899 | + } | |
| 21900 | + if (!property_exists($obj, '<img src=x onerror=\\x12"javascript:alert(1)">')) { | |
| 21901 | + throw new Exception("Missing required property"); | |
| 21902 | + } | |
| 21903 | + if (!property_exists($obj, '`"\'><img src=xxx:x \\x0Aonerror=javascript:alert(1)>')) { | |
| 21904 | + throw new Exception("Missing required property"); | |
| 21905 | + } | |
| 21906 | + if (!property_exists($obj, '`"\'><img src=xxx:x \\x0Conerror=javascript:alert(1)>')) { | |
| 21907 | + throw new Exception("Missing required property"); | |
| 21908 | + } | |
| 21909 | + if (!property_exists($obj, '`"\'><img src=xxx:x \\x0Donerror=javascript:alert(1)>')) { | |
| 21910 | + throw new Exception("Missing required property"); | |
| 21911 | + } | |
| 21912 | + if (!property_exists($obj, '<img \\x00src=x onerror="javascript:alert(1)">')) { | |
| 21913 | + throw new Exception("Missing required property"); | |
| 21914 | + } | |
| 21915 | + if (!property_exists($obj, '<img \\x11src=x onerror="javascript:alert(1)">')) { | |
| 21916 | + throw new Exception("Missing required property"); | |
| 21917 | + } | |
| 21918 | + if (!property_exists($obj, '<img \\x12src=x onerror="javascript:alert(1)">')) { | |
| 21919 | + throw new Exception("Missing required property"); | |
| 21920 | + } | |
| 21921 | + if (!property_exists($obj, '<img \\x47src=x onerror="javascript:alert(1)">')) { | |
| 21922 | + throw new Exception("Missing required property"); | |
| 21923 | + } | |
| 21924 | + if (!property_exists($obj, '⁰⁴⁵₀₁₂')) { | |
| 21925 | + throw new Exception("Missing required property"); | |
| 21926 | + } | |
| 21927 | + if (!property_exists($obj, 'Ω≈ç√∫˜µ≤≥÷')) { | |
| 21928 | + throw new Exception("Missing required property"); | |
| 21929 | + } | |
| 21930 | + if (!property_exists($obj, '# IRC specific strings')) { | |
| 21931 | + throw new Exception("Missing required property"); | |
| 21932 | + } | |
| 21933 | + if (!property_exists($obj, '# Japanese Emoticons')) { | |
| 21934 | + throw new Exception("Missing required property"); | |
| 21935 | + } | |
| 21936 | + if (!property_exists($obj, 'Kernel.exec("ls -al /")')) { | |
| 21937 | + throw new Exception("Missing required property"); | |
| 21938 | + } | |
| 21939 | + if (!property_exists($obj, 'Linda Callahan')) { | |
| 21940 | + throw new Exception("Missing required property"); | |
| 21941 | + } | |
| 21942 | + if (!property_exists($obj, '部落格')) { | |
| 21943 | + throw new Exception("Missing required property"); | |
| 21944 | + } | |
| 21945 | + if (!property_exists($obj, '찦차를 타고 온 펲시맨과 쑛다리 똠방각하')) { | |
| 21946 | + throw new Exception("Missing required property"); | |
| 21947 | + } | |
| 21948 | + if (!property_exists($obj, '˙ɐnbᴉlɐ ɐuƃɐɯ ǝɹolop ʇǝ ǝɹoqɐl ʇn ʇunpᴉpᴉɔuᴉ ɹodɯǝʇ poɯsnᴉǝ op pǝs \'ʇᴉlǝ ƃuᴉɔsᴉdᴉpɐ ɹnʇǝʇɔǝsuoɔ \'ʇǝɯɐ ʇᴉs ɹolop ɯnsdᴉ ɯǝɹo˥')) { | |
| 21949 | + throw new Exception("Missing required property"); | |
| 21950 | + } | |
| 21951 | + if (!property_exists($obj, 'NIL')) { | |
| 21952 | + throw new Exception("Missing required property"); | |
| 21953 | + } | |
| 21954 | + if (!property_exists($obj, 'NUL')) { | |
| 21955 | + throw new Exception("Missing required property"); | |
| 21956 | + } | |
| 21957 | + if (!property_exists($obj, 'null')) { | |
| 21958 | + throw new Exception("Missing required property"); | |
| 21959 | + } | |
| 21960 | + if (!property_exists($obj, '# Numeric Strings')) { | |
| 21961 | + throw new Exception("Missing required property"); | |
| 21962 | + } | |
| 21963 | + if (!property_exists($obj, 'Ṱ̺̺̕o͞ ̷i̲̬͇̪͙n̝̗͕v̟̜̘̦͟o̶̙̰̠kè͚̮̺̪̹̱̤ ̖t̝͕̳̣̻̪͞h̼͓̲̦̳̘̲e͇̣̰̦̬͎ ̢̼̻̱̘h͚͎͙̜̣̲ͅi̦̲̣̰̤v̻͍e̺̭̳̪̰-m̢iͅn̖̺̞̲̯̰d̵̼̟͙̩̼̘̳ ̞̥̱̳̭r̛̗̘e͙p͠r̼̞̻̭̗e̺̠̣͟s̘͇̳͍̝͉e͉̥̯̞̲͚̬͜ǹ̬͎͎̟̖͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ͏͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣')) { | |
| 21964 | + throw new Exception("Missing required property"); | |
| 21965 | + } | |
| 21966 | + if (!property_exists($obj, '# Often forbidden to appear in various text-based file formats (e.g. XML),')) { | |
| 21967 | + throw new Exception("Missing required property"); | |
| 21968 | + } | |
| 21969 | + if (!property_exists($obj, '" onfocus=JaVaSCript:alert(123) autofocus')) { | |
| 21970 | + throw new Exception("Missing required property"); | |
| 21971 | + } | |
| 21972 | + if (!property_exists($obj, '\' OR 1=1 -- 1')) { | |
| 21973 | + throw new Exception("Missing required property"); | |
| 21974 | + } | |
| 21975 | + if (!property_exists($obj, '"')) { | |
| 21976 | + throw new Exception("Missing required property"); | |
| 21977 | + } | |
| 21978 | + if (!property_exists($obj, '<script>alert(123)</script>')) { | |
| 21979 | + throw new Exception("Missing required property"); | |
| 21980 | + } | |
| 21981 | + if (!property_exists($obj, '# Quotation Marks')) { | |
| 21982 | + throw new Exception("Missing required property"); | |
| 21983 | + } | |
| 21984 | + if (!property_exists($obj, '# Regional Indicator Symbols')) { | |
| 21985 | + throw new Exception("Missing required property"); | |
| 21986 | + } | |
| 21987 | + if (!property_exists($obj, '# Regional Indicator Symbols can be displayed differently across')) { | |
| 21988 | + throw new Exception("Missing required property"); | |
| 21989 | + } | |
| 21990 | + if (!property_exists($obj, '# Reserved Strings')) { | |
| 21991 | + throw new Exception("Missing required property"); | |
| 21992 | + } | |
| 21993 | + if (!property_exists($obj, '"><script>alert(123)</script>')) { | |
| 21994 | + throw new Exception("Missing required property"); | |
| 21995 | + } | |
| 21996 | + if (!property_exists($obj, '><script>alert(123);</script x=')) { | |
| 21997 | + throw new Exception("Missing required property"); | |
| 21998 | + } | |
| 21999 | + if (!property_exists($obj, '<<SCRIPT>alert("XSS");//<</SCRIPT>')) { | |
| 22000 | + throw new Exception("Missing required property"); | |
| 22001 | + } | |
| 22002 | + if (!property_exists($obj, '<SCRIPT SRC=//ha.ckers.org/.j>')) { | |
| 22003 | + throw new Exception("Missing required property"); | |
| 22004 | + } | |
| 22005 | + if (!property_exists($obj, '<script src="\\\\%(jscript)s"></script>')) { | |
| 22006 | + throw new Exception("Missing required property"); | |
| 22007 | + } | |
| 22008 | + if (!property_exists($obj, '"`\'><script>\\x09javascript:alert(1)</script>')) { | |
| 22009 | + throw new Exception("Missing required property"); | |
| 22010 | + } | |
| 22011 | + if (!property_exists($obj, '<script\\x0Atype="text/javascript">javascript:alert(1);</script>')) { | |
| 22012 | + throw new Exception("Missing required property"); | |
| 22013 | + } | |
| 22014 | + if (!property_exists($obj, '<script\\x0Dtype="text/javascript">javascript:alert(1);</script>')) { | |
| 22015 | + throw new Exception("Missing required property"); | |
| 22016 | + } | |
| 22017 | + if (!property_exists($obj, '"`\'><script>\\x21javascript:alert(1)</script>')) { | |
| 22018 | + throw new Exception("Missing required property"); | |
| 22019 | + } | |
| 22020 | + if (!property_exists($obj, '"`\'><script>\\x3Bjavascript:alert(1)</script>')) { | |
| 22021 | + throw new Exception("Missing required property"); | |
| 22022 | + } | |
| 22023 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\x85javascript:alert(1)</script>')) { | |
| 22024 | + throw new Exception("Missing required property"); | |
| 22025 | + } | |
| 22026 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\x87javascript:alert(1)</script>')) { | |
| 22027 | + throw new Exception("Missing required property"); | |
| 22028 | + } | |
| 22029 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\x8Ajavascript:alert(1)</script>')) { | |
| 22030 | + throw new Exception("Missing required property"); | |
| 22031 | + } | |
| 22032 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\xA8javascript:alert(1)</script>')) { | |
| 22033 | + throw new Exception("Missing required property"); | |
| 22034 | + } | |
| 22035 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\xA9javascript:alert(1)</script>')) { | |
| 22036 | + throw new Exception("Missing required property"); | |
| 22037 | + } | |
| 22038 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\xAFjavascript:alert(1)</script>')) { | |
| 22039 | + throw new Exception("Missing required property"); | |
| 22040 | + } | |
| 22041 | + if (!property_exists($obj, '"`\'><script>\\xE3\\x80\\x80javascript:alert(1)</script>')) { | |
| 22042 | + throw new Exception("Missing required property"); | |
| 22043 | + } | |
| 22044 | + if (!property_exists($obj, '# Scunthorpe Problem')) { | |
| 22045 | + throw new Exception("Missing required property"); | |
| 22046 | + } | |
| 22047 | + if (!property_exists($obj, 'åß∂ƒ©˙∆˚¬…æ')) { | |
| 22048 | + throw new Exception("Missing required property"); | |
| 22049 | + } | |
| 22050 | + if (!property_exists($obj, '# Strings that may occur on IRC clients that make security products freak out')) { | |
| 22051 | + throw new Exception("Missing required property"); | |
| 22052 | + } | |
| 22053 | + if (!property_exists($obj, '# Strings which are reserved characters in MSDOS/Windows')) { | |
| 22054 | + throw new Exception("Missing required property"); | |
| 22055 | + } | |
| 22056 | + if (!property_exists($obj, '# Strings which attempt to invoke a benign script injection; shows vulnerability to XSS')) { | |
| 22057 | + throw new Exception("Missing required property"); | |
| 22058 | + } | |
| 22059 | + if (!property_exists($obj, '# Strings which contain text that should be rendered RTL if possible (e.g. Arabic, Hebrew)')) { | |
| 22060 | + throw new Exception("Missing required property"); | |
| 22061 | + } | |
| 22062 | + if (!property_exists($obj, '# Strings which contain two-byte characters: can cause rendering issues or character-length issues')) { | |
| 22063 | + throw new Exception("Missing required property"); | |
| 22064 | + } | |
| 22065 | + if (!property_exists($obj, '# Strings which contain unicode numbers; if the code is localized, it should see the input as numeric')) { | |
| 22066 | + throw new Exception("Missing required property"); | |
| 22067 | + } | |
| 22068 | + if (!property_exists($obj, '# Strings which may be used elsewhere in code')) { | |
| 22069 | + throw new Exception("Missing required property"); | |
| 22070 | + } | |
| 22071 | + if (!property_exists($obj, '(。◕ ∀ ◕。)')) { | |
| 22072 | + throw new Exception("Missing required property"); | |
| 22073 | + } | |
| 22074 | + if (!property_exists($obj, '# Terminal escape codes')) { | |
| 22075 | + throw new Exception("Missing required property"); | |
| 22076 | + } | |
| 22077 | + if (!property_exists($obj, '0.00')) { | |
| 22078 | + throw new Exception("Missing required property"); | |
| 22079 | + } | |
| 22080 | + if (!property_exists($obj, '01000')) { | |
| 22081 | + throw new Exception("Missing required property"); | |
| 22082 | + } | |
| 22083 | + if (!property_exists($obj, '08')) { | |
| 22084 | + throw new Exception("Missing required property"); | |
| 22085 | + } | |
| 22086 | + if (!property_exists($obj, '09')) { | |
| 22087 | + throw new Exception("Missing required property"); | |
| 22088 | + } | |
| 22089 | + if (!property_exists($obj, '0xffffffffffffffff')) { | |
| 22090 | + throw new Exception("Missing required property"); | |
| 22091 | + } | |
| 22092 | + if (!property_exists($obj, '😍')) { | |
| 22093 | + throw new Exception("Missing required property"); | |
| 22094 | + } | |
| 22095 | + if (!property_exists($obj, '$1.00')) { | |
| 22096 | + throw new Exception("Missing required property"); | |
| 22097 | + } | |
| 22098 | + if (!property_exists($obj, '1,0/0,0')) { | |
| 22099 | + throw new Exception("Missing required property"); | |
| 22100 | + } | |
| 22101 | + if (!property_exists($obj, '1 000.00')) { | |
| 22102 | + throw new Exception("Missing required property"); | |
| 22103 | + } | |
| 22104 | + if (!property_exists($obj, '1 000 000,00')) { | |
| 22105 | + throw new Exception("Missing required property"); | |
| 22106 | + } | |
| 22107 | + if (!property_exists($obj, '1\'; DROP TABLE users-- 1')) { | |
| 22108 | + throw new Exception("Missing required property"); | |
| 22109 | + } | |
| 22110 | + if (!property_exists($obj, '1#IND')) { | |
| 22111 | + throw new Exception("Missing required property"); | |
| 22112 | + } | |
| 22113 | + if (!property_exists($obj, '1#INF')) { | |
| 22114 | + throw new Exception("Missing required property"); | |
| 22115 | + } | |
| 22116 | + if (!property_exists($obj, '-2147483648/-1')) { | |
| 22117 | + throw new Exception("Missing required property"); | |
| 22118 | + } | |
| 22119 | + if (!property_exists($obj, '2.2250738585072011e-308')) { | |
| 22120 | + throw new Exception("Missing required property"); | |
| 22121 | + } | |
| 22122 | + if (!property_exists($obj, '# The next line may appear to be blank, mojibake, or dingbats in some viewers.')) { | |
| 22123 | + throw new Exception("Missing required property"); | |
| 22124 | + } | |
| 22125 | + if (!property_exists($obj, '# The next line may appear to be blank or mojibake in some viewers.')) { | |
| 22126 | + throw new Exception("Missing required property"); | |
| 22127 | + } | |
| 22128 | + if (!property_exists($obj, '# The next line may be flagged for "trailing whitespace" in some viewers.')) { | |
| 22129 | + throw new Exception("Missing required property"); | |
| 22130 | + } | |
| 22131 | + if (!property_exists($obj, '# This file unfortunately cannot express strings containing')) { | |
| 22132 | + throw new Exception("Missing required property"); | |
| 22133 | + } | |
| 22134 | + if (!property_exists($obj, '$(touch /tmp/blns.fail)')) { | |
| 22135 | + throw new Exception("Missing required property"); | |
| 22136 | + } | |
| 22137 | + if (!property_exists($obj, '() { _; } >_[$($())] { touch /tmp/blns.shellshock2.fail; }')) { | |
| 22138 | + throw new Exception("Missing required property"); | |
| 22139 | + } | |
| 22140 | + if (!property_exists($obj, 'Tyson Gay')) { | |
| 22141 | + throw new Exception("Missing required property"); | |
| 22142 | + } | |
| 22143 | + if (!property_exists($obj, '# Unicode Symbols')) { | |
| 22144 | + throw new Exception("Missing required property"); | |
| 22145 | + } | |
| 22146 | + if (!property_exists($obj, '\'`"><\\x00script>javascript:alert(1)</script>')) { | |
| 22147 | + throw new Exception("Missing required property"); | |
| 22148 | + } | |
| 22149 | + if (!property_exists($obj, '\'`"><\\x3Cscript>javascript:alert(1)</script>')) { | |
| 22150 | + throw new Exception("Missing required property"); | |
| 22151 | + } | |
| 22152 | + return new B( | |
| 22153 | + B::from1($obj->{'ﷺ'}) | |
| 22154 | + ,B::from2($obj->{'123'}) | |
| 22155 | + ,B::fromAHrefHTTPFooBarXYAImgAltImgSrcXXOnerrorJavascriptAlert1A($obj->{'<a href=http://foo.bar/#x=`y></a><img alt="`><img src=x:x onerror=javascript:alert(1)></a>">'}) | |
| 22156 | + ,B::fromAHrefJavascriptX00JavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="javascript\\x00:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22157 | + ,B::fromAHrefJavascriptX0DJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="javascript\\x0D:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22158 | + ,B::fromAHrefX02JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x02javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22159 | + ,B::fromAHrefX04JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x04javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22160 | + ,B::fromAHrefX0AjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x0Ajavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22161 | + ,B::fromAHrefX0DjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x0Djavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22162 | + ,B::fromAHrefX0EjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x0Ejavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22163 | + ,B::fromAHrefX0FjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x0Fjavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22164 | + ,B::fromAHrefX16JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x16javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22165 | + ,B::fromAHrefX19JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x19javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22166 | + ,B::fromAHrefX1AjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x1Ajavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22167 | + ,B::fromAHrefX1DjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x1Djavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22168 | + ,B::fromAHrefX1EjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\x1Ejavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22169 | + ,B::fromAHrefXE2X80X81JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\xE2\\x80\\x81javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22170 | + ,B::fromAHrefXE2X80X82JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\xE2\\x80\\x82javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22171 | + ,B::fromAHrefXE2X80XA9JavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\xE2\\x80\\xA9javascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22172 | + ,B::fromAHrefXE2X80XAFjavascriptJavascriptAlert1IDFuzzelement1TestA($obj->{'<a href="\\xE2\\x80\\xAFjavascript:javascript:alert(1)" id="fuzzelement1">test</a>'}) | |
| 22173 | + ,B::fromAbcDivStyleXExpressionX5CJavascriptAlert1DEF($obj->{'ABC<div style="x:expression\\x5C(javascript:alert(1)">DEF'}) | |
| 22174 | + ,B::fromAbcDivStyleXX0AexpressionJavascriptAlert1DEF($obj->{'ABC<div style="x:\\x0Aexpression(javascript:alert(1)">DEF'}) | |
| 20999 | 22175 | ,B::fromAbcDivStyleXX0DexpressionJavascriptAlert1DEF($obj->{'ABC<div style="x:\\x0Dexpression(javascript:alert(1)">DEF'}) |
| 21000 | 22176 | ,B::fromAbcDivStyleXXE2X80X82ExpressionJavascriptAlert1DEF($obj->{'ABC<div style="x:\\xE2\\x80\\x82expression(javascript:alert(1)">DEF'}) |
| 21001 | 22177 | ,B::fromAbcDivStyleXXE2X80X83ExpressionJavascriptAlert1DEF($obj->{'ABC<div style="x:\\xE2\\x80\\x83expression(javascript:alert(1)">DEF'}) |
| @@ -31475,6 +32651,591 @@ class C { | ||
| 31475 | 32651 | * @throws Exception |
| 31476 | 32652 | */ |
| 31477 | 32653 | public static function from(stdClass $obj): C { |
| 32654 | + if (!property_exists($obj, 'مُنَاقَشَةُ سُبُلِ اِسْتِخْدَامِ اللُّغَةِ فِي النُّظُمِ الْقَائِمَةِ وَفِيم يَخُصَّ التَّطْبِيقَاتُ الْحاسُوبِيَّةُ، ')) { | |
| 32655 | + throw new Exception("Missing required property"); | |
| 32656 | + } | |
| 32657 | + if (!property_exists($obj, '١٢٣')) { | |
| 32658 | + throw new Exception("Missing required property"); | |
| 32659 | + } | |
| 32660 | + if (!property_exists($obj, '울란바토르')) { | |
| 32661 | + throw new Exception("Missing required property"); | |
| 32662 | + } | |
| 32663 | + if (!property_exists($obj, '𠜎𠜱𠝹𠱓𠱸𠲖𠳏')) { | |
| 32664 | + throw new Exception("Missing required property"); | |
| 32665 | + } | |
| 32666 | + if (!property_exists($obj, 'A:')) { | |
| 32667 | + throw new Exception("Missing required property"); | |
| 32668 | + } | |
| 32669 | + if (!property_exists($obj, '<a href="\\x00javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32670 | + throw new Exception("Missing required property"); | |
| 32671 | + } | |
| 32672 | + if (!property_exists($obj, '<a href="\\x03javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32673 | + throw new Exception("Missing required property"); | |
| 32674 | + } | |
| 32675 | + if (!property_exists($obj, '<a href="\\x06javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32676 | + throw new Exception("Missing required property"); | |
| 32677 | + } | |
| 32678 | + if (!property_exists($obj, '<a href="\\x07javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32679 | + throw new Exception("Missing required property"); | |
| 32680 | + } | |
| 32681 | + if (!property_exists($obj, '<a href="\\x0Bjavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32682 | + throw new Exception("Missing required property"); | |
| 32683 | + } | |
| 32684 | + if (!property_exists($obj, '<a href="\\x12javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32685 | + throw new Exception("Missing required property"); | |
| 32686 | + } | |
| 32687 | + if (!property_exists($obj, '<a href="\\x14javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32688 | + throw new Exception("Missing required property"); | |
| 32689 | + } | |
| 32690 | + if (!property_exists($obj, '<a href="\\x15javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32691 | + throw new Exception("Missing required property"); | |
| 32692 | + } | |
| 32693 | + if (!property_exists($obj, '<a href="\\x18javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32694 | + throw new Exception("Missing required property"); | |
| 32695 | + } | |
| 32696 | + if (!property_exists($obj, '<a href="\\x1Bjavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32697 | + throw new Exception("Missing required property"); | |
| 32698 | + } | |
| 32699 | + if (!property_exists($obj, '<a href="\\x1Cjavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32700 | + throw new Exception("Missing required property"); | |
| 32701 | + } | |
| 32702 | + if (!property_exists($obj, '<a href="\\x20javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32703 | + throw new Exception("Missing required property"); | |
| 32704 | + } | |
| 32705 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\x80javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32706 | + throw new Exception("Missing required property"); | |
| 32707 | + } | |
| 32708 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\x85javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32709 | + throw new Exception("Missing required property"); | |
| 32710 | + } | |
| 32711 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\x88javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32712 | + throw new Exception("Missing required property"); | |
| 32713 | + } | |
| 32714 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\x89javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32715 | + throw new Exception("Missing required property"); | |
| 32716 | + } | |
| 32717 | + if (!property_exists($obj, '<a href="\\xE2\\x80\\x8Ajavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32718 | + throw new Exception("Missing required property"); | |
| 32719 | + } | |
| 32720 | + if (!property_exists($obj, '<a href="\\xE2\\x81\\x9Fjavascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32721 | + throw new Exception("Missing required property"); | |
| 32722 | + } | |
| 32723 | + if (!property_exists($obj, '<a href="\\xE3\\x80\\x80javascript:javascript:alert(1)" id="fuzzelement1">test</a>')) { | |
| 32724 | + throw new Exception("Missing required property"); | |
| 32725 | + } | |
| 32726 | + if (!property_exists($obj, 'ABC<div style="x:expression\\x00(javascript:alert(1)">DEF')) { | |
| 32727 | + throw new Exception("Missing required property"); | |
| 32728 | + } | |
| 32729 | + if (!property_exists($obj, 'ABC<div style="x:\\x00expression(javascript:alert(1)">DEF')) { | |
| 32730 | + throw new Exception("Missing required property"); | |
| 32731 | + } | |
| 32732 | + if (!property_exists($obj, 'ABC<div style="x:\\x0Cexpression(javascript:alert(1)">DEF')) { | |
| 32733 | + throw new Exception("Missing required property"); | |
| 32734 | + } | |
| 32735 | + if (!property_exists($obj, 'ABC<div style="x:\\xE2\\x80\\x81expression(javascript:alert(1)">DEF')) { | |
| 32736 | + throw new Exception("Missing required property"); | |
| 32737 | + } | |
| 32738 | + if (!property_exists($obj, 'ABC<div style="x:\\xE2\\x80\\x86expression(javascript:alert(1)">DEF')) { | |
| 32739 | + throw new Exception("Missing required property"); | |
| 32740 | + } | |
| 32741 | + if (!property_exists($obj, 'ABC<div style="x:\\xE2\\x80\\x88expression(javascript:alert(1)">DEF')) { | |
| 32742 | + throw new Exception("Missing required property"); | |
| 32743 | + } | |
| 32744 | + if (!property_exists($obj, 'ABC<div style="x:\\xE3\\x80\\x80expression(javascript:alert(1)">DEF')) { | |
| 32745 | + throw new Exception("Missing required property"); | |
| 32746 | + } | |
| 32747 | + if (!property_exists($obj, 'ABC<div style="x:\\xEF\\xBB\\xBFexpression(javascript:alert(1)">DEF')) { | |
| 32748 | + throw new Exception("Missing required property"); | |
| 32749 | + } | |
| 32750 | + if (!property_exists($obj, '.')) { | |
| 32751 | + throw new Exception("Missing required property"); | |
| 32752 | + } | |
| 32753 | + if (!property_exists($obj, '# and U+007F (DEL)')) { | |
| 32754 | + throw new Exception("Missing required property"); | |
| 32755 | + } | |
| 32756 | + if (!property_exists($obj, '# ASCII punctuation. All of these characters may need to be escaped in some')) { | |
| 32757 | + throw new Exception("Missing required property"); | |
| 32758 | + } | |
| 32759 | + if (!property_exists($obj, '<BODY onload!#$%&()*~+-_.,:;?@[/|\\]^`=alert("XSS")>')) { | |
| 32760 | + throw new Exception("Missing required property"); | |
| 32761 | + } | |
| 32762 | + if (!property_exists($obj, 'בְּרֵאשִׁית, בָּרָא אֱלֹהִים, אֵת הַשָּׁמַיִם, וְאֵת הָאָרֶץ')) { | |
| 32763 | + throw new Exception("Missing required property"); | |
| 32764 | + } | |
| 32765 | + if (!property_exists($obj, '"\'"\'"\'\'\'\'"')) { | |
| 32766 | + throw new Exception("Missing required property"); | |
| 32767 | + } | |
| 32768 | + if (!property_exists($obj, '-0.0')) { | |
| 32769 | + throw new Exception("Missing required property"); | |
| 32770 | + } | |
| 32771 | + if (!property_exists($obj, '0.0/0')) { | |
| 32772 | + throw new Exception("Missing required property"); | |
| 32773 | + } | |
| 32774 | + if (!property_exists($obj, '-1.00')) { | |
| 32775 | + throw new Exception("Missing required property"); | |
| 32776 | + } | |
| 32777 | + if (!property_exists($obj, '1,000.00')) { | |
| 32778 | + throw new Exception("Missing required property"); | |
| 32779 | + } | |
| 32780 | + if (!property_exists($obj, '1,000,000.00')) { | |
| 32781 | + throw new Exception("Missing required property"); | |
| 32782 | + } | |
| 32783 | + if (!property_exists($obj, '1E+02')) { | |
| 32784 | + throw new Exception("Missing required property"); | |
| 32785 | + } | |
| 32786 | + if (!property_exists($obj, '><script>alert(123)</script>')) { | |
| 32787 | + throw new Exception("Missing required property"); | |
| 32788 | + } | |
| 32789 | + if (!property_exists($obj, '┬─┬ノ( º _ ºノ)')) { | |
| 32790 | + throw new Exception("Missing required property"); | |
| 32791 | + } | |
| 32792 | + if (!property_exists($obj, 'CLOCK$')) { | |
| 32793 | + throw new Exception("Missing required property"); | |
| 32794 | + } | |
| 32795 | + if (!property_exists($obj, 'COM2')) { | |
| 32796 | + throw new Exception("Missing required property"); | |
| 32797 | + } | |
| 32798 | + if (!property_exists($obj, 'COM4')) { | |
| 32799 | + throw new Exception("Missing required property"); | |
| 32800 | + } | |
| 32801 | + if (!property_exists($obj, 'Craig Cockburn, Software Specialist')) { | |
| 32802 | + throw new Exception("Missing required property"); | |
| 32803 | + } | |
| 32804 | + if (!property_exists($obj, '\\\\')) { | |
| 32805 | + throw new Exception("Missing required property"); | |
| 32806 | + } | |
| 32807 | + if (!property_exists($obj, 'DCC SEND STARTKEYLOGGER 0 0 0')) { | |
| 32808 | + throw new Exception("Missing required property"); | |
| 32809 | + } | |
| 32810 | + if (!property_exists($obj, 'dontMakeAMap')) { | |
| 32811 | + throw new Exception("Missing required property"); | |
| 32812 | + } | |
| 32813 | + if (!property_exists($obj, '# Emoji')) { | |
| 32814 | + throw new Exception("Missing required property"); | |
| 32815 | + } | |
| 32816 | + if (!property_exists($obj, '""')) { | |
| 32817 | + throw new Exception("Missing required property"); | |
| 32818 | + } | |
| 32819 | + if (!property_exists($obj, 'evaluate')) { | |
| 32820 | + throw new Exception("Missing required property"); | |
| 32821 | + } | |
| 32822 | + if (!property_exists($obj, '%')) { | |
| 32823 | + throw new Exception("Missing required property"); | |
| 32824 | + } | |
| 32825 | + if (!property_exists($obj, '0/0')) { | |
| 32826 | + throw new Exception("Missing required property"); | |
| 32827 | + } | |
| 32828 | + if (!property_exists($obj, '<foo val=“bar” />')) { | |
| 32829 | + throw new Exception("Missing required property"); | |
| 32830 | + } | |
| 32831 | + if (!property_exists($obj, 'ÅÍÎÏ˝ÓÔÒÚÆ☃')) { | |
| 32832 | + throw new Exception("Missing required property"); | |
| 32833 | + } | |
| 32834 | + if (!property_exists($obj, '̗̺͖̹̯͓Ṯ̤͍̥͇͈h̲́e͏͓̼̗̙̼̣͔ ͇̜̱̠͓͍ͅN͕͠e̗̱z̘̝̜̺͙p̤̺̹͍̯͚e̠̻̠͜r̨̤͍̺̖͔̖̖d̠̟̭̬̝͟i̦͖̩͓͔̤a̠̗̬͉̙n͚͜ ̻̞̰͚ͅh̵͉i̳̞v̢͇ḙ͎͟-҉̭̩̼͔m̤̭̫i͕͇̝̦n̗͙ḍ̟ ̯̲͕͞ǫ̟̯̰̲͙̻̝f ̪̰̰̗̖̭̘͘c̦͍̲̞͍̩̙ḥ͚a̮͎̟̙͜ơ̩̹͎s̤.̝̝ ҉Z̡̖̜͖̰̣͉̜a͖̰͙̬͡l̲̫̳͍̩g̡̟̼̱͚̞̬ͅo̗͜.̟')) { | |
| 32835 | + throw new Exception("Missing required property"); | |
| 32836 | + } | |
| 32837 | + if (!property_exists($obj, 'hasOwnProperty')) { | |
| 32838 | + throw new Exception("Missing required property"); | |
| 32839 | + } | |
| 32840 | + if (!property_exists($obj, '--')) { | |
| 32841 | + throw new Exception("Missing required property"); | |
| 32842 | + } | |
| 32843 | + if (!property_exists($obj, 'Horniman Museum')) { | |
| 32844 | + throw new Exception("Missing required property"); | |
| 32845 | + } | |
| 32846 | + if (!property_exists($obj, 'http://www.cum.qc.ca/')) { | |
| 32847 | + throw new Exception("Missing required property"); | |
| 32848 | + } | |
| 32849 | + if (!property_exists($obj, '<i onwheel=alert(1)> Scroll over me </i>')) { | |
| 32850 | + throw new Exception("Missing required property"); | |
| 32851 | + } | |
| 32852 | + if (!property_exists($obj, '<img[a][b][c]src[d]=x[e]onerror=[f]"alert(1)">')) { | |
| 32853 | + throw new Exception("Missing required property"); | |
| 32854 | + } | |
| 32855 | + if (!property_exists($obj, '<IMG onmouseover="alert(\'xxs\')">')) { | |
| 32856 | + throw new Exception("Missing required property"); | |
| 32857 | + } | |
| 32858 | + if (!property_exists($obj, '<IMG """><SCRIPT>alert("XSS")</SCRIPT>">')) { | |
| 32859 | + throw new Exception("Missing required property"); | |
| 32860 | + } | |
| 32861 | + if (!property_exists($obj, '<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>')) { | |
| 32862 | + throw new Exception("Missing required property"); | |
| 32863 | + } | |
| 32864 | + if (!property_exists($obj, '<IMG SRC="javascript:alert(\'XSS\')"')) { | |
| 32865 | + throw new Exception("Missing required property"); | |
| 32866 | + } | |
| 32867 | + if (!property_exists($obj, '<img src onerror /" \'"= alt=javascript:alert(1)//">')) { | |
| 32868 | + throw new Exception("Missing required property"); | |
| 32869 | + } | |
| 32870 | + if (!property_exists($obj, '<img src\\x10=x onerror="javascript:alert(1)">')) { | |
| 32871 | + throw new Exception("Missing required property"); | |
| 32872 | + } | |
| 32873 | + if (!property_exists($obj, '<img src\\x12=x onerror="javascript:alert(1)">')) { | |
| 32874 | + throw new Exception("Missing required property"); | |
| 32875 | + } | |
| 32876 | + if (!property_exists($obj, '<img src\\x13=x onerror="javascript:alert(1)">')) { | |
| 32877 | + throw new Exception("Missing required property"); | |
| 32878 | + } | |
| 32879 | + if (!property_exists($obj, '<img src\\x32=x onerror="javascript:alert(1)">')) { | |
| 32880 | + throw new Exception("Missing required property"); | |
| 32881 | + } | |
| 32882 | + if (!property_exists($obj, '<img src\\x47=x onerror="javascript:alert(1)">')) { | |
| 32883 | + throw new Exception("Missing required property"); | |
| 32884 | + } | |
| 32885 | + if (!property_exists($obj, '<img src=x onerror=alert(123) />')) { | |
| 32886 | + throw new Exception("Missing required property"); | |
| 32887 | + } | |
| 32888 | + if (!property_exists($obj, '<img src=x onerror=\\x10"javascript:alert(1)">')) { | |
| 32889 | + throw new Exception("Missing required property"); | |
| 32890 | + } | |
| 32891 | + if (!property_exists($obj, '<img src=x onerror=\\x32"javascript:alert(1)">')) { | |
| 32892 | + throw new Exception("Missing required property"); | |
| 32893 | + } | |
| 32894 | + if (!property_exists($obj, '<img src="x` `<script>javascript:alert(1)</script>"` `>')) { | |
| 32895 | + throw new Exception("Missing required property"); | |
| 32896 | + } | |
| 32897 | + if (!property_exists($obj, '`"\'><img src=xxx:x \\x09onerror=javascript:alert(1)>')) { | |
| 32898 | + throw new Exception("Missing required property"); | |
| 32899 | + } | |
| 32900 | + if (!property_exists($obj, '`"\'><img src=xxx:x \\x20onerror=javascript:alert(1)>')) { | |
| 32901 | + throw new Exception("Missing required property"); | |
| 32902 | + } | |
| 32903 | + if (!property_exists($obj, '`"\'><img src=xxx:x \\x22onerror=javascript:alert(1)>')) { | |
| 32904 | + throw new Exception("Missing required property"); | |
| 32905 | + } | |
| 32906 | + if (!property_exists($obj, '`"\'><img src=xxx:x \\x27onerror=javascript:alert(1)>')) { | |
| 32907 | + throw new Exception("Missing required property"); | |
| 32908 | + } | |
| 32909 | + if (!property_exists($obj, '<img\\x11src=x onerror="javascript:alert(1)">')) { | |
| 32910 | + throw new Exception("Missing required property"); | |
| 32911 | + } | |
| 32912 | + if (!property_exists($obj, '<img \\x34src=x onerror="javascript:alert(1)">')) { | |
| 32913 | + throw new Exception("Missing required property"); | |
| 32914 | + } | |
| 32915 | + if (!property_exists($obj, '<img\\x47src=x onerror="javascript:alert(1)">')) { | |
| 32916 | + throw new Exception("Missing required property"); | |
| 32917 | + } | |
| 32918 | + if (!property_exists($obj, '-')) { | |
| 32919 | + throw new Exception("Missing required property"); | |
| 32920 | + } | |
| 32921 | + if (!property_exists($obj, ',。・:*:・゜’( ☻ ω ☻ )。・:*:・゜’')) { | |
| 32922 | + throw new Exception("Missing required property"); | |
| 32923 | + } | |
| 32924 | + if (!property_exists($obj, 'Infinity')) { | |
| 32925 | + throw new Exception("Missing required property"); | |
| 32926 | + } | |
| 32927 | + if (!property_exists($obj, 'JavaSCript:alert(123)')) { | |
| 32928 | + throw new Exception("Missing required property"); | |
| 32929 | + } | |
| 32930 | + if (!property_exists($obj, 'LPT1')) { | |
| 32931 | + throw new Exception("Missing required property"); | |
| 32932 | + } | |
| 32933 | + if (!property_exists($obj, '<script>alert('123');</script>')) { | |
| 32934 | + throw new Exception("Missing required property"); | |
| 32935 | + } | |
| 32936 | + if (!property_exists($obj, '_')) { | |
| 32937 | + throw new Exception("Missing required property"); | |
| 32938 | + } | |
| 32939 | + if (!property_exists($obj, 'magna cum laude')) { | |
| 32940 | + throw new Exception("Missing required property"); | |
| 32941 | + } | |
| 32942 | + if (!property_exists($obj, 'medieval erection of parapets')) { | |
| 32943 | + throw new Exception("Missing required property"); | |
| 32944 | + } | |
| 32945 | + if (!property_exists($obj, 'ЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя')) { | |
| 32946 | + throw new Exception("Missing required property"); | |
| 32947 | + } | |
| 32948 | + if (!property_exists($obj, 'mocha')) { | |
| 32949 | + throw new Exception("Missing required property"); | |
| 32950 | + } | |
| 32951 | + if (!property_exists($obj, 'NaN')) { | |
| 32952 | + throw new Exception("Missing required property"); | |
| 32953 | + } | |
| 32954 | + if (!property_exists($obj, '# Non-whitespace C0 controls: U+0001 through U+0008, U+000E through U+001F,')) { | |
| 32955 | + throw new Exception("Missing required property"); | |
| 32956 | + } | |
| 32957 | + if (!property_exists($obj, 'NULL')) { | |
| 32958 | + throw new Exception("Missing required property"); | |
| 32959 | + } | |
| 32960 | + if (!property_exists($obj, '\' onfocus=JaVaSCript:alert(123) autofocus')) { | |
| 32961 | + throw new Exception("Missing required property"); | |
| 32962 | + } | |
| 32963 | + if (!property_exists($obj, '# or reused for internal delimiters on the theory that they should never')) { | |
| 32964 | + throw new Exception("Missing required property"); | |
| 32965 | + } | |
| 32966 | + if (!property_exists($obj, '<plaintext>')) { | |
| 32967 | + throw new Exception("Missing required property"); | |
| 32968 | + } | |
| 32969 | + if (!property_exists($obj, 'Powerلُلُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ冗')) { | |
| 32970 | + throw new Exception("Missing required property"); | |
| 32971 | + } | |
| 32972 | + if (!property_exists($obj, '"\'\'\'\'"\'"')) { | |
| 32973 | + throw new Exception("Missing required property"); | |
| 32974 | + } | |
| 32975 | + if (!property_exists($obj, '0,,0')) { | |
| 32976 | + throw new Exception("Missing required property"); | |
| 32977 | + } | |
| 32978 | + if (!property_exists($obj, '1.000,00')) { | |
| 32979 | + throw new Exception("Missing required property"); | |
| 32980 | + } | |
| 32981 | + if (!property_exists($obj, '1.000.000,00')) { | |
| 32982 | + throw new Exception("Missing required property"); | |
| 32983 | + } | |
| 32984 | + if (!property_exists($obj, '<script>alert(123)</script>')) { | |
| 32985 | + throw new Exception("Missing required property"); | |
| 32986 | + } | |
| 32987 | + if (!property_exists($obj, '# Right-To-Left Strings')) { | |
| 32988 | + throw new Exception("Missing required property"); | |
| 32989 | + } | |
| 32990 | + if (!property_exists($obj, 'Roses are [0;31mred[0m, violets are [0;34mblue. Hope you enjoy terminal hue')) { | |
| 32991 | + throw new Exception("Missing required property"); | |
| 32992 | + } | |
| 32993 | + if (!property_exists($obj, '%*.*s')) { | |
| 32994 | + throw new Exception("Missing required property"); | |
| 32995 | + } | |
| 32996 | + if (!property_exists($obj, '\'><script>alert(123)</script>')) { | |
| 32997 | + throw new Exception("Missing required property"); | |
| 32998 | + } | |
| 32999 | + if (!property_exists($obj, '\'><script>alert(123);</script x=\'')) { | |
| 33000 | + throw new Exception("Missing required property"); | |
| 33001 | + } | |
| 33002 | + if (!property_exists($obj, '"`\'><script>-javascript:alert(1)</script>')) { | |
| 33003 | + throw new Exception("Missing required property"); | |
| 33004 | + } | |
| 33005 | + if (!property_exists($obj, '< / script >< script >alert(123)< / script >')) { | |
| 33006 | + throw new Exception("Missing required property"); | |
| 33007 | + } | |
| 33008 | + if (!property_exists($obj, '<script src="/\\%(jscript)s"></script>')) { | |
| 33009 | + throw new Exception("Missing required property"); | |
| 33010 | + } | |
| 33011 | + if (!property_exists($obj, '"`\'><script>\\x0Ajavascript:alert(1)</script>')) { | |
| 33012 | + throw new Exception("Missing required property"); | |
| 33013 | + } | |
| 33014 | + if (!property_exists($obj, '"`\'><script>\\x0Bjavascript:alert(1)</script>')) { | |
| 33015 | + throw new Exception("Missing required property"); | |
| 33016 | + } | |
| 33017 | + if (!property_exists($obj, '<script\\x0Ctype="text/javascript">javascript:alert(1);</script>')) { | |
| 33018 | + throw new Exception("Missing required property"); | |
| 33019 | + } | |
| 33020 | + if (!property_exists($obj, '"`\'><script>\\x20javascript:alert(1)</script>')) { | |
| 33021 | + throw new Exception("Missing required property"); | |
| 33022 | + } | |
| 33023 | + if (!property_exists($obj, '"`\'><script>\\x2Bjavascript:alert(1)</script>')) { | |
| 33024 | + throw new Exception("Missing required property"); | |
| 33025 | + } | |
| 33026 | + if (!property_exists($obj, '<script\\x2Ftype="text/javascript">javascript:alert(1);</script>')) { | |
| 33027 | + throw new Exception("Missing required property"); | |
| 33028 | + } | |
| 33029 | + if (!property_exists($obj, '"`\'><script>\\x7Ejavascript:alert(1)</script>')) { | |
| 33030 | + throw new Exception("Missing required property"); | |
| 33031 | + } | |
| 33032 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\x80javascript:alert(1)</script>')) { | |
| 33033 | + throw new Exception("Missing required property"); | |
| 33034 | + } | |
| 33035 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\x82javascript:alert(1)</script>')) { | |
| 33036 | + throw new Exception("Missing required property"); | |
| 33037 | + } | |
| 33038 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\x83javascript:alert(1)</script>')) { | |
| 33039 | + throw new Exception("Missing required property"); | |
| 33040 | + } | |
| 33041 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\x84javascript:alert(1)</script>')) { | |
| 33042 | + throw new Exception("Missing required property"); | |
| 33043 | + } | |
| 33044 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\x88javascript:alert(1)</script>')) { | |
| 33045 | + throw new Exception("Missing required property"); | |
| 33046 | + } | |
| 33047 | + if (!property_exists($obj, '"`\'><script>\\xE2\\x80\\x8Bjavascript:alert(1)</script>')) { | |
| 33048 | + throw new Exception("Missing required property"); | |
| 33049 | + } | |
| 33050 | + if (!property_exists($obj, '"`\'><script>\\xEF\\xBF\\xAEjavascript:alert(1)</script>')) { | |
| 33051 | + throw new Exception("Missing required property"); | |
| 33052 | + } | |
| 33053 | + if (!property_exists($obj, '"`\'><script>\\xEF\\xBF\\xBEjavascript:alert(1)</script>')) { | |
| 33054 | + throw new Exception("Missing required property"); | |
| 33055 | + } | |
| 33056 | + if (!property_exists($obj, 'Scunthorpe General Hospital')) { | |
| 33057 | + throw new Exception("Missing required property"); | |
| 33058 | + } | |
| 33059 | + if (!property_exists($obj, '# Server Code Injection')) { | |
| 33060 | + throw new Exception("Missing required property"); | |
| 33061 | + } | |
| 33062 | + if (!property_exists($obj, 'shitake mushrooms')) { | |
| 33063 | + throw new Exception("Missing required property"); | |
| 33064 | + } | |
| 33065 | + if (!property_exists($obj, '# Special Characters')) { | |
| 33066 | + throw new Exception("Missing required property"); | |
| 33067 | + } | |
| 33068 | + if (!property_exists($obj, 'src=JaVaSCript:prompt(132)')) { | |
| 33069 | + throw new Exception("Missing required property"); | |
| 33070 | + } | |
| 33071 | + if (!property_exists($obj, '(ノಥ益ಥ)ノ ┻━┻')) { | |
| 33072 | + throw new Exception("Missing required property"); | |
| 33073 | + } | |
| 33074 | + if (!property_exists($obj, '# Strings which can be interpreted as numeric')) { | |
| 33075 | + throw new Exception("Missing required property"); | |
| 33076 | + } | |
| 33077 | + if (!property_exists($obj, '# Strings which can cause a SQL injection if inputs are not sanitized')) { | |
| 33078 | + throw new Exception("Missing required property"); | |
| 33079 | + } | |
| 33080 | + if (!property_exists($obj, '# Strings which can cause user to pull in files that should not be a part of a web server')) { | |
| 33081 | + throw new Exception("Missing required property"); | |
| 33082 | + } | |
| 33083 | + if (!property_exists($obj, '# Strings which can cause user to run code on server as a privileged user (c.f. https://news.ycombinator.com/item?id=7665153)')) { | |
| 33084 | + throw new Exception("Missing required property"); | |
| 33085 | + } | |
| 33086 | + if (!property_exists($obj, '# Strings which contain "corrupted" text. The corruption will not appear in non-HTML text, however. (via http://www.eeemo.net)')) { | |
| 33087 | + throw new Exception("Missing required property"); | |
| 33088 | + } | |
| 33089 | + if (!property_exists($obj, '# Strings which contain unicode with an "upsidedown" effect (via http://www.upsidedowntext.com)')) { | |
| 33090 | + throw new Exception("Missing required property"); | |
| 33091 | + } | |
| 33092 | + if (!property_exists($obj, '# Strings which contain unicode with unusual properties (e.g. Right-to-left override) (c.f. http://www.unicode.org/charts/PDF/U2000.pdf)')) { | |
| 33093 | + throw new Exception("Missing required property"); | |
| 33094 | + } | |
| 33095 | + if (!property_exists($obj, '# Strings which punish the fools who use cat/type on this file')) { | |
| 33096 | + throw new Exception("Missing required property"); | |
| 33097 | + } | |
| 33098 | + if (!property_exists($obj, '<svg><script>123<1>alert(123)</script>')) { | |
| 33099 | + throw new Exception("Missing required property"); | |
| 33100 | + } | |
| 33101 | + if (!property_exists($obj, 'System("ls -al /")')) { | |
| 33102 | + throw new Exception("Missing required property"); | |
| 33103 | + } | |
| 33104 | + if (!property_exists($obj, '@{[system "touch /tmp/blns.fail"]}')) { | |
| 33105 | + throw new Exception("Missing required property"); | |
| 33106 | + } | |
| 33107 | + if (!property_exists($obj, '\'\'')) { | |
| 33108 | + throw new Exception("Missing required property"); | |
| 33109 | + } | |
| 33110 | + if (!property_exists($obj, ' test ')) { | |
| 33111 | + throw new Exception("Missing required property"); | |
| 33112 | + } | |
| 33113 | + if (!property_exists($obj, 'testtest')) { | |
| 33114 | + throw new Exception("Missing required property"); | |
| 33115 | + } | |
| 33116 | + if (!property_exists($obj, '🏳0🌈️')) { | |
| 33117 | + throw new Exception("Missing required property"); | |
| 33118 | + } | |
| 33119 | + if (!property_exists($obj, '+0.0')) { | |
| 33120 | + throw new Exception("Missing required property"); | |
| 33121 | + } | |
| 33122 | + if (!property_exists($obj, '0.0.0')) { | |
| 33123 | + throw new Exception("Missing required property"); | |
| 33124 | + } | |
| 33125 | + if (!property_exists($obj, '0️⃣ 1️⃣ 2️⃣ 3️⃣ 4️⃣ 5️⃣ 6️⃣ 7️⃣ 8️⃣ 9️⃣ 🔟')) { | |
| 33126 | + throw new Exception("Missing required property"); | |
| 33127 | + } | |
| 33128 | + if (!property_exists($obj, '() { 0; }; touch /tmp/blns.shellshock1.fail;')) { | |
| 33129 | + throw new Exception("Missing required property"); | |
| 33130 | + } | |
| 33131 | + if (!property_exists($obj, '0xabad1dea')) { | |
| 33132 | + throw new Exception("Missing required property"); | |
| 33133 | + } | |
| 33134 | + if (!property_exists($obj, '0xffffffff')) { | |
| 33135 | + throw new Exception("Missing required property"); | |
| 33136 | + } | |
| 33137 | + if (!property_exists($obj, '--1')) { | |
| 33138 | + throw new Exception("Missing required property"); | |
| 33139 | + } | |
| 33140 | + if (!property_exists($obj, 'The quick brown fox jumps over the lazy dog')) { | |
| 33141 | + throw new Exception("Missing required property"); | |
| 33142 | + } | |
| 33143 | + if (!property_exists($obj, '-$1.00')) { | |
| 33144 | + throw new Exception("Missing required property"); | |
| 33145 | + } | |
| 33146 | + if (!property_exists($obj, '1 000,00')) { | |
| 33147 | + throw new Exception("Missing required property"); | |
| 33148 | + } | |
| 33149 | + if (!property_exists($obj, '1\'000\'000,00')) { | |
| 33150 | + throw new Exception("Missing required property"); | |
| 33151 | + } | |
| 33152 | + if (!property_exists($obj, '-1/2')) { | |
| 33153 | + throw new Exception("Missing required property"); | |
| 33154 | + } | |
| 33155 | + if (!property_exists($obj, '-1E+02')) { | |
| 33156 | + throw new Exception("Missing required property"); | |
| 33157 | + } | |
| 33158 | + if (!property_exists($obj, '-1E2')) { | |
| 33159 | + throw new Exception("Missing required property"); | |
| 33160 | + } | |
| 33161 | + if (!property_exists($obj, '-1#IND')) { | |
| 33162 | + throw new Exception("Missing required property"); | |
| 33163 | + } | |
| 33164 | + if (!property_exists($obj, '⁰⁴⁵')) { | |
| 33165 | + throw new Exception("Missing required property"); | |
| 33166 | + } | |
| 33167 | + if (!property_exists($obj, '⅛⅜⅝⅞')) { | |
| 33168 | + throw new Exception("Missing required property"); | |
| 33169 | + } | |
| 33170 | + if (!property_exists($obj, '✋🏿 💪🏿 👐🏿 🙌🏿 👏🏿 🙏🏿')) { | |
| 33171 | + throw new Exception("Missing required property"); | |
| 33172 | + } | |
| 33173 | + if (!property_exists($obj, '・( ̄∀ ̄)・:*:')) { | |
| 33174 | + throw new Exception("Missing required property"); | |
| 33175 | + } | |
| 33176 | + if (!property_exists($obj, '𝐓𝐡𝐞 𝐪𝐮𝐢𝐜𝐤 𝐛𝐫𝐨𝐰𝐧 𝐟𝐨𝐱 𝐣𝐮𝐦𝐩𝐬 𝐨𝐯𝐞𝐫 𝐭𝐡𝐞 𝐥𝐚𝐳𝐲 𝐝𝐨𝐠')) { | |
| 33177 | + throw new Exception("Missing required property"); | |
| 33178 | + } | |
| 33179 | + if (!property_exists($obj, '𝚃𝚑𝚎 𝚚𝚞𝚒𝚌𝚔 𝚋𝚛𝚘𝚠𝚗 𝚏𝚘𝚡 𝚓𝚞𝚖𝚙𝚜 𝚘𝚟𝚎𝚛 𝚝𝚑𝚎 𝚕𝚊𝚣𝚢 𝚍𝚘𝚐')) { | |
| 33180 | + throw new Exception("Missing required property"); | |
| 33181 | + } | |
| 33182 | + if (!property_exists($obj, '🐵 🙈 🙉 🙊')) { | |
| 33183 | + throw new Exception("Missing required property"); | |
| 33184 | + } | |
| 33185 | + if (!property_exists($obj, '👾 🙇 💁 🙅 🙆 🙋 🙎 🙍')) { | |
| 33186 | + throw new Exception("Missing required property"); | |
| 33187 | + } | |
| 33188 | + if (!property_exists($obj, '-9223372036854775808/-1')) { | |
| 33189 | + throw new Exception("Missing required property"); | |
| 33190 | + } | |
| 33191 | + if (!property_exists($obj, '<title onpropertychange=javascript:alert(1)></title><title title=>')) { | |
| 33192 | + throw new Exception("Missing required property"); | |
| 33193 | + } | |
| 33194 | + if (!property_exists($obj, '# treated as whitespace in some contexts.')) { | |
| 33195 | + throw new Exception("Missing required property"); | |
| 33196 | + } | |
| 33197 | + if (!property_exists($obj, '# Trick Unicode')) { | |
| 33198 | + throw new Exception("Missing required property"); | |
| 33199 | + } | |
| 33200 | + if (!property_exists($obj, 'true')) { | |
| 33201 | + throw new Exception("Missing required property"); | |
| 33202 | + } | |
| 33203 | + if (!property_exists($obj, 'undefined')) { | |
| 33204 | + throw new Exception("Missing required property"); | |
| 33205 | + } | |
| 33206 | + if (!property_exists($obj, '# Unicode additional control characters: all of the characters with')) { | |
| 33207 | + throw new Exception("Missing required property"); | |
| 33208 | + } | |
| 33209 | + if (!property_exists($obj, '# Unicode Subscript/Superscript/Accents')) { | |
| 33210 | + throw new Exception("Missing required property"); | |
| 33211 | + } | |
| 33212 | + if (!property_exists($obj, '# Unicode Upsidedown')) { | |
| 33213 | + throw new Exception("Missing required property"); | |
| 33214 | + } | |
| 33215 | + if (!property_exists($obj, '$USER')) { | |
| 33216 | + throw new Exception("Missing required property"); | |
| 33217 | + } | |
| 33218 | + if (!property_exists($obj, '--version')) { | |
| 33219 | + throw new Exception("Missing required property"); | |
| 33220 | + } | |
| 33221 | + if (!property_exists($obj, '# version 8.0.0), plus U+0009 (HT), U+000B (VT), U+000C (FF), U+0085 (NEL),')) { | |
| 33222 | + throw new Exception("Missing required property"); | |
| 33223 | + } | |
| 33224 | + if (!property_exists($obj, '# Whitespace: all of the characters with category Zs, Zl, or Zp (in Unicode')) { | |
| 33225 | + throw new Exception("Missing required property"); | |
| 33226 | + } | |
| 33227 | + if (!property_exists($obj, '<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE foo [ <!ELEMENT foo ANY ><!ENTITY xxe SYSTEM "file:///etc/passwd" >]><foo>&xxe;</foo>')) { | |
| 33228 | + throw new Exception("Missing required property"); | |
| 33229 | + } | |
| 33230 | + if (!property_exists($obj, '# XXE Injection (XML)')) { | |
| 33231 | + throw new Exception("Missing required property"); | |
| 33232 | + } | |
| 33233 | + if (!property_exists($obj, '# Zalgo Text')) { | |
| 33234 | + throw new Exception("Missing required property"); | |
| 33235 | + } | |
| 33236 | + if (!property_exists($obj, 'ZZ:')) { | |
| 33237 | + throw new Exception("Missing required property"); | |
| 33238 | + } | |
| 31478 | 33239 | return new C( |
| 31479 | 33240 | C::from1($obj->{'مُنَاقَشَةُ سُبُلِ اِسْتِخْدَامِ اللُّغَةِ فِي النُّظُمِ الْقَائِمَةِ وَفِيم يَخُصَّ التَّطْبِيقَاتُ الْحاسُوبِيَّةُ، '}) |
| 31480 | 33241 | ,C::from2($obj->{'١٢٣'}) |
Test case
1 generated file · +9 −0test/inputs/json/priority/bug2037.json
Mphpdefault / TopLevel.php+9 −0
| @@ -99,6 +99,9 @@ class TopLevel { | ||
| 99 | 99 | * @throws Exception |
| 100 | 100 | */ |
| 101 | 101 | public static function from(stdClass $obj): TopLevel { |
| 102 | + if (!property_exists($obj, 'mission_specs')) { | |
| 103 | + throw new Exception("Missing required property"); | |
| 104 | + } | |
| 102 | 105 | return new TopLevel( |
| 103 | 106 | TopLevel::fromMissionSpecs($obj->{'mission_specs'}) |
| 104 | 107 | ); |
| @@ -212,6 +215,9 @@ class MissionSpec { | ||
| 212 | 215 | * @throws Exception |
| 213 | 216 | */ |
| 214 | 217 | public static function from(stdClass $obj): MissionSpec { |
| 218 | + if (!property_exists($obj, 'objectives')) { | |
| 219 | + throw new Exception("Missing required property"); | |
| 220 | + } | |
| 215 | 221 | return new MissionSpec( |
| 216 | 222 | MissionSpec::fromObjectives($obj->{'objectives'}) |
| 217 | 223 | ); |
| @@ -325,6 +331,9 @@ class Objective { | ||
| 325 | 331 | * @throws Exception |
| 326 | 332 | */ |
| 327 | 333 | public static function from(stdClass $obj): Objective { |
| 334 | + if (!property_exists($obj, 'rewards')) { | |
| 335 | + throw new Exception("Missing required property"); | |
| 336 | + } | |
| 328 | 337 | return new Objective( |
| 329 | 338 | Objective::fromRewards($obj->{'rewards'}) |
| 330 | 339 | ); |
Test case
1 generated file · +6 −0test/inputs/json/priority/bug2521.json
Mphpdefault / TopLevel.php+6 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'options')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromOptions($obj->{'options'}) |
| 101 | 104 | ); |
| @@ -256,6 +259,9 @@ class Option { | ||
| 256 | 259 | * @throws Exception |
| 257 | 260 | */ |
| 258 | 261 | public static function from(stdClass $obj): Option { |
| 262 | + if (!property_exists($obj, 'name')) { | |
| 263 | + throw new Exception("Missing required property"); | |
| 264 | + } | |
| 259 | 265 | return new Option( |
| 260 | 266 | Option::fromFoo($obj->{'foo'}) |
| 261 | 267 | ,Option::fromName($obj->{'name'}) |
Test case
1 generated file · +12 −0test/inputs/json/priority/bug2590.json
Mphpdefault / TopLevel.php+12 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'invoices')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromInvoices($obj->{'invoices'}) |
| 101 | 104 | ); |
| @@ -325,6 +328,15 @@ class Invoice { | ||
| 325 | 328 | * @throws Exception |
| 326 | 329 | */ |
| 327 | 330 | public static function from(stdClass $obj): Invoice { |
| 331 | + if (!property_exists($obj, 'createdAt')) { | |
| 332 | + throw new Exception("Missing required property"); | |
| 333 | + } | |
| 334 | + if (!property_exists($obj, 'dueDate')) { | |
| 335 | + throw new Exception("Missing required property"); | |
| 336 | + } | |
| 337 | + if (!property_exists($obj, 'name')) { | |
| 338 | + throw new Exception("Missing required property"); | |
| 339 | + } | |
| 328 | 340 | return new Invoice( |
| 329 | 341 | Invoice::fromCreatedAt($obj->{'createdAt'}) |
| 330 | 342 | ,Invoice::fromDueDate($obj->{'dueDate'}) |
Test case
1 generated file · +9 −0test/inputs/json/priority/bug2663.json
Mphpdefault / TopLevel.php+9 −0
| @@ -195,6 +195,15 @@ class TopLevel { | ||
| 195 | 195 | * @throws Exception |
| 196 | 196 | */ |
| 197 | 197 | public static function from(stdClass $obj): TopLevel { |
| 198 | + if (!property_exists($obj, 'birthday')) { | |
| 199 | + throw new Exception("Missing required property"); | |
| 200 | + } | |
| 201 | + if (!property_exists($obj, 'lastSeen')) { | |
| 202 | + throw new Exception("Missing required property"); | |
| 203 | + } | |
| 204 | + if (!property_exists($obj, 'name')) { | |
| 205 | + throw new Exception("Missing required property"); | |
| 206 | + } | |
| 198 | 207 | return new TopLevel( |
| 199 | 208 | TopLevel::fromBirthday($obj->{'birthday'}) |
| 200 | 209 | ,TopLevel::fromLastSeen($obj->{'lastSeen'}) |
Test case
1 generated file · +12 −0test/inputs/json/priority/bug2793.json
Mphpdefault / TopLevel.php+12 −0
| @@ -138,6 +138,12 @@ class TopLevel { | ||
| 138 | 138 | * @throws Exception |
| 139 | 139 | */ |
| 140 | 140 | public static function from(stdClass $obj): TopLevel { |
| 141 | + if (!property_exists($obj, 'Hints')) { | |
| 142 | + throw new Exception("Missing required property"); | |
| 143 | + } | |
| 144 | + if (!property_exists($obj, 'Labels')) { | |
| 145 | + throw new Exception("Missing required property"); | |
| 146 | + } | |
| 141 | 147 | return new TopLevel( |
| 142 | 148 | TopLevel::fromHints($obj->{'Hints'}) |
| 143 | 149 | ,TopLevel::fromLabels($obj->{'Labels'}) |
| @@ -335,6 +341,12 @@ class Labels { | ||
| 335 | 341 | * @throws Exception |
| 336 | 342 | */ |
| 337 | 343 | public static function from(stdClass $obj): Labels { |
| 344 | + if (!property_exists($obj, 'AccountNumber')) { | |
| 345 | + throw new Exception("Missing required property"); | |
| 346 | + } | |
| 347 | + if (!property_exists($obj, 'Title')) { | |
| 348 | + throw new Exception("Missing required property"); | |
| 349 | + } | |
| 338 | 350 | return new Labels( |
| 339 | 351 | Labels::fromAccountNumber($obj->{'AccountNumber'}) |
| 340 | 352 | ,Labels::fromTitle($obj->{'Title'}) |
Test case
1 generated file · +612 −0test/inputs/json/priority/bug427.json
Mphpdefault / TopLevel.php+612 −0
| @@ -369,6 +369,24 @@ class TopLevel { | ||
| 369 | 369 | * @throws Exception |
| 370 | 370 | */ |
| 371 | 371 | public static function from(stdClass $obj): TopLevel { |
| 372 | + if (!property_exists($obj, 'children')) { | |
| 373 | + throw new Exception("Missing required property"); | |
| 374 | + } | |
| 375 | + if (!property_exists($obj, 'flags')) { | |
| 376 | + throw new Exception("Missing required property"); | |
| 377 | + } | |
| 378 | + if (!property_exists($obj, 'groups')) { | |
| 379 | + throw new Exception("Missing required property"); | |
| 380 | + } | |
| 381 | + if (!property_exists($obj, 'id')) { | |
| 382 | + throw new Exception("Missing required property"); | |
| 383 | + } | |
| 384 | + if (!property_exists($obj, 'kind')) { | |
| 385 | + throw new Exception("Missing required property"); | |
| 386 | + } | |
| 387 | + if (!property_exists($obj, 'name')) { | |
| 388 | + throw new Exception("Missing required property"); | |
| 389 | + } | |
| 372 | 390 | return new TopLevel( |
| 373 | 391 | TopLevel::fromChildren($obj->{'children'}) |
| 374 | 392 | ,TopLevel::fromFlags($obj->{'flags'}) |
| @@ -994,6 +1012,33 @@ class TopLevelChild { | ||
| 994 | 1012 | * @throws Exception |
| 995 | 1013 | */ |
| 996 | 1014 | public static function from(stdClass $obj): TopLevelChild { |
| 1015 | + if (!property_exists($obj, 'children')) { | |
| 1016 | + throw new Exception("Missing required property"); | |
| 1017 | + } | |
| 1018 | + if (!property_exists($obj, 'flags')) { | |
| 1019 | + throw new Exception("Missing required property"); | |
| 1020 | + } | |
| 1021 | + if (!property_exists($obj, 'groups')) { | |
| 1022 | + throw new Exception("Missing required property"); | |
| 1023 | + } | |
| 1024 | + if (!property_exists($obj, 'id')) { | |
| 1025 | + throw new Exception("Missing required property"); | |
| 1026 | + } | |
| 1027 | + if (!property_exists($obj, 'kind')) { | |
| 1028 | + throw new Exception("Missing required property"); | |
| 1029 | + } | |
| 1030 | + if (!property_exists($obj, 'kindString')) { | |
| 1031 | + throw new Exception("Missing required property"); | |
| 1032 | + } | |
| 1033 | + if (!property_exists($obj, 'name')) { | |
| 1034 | + throw new Exception("Missing required property"); | |
| 1035 | + } | |
| 1036 | + if (!property_exists($obj, 'originalName')) { | |
| 1037 | + throw new Exception("Missing required property"); | |
| 1038 | + } | |
| 1039 | + if (!property_exists($obj, 'sources')) { | |
| 1040 | + throw new Exception("Missing required property"); | |
| 1041 | + } | |
| 997 | 1042 | return new TopLevelChild( |
| 998 | 1043 | TopLevelChild::fromChildren($obj->{'children'}) |
| 999 | 1044 | ,TopLevelChild::fromComment($obj->{'comment'}) |
| @@ -2164,6 +2209,24 @@ class PurpleChild { | ||
| 2164 | 2209 | * @throws Exception |
| 2165 | 2210 | */ |
| 2166 | 2211 | public static function from(stdClass $obj): PurpleChild { |
| 2212 | + if (!property_exists($obj, 'flags')) { | |
| 2213 | + throw new Exception("Missing required property"); | |
| 2214 | + } | |
| 2215 | + if (!property_exists($obj, 'id')) { | |
| 2216 | + throw new Exception("Missing required property"); | |
| 2217 | + } | |
| 2218 | + if (!property_exists($obj, 'kind')) { | |
| 2219 | + throw new Exception("Missing required property"); | |
| 2220 | + } | |
| 2221 | + if (!property_exists($obj, 'kindString')) { | |
| 2222 | + throw new Exception("Missing required property"); | |
| 2223 | + } | |
| 2224 | + if (!property_exists($obj, 'name')) { | |
| 2225 | + throw new Exception("Missing required property"); | |
| 2226 | + } | |
| 2227 | + if (!property_exists($obj, 'sources')) { | |
| 2228 | + throw new Exception("Missing required property"); | |
| 2229 | + } | |
| 2167 | 2230 | return new PurpleChild( |
| 2168 | 2231 | PurpleChild::fromChildren($obj->{'children'}) |
| 2169 | 2232 | ,PurpleChild::fromComment($obj->{'comment'}) |
| @@ -3293,6 +3356,24 @@ class FluffyChild { | ||
| 3293 | 3356 | * @throws Exception |
| 3294 | 3357 | */ |
| 3295 | 3358 | public static function from(stdClass $obj): FluffyChild { |
| 3359 | + if (!property_exists($obj, 'flags')) { | |
| 3360 | + throw new Exception("Missing required property"); | |
| 3361 | + } | |
| 3362 | + if (!property_exists($obj, 'id')) { | |
| 3363 | + throw new Exception("Missing required property"); | |
| 3364 | + } | |
| 3365 | + if (!property_exists($obj, 'kind')) { | |
| 3366 | + throw new Exception("Missing required property"); | |
| 3367 | + } | |
| 3368 | + if (!property_exists($obj, 'kindString')) { | |
| 3369 | + throw new Exception("Missing required property"); | |
| 3370 | + } | |
| 3371 | + if (!property_exists($obj, 'name')) { | |
| 3372 | + throw new Exception("Missing required property"); | |
| 3373 | + } | |
| 3374 | + if (!property_exists($obj, 'sources')) { | |
| 3375 | + throw new Exception("Missing required property"); | |
| 3376 | + } | |
| 3296 | 3377 | return new FluffyChild( |
| 3297 | 3378 | FluffyChild::fromChildren($obj->{'children'}) |
| 3298 | 3379 | ,FluffyChild::fromComment($obj->{'comment'}) |
| @@ -3959,6 +4040,24 @@ class TentacledChild { | ||
| 3959 | 4040 | * @throws Exception |
| 3960 | 4041 | */ |
| 3961 | 4042 | public static function from(stdClass $obj): TentacledChild { |
| 4043 | + if (!property_exists($obj, 'flags')) { | |
| 4044 | + throw new Exception("Missing required property"); | |
| 4045 | + } | |
| 4046 | + if (!property_exists($obj, 'id')) { | |
| 4047 | + throw new Exception("Missing required property"); | |
| 4048 | + } | |
| 4049 | + if (!property_exists($obj, 'kind')) { | |
| 4050 | + throw new Exception("Missing required property"); | |
| 4051 | + } | |
| 4052 | + if (!property_exists($obj, 'kindString')) { | |
| 4053 | + throw new Exception("Missing required property"); | |
| 4054 | + } | |
| 4055 | + if (!property_exists($obj, 'name')) { | |
| 4056 | + throw new Exception("Missing required property"); | |
| 4057 | + } | |
| 4058 | + if (!property_exists($obj, 'sources')) { | |
| 4059 | + throw new Exception("Missing required property"); | |
| 4060 | + } | |
| 3962 | 4061 | return new TentacledChild( |
| 3963 | 4062 | TentacledChild::fromComment($obj->{'comment'}) |
| 3964 | 4063 | ,TentacledChild::fromDefaultValue($obj->{'defaultValue'}) |
| @@ -4075,6 +4174,9 @@ class PurpleComment { | ||
| 4075 | 4174 | * @throws Exception |
| 4076 | 4175 | */ |
| 4077 | 4176 | public static function from(stdClass $obj): PurpleComment { |
| 4177 | + if (!property_exists($obj, 'shortText')) { | |
| 4178 | + throw new Exception("Missing required property"); | |
| 4179 | + } | |
| 4078 | 4180 | return new PurpleComment( |
| 4079 | 4181 | PurpleComment::fromShortText($obj->{'shortText'}) |
| 4080 | 4182 | ); |
| @@ -4748,6 +4850,27 @@ class PurpleSignature { | ||
| 4748 | 4850 | * @throws Exception |
| 4749 | 4851 | */ |
| 4750 | 4852 | public static function from(stdClass $obj): PurpleSignature { |
| 4853 | + if (!property_exists($obj, 'flags')) { | |
| 4854 | + throw new Exception("Missing required property"); | |
| 4855 | + } | |
| 4856 | + if (!property_exists($obj, 'id')) { | |
| 4857 | + throw new Exception("Missing required property"); | |
| 4858 | + } | |
| 4859 | + if (!property_exists($obj, 'kind')) { | |
| 4860 | + throw new Exception("Missing required property"); | |
| 4861 | + } | |
| 4862 | + if (!property_exists($obj, 'kindString')) { | |
| 4863 | + throw new Exception("Missing required property"); | |
| 4864 | + } | |
| 4865 | + if (!property_exists($obj, 'name')) { | |
| 4866 | + throw new Exception("Missing required property"); | |
| 4867 | + } | |
| 4868 | + if (!property_exists($obj, 'parameters')) { | |
| 4869 | + throw new Exception("Missing required property"); | |
| 4870 | + } | |
| 4871 | + if (!property_exists($obj, 'type')) { | |
| 4872 | + throw new Exception("Missing required property"); | |
| 4873 | + } | |
| 4751 | 4874 | return new PurpleSignature( |
| 4752 | 4875 | PurpleSignature::fromComment($obj->{'comment'}) |
| 4753 | 4876 | ,PurpleSignature::fromFlags($obj->{'flags'}) |
| @@ -5144,6 +5267,9 @@ class GetSignatureType { | ||
| 5144 | 5267 | * @throws Exception |
| 5145 | 5268 | */ |
| 5146 | 5269 | public static function from(stdClass $obj): GetSignatureType { |
| 5270 | + if (!property_exists($obj, 'type')) { | |
| 5271 | + throw new Exception("Missing required property"); | |
| 5272 | + } | |
| 5147 | 5273 | return new GetSignatureType( |
| 5148 | 5274 | GetSignatureType::fromDeclaration($obj->{'declaration'}) |
| 5149 | 5275 | ,GetSignatureType::fromElementType($obj->{'elementType'}) |
| @@ -5584,6 +5710,24 @@ class IndexSignatureElement { | ||
| 5584 | 5710 | * @throws Exception |
| 5585 | 5711 | */ |
| 5586 | 5712 | public static function from(stdClass $obj): IndexSignatureElement { |
| 5713 | + if (!property_exists($obj, 'flags')) { | |
| 5714 | + throw new Exception("Missing required property"); | |
| 5715 | + } | |
| 5716 | + if (!property_exists($obj, 'id')) { | |
| 5717 | + throw new Exception("Missing required property"); | |
| 5718 | + } | |
| 5719 | + if (!property_exists($obj, 'kind')) { | |
| 5720 | + throw new Exception("Missing required property"); | |
| 5721 | + } | |
| 5722 | + if (!property_exists($obj, 'kindString')) { | |
| 5723 | + throw new Exception("Missing required property"); | |
| 5724 | + } | |
| 5725 | + if (!property_exists($obj, 'name')) { | |
| 5726 | + throw new Exception("Missing required property"); | |
| 5727 | + } | |
| 5728 | + if (!property_exists($obj, 'type')) { | |
| 5729 | + throw new Exception("Missing required property"); | |
| 5730 | + } | |
| 5587 | 5731 | return new IndexSignatureElement( |
| 5588 | 5732 | IndexSignatureElement::fromFlags($obj->{'flags'}) |
| 5589 | 5733 | ,IndexSignatureElement::fromID($obj->{'id'}) |
| @@ -5821,6 +5965,9 @@ class PurpleType { | ||
| 5821 | 5965 | * @throws Exception |
| 5822 | 5966 | */ |
| 5823 | 5967 | public static function from(stdClass $obj): PurpleType { |
| 5968 | + if (!property_exists($obj, 'type')) { | |
| 5969 | + throw new Exception("Missing required property"); | |
| 5970 | + } | |
| 5824 | 5971 | return new PurpleType( |
| 5825 | 5972 | PurpleType::fromDeclaration($obj->{'declaration'}) |
| 5826 | 5973 | ,PurpleType::fromName($obj->{'name'}) |
| @@ -6313,6 +6460,27 @@ class GetSignatureChild { | ||
| 6313 | 6460 | * @throws Exception |
| 6314 | 6461 | */ |
| 6315 | 6462 | public static function from(stdClass $obj): GetSignatureChild { |
| 6463 | + if (!property_exists($obj, 'flags')) { | |
| 6464 | + throw new Exception("Missing required property"); | |
| 6465 | + } | |
| 6466 | + if (!property_exists($obj, 'id')) { | |
| 6467 | + throw new Exception("Missing required property"); | |
| 6468 | + } | |
| 6469 | + if (!property_exists($obj, 'kind')) { | |
| 6470 | + throw new Exception("Missing required property"); | |
| 6471 | + } | |
| 6472 | + if (!property_exists($obj, 'kindString')) { | |
| 6473 | + throw new Exception("Missing required property"); | |
| 6474 | + } | |
| 6475 | + if (!property_exists($obj, 'name')) { | |
| 6476 | + throw new Exception("Missing required property"); | |
| 6477 | + } | |
| 6478 | + if (!property_exists($obj, 'sources')) { | |
| 6479 | + throw new Exception("Missing required property"); | |
| 6480 | + } | |
| 6481 | + if (!property_exists($obj, 'type')) { | |
| 6482 | + throw new Exception("Missing required property"); | |
| 6483 | + } | |
| 6316 | 6484 | return new GetSignatureChild( |
| 6317 | 6485 | GetSignatureChild::fromComment($obj->{'comment'}) |
| 6318 | 6486 | ,GetSignatureChild::fromFlags($obj->{'flags'}) |
| @@ -7266,6 +7434,21 @@ class GetSignature { | ||
| 7266 | 7434 | * @throws Exception |
| 7267 | 7435 | */ |
| 7268 | 7436 | public static function from(stdClass $obj): GetSignature { |
| 7437 | + if (!property_exists($obj, 'flags')) { | |
| 7438 | + throw new Exception("Missing required property"); | |
| 7439 | + } | |
| 7440 | + if (!property_exists($obj, 'id')) { | |
| 7441 | + throw new Exception("Missing required property"); | |
| 7442 | + } | |
| 7443 | + if (!property_exists($obj, 'kind')) { | |
| 7444 | + throw new Exception("Missing required property"); | |
| 7445 | + } | |
| 7446 | + if (!property_exists($obj, 'kindString')) { | |
| 7447 | + throw new Exception("Missing required property"); | |
| 7448 | + } | |
| 7449 | + if (!property_exists($obj, 'name')) { | |
| 7450 | + throw new Exception("Missing required property"); | |
| 7451 | + } | |
| 7269 | 7452 | return new GetSignature( |
| 7270 | 7453 | GetSignature::fromChildren($obj->{'children'}) |
| 7271 | 7454 | ,GetSignature::fromComment($obj->{'comment'}) |
| @@ -7444,6 +7627,12 @@ class ElementType { | ||
| 7444 | 7627 | * @throws Exception |
| 7445 | 7628 | */ |
| 7446 | 7629 | public static function from(stdClass $obj): ElementType { |
| 7630 | + if (!property_exists($obj, 'name')) { | |
| 7631 | + throw new Exception("Missing required property"); | |
| 7632 | + } | |
| 7633 | + if (!property_exists($obj, 'type')) { | |
| 7634 | + throw new Exception("Missing required property"); | |
| 7635 | + } | |
| 7447 | 7636 | return new ElementType( |
| 7448 | 7637 | ElementType::fromName($obj->{'name'}) |
| 7449 | 7638 | ,ElementType::fromType($obj->{'type'}) |
| @@ -7694,6 +7883,9 @@ class FluffyComment { | ||
| 7694 | 7883 | * @throws Exception |
| 7695 | 7884 | */ |
| 7696 | 7885 | public static function from(stdClass $obj): FluffyComment { |
| 7886 | + if (!property_exists($obj, 'text')) { | |
| 7887 | + throw new Exception("Missing required property"); | |
| 7888 | + } | |
| 7697 | 7889 | return new FluffyComment( |
| 7698 | 7890 | FluffyComment::fromText($obj->{'text'}) |
| 7699 | 7891 | ); |
| @@ -8005,6 +8197,15 @@ class Source { | ||
| 8005 | 8197 | * @throws Exception |
| 8006 | 8198 | */ |
| 8007 | 8199 | public static function from(stdClass $obj): Source { |
| 8200 | + if (!property_exists($obj, 'character')) { | |
| 8201 | + throw new Exception("Missing required property"); | |
| 8202 | + } | |
| 8203 | + if (!property_exists($obj, 'fileName')) { | |
| 8204 | + throw new Exception("Missing required property"); | |
| 8205 | + } | |
| 8206 | + if (!property_exists($obj, 'line')) { | |
| 8207 | + throw new Exception("Missing required property"); | |
| 8208 | + } | |
| 8008 | 8209 | return new Source( |
| 8009 | 8210 | Source::fromCharacter($obj->{'character'}) |
| 8010 | 8211 | ,Source::fromFileName($obj->{'fileName'}) |
| @@ -8554,6 +8755,15 @@ class Group { | ||
| 8554 | 8755 | * @throws Exception |
| 8555 | 8756 | */ |
| 8556 | 8757 | public static function from(stdClass $obj): Group { |
| 8758 | + if (!property_exists($obj, 'children')) { | |
| 8759 | + throw new Exception("Missing required property"); | |
| 8760 | + } | |
| 8761 | + if (!property_exists($obj, 'kind')) { | |
| 8762 | + throw new Exception("Missing required property"); | |
| 8763 | + } | |
| 8764 | + if (!property_exists($obj, 'title')) { | |
| 8765 | + throw new Exception("Missing required property"); | |
| 8766 | + } | |
| 8557 | 8767 | return new Group( |
| 8558 | 8768 | Group::fromChildren($obj->{'children'}) |
| 8559 | 8769 | ,Group::fromKind($obj->{'kind'}) |
| @@ -8982,6 +9192,24 @@ class GetSignatureParameter { | ||
| 8982 | 9192 | * @throws Exception |
| 8983 | 9193 | */ |
| 8984 | 9194 | public static function from(stdClass $obj): GetSignatureParameter { |
| 9195 | + if (!property_exists($obj, 'flags')) { | |
| 9196 | + throw new Exception("Missing required property"); | |
| 9197 | + } | |
| 9198 | + if (!property_exists($obj, 'id')) { | |
| 9199 | + throw new Exception("Missing required property"); | |
| 9200 | + } | |
| 9201 | + if (!property_exists($obj, 'kind')) { | |
| 9202 | + throw new Exception("Missing required property"); | |
| 9203 | + } | |
| 9204 | + if (!property_exists($obj, 'kindString')) { | |
| 9205 | + throw new Exception("Missing required property"); | |
| 9206 | + } | |
| 9207 | + if (!property_exists($obj, 'name')) { | |
| 9208 | + throw new Exception("Missing required property"); | |
| 9209 | + } | |
| 9210 | + if (!property_exists($obj, 'type')) { | |
| 9211 | + throw new Exception("Missing required property"); | |
| 9212 | + } | |
| 8985 | 9213 | return new GetSignatureParameter( |
| 8986 | 9214 | GetSignatureParameter::fromComment($obj->{'comment'}) |
| 8987 | 9215 | ,GetSignatureParameter::fromFlags($obj->{'flags'}) |
| @@ -9682,6 +9910,9 @@ class FluffyType { | ||
| 9682 | 9910 | * @throws Exception |
| 9683 | 9911 | */ |
| 9684 | 9912 | public static function from(stdClass $obj): FluffyType { |
| 9913 | + if (!property_exists($obj, 'type')) { | |
| 9914 | + throw new Exception("Missing required property"); | |
| 9915 | + } | |
| 9685 | 9916 | return new FluffyType( |
| 9686 | 9917 | FluffyType::fromElementType($obj->{'elementType'}) |
| 9687 | 9918 | ,FluffyType::fromName($obj->{'name'}) |
| @@ -9913,6 +10144,9 @@ class TentacledType { | ||
| 9913 | 10144 | * @throws Exception |
| 9914 | 10145 | */ |
| 9915 | 10146 | public static function from(stdClass $obj): TentacledType { |
| 10147 | + if (!property_exists($obj, 'type')) { | |
| 10148 | + throw new Exception("Missing required property"); | |
| 10149 | + } | |
| 9916 | 10150 | return new TentacledType( |
| 9917 | 10151 | TentacledType::fromDeclaration($obj->{'declaration'}) |
| 9918 | 10152 | ,TentacledType::fromName($obj->{'name'}) |
| @@ -10352,6 +10586,27 @@ class PurpleDeclaration { | ||
| 10352 | 10586 | * @throws Exception |
| 10353 | 10587 | */ |
| 10354 | 10588 | public static function from(stdClass $obj): PurpleDeclaration { |
| 10589 | + if (!property_exists($obj, 'children')) { | |
| 10590 | + throw new Exception("Missing required property"); | |
| 10591 | + } | |
| 10592 | + if (!property_exists($obj, 'flags')) { | |
| 10593 | + throw new Exception("Missing required property"); | |
| 10594 | + } | |
| 10595 | + if (!property_exists($obj, 'groups')) { | |
| 10596 | + throw new Exception("Missing required property"); | |
| 10597 | + } | |
| 10598 | + if (!property_exists($obj, 'id')) { | |
| 10599 | + throw new Exception("Missing required property"); | |
| 10600 | + } | |
| 10601 | + if (!property_exists($obj, 'kind')) { | |
| 10602 | + throw new Exception("Missing required property"); | |
| 10603 | + } | |
| 10604 | + if (!property_exists($obj, 'kindString')) { | |
| 10605 | + throw new Exception("Missing required property"); | |
| 10606 | + } | |
| 10607 | + if (!property_exists($obj, 'name')) { | |
| 10608 | + throw new Exception("Missing required property"); | |
| 10609 | + } | |
| 10355 | 10610 | return new PurpleDeclaration( |
| 10356 | 10611 | PurpleDeclaration::fromChildren($obj->{'children'}) |
| 10357 | 10612 | ,PurpleDeclaration::fromFlags($obj->{'flags'}) |
| @@ -10726,6 +10981,9 @@ class TypeElement { | ||
| 10726 | 10981 | * @throws Exception |
| 10727 | 10982 | */ |
| 10728 | 10983 | public static function from(stdClass $obj): TypeElement { |
| 10984 | + if (!property_exists($obj, 'type')) { | |
| 10985 | + throw new Exception("Missing required property"); | |
| 10986 | + } | |
| 10729 | 10987 | return new TypeElement( |
| 10730 | 10988 | TypeElement::fromDeclaration($obj->{'declaration'}) |
| 10731 | 10989 | ,TypeElement::fromElementType($obj->{'elementType'}) |
| @@ -11196,6 +11454,12 @@ class Tag { | ||
| 11196 | 11454 | * @throws Exception |
| 11197 | 11455 | */ |
| 11198 | 11456 | public static function from(stdClass $obj): Tag { |
| 11457 | + if (!property_exists($obj, 'tag')) { | |
| 11458 | + throw new Exception("Missing required property"); | |
| 11459 | + } | |
| 11460 | + if (!property_exists($obj, 'text')) { | |
| 11461 | + throw new Exception("Missing required property"); | |
| 11462 | + } | |
| 11199 | 11463 | return new Tag( |
| 11200 | 11464 | Tag::fromTag($obj->{'tag'}) |
| 11201 | 11465 | ,Tag::fromText($obj->{'text'}) |
| @@ -12040,6 +12304,12 @@ class ExtendedBy { | ||
| 12040 | 12304 | * @throws Exception |
| 12041 | 12305 | */ |
| 12042 | 12306 | public static function from(stdClass $obj): ExtendedBy { |
| 12307 | + if (!property_exists($obj, 'name')) { | |
| 12308 | + throw new Exception("Missing required property"); | |
| 12309 | + } | |
| 12310 | + if (!property_exists($obj, 'type')) { | |
| 12311 | + throw new Exception("Missing required property"); | |
| 12312 | + } | |
| 12043 | 12313 | return new ExtendedBy( |
| 12044 | 12314 | ExtendedBy::fromConstraint($obj->{'constraint'}) |
| 12045 | 12315 | ,ExtendedBy::fromID($obj->{'id'}) |
| @@ -12809,6 +13079,24 @@ class FluffySignature { | ||
| 12809 | 13079 | * @throws Exception |
| 12810 | 13080 | */ |
| 12811 | 13081 | public static function from(stdClass $obj): FluffySignature { |
| 13082 | + if (!property_exists($obj, 'flags')) { | |
| 13083 | + throw new Exception("Missing required property"); | |
| 13084 | + } | |
| 13085 | + if (!property_exists($obj, 'id')) { | |
| 13086 | + throw new Exception("Missing required property"); | |
| 13087 | + } | |
| 13088 | + if (!property_exists($obj, 'kind')) { | |
| 13089 | + throw new Exception("Missing required property"); | |
| 13090 | + } | |
| 13091 | + if (!property_exists($obj, 'kindString')) { | |
| 13092 | + throw new Exception("Missing required property"); | |
| 13093 | + } | |
| 13094 | + if (!property_exists($obj, 'name')) { | |
| 13095 | + throw new Exception("Missing required property"); | |
| 13096 | + } | |
| 13097 | + if (!property_exists($obj, 'type')) { | |
| 13098 | + throw new Exception("Missing required property"); | |
| 13099 | + } | |
| 12812 | 13100 | return new FluffySignature( |
| 12813 | 13101 | FluffySignature::fromComment($obj->{'comment'}) |
| 12814 | 13102 | ,FluffySignature::fromFlags($obj->{'flags'}) |
| @@ -13427,6 +13715,24 @@ class PurpleParameter { | ||
| 13427 | 13715 | * @throws Exception |
| 13428 | 13716 | */ |
| 13429 | 13717 | public static function from(stdClass $obj): PurpleParameter { |
| 13718 | + if (!property_exists($obj, 'flags')) { | |
| 13719 | + throw new Exception("Missing required property"); | |
| 13720 | + } | |
| 13721 | + if (!property_exists($obj, 'id')) { | |
| 13722 | + throw new Exception("Missing required property"); | |
| 13723 | + } | |
| 13724 | + if (!property_exists($obj, 'kind')) { | |
| 13725 | + throw new Exception("Missing required property"); | |
| 13726 | + } | |
| 13727 | + if (!property_exists($obj, 'kindString')) { | |
| 13728 | + throw new Exception("Missing required property"); | |
| 13729 | + } | |
| 13730 | + if (!property_exists($obj, 'name')) { | |
| 13731 | + throw new Exception("Missing required property"); | |
| 13732 | + } | |
| 13733 | + if (!property_exists($obj, 'type')) { | |
| 13734 | + throw new Exception("Missing required property"); | |
| 13735 | + } | |
| 13430 | 13736 | return new PurpleParameter( |
| 13431 | 13737 | PurpleParameter::fromComment($obj->{'comment'}) |
| 13432 | 13738 | ,PurpleParameter::fromFlags($obj->{'flags'}) |
| @@ -13999,6 +14305,9 @@ class StickyType { | ||
| 13999 | 14305 | * @throws Exception |
| 14000 | 14306 | */ |
| 14001 | 14307 | public static function from(stdClass $obj): StickyType { |
| 14308 | + if (!property_exists($obj, 'type')) { | |
| 14309 | + throw new Exception("Missing required property"); | |
| 14310 | + } | |
| 14002 | 14311 | return new StickyType( |
| 14003 | 14312 | StickyType::fromConstraint($obj->{'constraint'}) |
| 14004 | 14313 | ,StickyType::fromDeclaration($obj->{'declaration'}) |
| @@ -14647,6 +14956,9 @@ class IndigoType { | ||
| 14647 | 14956 | * @throws Exception |
| 14648 | 14957 | */ |
| 14649 | 14958 | public static function from(stdClass $obj): IndigoType { |
| 14959 | + if (!property_exists($obj, 'type')) { | |
| 14960 | + throw new Exception("Missing required property"); | |
| 14961 | + } | |
| 14650 | 14962 | return new IndigoType( |
| 14651 | 14963 | IndigoType::fromConstraint($obj->{'constraint'}) |
| 14652 | 14964 | ,IndigoType::fromDeclaration($obj->{'declaration'}) |
| @@ -15319,6 +15631,24 @@ class FluffyDeclaration { | ||
| 15319 | 15631 | * @throws Exception |
| 15320 | 15632 | */ |
| 15321 | 15633 | public static function from(stdClass $obj): FluffyDeclaration { |
| 15634 | + if (!property_exists($obj, 'flags')) { | |
| 15635 | + throw new Exception("Missing required property"); | |
| 15636 | + } | |
| 15637 | + if (!property_exists($obj, 'id')) { | |
| 15638 | + throw new Exception("Missing required property"); | |
| 15639 | + } | |
| 15640 | + if (!property_exists($obj, 'kind')) { | |
| 15641 | + throw new Exception("Missing required property"); | |
| 15642 | + } | |
| 15643 | + if (!property_exists($obj, 'kindString')) { | |
| 15644 | + throw new Exception("Missing required property"); | |
| 15645 | + } | |
| 15646 | + if (!property_exists($obj, 'name')) { | |
| 15647 | + throw new Exception("Missing required property"); | |
| 15648 | + } | |
| 15649 | + if (!property_exists($obj, 'sources')) { | |
| 15650 | + throw new Exception("Missing required property"); | |
| 15651 | + } | |
| 15322 | 15652 | return new FluffyDeclaration( |
| 15323 | 15653 | FluffyDeclaration::fromChildren($obj->{'children'}) |
| 15324 | 15654 | ,FluffyDeclaration::fromFlags($obj->{'flags'}) |
| @@ -15825,6 +16155,27 @@ class StickyChild { | ||
| 15825 | 16155 | * @throws Exception |
| 15826 | 16156 | */ |
| 15827 | 16157 | public static function from(stdClass $obj): StickyChild { |
| 16158 | + if (!property_exists($obj, 'flags')) { | |
| 16159 | + throw new Exception("Missing required property"); | |
| 16160 | + } | |
| 16161 | + if (!property_exists($obj, 'id')) { | |
| 16162 | + throw new Exception("Missing required property"); | |
| 16163 | + } | |
| 16164 | + if (!property_exists($obj, 'kind')) { | |
| 16165 | + throw new Exception("Missing required property"); | |
| 16166 | + } | |
| 16167 | + if (!property_exists($obj, 'kindString')) { | |
| 16168 | + throw new Exception("Missing required property"); | |
| 16169 | + } | |
| 16170 | + if (!property_exists($obj, 'name')) { | |
| 16171 | + throw new Exception("Missing required property"); | |
| 16172 | + } | |
| 16173 | + if (!property_exists($obj, 'sources')) { | |
| 16174 | + throw new Exception("Missing required property"); | |
| 16175 | + } | |
| 16176 | + if (!property_exists($obj, 'type')) { | |
| 16177 | + throw new Exception("Missing required property"); | |
| 16178 | + } | |
| 15828 | 16179 | return new StickyChild( |
| 15829 | 16180 | StickyChild::fromComment($obj->{'comment'}) |
| 15830 | 16181 | ,StickyChild::fromFlags($obj->{'flags'}) |
| @@ -16138,6 +16489,9 @@ class IndecentType { | ||
| 16138 | 16489 | * @throws Exception |
| 16139 | 16490 | */ |
| 16140 | 16491 | public static function from(stdClass $obj): IndecentType { |
| 16492 | + if (!property_exists($obj, 'type')) { | |
| 16493 | + throw new Exception("Missing required property"); | |
| 16494 | + } | |
| 16141 | 16495 | return new IndecentType( |
| 16142 | 16496 | IndecentType::fromDeclaration($obj->{'declaration'}) |
| 16143 | 16497 | ,IndecentType::fromElements($obj->{'elements'}) |
| @@ -16568,6 +16922,27 @@ class IndexSignature { | ||
| 16568 | 16922 | * @throws Exception |
| 16569 | 16923 | */ |
| 16570 | 16924 | public static function from(stdClass $obj): IndexSignature { |
| 16925 | + if (!property_exists($obj, 'flags')) { | |
| 16926 | + throw new Exception("Missing required property"); | |
| 16927 | + } | |
| 16928 | + if (!property_exists($obj, 'id')) { | |
| 16929 | + throw new Exception("Missing required property"); | |
| 16930 | + } | |
| 16931 | + if (!property_exists($obj, 'kind')) { | |
| 16932 | + throw new Exception("Missing required property"); | |
| 16933 | + } | |
| 16934 | + if (!property_exists($obj, 'kindString')) { | |
| 16935 | + throw new Exception("Missing required property"); | |
| 16936 | + } | |
| 16937 | + if (!property_exists($obj, 'name')) { | |
| 16938 | + throw new Exception("Missing required property"); | |
| 16939 | + } | |
| 16940 | + if (!property_exists($obj, 'parameters')) { | |
| 16941 | + throw new Exception("Missing required property"); | |
| 16942 | + } | |
| 16943 | + if (!property_exists($obj, 'type')) { | |
| 16944 | + throw new Exception("Missing required property"); | |
| 16945 | + } | |
| 16571 | 16946 | return new IndexSignature( |
| 16572 | 16947 | IndexSignature::fromFlags($obj->{'flags'}) |
| 16573 | 16948 | ,IndexSignature::fromID($obj->{'id'}) |
| @@ -16732,6 +17107,12 @@ class HilariousType { | ||
| 16732 | 17107 | * @throws Exception |
| 16733 | 17108 | */ |
| 16734 | 17109 | public static function from(stdClass $obj): HilariousType { |
| 17110 | + if (!property_exists($obj, 'declaration')) { | |
| 17111 | + throw new Exception("Missing required property"); | |
| 17112 | + } | |
| 17113 | + if (!property_exists($obj, 'type')) { | |
| 17114 | + throw new Exception("Missing required property"); | |
| 17115 | + } | |
| 16735 | 17116 | return new HilariousType( |
| 16736 | 17117 | HilariousType::fromDeclaration($obj->{'declaration'}) |
| 16737 | 17118 | ,HilariousType::fromType($obj->{'type'}) |
| @@ -17232,6 +17613,24 @@ class TentacledSignature { | ||
| 17232 | 17613 | * @throws Exception |
| 17233 | 17614 | */ |
| 17234 | 17615 | public static function from(stdClass $obj): TentacledSignature { |
| 17616 | + if (!property_exists($obj, 'flags')) { | |
| 17617 | + throw new Exception("Missing required property"); | |
| 17618 | + } | |
| 17619 | + if (!property_exists($obj, 'id')) { | |
| 17620 | + throw new Exception("Missing required property"); | |
| 17621 | + } | |
| 17622 | + if (!property_exists($obj, 'kind')) { | |
| 17623 | + throw new Exception("Missing required property"); | |
| 17624 | + } | |
| 17625 | + if (!property_exists($obj, 'kindString')) { | |
| 17626 | + throw new Exception("Missing required property"); | |
| 17627 | + } | |
| 17628 | + if (!property_exists($obj, 'name')) { | |
| 17629 | + throw new Exception("Missing required property"); | |
| 17630 | + } | |
| 17631 | + if (!property_exists($obj, 'type')) { | |
| 17632 | + throw new Exception("Missing required property"); | |
| 17633 | + } | |
| 17235 | 17634 | return new TentacledSignature( |
| 17236 | 17635 | TentacledSignature::fromComment($obj->{'comment'}) |
| 17237 | 17636 | ,TentacledSignature::fromFlags($obj->{'flags'}) |
| @@ -17396,6 +17795,12 @@ class IndigoComment { | ||
| 17396 | 17795 | * @throws Exception |
| 17397 | 17796 | */ |
| 17398 | 17797 | public static function from(stdClass $obj): IndigoComment { |
| 17798 | + if (!property_exists($obj, 'returns')) { | |
| 17799 | + throw new Exception("Missing required property"); | |
| 17800 | + } | |
| 17801 | + if (!property_exists($obj, 'shortText')) { | |
| 17802 | + throw new Exception("Missing required property"); | |
| 17803 | + } | |
| 17399 | 17804 | return new IndigoComment( |
| 17400 | 17805 | IndigoComment::fromReturns($obj->{'returns'}) |
| 17401 | 17806 | ,IndigoComment::fromShortText($obj->{'shortText'}) |
| @@ -17895,6 +18300,24 @@ class FluffyParameter { | ||
| 17895 | 18300 | * @throws Exception |
| 17896 | 18301 | */ |
| 17897 | 18302 | public static function from(stdClass $obj): FluffyParameter { |
| 18303 | + if (!property_exists($obj, 'flags')) { | |
| 18304 | + throw new Exception("Missing required property"); | |
| 18305 | + } | |
| 18306 | + if (!property_exists($obj, 'id')) { | |
| 18307 | + throw new Exception("Missing required property"); | |
| 18308 | + } | |
| 18309 | + if (!property_exists($obj, 'kind')) { | |
| 18310 | + throw new Exception("Missing required property"); | |
| 18311 | + } | |
| 18312 | + if (!property_exists($obj, 'kindString')) { | |
| 18313 | + throw new Exception("Missing required property"); | |
| 18314 | + } | |
| 18315 | + if (!property_exists($obj, 'name')) { | |
| 18316 | + throw new Exception("Missing required property"); | |
| 18317 | + } | |
| 18318 | + if (!property_exists($obj, 'type')) { | |
| 18319 | + throw new Exception("Missing required property"); | |
| 18320 | + } | |
| 17898 | 18321 | return new FluffyParameter( |
| 17899 | 18322 | FluffyParameter::fromComment($obj->{'comment'}) |
| 17900 | 18323 | ,FluffyParameter::fromFlags($obj->{'flags'}) |
| @@ -18112,6 +18535,15 @@ class PurpleTypeArgument { | ||
| 18112 | 18535 | * @throws Exception |
| 18113 | 18536 | */ |
| 18114 | 18537 | public static function from(stdClass $obj): PurpleTypeArgument { |
| 18538 | + if (!property_exists($obj, 'operator')) { | |
| 18539 | + throw new Exception("Missing required property"); | |
| 18540 | + } | |
| 18541 | + if (!property_exists($obj, 'target')) { | |
| 18542 | + throw new Exception("Missing required property"); | |
| 18543 | + } | |
| 18544 | + if (!property_exists($obj, 'type')) { | |
| 18545 | + throw new Exception("Missing required property"); | |
| 18546 | + } | |
| 18115 | 18547 | return new PurpleTypeArgument( |
| 18116 | 18548 | PurpleTypeArgument::fromOperator($obj->{'operator'}) |
| 18117 | 18549 | ,PurpleTypeArgument::fromTarget($obj->{'target'}) |
| @@ -19243,6 +19675,27 @@ class StickySignature { | ||
| 19243 | 19675 | * @throws Exception |
| 19244 | 19676 | */ |
| 19245 | 19677 | public static function from(stdClass $obj): StickySignature { |
| 19678 | + if (!property_exists($obj, 'comment')) { | |
| 19679 | + throw new Exception("Missing required property"); | |
| 19680 | + } | |
| 19681 | + if (!property_exists($obj, 'flags')) { | |
| 19682 | + throw new Exception("Missing required property"); | |
| 19683 | + } | |
| 19684 | + if (!property_exists($obj, 'id')) { | |
| 19685 | + throw new Exception("Missing required property"); | |
| 19686 | + } | |
| 19687 | + if (!property_exists($obj, 'kind')) { | |
| 19688 | + throw new Exception("Missing required property"); | |
| 19689 | + } | |
| 19690 | + if (!property_exists($obj, 'kindString')) { | |
| 19691 | + throw new Exception("Missing required property"); | |
| 19692 | + } | |
| 19693 | + if (!property_exists($obj, 'name')) { | |
| 19694 | + throw new Exception("Missing required property"); | |
| 19695 | + } | |
| 19696 | + if (!property_exists($obj, 'type')) { | |
| 19697 | + throw new Exception("Missing required property"); | |
| 19698 | + } | |
| 19246 | 19699 | return new StickySignature( |
| 19247 | 19700 | StickySignature::fromComment($obj->{'comment'}) |
| 19248 | 19701 | ,StickySignature::fromFlags($obj->{'flags'}) |
| @@ -19807,6 +20260,24 @@ class TentacledParameter { | ||
| 19807 | 20260 | * @throws Exception |
| 19808 | 20261 | */ |
| 19809 | 20262 | public static function from(stdClass $obj): TentacledParameter { |
| 20263 | + if (!property_exists($obj, 'flags')) { | |
| 20264 | + throw new Exception("Missing required property"); | |
| 20265 | + } | |
| 20266 | + if (!property_exists($obj, 'id')) { | |
| 20267 | + throw new Exception("Missing required property"); | |
| 20268 | + } | |
| 20269 | + if (!property_exists($obj, 'kind')) { | |
| 20270 | + throw new Exception("Missing required property"); | |
| 20271 | + } | |
| 20272 | + if (!property_exists($obj, 'kindString')) { | |
| 20273 | + throw new Exception("Missing required property"); | |
| 20274 | + } | |
| 20275 | + if (!property_exists($obj, 'name')) { | |
| 20276 | + throw new Exception("Missing required property"); | |
| 20277 | + } | |
| 20278 | + if (!property_exists($obj, 'type')) { | |
| 20279 | + throw new Exception("Missing required property"); | |
| 20280 | + } | |
| 19810 | 20281 | return new TentacledParameter( |
| 19811 | 20282 | TentacledParameter::fromComment($obj->{'comment'}) |
| 19812 | 20283 | ,TentacledParameter::fromDefaultValue($obj->{'defaultValue'}) |
| @@ -20246,6 +20717,9 @@ class AmbitiousType { | ||
| 20246 | 20717 | * @throws Exception |
| 20247 | 20718 | */ |
| 20248 | 20719 | public static function from(stdClass $obj): AmbitiousType { |
| 20720 | + if (!property_exists($obj, 'type')) { | |
| 20721 | + throw new Exception("Missing required property"); | |
| 20722 | + } | |
| 20249 | 20723 | return new AmbitiousType( |
| 20250 | 20724 | AmbitiousType::fromDeclaration($obj->{'declaration'}) |
| 20251 | 20725 | ,AmbitiousType::fromElementType($obj->{'elementType'}) |
| @@ -20912,6 +21386,24 @@ class TentacledDeclaration { | ||
| 20912 | 21386 | * @throws Exception |
| 20913 | 21387 | */ |
| 20914 | 21388 | public static function from(stdClass $obj): TentacledDeclaration { |
| 21389 | + if (!property_exists($obj, 'flags')) { | |
| 21390 | + throw new Exception("Missing required property"); | |
| 21391 | + } | |
| 21392 | + if (!property_exists($obj, 'id')) { | |
| 21393 | + throw new Exception("Missing required property"); | |
| 21394 | + } | |
| 21395 | + if (!property_exists($obj, 'kind')) { | |
| 21396 | + throw new Exception("Missing required property"); | |
| 21397 | + } | |
| 21398 | + if (!property_exists($obj, 'kindString')) { | |
| 21399 | + throw new Exception("Missing required property"); | |
| 21400 | + } | |
| 21401 | + if (!property_exists($obj, 'name')) { | |
| 21402 | + throw new Exception("Missing required property"); | |
| 21403 | + } | |
| 21404 | + if (!property_exists($obj, 'sources')) { | |
| 21405 | + throw new Exception("Missing required property"); | |
| 21406 | + } | |
| 20915 | 21407 | return new TentacledDeclaration( |
| 20916 | 21408 | TentacledDeclaration::fromChildren($obj->{'children'}) |
| 20917 | 21409 | ,TentacledDeclaration::fromFlags($obj->{'flags'}) |
| @@ -21470,6 +21962,30 @@ class IndigoChild { | ||
| 21470 | 21962 | * @throws Exception |
| 21471 | 21963 | */ |
| 21472 | 21964 | public static function from(stdClass $obj): IndigoChild { |
| 21965 | + if (!property_exists($obj, 'comment')) { | |
| 21966 | + throw new Exception("Missing required property"); | |
| 21967 | + } | |
| 21968 | + if (!property_exists($obj, 'flags')) { | |
| 21969 | + throw new Exception("Missing required property"); | |
| 21970 | + } | |
| 21971 | + if (!property_exists($obj, 'id')) { | |
| 21972 | + throw new Exception("Missing required property"); | |
| 21973 | + } | |
| 21974 | + if (!property_exists($obj, 'kind')) { | |
| 21975 | + throw new Exception("Missing required property"); | |
| 21976 | + } | |
| 21977 | + if (!property_exists($obj, 'kindString')) { | |
| 21978 | + throw new Exception("Missing required property"); | |
| 21979 | + } | |
| 21980 | + if (!property_exists($obj, 'name')) { | |
| 21981 | + throw new Exception("Missing required property"); | |
| 21982 | + } | |
| 21983 | + if (!property_exists($obj, 'sources')) { | |
| 21984 | + throw new Exception("Missing required property"); | |
| 21985 | + } | |
| 21986 | + if (!property_exists($obj, 'type')) { | |
| 21987 | + throw new Exception("Missing required property"); | |
| 21988 | + } | |
| 21473 | 21989 | return new IndigoChild( |
| 21474 | 21990 | IndigoChild::fromComment($obj->{'comment'}) |
| 21475 | 21991 | ,IndigoChild::fromDefaultValue($obj->{'defaultValue'}) |
| @@ -21847,6 +22363,9 @@ class CunningType { | ||
| 21847 | 22363 | * @throws Exception |
| 21848 | 22364 | */ |
| 21849 | 22365 | public static function from(stdClass $obj): CunningType { |
| 22366 | + if (!property_exists($obj, 'type')) { | |
| 22367 | + throw new Exception("Missing required property"); | |
| 22368 | + } | |
| 21850 | 22369 | return new CunningType( |
| 21851 | 22370 | CunningType::fromDeclaration($obj->{'declaration'}) |
| 21852 | 22371 | ,CunningType::fromID($obj->{'id'}) |
| @@ -22488,6 +23007,9 @@ class MagentaType { | ||
| 22488 | 23007 | * @throws Exception |
| 22489 | 23008 | */ |
| 22490 | 23009 | public static function from(stdClass $obj): MagentaType { |
| 23010 | + if (!property_exists($obj, 'type')) { | |
| 23011 | + throw new Exception("Missing required property"); | |
| 23012 | + } | |
| 22491 | 23013 | return new MagentaType( |
| 22492 | 23014 | MagentaType::fromDeclaration($obj->{'declaration'}) |
| 22493 | 23015 | ,MagentaType::fromElementType($obj->{'elementType'}) |
| @@ -23087,6 +23609,27 @@ class StickyDeclaration { | ||
| 23087 | 23609 | * @throws Exception |
| 23088 | 23610 | */ |
| 23089 | 23611 | public static function from(stdClass $obj): StickyDeclaration { |
| 23612 | + if (!property_exists($obj, 'flags')) { | |
| 23613 | + throw new Exception("Missing required property"); | |
| 23614 | + } | |
| 23615 | + if (!property_exists($obj, 'id')) { | |
| 23616 | + throw new Exception("Missing required property"); | |
| 23617 | + } | |
| 23618 | + if (!property_exists($obj, 'kind')) { | |
| 23619 | + throw new Exception("Missing required property"); | |
| 23620 | + } | |
| 23621 | + if (!property_exists($obj, 'kindString')) { | |
| 23622 | + throw new Exception("Missing required property"); | |
| 23623 | + } | |
| 23624 | + if (!property_exists($obj, 'name')) { | |
| 23625 | + throw new Exception("Missing required property"); | |
| 23626 | + } | |
| 23627 | + if (!property_exists($obj, 'signatures')) { | |
| 23628 | + throw new Exception("Missing required property"); | |
| 23629 | + } | |
| 23630 | + if (!property_exists($obj, 'sources')) { | |
| 23631 | + throw new Exception("Missing required property"); | |
| 23632 | + } | |
| 23090 | 23633 | return new StickyDeclaration( |
| 23091 | 23634 | StickyDeclaration::fromChildren($obj->{'children'}) |
| 23092 | 23635 | ,StickyDeclaration::fromFlags($obj->{'flags'}) |
| @@ -23528,6 +24071,27 @@ class IndecentChild { | ||
| 23528 | 24071 | * @throws Exception |
| 23529 | 24072 | */ |
| 23530 | 24073 | public static function from(stdClass $obj): IndecentChild { |
| 24074 | + if (!property_exists($obj, 'flags')) { | |
| 24075 | + throw new Exception("Missing required property"); | |
| 24076 | + } | |
| 24077 | + if (!property_exists($obj, 'id')) { | |
| 24078 | + throw new Exception("Missing required property"); | |
| 24079 | + } | |
| 24080 | + if (!property_exists($obj, 'kind')) { | |
| 24081 | + throw new Exception("Missing required property"); | |
| 24082 | + } | |
| 24083 | + if (!property_exists($obj, 'kindString')) { | |
| 24084 | + throw new Exception("Missing required property"); | |
| 24085 | + } | |
| 24086 | + if (!property_exists($obj, 'name')) { | |
| 24087 | + throw new Exception("Missing required property"); | |
| 24088 | + } | |
| 24089 | + if (!property_exists($obj, 'sources')) { | |
| 24090 | + throw new Exception("Missing required property"); | |
| 24091 | + } | |
| 24092 | + if (!property_exists($obj, 'type')) { | |
| 24093 | + throw new Exception("Missing required property"); | |
| 24094 | + } | |
| 23531 | 24095 | return new IndecentChild( |
| 23532 | 24096 | IndecentChild::fromFlags($obj->{'flags'}) |
| 23533 | 24097 | ,IndecentChild::fromID($obj->{'id'}) |
| @@ -23765,6 +24329,9 @@ class FriskyType { | ||
| 23765 | 24329 | * @throws Exception |
| 23766 | 24330 | */ |
| 23767 | 24331 | public static function from(stdClass $obj): FriskyType { |
| 24332 | + if (!property_exists($obj, 'type')) { | |
| 24333 | + throw new Exception("Missing required property"); | |
| 24334 | + } | |
| 23768 | 24335 | return new FriskyType( |
| 23769 | 24336 | FriskyType::fromDeclaration($obj->{'declaration'}) |
| 23770 | 24337 | ,FriskyType::fromName($obj->{'name'}) |
| @@ -24362,6 +24929,24 @@ class IndigoDeclaration { | ||
| 24362 | 24929 | * @throws Exception |
| 24363 | 24930 | */ |
| 24364 | 24931 | public static function from(stdClass $obj): IndigoDeclaration { |
| 24932 | + if (!property_exists($obj, 'flags')) { | |
| 24933 | + throw new Exception("Missing required property"); | |
| 24934 | + } | |
| 24935 | + if (!property_exists($obj, 'id')) { | |
| 24936 | + throw new Exception("Missing required property"); | |
| 24937 | + } | |
| 24938 | + if (!property_exists($obj, 'kind')) { | |
| 24939 | + throw new Exception("Missing required property"); | |
| 24940 | + } | |
| 24941 | + if (!property_exists($obj, 'kindString')) { | |
| 24942 | + throw new Exception("Missing required property"); | |
| 24943 | + } | |
| 24944 | + if (!property_exists($obj, 'name')) { | |
| 24945 | + throw new Exception("Missing required property"); | |
| 24946 | + } | |
| 24947 | + if (!property_exists($obj, 'sources')) { | |
| 24948 | + throw new Exception("Missing required property"); | |
| 24949 | + } | |
| 24365 | 24950 | return new IndigoDeclaration( |
| 24366 | 24951 | IndigoDeclaration::fromChildren($obj->{'children'}) |
| 24367 | 24952 | ,IndigoDeclaration::fromFlags($obj->{'flags'}) |
| @@ -24541,6 +25126,12 @@ class FluffyTypeArgument { | ||
| 24541 | 25126 | * @throws Exception |
| 24542 | 25127 | */ |
| 24543 | 25128 | public static function from(stdClass $obj): FluffyTypeArgument { |
| 25129 | + if (!property_exists($obj, 'type')) { | |
| 25130 | + throw new Exception("Missing required property"); | |
| 25131 | + } | |
| 25132 | + if (!property_exists($obj, 'types')) { | |
| 25133 | + throw new Exception("Missing required property"); | |
| 25134 | + } | |
| 24544 | 25135 | return new FluffyTypeArgument( |
| 24545 | 25136 | FluffyTypeArgument::fromType($obj->{'type'}) |
| 24546 | 25137 | ,FluffyTypeArgument::fromTypes($obj->{'types'}) |
| @@ -24976,6 +25567,21 @@ class TypeParameter { | ||
| 24976 | 25567 | * @throws Exception |
| 24977 | 25568 | */ |
| 24978 | 25569 | public static function from(stdClass $obj): TypeParameter { |
| 25570 | + if (!property_exists($obj, 'flags')) { | |
| 25571 | + throw new Exception("Missing required property"); | |
| 25572 | + } | |
| 25573 | + if (!property_exists($obj, 'id')) { | |
| 25574 | + throw new Exception("Missing required property"); | |
| 25575 | + } | |
| 25576 | + if (!property_exists($obj, 'kind')) { | |
| 25577 | + throw new Exception("Missing required property"); | |
| 25578 | + } | |
| 25579 | + if (!property_exists($obj, 'kindString')) { | |
| 25580 | + throw new Exception("Missing required property"); | |
| 25581 | + } | |
| 25582 | + if (!property_exists($obj, 'name')) { | |
| 25583 | + throw new Exception("Missing required property"); | |
| 25584 | + } | |
| 24979 | 25585 | return new TypeParameter( |
| 24980 | 25586 | TypeParameter::fromComment($obj->{'comment'}) |
| 24981 | 25587 | ,TypeParameter::fromFlags($obj->{'flags'}) |
| @@ -25336,6 +25942,9 @@ class MischievousType { | ||
| 25336 | 25942 | * @throws Exception |
| 25337 | 25943 | */ |
| 25338 | 25944 | public static function from(stdClass $obj): MischievousType { |
| 25945 | + if (!property_exists($obj, 'type')) { | |
| 25946 | + throw new Exception("Missing required property"); | |
| 25947 | + } | |
| 25339 | 25948 | return new MischievousType( |
| 25340 | 25949 | MischievousType::fromID($obj->{'id'}) |
| 25341 | 25950 | ,MischievousType::fromName($obj->{'name'}) |
| @@ -25516,6 +26125,9 @@ class IndecentComment { | ||
| 25516 | 26125 | * @throws Exception |
| 25517 | 26126 | */ |
| 25518 | 26127 | public static function from(stdClass $obj): IndecentComment { |
| 26128 | + if (!property_exists($obj, 'shortText')) { | |
| 26129 | + throw new Exception("Missing required property"); | |
| 26130 | + } | |
| 25519 | 26131 | return new IndecentComment( |
| 25520 | 26132 | IndecentComment::fromShortText($obj->{'shortText'}) |
| 25521 | 26133 | ,IndecentComment::fromTags($obj->{'tags'}) |
Test case
1 generated file · +24 −0test/inputs/json/priority/bug790.json
Mphpdefault / TopLevel.php+24 −0
| @@ -460,6 +460,30 @@ class TopLevel { | ||
| 460 | 460 | * @throws Exception |
| 461 | 461 | */ |
| 462 | 462 | public static function from(stdClass $obj): TopLevel { |
| 463 | + if (!property_exists($obj, 'children_data')) { | |
| 464 | + throw new Exception("Missing required property"); | |
| 465 | + } | |
| 466 | + if (!property_exists($obj, 'id')) { | |
| 467 | + throw new Exception("Missing required property"); | |
| 468 | + } | |
| 469 | + if (!property_exists($obj, 'is_active')) { | |
| 470 | + throw new Exception("Missing required property"); | |
| 471 | + } | |
| 472 | + if (!property_exists($obj, 'level')) { | |
| 473 | + throw new Exception("Missing required property"); | |
| 474 | + } | |
| 475 | + if (!property_exists($obj, 'name')) { | |
| 476 | + throw new Exception("Missing required property"); | |
| 477 | + } | |
| 478 | + if (!property_exists($obj, 'parent_id')) { | |
| 479 | + throw new Exception("Missing required property"); | |
| 480 | + } | |
| 481 | + if (!property_exists($obj, 'position')) { | |
| 482 | + throw new Exception("Missing required property"); | |
| 483 | + } | |
| 484 | + if (!property_exists($obj, 'product_count')) { | |
| 485 | + throw new Exception("Missing required property"); | |
| 486 | + } | |
| 463 | 487 | return new TopLevel( |
| 464 | 488 | TopLevel::fromChildrenData($obj->{'children_data'}) |
| 465 | 489 | ,TopLevel::fromID($obj->{'id'}) |
Test case
1 generated file · +15 −0test/inputs/json/priority/bug855-short.json
Mphpdefault / TopLevel.php+15 −0
| @@ -296,6 +296,21 @@ class TopLevelValue { | ||
| 296 | 296 | * @throws Exception |
| 297 | 297 | */ |
| 298 | 298 | public static function from(stdClass $obj): TopLevelValue { |
| 299 | + if (!property_exists($obj, 'channel_id')) { | |
| 300 | + throw new Exception("Missing required property"); | |
| 301 | + } | |
| 302 | + if (!property_exists($obj, 'channel_name')) { | |
| 303 | + throw new Exception("Missing required property"); | |
| 304 | + } | |
| 305 | + if (!property_exists($obj, 'code')) { | |
| 306 | + throw new Exception("Missing required property"); | |
| 307 | + } | |
| 308 | + if (!property_exists($obj, 'emoticon_set')) { | |
| 309 | + throw new Exception("Missing required property"); | |
| 310 | + } | |
| 311 | + if (!property_exists($obj, 'id')) { | |
| 312 | + throw new Exception("Missing required property"); | |
| 313 | + } | |
| 299 | 314 | return new TopLevelValue( |
| 300 | 315 | TopLevelValue::fromChannelID($obj->{'channel_id'}) |
| 301 | 316 | ,TopLevelValue::fromChannelName($obj->{'channel_name'}) |
Test case
1 generated file · +30 −0test/inputs/json/priority/coin-pairs.json
Mphpdefault / TopLevel.php+30 −0
| @@ -151,6 +151,12 @@ class TopLevel { | ||
| 151 | 151 | * @throws Exception |
| 152 | 152 | */ |
| 153 | 153 | public static function from(stdClass $obj): TopLevel { |
| 154 | + if (!property_exists($obj, 'pairs')) { | |
| 155 | + throw new Exception("Missing required property"); | |
| 156 | + } | |
| 157 | + if (!property_exists($obj, 'server_time')) { | |
| 158 | + throw new Exception("Missing required property"); | |
| 159 | + } | |
| 154 | 160 | return new TopLevel( |
| 155 | 161 | TopLevel::fromPairs($obj->{'pairs'}) |
| 156 | 162 | ,TopLevel::fromServerTime($obj->{'server_time'}) |
| @@ -615,6 +621,30 @@ class Pair { | ||
| 615 | 621 | * @throws Exception |
| 616 | 622 | */ |
| 617 | 623 | public static function from(stdClass $obj): Pair { |
| 624 | + if (!property_exists($obj, 'decimal_places')) { | |
| 625 | + throw new Exception("Missing required property"); | |
| 626 | + } | |
| 627 | + if (!property_exists($obj, 'fee')) { | |
| 628 | + throw new Exception("Missing required property"); | |
| 629 | + } | |
| 630 | + if (!property_exists($obj, 'hidden')) { | |
| 631 | + throw new Exception("Missing required property"); | |
| 632 | + } | |
| 633 | + if (!property_exists($obj, 'max_amount')) { | |
| 634 | + throw new Exception("Missing required property"); | |
| 635 | + } | |
| 636 | + if (!property_exists($obj, 'max_price')) { | |
| 637 | + throw new Exception("Missing required property"); | |
| 638 | + } | |
| 639 | + if (!property_exists($obj, 'min_amount')) { | |
| 640 | + throw new Exception("Missing required property"); | |
| 641 | + } | |
| 642 | + if (!property_exists($obj, 'min_price')) { | |
| 643 | + throw new Exception("Missing required property"); | |
| 644 | + } | |
| 645 | + if (!property_exists($obj, 'min_total')) { | |
| 646 | + throw new Exception("Missing required property"); | |
| 647 | + } | |
| 618 | 648 | return new Pair( |
| 619 | 649 | Pair::fromDecimalPlaces($obj->{'decimal_places'}) |
| 620 | 650 | ,Pair::fromFee($obj->{'fee'}) |
Test case
1 generated file · +639 −0test/inputs/json/priority/combinations1.json
Mphpdefault / TopLevel.php+639 −0
| @@ -3957,6 +3957,135 @@ class TopLevel { | ||
| 3957 | 3957 | * @throws Exception |
| 3958 | 3958 | */ |
| 3959 | 3959 | public static function from(stdClass $obj): TopLevel { |
| 3960 | + if (!property_exists($obj, 'centrodesmose')) { | |
| 3961 | + throw new Exception("Missing required property"); | |
| 3962 | + } | |
| 3963 | + if (!property_exists($obj, 'cerograph')) { | |
| 3964 | + throw new Exception("Missing required property"); | |
| 3965 | + } | |
| 3966 | + if (!property_exists($obj, 'chemotherapeutics')) { | |
| 3967 | + throw new Exception("Missing required property"); | |
| 3968 | + } | |
| 3969 | + if (!property_exists($obj, 'cimelia')) { | |
| 3970 | + throw new Exception("Missing required property"); | |
| 3971 | + } | |
| 3972 | + if (!property_exists($obj, 'citrated')) { | |
| 3973 | + throw new Exception("Missing required property"); | |
| 3974 | + } | |
| 3975 | + if (!property_exists($obj, 'clinodome')) { | |
| 3976 | + throw new Exception("Missing required property"); | |
| 3977 | + } | |
| 3978 | + if (!property_exists($obj, 'coadjust')) { | |
| 3979 | + throw new Exception("Missing required property"); | |
| 3980 | + } | |
| 3981 | + if (!property_exists($obj, 'consilience')) { | |
| 3982 | + throw new Exception("Missing required property"); | |
| 3983 | + } | |
| 3984 | + if (!property_exists($obj, 'constructor')) { | |
| 3985 | + throw new Exception("Missing required property"); | |
| 3986 | + } | |
| 3987 | + if (!property_exists($obj, 'continuative')) { | |
| 3988 | + throw new Exception("Missing required property"); | |
| 3989 | + } | |
| 3990 | + if (!property_exists($obj, 'credulity')) { | |
| 3991 | + throw new Exception("Missing required property"); | |
| 3992 | + } | |
| 3993 | + if (!property_exists($obj, 'creviced')) { | |
| 3994 | + throw new Exception("Missing required property"); | |
| 3995 | + } | |
| 3996 | + if (!property_exists($obj, 'cubiculum')) { | |
| 3997 | + throw new Exception("Missing required property"); | |
| 3998 | + } | |
| 3999 | + if (!property_exists($obj, 'deruralize')) { | |
| 4000 | + throw new Exception("Missing required property"); | |
| 4001 | + } | |
| 4002 | + if (!property_exists($obj, 'diaereses')) { | |
| 4003 | + throw new Exception("Missing required property"); | |
| 4004 | + } | |
| 4005 | + if (!property_exists($obj, 'dissolution')) { | |
| 4006 | + throw new Exception("Missing required property"); | |
| 4007 | + } | |
| 4008 | + if (!property_exists($obj, 'downstroke')) { | |
| 4009 | + throw new Exception("Missing required property"); | |
| 4010 | + } | |
| 4011 | + if (!property_exists($obj, 'electrotautomerism')) { | |
| 4012 | + throw new Exception("Missing required property"); | |
| 4013 | + } | |
| 4014 | + if (!property_exists($obj, 'eleutheromania')) { | |
| 4015 | + throw new Exception("Missing required property"); | |
| 4016 | + } | |
| 4017 | + if (!property_exists($obj, 'encrust')) { | |
| 4018 | + throw new Exception("Missing required property"); | |
| 4019 | + } | |
| 4020 | + if (!property_exists($obj, 'entomoid')) { | |
| 4021 | + throw new Exception("Missing required property"); | |
| 4022 | + } | |
| 4023 | + if (!property_exists($obj, 'epipaleolithic')) { | |
| 4024 | + throw new Exception("Missing required property"); | |
| 4025 | + } | |
| 4026 | + if (!property_exists($obj, 'expropriable')) { | |
| 4027 | + throw new Exception("Missing required property"); | |
| 4028 | + } | |
| 4029 | + if (!property_exists($obj, 'faggingly')) { | |
| 4030 | + throw new Exception("Missing required property"); | |
| 4031 | + } | |
| 4032 | + if (!property_exists($obj, 'fenks')) { | |
| 4033 | + throw new Exception("Missing required property"); | |
| 4034 | + } | |
| 4035 | + if (!property_exists($obj, 'flagmaking')) { | |
| 4036 | + throw new Exception("Missing required property"); | |
| 4037 | + } | |
| 4038 | + if (!property_exists($obj, 'fluorometer')) { | |
| 4039 | + throw new Exception("Missing required property"); | |
| 4040 | + } | |
| 4041 | + if (!property_exists($obj, 'fulsome')) { | |
| 4042 | + throw new Exception("Missing required property"); | |
| 4043 | + } | |
| 4044 | + if (!property_exists($obj, 'fuzzy')) { | |
| 4045 | + throw new Exception("Missing required property"); | |
| 4046 | + } | |
| 4047 | + if (!property_exists($obj, 'gardenwards')) { | |
| 4048 | + throw new Exception("Missing required property"); | |
| 4049 | + } | |
| 4050 | + if (!property_exists($obj, 'generalissimo')) { | |
| 4051 | + throw new Exception("Missing required property"); | |
| 4052 | + } | |
| 4053 | + if (!property_exists($obj, 'habeas')) { | |
| 4054 | + throw new Exception("Missing required property"); | |
| 4055 | + } | |
| 4056 | + if (!property_exists($obj, 'hemicrystalline')) { | |
| 4057 | + throw new Exception("Missing required property"); | |
| 4058 | + } | |
| 4059 | + if (!property_exists($obj, 'hemocoele')) { | |
| 4060 | + throw new Exception("Missing required property"); | |
| 4061 | + } | |
| 4062 | + if (!property_exists($obj, 'hoister')) { | |
| 4063 | + throw new Exception("Missing required property"); | |
| 4064 | + } | |
| 4065 | + if (!property_exists($obj, 'hyperpiesis')) { | |
| 4066 | + throw new Exception("Missing required property"); | |
| 4067 | + } | |
| 4068 | + if (!property_exists($obj, 'hyppish')) { | |
| 4069 | + throw new Exception("Missing required property"); | |
| 4070 | + } | |
| 4071 | + if (!property_exists($obj, 'idealizer')) { | |
| 4072 | + throw new Exception("Missing required property"); | |
| 4073 | + } | |
| 4074 | + if (!property_exists($obj, 'incrustator')) { | |
| 4075 | + throw new Exception("Missing required property"); | |
| 4076 | + } | |
| 4077 | + if (!property_exists($obj, 'intentiveness')) { | |
| 4078 | + throw new Exception("Missing required property"); | |
| 4079 | + } | |
| 4080 | + if (!property_exists($obj, 'interacinar')) { | |
| 4081 | + throw new Exception("Missing required property"); | |
| 4082 | + } | |
| 4083 | + if (!property_exists($obj, 'intercorrelation')) { | |
| 4084 | + throw new Exception("Missing required property"); | |
| 4085 | + } | |
| 4086 | + if (!property_exists($obj, 'jacutinga')) { | |
| 4087 | + throw new Exception("Missing required property"); | |
| 4088 | + } | |
| 3960 | 4089 | return new TopLevel( |
| 3961 | 4090 | TopLevel::fromCentrodesmose($obj->{'centrodesmose'}) |
| 3962 | 4091 | ,TopLevel::fromCerograph($obj->{'cerograph'}) |
| @@ -5187,6 +5316,66 @@ class Cerograph { | ||
| 5187 | 5316 | * @throws Exception |
| 5188 | 5317 | */ |
| 5189 | 5318 | public static function from(stdClass $obj): Cerograph { |
| 5319 | + if (!property_exists($obj, 'apotropaion')) { | |
| 5320 | + throw new Exception("Missing required property"); | |
| 5321 | + } | |
| 5322 | + if (!property_exists($obj, 'casuary')) { | |
| 5323 | + throw new Exception("Missing required property"); | |
| 5324 | + } | |
| 5325 | + if (!property_exists($obj, 'creaker')) { | |
| 5326 | + throw new Exception("Missing required property"); | |
| 5327 | + } | |
| 5328 | + if (!property_exists($obj, 'disqualification')) { | |
| 5329 | + throw new Exception("Missing required property"); | |
| 5330 | + } | |
| 5331 | + if (!property_exists($obj, 'imperatorious')) { | |
| 5332 | + throw new Exception("Missing required property"); | |
| 5333 | + } | |
| 5334 | + if (!property_exists($obj, 'impermeabilize')) { | |
| 5335 | + throw new Exception("Missing required property"); | |
| 5336 | + } | |
| 5337 | + if (!property_exists($obj, 'metastoma')) { | |
| 5338 | + throw new Exception("Missing required property"); | |
| 5339 | + } | |
| 5340 | + if (!property_exists($obj, 'noctidiurnal')) { | |
| 5341 | + throw new Exception("Missing required property"); | |
| 5342 | + } | |
| 5343 | + if (!property_exists($obj, 'nonreserve')) { | |
| 5344 | + throw new Exception("Missing required property"); | |
| 5345 | + } | |
| 5346 | + if (!property_exists($obj, 'ophthalmotonometry')) { | |
| 5347 | + throw new Exception("Missing required property"); | |
| 5348 | + } | |
| 5349 | + if (!property_exists($obj, 'pailful')) { | |
| 5350 | + throw new Exception("Missing required property"); | |
| 5351 | + } | |
| 5352 | + if (!property_exists($obj, 'pigfish')) { | |
| 5353 | + throw new Exception("Missing required property"); | |
| 5354 | + } | |
| 5355 | + if (!property_exists($obj, 'pongee')) { | |
| 5356 | + throw new Exception("Missing required property"); | |
| 5357 | + } | |
| 5358 | + if (!property_exists($obj, 'prosodical')) { | |
| 5359 | + throw new Exception("Missing required property"); | |
| 5360 | + } | |
| 5361 | + if (!property_exists($obj, 'scrofuloderm')) { | |
| 5362 | + throw new Exception("Missing required property"); | |
| 5363 | + } | |
| 5364 | + if (!property_exists($obj, 'storekeeping')) { | |
| 5365 | + throw new Exception("Missing required property"); | |
| 5366 | + } | |
| 5367 | + if (!property_exists($obj, 'therologist')) { | |
| 5368 | + throw new Exception("Missing required property"); | |
| 5369 | + } | |
| 5370 | + if (!property_exists($obj, 'Tolowa')) { | |
| 5371 | + throw new Exception("Missing required property"); | |
| 5372 | + } | |
| 5373 | + if (!property_exists($obj, 'tradeful')) { | |
| 5374 | + throw new Exception("Missing required property"); | |
| 5375 | + } | |
| 5376 | + if (!property_exists($obj, 'unriveting')) { | |
| 5377 | + throw new Exception("Missing required property"); | |
| 5378 | + } | |
| 5190 | 5379 | return new Cerograph( |
| 5191 | 5380 | Cerograph::fromApotropaion($obj->{'apotropaion'}) |
| 5192 | 5381 | ,Cerograph::fromCasuary($obj->{'casuary'}) |
| @@ -7031,6 +7220,21 @@ class Cimelia { | ||
| 7031 | 7220 | * @throws Exception |
| 7032 | 7221 | */ |
| 7033 | 7222 | public static function from(stdClass $obj): Cimelia { |
| 7223 | + if (!property_exists($obj, 'catharticalness')) { | |
| 7224 | + throw new Exception("Missing required property"); | |
| 7225 | + } | |
| 7226 | + if (!property_exists($obj, 'Chirotherium')) { | |
| 7227 | + throw new Exception("Missing required property"); | |
| 7228 | + } | |
| 7229 | + if (!property_exists($obj, 'disdiapason')) { | |
| 7230 | + throw new Exception("Missing required property"); | |
| 7231 | + } | |
| 7232 | + if (!property_exists($obj, 'homocerc')) { | |
| 7233 | + throw new Exception("Missing required property"); | |
| 7234 | + } | |
| 7235 | + if (!property_exists($obj, 'nonbookish')) { | |
| 7236 | + throw new Exception("Missing required property"); | |
| 7237 | + } | |
| 7034 | 7238 | return new Cimelia( |
| 7035 | 7239 | Cimelia::fromCatharticalness($obj->{'catharticalness'}) |
| 7036 | 7240 | ,Cimelia::fromChirotherium($obj->{'Chirotherium'}) |
| @@ -9682,6 +9886,66 @@ class Credulity { | ||
| 9682 | 9886 | * @throws Exception |
| 9683 | 9887 | */ |
| 9684 | 9888 | public static function from(stdClass $obj): Credulity { |
| 9889 | + if (!property_exists($obj, 'ammonolytic')) { | |
| 9890 | + throw new Exception("Missing required property"); | |
| 9891 | + } | |
| 9892 | + if (!property_exists($obj, 'bushmaster')) { | |
| 9893 | + throw new Exception("Missing required property"); | |
| 9894 | + } | |
| 9895 | + if (!property_exists($obj, 'considering')) { | |
| 9896 | + throw new Exception("Missing required property"); | |
| 9897 | + } | |
| 9898 | + if (!property_exists($obj, 'consuetudinary')) { | |
| 9899 | + throw new Exception("Missing required property"); | |
| 9900 | + } | |
| 9901 | + if (!property_exists($obj, 'embarras')) { | |
| 9902 | + throw new Exception("Missing required property"); | |
| 9903 | + } | |
| 9904 | + if (!property_exists($obj, 'fineness')) { | |
| 9905 | + throw new Exception("Missing required property"); | |
| 9906 | + } | |
| 9907 | + if (!property_exists($obj, 'flaithship')) { | |
| 9908 | + throw new Exception("Missing required property"); | |
| 9909 | + } | |
| 9910 | + if (!property_exists($obj, 'Flavia')) { | |
| 9911 | + throw new Exception("Missing required property"); | |
| 9912 | + } | |
| 9913 | + if (!property_exists($obj, 'gruffly')) { | |
| 9914 | + throw new Exception("Missing required property"); | |
| 9915 | + } | |
| 9916 | + if (!property_exists($obj, 'Hedychium')) { | |
| 9917 | + throw new Exception("Missing required property"); | |
| 9918 | + } | |
| 9919 | + if (!property_exists($obj, 'leadwort')) { | |
| 9920 | + throw new Exception("Missing required property"); | |
| 9921 | + } | |
| 9922 | + if (!property_exists($obj, 'overseriously')) { | |
| 9923 | + throw new Exception("Missing required property"); | |
| 9924 | + } | |
| 9925 | + if (!property_exists($obj, 'parabola')) { | |
| 9926 | + throw new Exception("Missing required property"); | |
| 9927 | + } | |
| 9928 | + if (!property_exists($obj, 'pectinatodenticulate')) { | |
| 9929 | + throw new Exception("Missing required property"); | |
| 9930 | + } | |
| 9931 | + if (!property_exists($obj, 'Popean')) { | |
| 9932 | + throw new Exception("Missing required property"); | |
| 9933 | + } | |
| 9934 | + if (!property_exists($obj, 'pornocrat')) { | |
| 9935 | + throw new Exception("Missing required property"); | |
| 9936 | + } | |
| 9937 | + if (!property_exists($obj, 'quadrisect')) { | |
| 9938 | + throw new Exception("Missing required property"); | |
| 9939 | + } | |
| 9940 | + if (!property_exists($obj, 'seriality')) { | |
| 9941 | + throw new Exception("Missing required property"); | |
| 9942 | + } | |
| 9943 | + if (!property_exists($obj, 'vamphorn')) { | |
| 9944 | + throw new Exception("Missing required property"); | |
| 9945 | + } | |
| 9946 | + if (!property_exists($obj, 'wharp')) { | |
| 9947 | + throw new Exception("Missing required property"); | |
| 9948 | + } | |
| 9685 | 9949 | return new Credulity( |
| 9686 | 9950 | Credulity::fromAmmonolytic($obj->{'ammonolytic'}) |
| 9687 | 9951 | ,Credulity::fromBushmaster($obj->{'bushmaster'}) |
| @@ -10866,6 +11130,66 @@ class Deruralize { | ||
| 10866 | 11130 | * @throws Exception |
| 10867 | 11131 | */ |
| 10868 | 11132 | public static function from(stdClass $obj): Deruralize { |
| 11133 | + if (!property_exists($obj, 'bockerel')) { | |
| 11134 | + throw new Exception("Missing required property"); | |
| 11135 | + } | |
| 11136 | + if (!property_exists($obj, 'boulder')) { | |
| 11137 | + throw new Exception("Missing required property"); | |
| 11138 | + } | |
| 11139 | + if (!property_exists($obj, 'churrus')) { | |
| 11140 | + throw new Exception("Missing required property"); | |
| 11141 | + } | |
| 11142 | + if (!property_exists($obj, 'counterdigged')) { | |
| 11143 | + throw new Exception("Missing required property"); | |
| 11144 | + } | |
| 11145 | + if (!property_exists($obj, 'dialogite')) { | |
| 11146 | + throw new Exception("Missing required property"); | |
| 11147 | + } | |
| 11148 | + if (!property_exists($obj, 'digenic')) { | |
| 11149 | + throw new Exception("Missing required property"); | |
| 11150 | + } | |
| 11151 | + if (!property_exists($obj, 'dunbird')) { | |
| 11152 | + throw new Exception("Missing required property"); | |
| 11153 | + } | |
| 11154 | + if (!property_exists($obj, 'ergatogyne')) { | |
| 11155 | + throw new Exception("Missing required property"); | |
| 11156 | + } | |
| 11157 | + if (!property_exists($obj, 'fiendful')) { | |
| 11158 | + throw new Exception("Missing required property"); | |
| 11159 | + } | |
| 11160 | + if (!property_exists($obj, 'jackrod')) { | |
| 11161 | + throw new Exception("Missing required property"); | |
| 11162 | + } | |
| 11163 | + if (!property_exists($obj, 'Jehovistic')) { | |
| 11164 | + throw new Exception("Missing required property"); | |
| 11165 | + } | |
| 11166 | + if (!property_exists($obj, 'Paninean')) { | |
| 11167 | + throw new Exception("Missing required property"); | |
| 11168 | + } | |
| 11169 | + if (!property_exists($obj, 'panther')) { | |
| 11170 | + throw new Exception("Missing required property"); | |
| 11171 | + } | |
| 11172 | + if (!property_exists($obj, 'placentigerous')) { | |
| 11173 | + throw new Exception("Missing required property"); | |
| 11174 | + } | |
| 11175 | + if (!property_exists($obj, 'Romney')) { | |
| 11176 | + throw new Exception("Missing required property"); | |
| 11177 | + } | |
| 11178 | + if (!property_exists($obj, 'sparm')) { | |
| 11179 | + throw new Exception("Missing required property"); | |
| 11180 | + } | |
| 11181 | + if (!property_exists($obj, 'tocsin')) { | |
| 11182 | + throw new Exception("Missing required property"); | |
| 11183 | + } | |
| 11184 | + if (!property_exists($obj, 'unnicked')) { | |
| 11185 | + throw new Exception("Missing required property"); | |
| 11186 | + } | |
| 11187 | + if (!property_exists($obj, 'unstavable')) { | |
| 11188 | + throw new Exception("Missing required property"); | |
| 11189 | + } | |
| 11190 | + if (!property_exists($obj, 'windfirm')) { | |
| 11191 | + throw new Exception("Missing required property"); | |
| 11192 | + } | |
| 10869 | 11193 | return new Deruralize( |
| 10870 | 11194 | Deruralize::fromBockerel($obj->{'bockerel'}) |
| 10871 | 11195 | ,Deruralize::fromBoulder($obj->{'boulder'}) |
| @@ -12050,6 +12374,66 @@ class Diaerese { | ||
| 12050 | 12374 | * @throws Exception |
| 12051 | 12375 | */ |
| 12052 | 12376 | public static function from(stdClass $obj): Diaerese { |
| 12377 | + if (!property_exists($obj, 'Amoreuxia')) { | |
| 12378 | + throw new Exception("Missing required property"); | |
| 12379 | + } | |
| 12380 | + if (!property_exists($obj, 'ani')) { | |
| 12381 | + throw new Exception("Missing required property"); | |
| 12382 | + } | |
| 12383 | + if (!property_exists($obj, 'bernicle')) { | |
| 12384 | + throw new Exception("Missing required property"); | |
| 12385 | + } | |
| 12386 | + if (!property_exists($obj, 'blackwasher')) { | |
| 12387 | + throw new Exception("Missing required property"); | |
| 12388 | + } | |
| 12389 | + if (!property_exists($obj, 'blowhard')) { | |
| 12390 | + throw new Exception("Missing required property"); | |
| 12391 | + } | |
| 12392 | + if (!property_exists($obj, 'broma')) { | |
| 12393 | + throw new Exception("Missing required property"); | |
| 12394 | + } | |
| 12395 | + if (!property_exists($obj, 'closecross')) { | |
| 12396 | + throw new Exception("Missing required property"); | |
| 12397 | + } | |
| 12398 | + if (!property_exists($obj, 'congregationalism')) { | |
| 12399 | + throw new Exception("Missing required property"); | |
| 12400 | + } | |
| 12401 | + if (!property_exists($obj, 'grayly')) { | |
| 12402 | + throw new Exception("Missing required property"); | |
| 12403 | + } | |
| 12404 | + if (!property_exists($obj, 'historically')) { | |
| 12405 | + throw new Exception("Missing required property"); | |
| 12406 | + } | |
| 12407 | + if (!property_exists($obj, 'hoast')) { | |
| 12408 | + throw new Exception("Missing required property"); | |
| 12409 | + } | |
| 12410 | + if (!property_exists($obj, 'irretentive')) { | |
| 12411 | + throw new Exception("Missing required property"); | |
| 12412 | + } | |
| 12413 | + if (!property_exists($obj, 'parcener')) { | |
| 12414 | + throw new Exception("Missing required property"); | |
| 12415 | + } | |
| 12416 | + if (!property_exists($obj, 'pedder')) { | |
| 12417 | + throw new Exception("Missing required property"); | |
| 12418 | + } | |
| 12419 | + if (!property_exists($obj, 'pseudoanatomic')) { | |
| 12420 | + throw new Exception("Missing required property"); | |
| 12421 | + } | |
| 12422 | + if (!property_exists($obj, 'rhizocarpian')) { | |
| 12423 | + throw new Exception("Missing required property"); | |
| 12424 | + } | |
| 12425 | + if (!property_exists($obj, 'samel')) { | |
| 12426 | + throw new Exception("Missing required property"); | |
| 12427 | + } | |
| 12428 | + if (!property_exists($obj, 'silker')) { | |
| 12429 | + throw new Exception("Missing required property"); | |
| 12430 | + } | |
| 12431 | + if (!property_exists($obj, 'subdentated')) { | |
| 12432 | + throw new Exception("Missing required property"); | |
| 12433 | + } | |
| 12434 | + if (!property_exists($obj, 'subobscure')) { | |
| 12435 | + throw new Exception("Missing required property"); | |
| 12436 | + } | |
| 12053 | 12437 | return new Diaerese( |
| 12054 | 12438 | Diaerese::fromAmoreuxia($obj->{'Amoreuxia'}) |
| 12055 | 12439 | ,Diaerese::fromAni($obj->{'ani'}) |
| @@ -13234,6 +13618,66 @@ class Encrust { | ||
| 13234 | 13618 | * @throws Exception |
| 13235 | 13619 | */ |
| 13236 | 13620 | public static function from(stdClass $obj): Encrust { |
| 13621 | + if (!property_exists($obj, 'comradely')) { | |
| 13622 | + throw new Exception("Missing required property"); | |
| 13623 | + } | |
| 13624 | + if (!property_exists($obj, 'diacanthous')) { | |
| 13625 | + throw new Exception("Missing required property"); | |
| 13626 | + } | |
| 13627 | + if (!property_exists($obj, 'feminineness')) { | |
| 13628 | + throw new Exception("Missing required property"); | |
| 13629 | + } | |
| 13630 | + if (!property_exists($obj, 'gossamered')) { | |
| 13631 | + throw new Exception("Missing required property"); | |
| 13632 | + } | |
| 13633 | + if (!property_exists($obj, 'Hibernia')) { | |
| 13634 | + throw new Exception("Missing required property"); | |
| 13635 | + } | |
| 13636 | + if (!property_exists($obj, 'Hibiscus')) { | |
| 13637 | + throw new Exception("Missing required property"); | |
| 13638 | + } | |
| 13639 | + if (!property_exists($obj, 'Lepidosauria')) { | |
| 13640 | + throw new Exception("Missing required property"); | |
| 13641 | + } | |
| 13642 | + if (!property_exists($obj, 'lollingly')) { | |
| 13643 | + throw new Exception("Missing required property"); | |
| 13644 | + } | |
| 13645 | + if (!property_exists($obj, 'manager')) { | |
| 13646 | + throw new Exception("Missing required property"); | |
| 13647 | + } | |
| 13648 | + if (!property_exists($obj, 'mechanic')) { | |
| 13649 | + throw new Exception("Missing required property"); | |
| 13650 | + } | |
| 13651 | + if (!property_exists($obj, 'overminuteness')) { | |
| 13652 | + throw new Exception("Missing required property"); | |
| 13653 | + } | |
| 13654 | + if (!property_exists($obj, 'papelonne')) { | |
| 13655 | + throw new Exception("Missing required property"); | |
| 13656 | + } | |
| 13657 | + if (!property_exists($obj, 'plebification')) { | |
| 13658 | + throw new Exception("Missing required property"); | |
| 13659 | + } | |
| 13660 | + if (!property_exists($obj, 'pugmiller')) { | |
| 13661 | + throw new Exception("Missing required property"); | |
| 13662 | + } | |
| 13663 | + if (!property_exists($obj, 'recoveror')) { | |
| 13664 | + throw new Exception("Missing required property"); | |
| 13665 | + } | |
| 13666 | + if (!property_exists($obj, 'spermatoblastic')) { | |
| 13667 | + throw new Exception("Missing required property"); | |
| 13668 | + } | |
| 13669 | + if (!property_exists($obj, 'Syllidae')) { | |
| 13670 | + throw new Exception("Missing required property"); | |
| 13671 | + } | |
| 13672 | + if (!property_exists($obj, 'ungyved')) { | |
| 13673 | + throw new Exception("Missing required property"); | |
| 13674 | + } | |
| 13675 | + if (!property_exists($obj, 'whirlabout')) { | |
| 13676 | + throw new Exception("Missing required property"); | |
| 13677 | + } | |
| 13678 | + if (!property_exists($obj, 'woodenware')) { | |
| 13679 | + throw new Exception("Missing required property"); | |
| 13680 | + } | |
| 13237 | 13681 | return new Encrust( |
| 13238 | 13682 | Encrust::fromComradely($obj->{'comradely'}) |
| 13239 | 13683 | ,Encrust::fromDiacanthous($obj->{'diacanthous'}) |
| @@ -14418,6 +14862,66 @@ class Faggingly { | ||
| 14418 | 14862 | * @throws Exception |
| 14419 | 14863 | */ |
| 14420 | 14864 | public static function from(stdClass $obj): Faggingly { |
| 14865 | + if (!property_exists($obj, 'abranchian')) { | |
| 14866 | + throw new Exception("Missing required property"); | |
| 14867 | + } | |
| 14868 | + if (!property_exists($obj, 'aculeiform')) { | |
| 14869 | + throw new Exception("Missing required property"); | |
| 14870 | + } | |
| 14871 | + if (!property_exists($obj, 'adiaphoristic')) { | |
| 14872 | + throw new Exception("Missing required property"); | |
| 14873 | + } | |
| 14874 | + if (!property_exists($obj, 'adoptionism')) { | |
| 14875 | + throw new Exception("Missing required property"); | |
| 14876 | + } | |
| 14877 | + if (!property_exists($obj, 'Anglic')) { | |
| 14878 | + throw new Exception("Missing required property"); | |
| 14879 | + } | |
| 14880 | + if (!property_exists($obj, 'antrotomy')) { | |
| 14881 | + throw new Exception("Missing required property"); | |
| 14882 | + } | |
| 14883 | + if (!property_exists($obj, 'coerciveness')) { | |
| 14884 | + throw new Exception("Missing required property"); | |
| 14885 | + } | |
| 14886 | + if (!property_exists($obj, 'decorist')) { | |
| 14887 | + throw new Exception("Missing required property"); | |
| 14888 | + } | |
| 14889 | + if (!property_exists($obj, 'duckhood')) { | |
| 14890 | + throw new Exception("Missing required property"); | |
| 14891 | + } | |
| 14892 | + if (!property_exists($obj, 'Heteromeri')) { | |
| 14893 | + throw new Exception("Missing required property"); | |
| 14894 | + } | |
| 14895 | + if (!property_exists($obj, 'hypochnose')) { | |
| 14896 | + throw new Exception("Missing required property"); | |
| 14897 | + } | |
| 14898 | + if (!property_exists($obj, 'lochage')) { | |
| 14899 | + throw new Exception("Missing required property"); | |
| 14900 | + } | |
| 14901 | + if (!property_exists($obj, 'melee')) { | |
| 14902 | + throw new Exception("Missing required property"); | |
| 14903 | + } | |
| 14904 | + if (!property_exists($obj, 'nonconformitant')) { | |
| 14905 | + throw new Exception("Missing required property"); | |
| 14906 | + } | |
| 14907 | + if (!property_exists($obj, 'Poinsettia')) { | |
| 14908 | + throw new Exception("Missing required property"); | |
| 14909 | + } | |
| 14910 | + if (!property_exists($obj, 'putatively')) { | |
| 14911 | + throw new Exception("Missing required property"); | |
| 14912 | + } | |
| 14913 | + if (!property_exists($obj, 'semivolatile')) { | |
| 14914 | + throw new Exception("Missing required property"); | |
| 14915 | + } | |
| 14916 | + if (!property_exists($obj, 'soleas')) { | |
| 14917 | + throw new Exception("Missing required property"); | |
| 14918 | + } | |
| 14919 | + if (!property_exists($obj, 'unfastenable')) { | |
| 14920 | + throw new Exception("Missing required property"); | |
| 14921 | + } | |
| 14922 | + if (!property_exists($obj, 'unmillinered')) { | |
| 14923 | + throw new Exception("Missing required property"); | |
| 14924 | + } | |
| 14421 | 14925 | return new Faggingly( |
| 14422 | 14926 | Faggingly::fromAbranchian($obj->{'abranchian'}) |
| 14423 | 14927 | ,Faggingly::fromAculeiform($obj->{'aculeiform'}) |
| @@ -15602,6 +16106,66 @@ class Fenk { | ||
| 15602 | 16106 | * @throws Exception |
| 15603 | 16107 | */ |
| 15604 | 16108 | public static function from(stdClass $obj): Fenk { |
| 16109 | + if (!property_exists($obj, 'apoise')) { | |
| 16110 | + throw new Exception("Missing required property"); | |
| 16111 | + } | |
| 16112 | + if (!property_exists($obj, 'astronomize')) { | |
| 16113 | + throw new Exception("Missing required property"); | |
| 16114 | + } | |
| 16115 | + if (!property_exists($obj, 'cockhorse')) { | |
| 16116 | + throw new Exception("Missing required property"); | |
| 16117 | + } | |
| 16118 | + if (!property_exists($obj, 'copular')) { | |
| 16119 | + throw new Exception("Missing required property"); | |
| 16120 | + } | |
| 16121 | + if (!property_exists($obj, 'Dagomba')) { | |
| 16122 | + throw new Exception("Missing required property"); | |
| 16123 | + } | |
| 16124 | + if (!property_exists($obj, 'draffy')) { | |
| 16125 | + throw new Exception("Missing required property"); | |
| 16126 | + } | |
| 16127 | + if (!property_exists($obj, 'foreigner')) { | |
| 16128 | + throw new Exception("Missing required property"); | |
| 16129 | + } | |
| 16130 | + if (!property_exists($obj, 'Guyandot')) { | |
| 16131 | + throw new Exception("Missing required property"); | |
| 16132 | + } | |
| 16133 | + if (!property_exists($obj, 'neurogliosis')) { | |
| 16134 | + throw new Exception("Missing required property"); | |
| 16135 | + } | |
| 16136 | + if (!property_exists($obj, 'osmious')) { | |
| 16137 | + throw new Exception("Missing required property"); | |
| 16138 | + } | |
| 16139 | + if (!property_exists($obj, 'palpitate')) { | |
| 16140 | + throw new Exception("Missing required property"); | |
| 16141 | + } | |
| 16142 | + if (!property_exists($obj, 'rebukeable')) { | |
| 16143 | + throw new Exception("Missing required property"); | |
| 16144 | + } | |
| 16145 | + if (!property_exists($obj, 'Reinwardtia')) { | |
| 16146 | + throw new Exception("Missing required property"); | |
| 16147 | + } | |
| 16148 | + if (!property_exists($obj, 'reservatory')) { | |
| 16149 | + throw new Exception("Missing required property"); | |
| 16150 | + } | |
| 16151 | + if (!property_exists($obj, 'scalt')) { | |
| 16152 | + throw new Exception("Missing required property"); | |
| 16153 | + } | |
| 16154 | + if (!property_exists($obj, 'scripturalize')) { | |
| 16155 | + throw new Exception("Missing required property"); | |
| 16156 | + } | |
| 16157 | + if (!property_exists($obj, 'tintometer')) { | |
| 16158 | + throw new Exception("Missing required property"); | |
| 16159 | + } | |
| 16160 | + if (!property_exists($obj, 'Tritoness')) { | |
| 16161 | + throw new Exception("Missing required property"); | |
| 16162 | + } | |
| 16163 | + if (!property_exists($obj, 'undergrade')) { | |
| 16164 | + throw new Exception("Missing required property"); | |
| 16165 | + } | |
| 16166 | + if (!property_exists($obj, 'undermountain')) { | |
| 16167 | + throw new Exception("Missing required property"); | |
| 16168 | + } | |
| 15605 | 16169 | return new Fenk( |
| 15606 | 16170 | Fenk::fromApoise($obj->{'apoise'}) |
| 15607 | 16171 | ,Fenk::fromAstronomize($obj->{'astronomize'}) |
| @@ -16786,6 +17350,66 @@ class Flagmaking { | ||
| 16786 | 17350 | * @throws Exception |
| 16787 | 17351 | */ |
| 16788 | 17352 | public static function from(stdClass $obj): Flagmaking { |
| 17353 | + if (!property_exists($obj, 'albarco')) { | |
| 17354 | + throw new Exception("Missing required property"); | |
| 17355 | + } | |
| 17356 | + if (!property_exists($obj, 'Bunodonta')) { | |
| 17357 | + throw new Exception("Missing required property"); | |
| 17358 | + } | |
| 17359 | + if (!property_exists($obj, 'hornify')) { | |
| 17360 | + throw new Exception("Missing required property"); | |
| 17361 | + } | |
| 17362 | + if (!property_exists($obj, 'Hydrocorisae')) { | |
| 17363 | + throw new Exception("Missing required property"); | |
| 17364 | + } | |
| 17365 | + if (!property_exists($obj, 'hypoglossus')) { | |
| 17366 | + throw new Exception("Missing required property"); | |
| 17367 | + } | |
| 17368 | + if (!property_exists($obj, 'inexpiably')) { | |
| 17369 | + throw new Exception("Missing required property"); | |
| 17370 | + } | |
| 17371 | + if (!property_exists($obj, 'ingratitude')) { | |
| 17372 | + throw new Exception("Missing required property"); | |
| 17373 | + } | |
| 17374 | + if (!property_exists($obj, 'ladyfly')) { | |
| 17375 | + throw new Exception("Missing required property"); | |
| 17376 | + } | |
| 17377 | + if (!property_exists($obj, 'medicament')) { | |
| 17378 | + throw new Exception("Missing required property"); | |
| 17379 | + } | |
| 17380 | + if (!property_exists($obj, 'monogrammatic')) { | |
| 17381 | + throw new Exception("Missing required property"); | |
| 17382 | + } | |
| 17383 | + if (!property_exists($obj, 'nobbut')) { | |
| 17384 | + throw new Exception("Missing required property"); | |
| 17385 | + } | |
| 17386 | + if (!property_exists($obj, 'Notacanthidae')) { | |
| 17387 | + throw new Exception("Missing required property"); | |
| 17388 | + } | |
| 17389 | + if (!property_exists($obj, 'polyplacophore')) { | |
| 17390 | + throw new Exception("Missing required property"); | |
| 17391 | + } | |
| 17392 | + if (!property_exists($obj, 'proexercise')) { | |
| 17393 | + throw new Exception("Missing required property"); | |
| 17394 | + } | |
| 17395 | + if (!property_exists($obj, 'protoplast')) { | |
| 17396 | + throw new Exception("Missing required property"); | |
| 17397 | + } | |
| 17398 | + if (!property_exists($obj, 'puzzling')) { | |
| 17399 | + throw new Exception("Missing required property"); | |
| 17400 | + } | |
| 17401 | + if (!property_exists($obj, 'splanchnoskeleton')) { | |
| 17402 | + throw new Exception("Missing required property"); | |
| 17403 | + } | |
| 17404 | + if (!property_exists($obj, 'unloveliness')) { | |
| 17405 | + throw new Exception("Missing required property"); | |
| 17406 | + } | |
| 17407 | + if (!property_exists($obj, 'unquarantined')) { | |
| 17408 | + throw new Exception("Missing required property"); | |
| 17409 | + } | |
| 17410 | + if (!property_exists($obj, 'unrenounceable')) { | |
| 17411 | + throw new Exception("Missing required property"); | |
| 17412 | + } | |
| 16789 | 17413 | return new Flagmaking( |
| 16790 | 17414 | Flagmaking::fromAlbarco($obj->{'albarco'}) |
| 16791 | 17415 | ,Flagmaking::fromBunodonta($obj->{'Bunodonta'}) |
| @@ -18630,6 +19254,21 @@ class Interacinar { | ||
| 18630 | 19254 | * @throws Exception |
| 18631 | 19255 | */ |
| 18632 | 19256 | public static function from(stdClass $obj): Interacinar { |
| 19257 | + if (!property_exists($obj, 'assapan')) { | |
| 19258 | + throw new Exception("Missing required property"); | |
| 19259 | + } | |
| 19260 | + if (!property_exists($obj, 'benefactorship')) { | |
| 19261 | + throw new Exception("Missing required property"); | |
| 19262 | + } | |
| 19263 | + if (!property_exists($obj, 'triseriatim')) { | |
| 19264 | + throw new Exception("Missing required property"); | |
| 19265 | + } | |
| 19266 | + if (!property_exists($obj, 'tubbing')) { | |
| 19267 | + throw new Exception("Missing required property"); | |
| 19268 | + } | |
| 19269 | + if (!property_exists($obj, 'untrimmed')) { | |
| 19270 | + throw new Exception("Missing required property"); | |
| 19271 | + } | |
| 18633 | 19272 | return new Interacinar( |
| 18634 | 19273 | Interacinar::fromAssapan($obj->{'assapan'}) |
| 18635 | 19274 | ,Interacinar::fromBenefactorship($obj->{'benefactorship'}) |
Test case
1 generated file · +510 −0test/inputs/json/priority/combinations2.json
Mphpdefault / TopLevel.php+510 −0
| @@ -4256,6 +4256,141 @@ class TopLevel { | ||
| 4256 | 4256 | * @throws Exception |
| 4257 | 4257 | */ |
| 4258 | 4258 | public static function from(stdClass $obj): TopLevel { |
| 4259 | + if (!property_exists($obj, 'Abranchiata')) { | |
| 4260 | + throw new Exception("Missing required property"); | |
| 4261 | + } | |
| 4262 | + if (!property_exists($obj, 'academe')) { | |
| 4263 | + throw new Exception("Missing required property"); | |
| 4264 | + } | |
| 4265 | + if (!property_exists($obj, 'acquirable')) { | |
| 4266 | + throw new Exception("Missing required property"); | |
| 4267 | + } | |
| 4268 | + if (!property_exists($obj, 'aerometry')) { | |
| 4269 | + throw new Exception("Missing required property"); | |
| 4270 | + } | |
| 4271 | + if (!property_exists($obj, 'alexin')) { | |
| 4272 | + throw new Exception("Missing required property"); | |
| 4273 | + } | |
| 4274 | + if (!property_exists($obj, 'alleviate')) { | |
| 4275 | + throw new Exception("Missing required property"); | |
| 4276 | + } | |
| 4277 | + if (!property_exists($obj, 'amaas')) { | |
| 4278 | + throw new Exception("Missing required property"); | |
| 4279 | + } | |
| 4280 | + if (!property_exists($obj, 'ambassage')) { | |
| 4281 | + throw new Exception("Missing required property"); | |
| 4282 | + } | |
| 4283 | + if (!property_exists($obj, 'amphithyron')) { | |
| 4284 | + throw new Exception("Missing required property"); | |
| 4285 | + } | |
| 4286 | + if (!property_exists($obj, 'Andriana')) { | |
| 4287 | + throw new Exception("Missing required property"); | |
| 4288 | + } | |
| 4289 | + if (!property_exists($obj, 'ankee')) { | |
| 4290 | + throw new Exception("Missing required property"); | |
| 4291 | + } | |
| 4292 | + if (!property_exists($obj, 'annihilator')) { | |
| 4293 | + throw new Exception("Missing required property"); | |
| 4294 | + } | |
| 4295 | + if (!property_exists($obj, 'annulose')) { | |
| 4296 | + throw new Exception("Missing required property"); | |
| 4297 | + } | |
| 4298 | + if (!property_exists($obj, 'Ansarie')) { | |
| 4299 | + throw new Exception("Missing required property"); | |
| 4300 | + } | |
| 4301 | + if (!property_exists($obj, 'aphasia')) { | |
| 4302 | + throw new Exception("Missing required property"); | |
| 4303 | + } | |
| 4304 | + if (!property_exists($obj, 'asprawl')) { | |
| 4305 | + throw new Exception("Missing required property"); | |
| 4306 | + } | |
| 4307 | + if (!property_exists($obj, 'attractive')) { | |
| 4308 | + throw new Exception("Missing required property"); | |
| 4309 | + } | |
| 4310 | + if (!property_exists($obj, 'barksome')) { | |
| 4311 | + throw new Exception("Missing required property"); | |
| 4312 | + } | |
| 4313 | + if (!property_exists($obj, 'bedesman')) { | |
| 4314 | + throw new Exception("Missing required property"); | |
| 4315 | + } | |
| 4316 | + if (!property_exists($obj, 'belard')) { | |
| 4317 | + throw new Exception("Missing required property"); | |
| 4318 | + } | |
| 4319 | + if (!property_exists($obj, 'bocking')) { | |
| 4320 | + throw new Exception("Missing required property"); | |
| 4321 | + } | |
| 4322 | + if (!property_exists($obj, 'brawlingly')) { | |
| 4323 | + throw new Exception("Missing required property"); | |
| 4324 | + } | |
| 4325 | + if (!property_exists($obj, 'brookie')) { | |
| 4326 | + throw new Exception("Missing required property"); | |
| 4327 | + } | |
| 4328 | + if (!property_exists($obj, 'bumboatman')) { | |
| 4329 | + throw new Exception("Missing required property"); | |
| 4330 | + } | |
| 4331 | + if (!property_exists($obj, 'bystreet')) { | |
| 4332 | + throw new Exception("Missing required property"); | |
| 4333 | + } | |
| 4334 | + if (!property_exists($obj, 'calaverite')) { | |
| 4335 | + throw new Exception("Missing required property"); | |
| 4336 | + } | |
| 4337 | + if (!property_exists($obj, 'catallactic')) { | |
| 4338 | + throw new Exception("Missing required property"); | |
| 4339 | + } | |
| 4340 | + if (!property_exists($obj, 'cemental')) { | |
| 4341 | + throw new Exception("Missing required property"); | |
| 4342 | + } | |
| 4343 | + if (!property_exists($obj, 'Chytridiaceae')) { | |
| 4344 | + throw new Exception("Missing required property"); | |
| 4345 | + } | |
| 4346 | + if (!property_exists($obj, 'Discordia')) { | |
| 4347 | + throw new Exception("Missing required property"); | |
| 4348 | + } | |
| 4349 | + if (!property_exists($obj, 'Endomyces')) { | |
| 4350 | + throw new Exception("Missing required property"); | |
| 4351 | + } | |
| 4352 | + if (!property_exists($obj, 'Epinephelidae')) { | |
| 4353 | + throw new Exception("Missing required property"); | |
| 4354 | + } | |
| 4355 | + if (!property_exists($obj, 'Eupatorium')) { | |
| 4356 | + throw new Exception("Missing required property"); | |
| 4357 | + } | |
| 4358 | + if (!property_exists($obj, 'Gryphosaurus')) { | |
| 4359 | + throw new Exception("Missing required property"); | |
| 4360 | + } | |
| 4361 | + if (!property_exists($obj, 'Koryak')) { | |
| 4362 | + throw new Exception("Missing required property"); | |
| 4363 | + } | |
| 4364 | + if (!property_exists($obj, 'Lavinia')) { | |
| 4365 | + throw new Exception("Missing required property"); | |
| 4366 | + } | |
| 4367 | + if (!property_exists($obj, 'Oskar')) { | |
| 4368 | + throw new Exception("Missing required property"); | |
| 4369 | + } | |
| 4370 | + if (!property_exists($obj, 'Rebecca')) { | |
| 4371 | + throw new Exception("Missing required property"); | |
| 4372 | + } | |
| 4373 | + if (!property_exists($obj, 'Rhomboganoidei')) { | |
| 4374 | + throw new Exception("Missing required property"); | |
| 4375 | + } | |
| 4376 | + if (!property_exists($obj, 'Rigsmal')) { | |
| 4377 | + throw new Exception("Missing required property"); | |
| 4378 | + } | |
| 4379 | + if (!property_exists($obj, 'Ruellia')) { | |
| 4380 | + throw new Exception("Missing required property"); | |
| 4381 | + } | |
| 4382 | + if (!property_exists($obj, 'School')) { | |
| 4383 | + throw new Exception("Missing required property"); | |
| 4384 | + } | |
| 4385 | + if (!property_exists($obj, 'Shakespearolater')) { | |
| 4386 | + throw new Exception("Missing required property"); | |
| 4387 | + } | |
| 4388 | + if (!property_exists($obj, 'Svan')) { | |
| 4389 | + throw new Exception("Missing required property"); | |
| 4390 | + } | |
| 4391 | + if (!property_exists($obj, 'Wayao')) { | |
| 4392 | + throw new Exception("Missing required property"); | |
| 4393 | + } | |
| 4259 | 4394 | return new TopLevel( |
| 4260 | 4395 | TopLevel::fromAbranchiata($obj->{'Abranchiata'}) |
| 4261 | 4396 | ,TopLevel::fromAcademe($obj->{'academe'}) |
| @@ -5490,6 +5625,66 @@ class Alleviate { | ||
| 5490 | 5625 | * @throws Exception |
| 5491 | 5626 | */ |
| 5492 | 5627 | public static function from(stdClass $obj): Alleviate { |
| 5628 | + if (!property_exists($obj, 'apriori')) { | |
| 5629 | + throw new Exception("Missing required property"); | |
| 5630 | + } | |
| 5631 | + if (!property_exists($obj, 'beggarer')) { | |
| 5632 | + throw new Exception("Missing required property"); | |
| 5633 | + } | |
| 5634 | + if (!property_exists($obj, 'brokenheartedly')) { | |
| 5635 | + throw new Exception("Missing required property"); | |
| 5636 | + } | |
| 5637 | + if (!property_exists($obj, 'debilitation')) { | |
| 5638 | + throw new Exception("Missing required property"); | |
| 5639 | + } | |
| 5640 | + if (!property_exists($obj, 'frike')) { | |
| 5641 | + throw new Exception("Missing required property"); | |
| 5642 | + } | |
| 5643 | + if (!property_exists($obj, 'gastrolith')) { | |
| 5644 | + throw new Exception("Missing required property"); | |
| 5645 | + } | |
| 5646 | + if (!property_exists($obj, 'Hulsean')) { | |
| 5647 | + throw new Exception("Missing required property"); | |
| 5648 | + } | |
| 5649 | + if (!property_exists($obj, 'orthocentric')) { | |
| 5650 | + throw new Exception("Missing required property"); | |
| 5651 | + } | |
| 5652 | + if (!property_exists($obj, 'petaly')) { | |
| 5653 | + throw new Exception("Missing required property"); | |
| 5654 | + } | |
| 5655 | + if (!property_exists($obj, 'probudgeting')) { | |
| 5656 | + throw new Exception("Missing required property"); | |
| 5657 | + } | |
| 5658 | + if (!property_exists($obj, 'reacquire')) { | |
| 5659 | + throw new Exception("Missing required property"); | |
| 5660 | + } | |
| 5661 | + if (!property_exists($obj, 'scow')) { | |
| 5662 | + throw new Exception("Missing required property"); | |
| 5663 | + } | |
| 5664 | + if (!property_exists($obj, 'shutoff')) { | |
| 5665 | + throw new Exception("Missing required property"); | |
| 5666 | + } | |
| 5667 | + if (!property_exists($obj, 'subcontiguous')) { | |
| 5668 | + throw new Exception("Missing required property"); | |
| 5669 | + } | |
| 5670 | + if (!property_exists($obj, 'suffumigate')) { | |
| 5671 | + throw new Exception("Missing required property"); | |
| 5672 | + } | |
| 5673 | + if (!property_exists($obj, 'transformable')) { | |
| 5674 | + throw new Exception("Missing required property"); | |
| 5675 | + } | |
| 5676 | + if (!property_exists($obj, 'uncoroneted')) { | |
| 5677 | + throw new Exception("Missing required property"); | |
| 5678 | + } | |
| 5679 | + if (!property_exists($obj, 'unparking')) { | |
| 5680 | + throw new Exception("Missing required property"); | |
| 5681 | + } | |
| 5682 | + if (!property_exists($obj, 'unvarnishedness')) { | |
| 5683 | + throw new Exception("Missing required property"); | |
| 5684 | + } | |
| 5685 | + if (!property_exists($obj, 'wherewithal')) { | |
| 5686 | + throw new Exception("Missing required property"); | |
| 5687 | + } | |
| 5493 | 5688 | return new Alleviate( |
| 5494 | 5689 | Alleviate::fromApriori($obj->{'apriori'}) |
| 5495 | 5690 | ,Alleviate::fromBeggarer($obj->{'beggarer'}) |
| @@ -5837,6 +6032,21 @@ class Rebecca { | ||
| 5837 | 6032 | * @throws Exception |
| 5838 | 6033 | */ |
| 5839 | 6034 | public static function from(stdClass $obj): Rebecca { |
| 6035 | + if (!property_exists($obj, 'catharticalness')) { | |
| 6036 | + throw new Exception("Missing required property"); | |
| 6037 | + } | |
| 6038 | + if (!property_exists($obj, 'Chirotherium')) { | |
| 6039 | + throw new Exception("Missing required property"); | |
| 6040 | + } | |
| 6041 | + if (!property_exists($obj, 'disdiapason')) { | |
| 6042 | + throw new Exception("Missing required property"); | |
| 6043 | + } | |
| 6044 | + if (!property_exists($obj, 'homocerc')) { | |
| 6045 | + throw new Exception("Missing required property"); | |
| 6046 | + } | |
| 6047 | + if (!property_exists($obj, 'nonbookish')) { | |
| 6048 | + throw new Exception("Missing required property"); | |
| 6049 | + } | |
| 5840 | 6050 | return new Rebecca( |
| 5841 | 6051 | Rebecca::fromCatharticalness($obj->{'catharticalness'}) |
| 5842 | 6052 | ,Rebecca::fromChirotherium($obj->{'Chirotherium'}) |
| @@ -8628,6 +8838,66 @@ class Ankee { | ||
| 8628 | 8838 | * @throws Exception |
| 8629 | 8839 | */ |
| 8630 | 8840 | public static function from(stdClass $obj): Ankee { |
| 8841 | + if (!property_exists($obj, 'Anomoean')) { | |
| 8842 | + throw new Exception("Missing required property"); | |
| 8843 | + } | |
| 8844 | + if (!property_exists($obj, 'barleyhood')) { | |
| 8845 | + throw new Exception("Missing required property"); | |
| 8846 | + } | |
| 8847 | + if (!property_exists($obj, 'befriender')) { | |
| 8848 | + throw new Exception("Missing required property"); | |
| 8849 | + } | |
| 8850 | + if (!property_exists($obj, 'brutishness')) { | |
| 8851 | + throw new Exception("Missing required property"); | |
| 8852 | + } | |
| 8853 | + if (!property_exists($obj, 'cephalalgy')) { | |
| 8854 | + throw new Exception("Missing required property"); | |
| 8855 | + } | |
| 8856 | + if (!property_exists($obj, 'cirurgian')) { | |
| 8857 | + throw new Exception("Missing required property"); | |
| 8858 | + } | |
| 8859 | + if (!property_exists($obj, 'conventionally')) { | |
| 8860 | + throw new Exception("Missing required property"); | |
| 8861 | + } | |
| 8862 | + if (!property_exists($obj, 'jackshay')) { | |
| 8863 | + throw new Exception("Missing required property"); | |
| 8864 | + } | |
| 8865 | + if (!property_exists($obj, 'milammeter')) { | |
| 8866 | + throw new Exception("Missing required property"); | |
| 8867 | + } | |
| 8868 | + if (!property_exists($obj, 'Naja')) { | |
| 8869 | + throw new Exception("Missing required property"); | |
| 8870 | + } | |
| 8871 | + if (!property_exists($obj, 'ombrological')) { | |
| 8872 | + throw new Exception("Missing required property"); | |
| 8873 | + } | |
| 8874 | + if (!property_exists($obj, 'phonasthenia')) { | |
| 8875 | + throw new Exception("Missing required property"); | |
| 8876 | + } | |
| 8877 | + if (!property_exists($obj, 'retrievableness')) { | |
| 8878 | + throw new Exception("Missing required property"); | |
| 8879 | + } | |
| 8880 | + if (!property_exists($obj, 'snakily')) { | |
| 8881 | + throw new Exception("Missing required property"); | |
| 8882 | + } | |
| 8883 | + if (!property_exists($obj, 'swot')) { | |
| 8884 | + throw new Exception("Missing required property"); | |
| 8885 | + } | |
| 8886 | + if (!property_exists($obj, 'tartlet')) { | |
| 8887 | + throw new Exception("Missing required property"); | |
| 8888 | + } | |
| 8889 | + if (!property_exists($obj, 'thiofuran')) { | |
| 8890 | + throw new Exception("Missing required property"); | |
| 8891 | + } | |
| 8892 | + if (!property_exists($obj, 'tracheophone')) { | |
| 8893 | + throw new Exception("Missing required property"); | |
| 8894 | + } | |
| 8895 | + if (!property_exists($obj, 'tuglike')) { | |
| 8896 | + throw new Exception("Missing required property"); | |
| 8897 | + } | |
| 8898 | + if (!property_exists($obj, 'unscratchingly')) { | |
| 8899 | + throw new Exception("Missing required property"); | |
| 8900 | + } | |
| 8631 | 8901 | return new Ankee( |
| 8632 | 8902 | Ankee::fromAnomoean($obj->{'Anomoean'}) |
| 8633 | 8903 | ,Ankee::fromBarleyhood($obj->{'barleyhood'}) |
| @@ -9812,6 +10082,66 @@ class Ansarie { | ||
| 9812 | 10082 | * @throws Exception |
| 9813 | 10083 | */ |
| 9814 | 10084 | public static function from(stdClass $obj): Ansarie { |
| 10085 | + if (!property_exists($obj, 'accension')) { | |
| 10086 | + throw new Exception("Missing required property"); | |
| 10087 | + } | |
| 10088 | + if (!property_exists($obj, 'Alida')) { | |
| 10089 | + throw new Exception("Missing required property"); | |
| 10090 | + } | |
| 10091 | + if (!property_exists($obj, 'asteria')) { | |
| 10092 | + throw new Exception("Missing required property"); | |
| 10093 | + } | |
| 10094 | + if (!property_exists($obj, 'beriberic')) { | |
| 10095 | + throw new Exception("Missing required property"); | |
| 10096 | + } | |
| 10097 | + if (!property_exists($obj, 'edgebone')) { | |
| 10098 | + throw new Exception("Missing required property"); | |
| 10099 | + } | |
| 10100 | + if (!property_exists($obj, 'gastrodialysis')) { | |
| 10101 | + throw new Exception("Missing required property"); | |
| 10102 | + } | |
| 10103 | + if (!property_exists($obj, 'geographic')) { | |
| 10104 | + throw new Exception("Missing required property"); | |
| 10105 | + } | |
| 10106 | + if (!property_exists($obj, 'Ictonyx')) { | |
| 10107 | + throw new Exception("Missing required property"); | |
| 10108 | + } | |
| 10109 | + if (!property_exists($obj, 'metrocele')) { | |
| 10110 | + throw new Exception("Missing required property"); | |
| 10111 | + } | |
| 10112 | + if (!property_exists($obj, 'misgraft')) { | |
| 10113 | + throw new Exception("Missing required property"); | |
| 10114 | + } | |
| 10115 | + if (!property_exists($obj, 'monteith')) { | |
| 10116 | + throw new Exception("Missing required property"); | |
| 10117 | + } | |
| 10118 | + if (!property_exists($obj, 'notcher')) { | |
| 10119 | + throw new Exception("Missing required property"); | |
| 10120 | + } | |
| 10121 | + if (!property_exists($obj, 'prorestriction')) { | |
| 10122 | + throw new Exception("Missing required property"); | |
| 10123 | + } | |
| 10124 | + if (!property_exists($obj, 'Ramist')) { | |
| 10125 | + throw new Exception("Missing required property"); | |
| 10126 | + } | |
| 10127 | + if (!property_exists($obj, 'throatlet')) { | |
| 10128 | + throw new Exception("Missing required property"); | |
| 10129 | + } | |
| 10130 | + if (!property_exists($obj, 'unfair')) { | |
| 10131 | + throw new Exception("Missing required property"); | |
| 10132 | + } | |
| 10133 | + if (!property_exists($obj, 'unsynonymous')) { | |
| 10134 | + throw new Exception("Missing required property"); | |
| 10135 | + } | |
| 10136 | + if (!property_exists($obj, 'water')) { | |
| 10137 | + throw new Exception("Missing required property"); | |
| 10138 | + } | |
| 10139 | + if (!property_exists($obj, 'zestfully')) { | |
| 10140 | + throw new Exception("Missing required property"); | |
| 10141 | + } | |
| 10142 | + if (!property_exists($obj, 'zincic')) { | |
| 10143 | + throw new Exception("Missing required property"); | |
| 10144 | + } | |
| 9815 | 10145 | return new Ansarie( |
| 9816 | 10146 | Ansarie::fromAccension($obj->{'accension'}) |
| 9817 | 10147 | ,Ansarie::fromAlida($obj->{'Alida'}) |
| @@ -10996,6 +11326,66 @@ class Chytridiaceae { | ||
| 10996 | 11326 | * @throws Exception |
| 10997 | 11327 | */ |
| 10998 | 11328 | public static function from(stdClass $obj): Chytridiaceae { |
| 11329 | + if (!property_exists($obj, 'Batidaceae')) { | |
| 11330 | + throw new Exception("Missing required property"); | |
| 11331 | + } | |
| 11332 | + if (!property_exists($obj, 'Brechites')) { | |
| 11333 | + throw new Exception("Missing required property"); | |
| 11334 | + } | |
| 11335 | + if (!property_exists($obj, 'codespairer')) { | |
| 11336 | + throw new Exception("Missing required property"); | |
| 11337 | + } | |
| 11338 | + if (!property_exists($obj, 'Emery')) { | |
| 11339 | + throw new Exception("Missing required property"); | |
| 11340 | + } | |
| 11341 | + if (!property_exists($obj, 'enervative')) { | |
| 11342 | + throw new Exception("Missing required property"); | |
| 11343 | + } | |
| 11344 | + if (!property_exists($obj, 'excriminate')) { | |
| 11345 | + throw new Exception("Missing required property"); | |
| 11346 | + } | |
| 11347 | + if (!property_exists($obj, 'goshenite')) { | |
| 11348 | + throw new Exception("Missing required property"); | |
| 11349 | + } | |
| 11350 | + if (!property_exists($obj, 'grime')) { | |
| 11351 | + throw new Exception("Missing required property"); | |
| 11352 | + } | |
| 11353 | + if (!property_exists($obj, 'gritten')) { | |
| 11354 | + throw new Exception("Missing required property"); | |
| 11355 | + } | |
| 11356 | + if (!property_exists($obj, 'hectorly')) { | |
| 11357 | + throw new Exception("Missing required property"); | |
| 11358 | + } | |
| 11359 | + if (!property_exists($obj, 'intermediation')) { | |
| 11360 | + throw new Exception("Missing required property"); | |
| 11361 | + } | |
| 11362 | + if (!property_exists($obj, 'meeterly')) { | |
| 11363 | + throw new Exception("Missing required property"); | |
| 11364 | + } | |
| 11365 | + if (!property_exists($obj, 'Narraganset')) { | |
| 11366 | + throw new Exception("Missing required property"); | |
| 11367 | + } | |
| 11368 | + if (!property_exists($obj, 'onymatic')) { | |
| 11369 | + throw new Exception("Missing required property"); | |
| 11370 | + } | |
| 11371 | + if (!property_exists($obj, 'paddlecock')) { | |
| 11372 | + throw new Exception("Missing required property"); | |
| 11373 | + } | |
| 11374 | + if (!property_exists($obj, 'thana')) { | |
| 11375 | + throw new Exception("Missing required property"); | |
| 11376 | + } | |
| 11377 | + if (!property_exists($obj, 'thornily')) { | |
| 11378 | + throw new Exception("Missing required property"); | |
| 11379 | + } | |
| 11380 | + if (!property_exists($obj, 'uckia')) { | |
| 11381 | + throw new Exception("Missing required property"); | |
| 11382 | + } | |
| 11383 | + if (!property_exists($obj, 'unmettle')) { | |
| 11384 | + throw new Exception("Missing required property"); | |
| 11385 | + } | |
| 11386 | + if (!property_exists($obj, 'vorticellid')) { | |
| 11387 | + throw new Exception("Missing required property"); | |
| 11388 | + } | |
| 10999 | 11389 | return new Chytridiaceae( |
| 11000 | 11390 | Chytridiaceae::fromBatidaceae($obj->{'Batidaceae'}) |
| 11001 | 11391 | ,Chytridiaceae::fromBrechites($obj->{'Brechites'}) |
| @@ -13817,6 +14207,66 @@ class Gryphosaurus { | ||
| 13817 | 14207 | * @throws Exception |
| 13818 | 14208 | */ |
| 13819 | 14209 | public static function from(stdClass $obj): Gryphosaurus { |
| 14210 | + if (!property_exists($obj, 'amissibility')) { | |
| 14211 | + throw new Exception("Missing required property"); | |
| 14212 | + } | |
| 14213 | + if (!property_exists($obj, 'Burushaski')) { | |
| 14214 | + throw new Exception("Missing required property"); | |
| 14215 | + } | |
| 14216 | + if (!property_exists($obj, 'citronin')) { | |
| 14217 | + throw new Exception("Missing required property"); | |
| 14218 | + } | |
| 14219 | + if (!property_exists($obj, 'coplaintiff')) { | |
| 14220 | + throw new Exception("Missing required property"); | |
| 14221 | + } | |
| 14222 | + if (!property_exists($obj, 'disquisitionary')) { | |
| 14223 | + throw new Exception("Missing required property"); | |
| 14224 | + } | |
| 14225 | + if (!property_exists($obj, 'enoplan')) { | |
| 14226 | + throw new Exception("Missing required property"); | |
| 14227 | + } | |
| 14228 | + if (!property_exists($obj, 'faintness')) { | |
| 14229 | + throw new Exception("Missing required property"); | |
| 14230 | + } | |
| 14231 | + if (!property_exists($obj, 'hebetomy')) { | |
| 14232 | + throw new Exception("Missing required property"); | |
| 14233 | + } | |
| 14234 | + if (!property_exists($obj, 'islandry')) { | |
| 14235 | + throw new Exception("Missing required property"); | |
| 14236 | + } | |
| 14237 | + if (!property_exists($obj, 'lameduck')) { | |
| 14238 | + throw new Exception("Missing required property"); | |
| 14239 | + } | |
| 14240 | + if (!property_exists($obj, 'overbattle')) { | |
| 14241 | + throw new Exception("Missing required property"); | |
| 14242 | + } | |
| 14243 | + if (!property_exists($obj, 'overinterested')) { | |
| 14244 | + throw new Exception("Missing required property"); | |
| 14245 | + } | |
| 14246 | + if (!property_exists($obj, 'phrenologic')) { | |
| 14247 | + throw new Exception("Missing required property"); | |
| 14248 | + } | |
| 14249 | + if (!property_exists($obj, 'rainband')) { | |
| 14250 | + throw new Exception("Missing required property"); | |
| 14251 | + } | |
| 14252 | + if (!property_exists($obj, 'shiningly')) { | |
| 14253 | + throw new Exception("Missing required property"); | |
| 14254 | + } | |
| 14255 | + if (!property_exists($obj, 'stamineous')) { | |
| 14256 | + throw new Exception("Missing required property"); | |
| 14257 | + } | |
| 14258 | + if (!property_exists($obj, 'subscapularis')) { | |
| 14259 | + throw new Exception("Missing required property"); | |
| 14260 | + } | |
| 14261 | + if (!property_exists($obj, 'Tahami')) { | |
| 14262 | + throw new Exception("Missing required property"); | |
| 14263 | + } | |
| 14264 | + if (!property_exists($obj, 'undaubed')) { | |
| 14265 | + throw new Exception("Missing required property"); | |
| 14266 | + } | |
| 14267 | + if (!property_exists($obj, 'underntime')) { | |
| 14268 | + throw new Exception("Missing required property"); | |
| 14269 | + } | |
| 13820 | 14270 | return new Gryphosaurus( |
| 13821 | 14271 | Gryphosaurus::fromAmissibility($obj->{'amissibility'}) |
| 13822 | 14272 | ,Gryphosaurus::fromBurushaski($obj->{'Burushaski'}) |
| @@ -16638,6 +17088,66 @@ class Oskar { | ||
| 16638 | 17088 | * @throws Exception |
| 16639 | 17089 | */ |
| 16640 | 17090 | public static function from(stdClass $obj): Oskar { |
| 17091 | + if (!property_exists($obj, 'Acrobates')) { | |
| 17092 | + throw new Exception("Missing required property"); | |
| 17093 | + } | |
| 17094 | + if (!property_exists($obj, 'beanshooter')) { | |
| 17095 | + throw new Exception("Missing required property"); | |
| 17096 | + } | |
| 17097 | + if (!property_exists($obj, 'bearhound')) { | |
| 17098 | + throw new Exception("Missing required property"); | |
| 17099 | + } | |
| 17100 | + if (!property_exists($obj, 'Cayuga')) { | |
| 17101 | + throw new Exception("Missing required property"); | |
| 17102 | + } | |
| 17103 | + if (!property_exists($obj, 'guarneri')) { | |
| 17104 | + throw new Exception("Missing required property"); | |
| 17105 | + } | |
| 17106 | + if (!property_exists($obj, 'hypochondriacism')) { | |
| 17107 | + throw new Exception("Missing required property"); | |
| 17108 | + } | |
| 17109 | + if (!property_exists($obj, 'indication')) { | |
| 17110 | + throw new Exception("Missing required property"); | |
| 17111 | + } | |
| 17112 | + if (!property_exists($obj, 'jaculative')) { | |
| 17113 | + throw new Exception("Missing required property"); | |
| 17114 | + } | |
| 17115 | + if (!property_exists($obj, 'nagana')) { | |
| 17116 | + throw new Exception("Missing required property"); | |
| 17117 | + } | |
| 17118 | + if (!property_exists($obj, 'Netherlandish')) { | |
| 17119 | + throw new Exception("Missing required property"); | |
| 17120 | + } | |
| 17121 | + if (!property_exists($obj, 'noctivagous')) { | |
| 17122 | + throw new Exception("Missing required property"); | |
| 17123 | + } | |
| 17124 | + if (!property_exists($obj, 'nonphysiological')) { | |
| 17125 | + throw new Exception("Missing required property"); | |
| 17126 | + } | |
| 17127 | + if (!property_exists($obj, 'praxis')) { | |
| 17128 | + throw new Exception("Missing required property"); | |
| 17129 | + } | |
| 17130 | + if (!property_exists($obj, 'provision')) { | |
| 17131 | + throw new Exception("Missing required property"); | |
| 17132 | + } | |
| 17133 | + if (!property_exists($obj, 'subterhuman')) { | |
| 17134 | + throw new Exception("Missing required property"); | |
| 17135 | + } | |
| 17136 | + if (!property_exists($obj, 'sunlit')) { | |
| 17137 | + throw new Exception("Missing required property"); | |
| 17138 | + } | |
| 17139 | + if (!property_exists($obj, 'syncraniate')) { | |
| 17140 | + throw new Exception("Missing required property"); | |
| 17141 | + } | |
| 17142 | + if (!property_exists($obj, 'teachment')) { | |
| 17143 | + throw new Exception("Missing required property"); | |
| 17144 | + } | |
| 17145 | + if (!property_exists($obj, 'unmutinous')) { | |
| 17146 | + throw new Exception("Missing required property"); | |
| 17147 | + } | |
| 17148 | + if (!property_exists($obj, 'unstoppable')) { | |
| 17149 | + throw new Exception("Missing required property"); | |
| 17150 | + } | |
| 16641 | 17151 | return new Oskar( |
| 16642 | 17152 | Oskar::fromAcrobates($obj->{'Acrobates'}) |
| 16643 | 17153 | ,Oskar::fromBeanshooter($obj->{'beanshooter'}) |
Test case
1 generated file · +576 −0test/inputs/json/priority/combinations3.json
Mphpdefault / TopLevel.php+576 −0
| @@ -3969,6 +3969,132 @@ class TopLevel { | ||
| 3969 | 3969 | * @throws Exception |
| 3970 | 3970 | */ |
| 3971 | 3971 | public static function from(stdClass $obj): TopLevel { |
| 3972 | + if (!property_exists($obj, 'juror')) { | |
| 3973 | + throw new Exception("Missing required property"); | |
| 3974 | + } | |
| 3975 | + if (!property_exists($obj, 'kongoni')) { | |
| 3976 | + throw new Exception("Missing required property"); | |
| 3977 | + } | |
| 3978 | + if (!property_exists($obj, 'ladronism')) { | |
| 3979 | + throw new Exception("Missing required property"); | |
| 3980 | + } | |
| 3981 | + if (!property_exists($obj, 'landlubberly')) { | |
| 3982 | + throw new Exception("Missing required property"); | |
| 3983 | + } | |
| 3984 | + if (!property_exists($obj, 'listener')) { | |
| 3985 | + throw new Exception("Missing required property"); | |
| 3986 | + } | |
| 3987 | + if (!property_exists($obj, 'lupus')) { | |
| 3988 | + throw new Exception("Missing required property"); | |
| 3989 | + } | |
| 3990 | + if (!property_exists($obj, 'maslin')) { | |
| 3991 | + throw new Exception("Missing required property"); | |
| 3992 | + } | |
| 3993 | + if (!property_exists($obj, 'monazite')) { | |
| 3994 | + throw new Exception("Missing required property"); | |
| 3995 | + } | |
| 3996 | + if (!property_exists($obj, 'monoliteral')) { | |
| 3997 | + throw new Exception("Missing required property"); | |
| 3998 | + } | |
| 3999 | + if (!property_exists($obj, 'monotheistically')) { | |
| 4000 | + throw new Exception("Missing required property"); | |
| 4001 | + } | |
| 4002 | + if (!property_exists($obj, 'montage')) { | |
| 4003 | + throw new Exception("Missing required property"); | |
| 4004 | + } | |
| 4005 | + if (!property_exists($obj, 'moralness')) { | |
| 4006 | + throw new Exception("Missing required property"); | |
| 4007 | + } | |
| 4008 | + if (!property_exists($obj, 'mowra')) { | |
| 4009 | + throw new Exception("Missing required property"); | |
| 4010 | + } | |
| 4011 | + if (!property_exists($obj, 'mulishly')) { | |
| 4012 | + throw new Exception("Missing required property"); | |
| 4013 | + } | |
| 4014 | + if (!property_exists($obj, 'myoscope')) { | |
| 4015 | + throw new Exception("Missing required property"); | |
| 4016 | + } | |
| 4017 | + if (!property_exists($obj, 'nach')) { | |
| 4018 | + throw new Exception("Missing required property"); | |
| 4019 | + } | |
| 4020 | + if (!property_exists($obj, 'neuromastic')) { | |
| 4021 | + throw new Exception("Missing required property"); | |
| 4022 | + } | |
| 4023 | + if (!property_exists($obj, 'noncontributing')) { | |
| 4024 | + throw new Exception("Missing required property"); | |
| 4025 | + } | |
| 4026 | + if (!property_exists($obj, 'nonnervous')) { | |
| 4027 | + throw new Exception("Missing required property"); | |
| 4028 | + } | |
| 4029 | + if (!property_exists($obj, 'nonvaluation')) { | |
| 4030 | + throw new Exception("Missing required property"); | |
| 4031 | + } | |
| 4032 | + if (!property_exists($obj, 'occupationalist')) { | |
| 4033 | + throw new Exception("Missing required property"); | |
| 4034 | + } | |
| 4035 | + if (!property_exists($obj, 'outrival')) { | |
| 4036 | + throw new Exception("Missing required property"); | |
| 4037 | + } | |
| 4038 | + if (!property_exists($obj, 'paleographically')) { | |
| 4039 | + throw new Exception("Missing required property"); | |
| 4040 | + } | |
| 4041 | + if (!property_exists($obj, 'pamphletwise')) { | |
| 4042 | + throw new Exception("Missing required property"); | |
| 4043 | + } | |
| 4044 | + if (!property_exists($obj, 'pediatrics')) { | |
| 4045 | + throw new Exception("Missing required property"); | |
| 4046 | + } | |
| 4047 | + if (!property_exists($obj, 'perceptive')) { | |
| 4048 | + throw new Exception("Missing required property"); | |
| 4049 | + } | |
| 4050 | + if (!property_exists($obj, 'piaculum')) { | |
| 4051 | + throw new Exception("Missing required property"); | |
| 4052 | + } | |
| 4053 | + if (!property_exists($obj, 'piccadilly')) { | |
| 4054 | + throw new Exception("Missing required property"); | |
| 4055 | + } | |
| 4056 | + if (!property_exists($obj, 'piffler')) { | |
| 4057 | + throw new Exception("Missing required property"); | |
| 4058 | + } | |
| 4059 | + if (!property_exists($obj, 'pithful')) { | |
| 4060 | + throw new Exception("Missing required property"); | |
| 4061 | + } | |
| 4062 | + if (!property_exists($obj, 'placuntitis')) { | |
| 4063 | + throw new Exception("Missing required property"); | |
| 4064 | + } | |
| 4065 | + if (!property_exists($obj, 'plectopterous')) { | |
| 4066 | + throw new Exception("Missing required property"); | |
| 4067 | + } | |
| 4068 | + if (!property_exists($obj, 'pneumocele')) { | |
| 4069 | + throw new Exception("Missing required property"); | |
| 4070 | + } | |
| 4071 | + if (!property_exists($obj, 'poliorcetic')) { | |
| 4072 | + throw new Exception("Missing required property"); | |
| 4073 | + } | |
| 4074 | + if (!property_exists($obj, 'poormaster')) { | |
| 4075 | + throw new Exception("Missing required property"); | |
| 4076 | + } | |
| 4077 | + if (!property_exists($obj, 'potwhisky')) { | |
| 4078 | + throw new Exception("Missing required property"); | |
| 4079 | + } | |
| 4080 | + if (!property_exists($obj, 'practicalizer')) { | |
| 4081 | + throw new Exception("Missing required property"); | |
| 4082 | + } | |
| 4083 | + if (!property_exists($obj, 'prefreshman')) { | |
| 4084 | + throw new Exception("Missing required property"); | |
| 4085 | + } | |
| 4086 | + if (!property_exists($obj, 'prehensility')) { | |
| 4087 | + throw new Exception("Missing required property"); | |
| 4088 | + } | |
| 4089 | + if (!property_exists($obj, 'prevoidance')) { | |
| 4090 | + throw new Exception("Missing required property"); | |
| 4091 | + } | |
| 4092 | + if (!property_exists($obj, 'probant')) { | |
| 4093 | + throw new Exception("Missing required property"); | |
| 4094 | + } | |
| 4095 | + if (!property_exists($obj, 'protext')) { | |
| 4096 | + throw new Exception("Missing required property"); | |
| 4097 | + } | |
| 3972 | 4098 | return new TopLevel( |
| 3973 | 4099 | TopLevel::fromJuror($obj->{'juror'}) |
| 3974 | 4100 | ,TopLevel::fromKongoni($obj->{'kongoni'}) |
| @@ -5197,6 +5323,66 @@ class Juror { | ||
| 5197 | 5323 | * @throws Exception |
| 5198 | 5324 | */ |
| 5199 | 5325 | public static function from(stdClass $obj): Juror { |
| 5326 | + if (!property_exists($obj, 'adipsy')) { | |
| 5327 | + throw new Exception("Missing required property"); | |
| 5328 | + } | |
| 5329 | + if (!property_exists($obj, 'auxiliator')) { | |
| 5330 | + throw new Exception("Missing required property"); | |
| 5331 | + } | |
| 5332 | + if (!property_exists($obj, 'benda')) { | |
| 5333 | + throw new Exception("Missing required property"); | |
| 5334 | + } | |
| 5335 | + if (!property_exists($obj, 'benjamin')) { | |
| 5336 | + throw new Exception("Missing required property"); | |
| 5337 | + } | |
| 5338 | + if (!property_exists($obj, 'brandling')) { | |
| 5339 | + throw new Exception("Missing required property"); | |
| 5340 | + } | |
| 5341 | + if (!property_exists($obj, 'epicurishly')) { | |
| 5342 | + throw new Exception("Missing required property"); | |
| 5343 | + } | |
| 5344 | + if (!property_exists($obj, 'eremochaetous')) { | |
| 5345 | + throw new Exception("Missing required property"); | |
| 5346 | + } | |
| 5347 | + if (!property_exists($obj, 'marten')) { | |
| 5348 | + throw new Exception("Missing required property"); | |
| 5349 | + } | |
| 5350 | + if (!property_exists($obj, 'monocline')) { | |
| 5351 | + throw new Exception("Missing required property"); | |
| 5352 | + } | |
| 5353 | + if (!property_exists($obj, 'Olea')) { | |
| 5354 | + throw new Exception("Missing required property"); | |
| 5355 | + } | |
| 5356 | + if (!property_exists($obj, 'palgat')) { | |
| 5357 | + throw new Exception("Missing required property"); | |
| 5358 | + } | |
| 5359 | + if (!property_exists($obj, 'pennyworth')) { | |
| 5360 | + throw new Exception("Missing required property"); | |
| 5361 | + } | |
| 5362 | + if (!property_exists($obj, 'pioury')) { | |
| 5363 | + throw new Exception("Missing required property"); | |
| 5364 | + } | |
| 5365 | + if (!property_exists($obj, 'pragmatistic')) { | |
| 5366 | + throw new Exception("Missing required property"); | |
| 5367 | + } | |
| 5368 | + if (!property_exists($obj, 'stylelessness')) { | |
| 5369 | + throw new Exception("Missing required property"); | |
| 5370 | + } | |
| 5371 | + if (!property_exists($obj, 'systematical')) { | |
| 5372 | + throw new Exception("Missing required property"); | |
| 5373 | + } | |
| 5374 | + if (!property_exists($obj, 'thready')) { | |
| 5375 | + throw new Exception("Missing required property"); | |
| 5376 | + } | |
| 5377 | + if (!property_exists($obj, 'uncontemporary')) { | |
| 5378 | + throw new Exception("Missing required property"); | |
| 5379 | + } | |
| 5380 | + if (!property_exists($obj, 'uncouched')) { | |
| 5381 | + throw new Exception("Missing required property"); | |
| 5382 | + } | |
| 5383 | + if (!property_exists($obj, 'uninhabitedness')) { | |
| 5384 | + throw new Exception("Missing required property"); | |
| 5385 | + } | |
| 5200 | 5386 | return new Juror( |
| 5201 | 5387 | Juror::fromAdipsy($obj->{'adipsy'}) |
| 5202 | 5388 | ,Juror::fromAuxiliator($obj->{'auxiliator'}) |
| @@ -6381,6 +6567,66 @@ class Ladronism { | ||
| 6381 | 6567 | * @throws Exception |
| 6382 | 6568 | */ |
| 6383 | 6569 | public static function from(stdClass $obj): Ladronism { |
| 6570 | + if (!property_exists($obj, 'acclaimer')) { | |
| 6571 | + throw new Exception("Missing required property"); | |
| 6572 | + } | |
| 6573 | + if (!property_exists($obj, 'achree')) { | |
| 6574 | + throw new Exception("Missing required property"); | |
| 6575 | + } | |
| 6576 | + if (!property_exists($obj, 'base')) { | |
| 6577 | + throw new Exception("Missing required property"); | |
| 6578 | + } | |
| 6579 | + if (!property_exists($obj, 'conundrumize')) { | |
| 6580 | + throw new Exception("Missing required property"); | |
| 6581 | + } | |
| 6582 | + if (!property_exists($obj, 'degerminator')) { | |
| 6583 | + throw new Exception("Missing required property"); | |
| 6584 | + } | |
| 6585 | + if (!property_exists($obj, 'describable')) { | |
| 6586 | + throw new Exception("Missing required property"); | |
| 6587 | + } | |
| 6588 | + if (!property_exists($obj, 'exasperatedly')) { | |
| 6589 | + throw new Exception("Missing required property"); | |
| 6590 | + } | |
| 6591 | + if (!property_exists($obj, 'heroine')) { | |
| 6592 | + throw new Exception("Missing required property"); | |
| 6593 | + } | |
| 6594 | + if (!property_exists($obj, 'indazin')) { | |
| 6595 | + throw new Exception("Missing required property"); | |
| 6596 | + } | |
| 6597 | + if (!property_exists($obj, 'luteous')) { | |
| 6598 | + throw new Exception("Missing required property"); | |
| 6599 | + } | |
| 6600 | + if (!property_exists($obj, 'papular')) { | |
| 6601 | + throw new Exception("Missing required property"); | |
| 6602 | + } | |
| 6603 | + if (!property_exists($obj, 'pritch')) { | |
| 6604 | + throw new Exception("Missing required property"); | |
| 6605 | + } | |
| 6606 | + if (!property_exists($obj, 'Prodenia')) { | |
| 6607 | + throw new Exception("Missing required property"); | |
| 6608 | + } | |
| 6609 | + if (!property_exists($obj, 'seege')) { | |
| 6610 | + throw new Exception("Missing required property"); | |
| 6611 | + } | |
| 6612 | + if (!property_exists($obj, 'shopgirl')) { | |
| 6613 | + throw new Exception("Missing required property"); | |
| 6614 | + } | |
| 6615 | + if (!property_exists($obj, 'tragedietta')) { | |
| 6616 | + throw new Exception("Missing required property"); | |
| 6617 | + } | |
| 6618 | + if (!property_exists($obj, 'unsparse')) { | |
| 6619 | + throw new Exception("Missing required property"); | |
| 6620 | + } | |
| 6621 | + if (!property_exists($obj, 'uplook')) { | |
| 6622 | + throw new Exception("Missing required property"); | |
| 6623 | + } | |
| 6624 | + if (!property_exists($obj, 'vermiformis')) { | |
| 6625 | + throw new Exception("Missing required property"); | |
| 6626 | + } | |
| 6627 | + if (!property_exists($obj, 'whafabout')) { | |
| 6628 | + throw new Exception("Missing required property"); | |
| 6629 | + } | |
| 6384 | 6630 | return new Ladronism( |
| 6385 | 6631 | Ladronism::fromAcclaimer($obj->{'acclaimer'}) |
| 6386 | 6632 | ,Ladronism::fromAchree($obj->{'achree'}) |
| @@ -7565,6 +7811,66 @@ class Landlubberly { | ||
| 7565 | 7811 | * @throws Exception |
| 7566 | 7812 | */ |
| 7567 | 7813 | public static function from(stdClass $obj): Landlubberly { |
| 7814 | + if (!property_exists($obj, 'acropoleis')) { | |
| 7815 | + throw new Exception("Missing required property"); | |
| 7816 | + } | |
| 7817 | + if (!property_exists($obj, 'aminate')) { | |
| 7818 | + throw new Exception("Missing required property"); | |
| 7819 | + } | |
| 7820 | + if (!property_exists($obj, 'Amyraldism')) { | |
| 7821 | + throw new Exception("Missing required property"); | |
| 7822 | + } | |
| 7823 | + if (!property_exists($obj, 'bipenniform')) { | |
| 7824 | + throw new Exception("Missing required property"); | |
| 7825 | + } | |
| 7826 | + if (!property_exists($obj, 'bugre')) { | |
| 7827 | + throw new Exception("Missing required property"); | |
| 7828 | + } | |
| 7829 | + if (!property_exists($obj, 'calycule')) { | |
| 7830 | + throw new Exception("Missing required property"); | |
| 7831 | + } | |
| 7832 | + if (!property_exists($obj, 'caoutchouc')) { | |
| 7833 | + throw new Exception("Missing required property"); | |
| 7834 | + } | |
| 7835 | + if (!property_exists($obj, 'disprover')) { | |
| 7836 | + throw new Exception("Missing required property"); | |
| 7837 | + } | |
| 7838 | + if (!property_exists($obj, 'fitroot')) { | |
| 7839 | + throw new Exception("Missing required property"); | |
| 7840 | + } | |
| 7841 | + if (!property_exists($obj, 'fulgently')) { | |
| 7842 | + throw new Exception("Missing required property"); | |
| 7843 | + } | |
| 7844 | + if (!property_exists($obj, 'kickup')) { | |
| 7845 | + throw new Exception("Missing required property"); | |
| 7846 | + } | |
| 7847 | + if (!property_exists($obj, 'laevoversion')) { | |
| 7848 | + throw new Exception("Missing required property"); | |
| 7849 | + } | |
| 7850 | + if (!property_exists($obj, 'moter')) { | |
| 7851 | + throw new Exception("Missing required property"); | |
| 7852 | + } | |
| 7853 | + if (!property_exists($obj, 'objectivity')) { | |
| 7854 | + throw new Exception("Missing required property"); | |
| 7855 | + } | |
| 7856 | + if (!property_exists($obj, 'posterity')) { | |
| 7857 | + throw new Exception("Missing required property"); | |
| 7858 | + } | |
| 7859 | + if (!property_exists($obj, 'postnuptial')) { | |
| 7860 | + throw new Exception("Missing required property"); | |
| 7861 | + } | |
| 7862 | + if (!property_exists($obj, 'precedentary')) { | |
| 7863 | + throw new Exception("Missing required property"); | |
| 7864 | + } | |
| 7865 | + if (!property_exists($obj, 'saddling')) { | |
| 7866 | + throw new Exception("Missing required property"); | |
| 7867 | + } | |
| 7868 | + if (!property_exists($obj, 'subcurrent')) { | |
| 7869 | + throw new Exception("Missing required property"); | |
| 7870 | + } | |
| 7871 | + if (!property_exists($obj, 'unrecriminative')) { | |
| 7872 | + throw new Exception("Missing required property"); | |
| 7873 | + } | |
| 7568 | 7874 | return new Landlubberly( |
| 7569 | 7875 | Landlubberly::fromAcropoleis($obj->{'acropoleis'}) |
| 7570 | 7876 | ,Landlubberly::fromAminate($obj->{'aminate'}) |
| @@ -12326,6 +12632,21 @@ class Monazite { | ||
| 12326 | 12632 | * @throws Exception |
| 12327 | 12633 | */ |
| 12328 | 12634 | public static function from(stdClass $obj): Monazite { |
| 12635 | + if (!property_exists($obj, 'catharticalness')) { | |
| 12636 | + throw new Exception("Missing required property"); | |
| 12637 | + } | |
| 12638 | + if (!property_exists($obj, 'Chirotherium')) { | |
| 12639 | + throw new Exception("Missing required property"); | |
| 12640 | + } | |
| 12641 | + if (!property_exists($obj, 'disdiapason')) { | |
| 12642 | + throw new Exception("Missing required property"); | |
| 12643 | + } | |
| 12644 | + if (!property_exists($obj, 'homocerc')) { | |
| 12645 | + throw new Exception("Missing required property"); | |
| 12646 | + } | |
| 12647 | + if (!property_exists($obj, 'nonbookish')) { | |
| 12648 | + throw new Exception("Missing required property"); | |
| 12649 | + } | |
| 12329 | 12650 | return new Monazite( |
| 12330 | 12651 | Monazite::fromCatharticalness($obj->{'catharticalness'}) |
| 12331 | 12652 | ,Monazite::fromChirotherium($obj->{'Chirotherium'}) |
| @@ -14140,6 +14461,21 @@ class Noncontributing { | ||
| 14140 | 14461 | * @throws Exception |
| 14141 | 14462 | */ |
| 14142 | 14463 | public static function from(stdClass $obj): Noncontributing { |
| 14464 | + if (!property_exists($obj, 'estevin')) { | |
| 14465 | + throw new Exception("Missing required property"); | |
| 14466 | + } | |
| 14467 | + if (!property_exists($obj, 'jolterhead')) { | |
| 14468 | + throw new Exception("Missing required property"); | |
| 14469 | + } | |
| 14470 | + if (!property_exists($obj, 'sauternes')) { | |
| 14471 | + throw new Exception("Missing required property"); | |
| 14472 | + } | |
| 14473 | + if (!property_exists($obj, 'sparsely')) { | |
| 14474 | + throw new Exception("Missing required property"); | |
| 14475 | + } | |
| 14476 | + if (!property_exists($obj, 'unrequested')) { | |
| 14477 | + throw new Exception("Missing required property"); | |
| 14478 | + } | |
| 14143 | 14479 | return new Noncontributing( |
| 14144 | 14480 | Noncontributing::fromEstevin($obj->{'estevin'}) |
| 14145 | 14481 | ,Noncontributing::fromJolterhead($obj->{'jolterhead'}) |
| @@ -15294,6 +15630,66 @@ class Occupationalist { | ||
| 15294 | 15630 | * @throws Exception |
| 15295 | 15631 | */ |
| 15296 | 15632 | public static function from(stdClass $obj): Occupationalist { |
| 15633 | + if (!property_exists($obj, 'beholdable')) { | |
| 15634 | + throw new Exception("Missing required property"); | |
| 15635 | + } | |
| 15636 | + if (!property_exists($obj, 'brotuliform')) { | |
| 15637 | + throw new Exception("Missing required property"); | |
| 15638 | + } | |
| 15639 | + if (!property_exists($obj, 'Chimakum')) { | |
| 15640 | + throw new Exception("Missing required property"); | |
| 15641 | + } | |
| 15642 | + if (!property_exists($obj, 'doodler')) { | |
| 15643 | + throw new Exception("Missing required property"); | |
| 15644 | + } | |
| 15645 | + if (!property_exists($obj, 'emulsin')) { | |
| 15646 | + throw new Exception("Missing required property"); | |
| 15647 | + } | |
| 15648 | + if (!property_exists($obj, 'Fin')) { | |
| 15649 | + throw new Exception("Missing required property"); | |
| 15650 | + } | |
| 15651 | + if (!property_exists($obj, 'flourishing')) { | |
| 15652 | + throw new Exception("Missing required property"); | |
| 15653 | + } | |
| 15654 | + if (!property_exists($obj, 'flueless')) { | |
| 15655 | + throw new Exception("Missing required property"); | |
| 15656 | + } | |
| 15657 | + if (!property_exists($obj, 'furtively')) { | |
| 15658 | + throw new Exception("Missing required property"); | |
| 15659 | + } | |
| 15660 | + if (!property_exists($obj, 'gritter')) { | |
| 15661 | + throw new Exception("Missing required property"); | |
| 15662 | + } | |
| 15663 | + if (!property_exists($obj, 'interwish')) { | |
| 15664 | + throw new Exception("Missing required property"); | |
| 15665 | + } | |
| 15666 | + if (!property_exists($obj, 'monoxylic')) { | |
| 15667 | + throw new Exception("Missing required property"); | |
| 15668 | + } | |
| 15669 | + if (!property_exists($obj, 'myristic')) { | |
| 15670 | + throw new Exception("Missing required property"); | |
| 15671 | + } | |
| 15672 | + if (!property_exists($obj, 'nightwear')) { | |
| 15673 | + throw new Exception("Missing required property"); | |
| 15674 | + } | |
| 15675 | + if (!property_exists($obj, 'peruser')) { | |
| 15676 | + throw new Exception("Missing required property"); | |
| 15677 | + } | |
| 15678 | + if (!property_exists($obj, 'theoastrological')) { | |
| 15679 | + throw new Exception("Missing required property"); | |
| 15680 | + } | |
| 15681 | + if (!property_exists($obj, 'thumby')) { | |
| 15682 | + throw new Exception("Missing required property"); | |
| 15683 | + } | |
| 15684 | + if (!property_exists($obj, 'tingitid')) { | |
| 15685 | + throw new Exception("Missing required property"); | |
| 15686 | + } | |
| 15687 | + if (!property_exists($obj, 'trailless')) { | |
| 15688 | + throw new Exception("Missing required property"); | |
| 15689 | + } | |
| 15690 | + if (!property_exists($obj, 'unpocketed')) { | |
| 15691 | + throw new Exception("Missing required property"); | |
| 15692 | + } | |
| 15297 | 15693 | return new Occupationalist( |
| 15298 | 15694 | Occupationalist::fromBeholdable($obj->{'beholdable'}) |
| 15299 | 15695 | ,Occupationalist::fromBrotuliform($obj->{'brotuliform'}) |
| @@ -16478,6 +16874,66 @@ class Outrival { | ||
| 16478 | 16874 | * @throws Exception |
| 16479 | 16875 | */ |
| 16480 | 16876 | public static function from(stdClass $obj): Outrival { |
| 16877 | + if (!property_exists($obj, 'adroitly')) { | |
| 16878 | + throw new Exception("Missing required property"); | |
| 16879 | + } | |
| 16880 | + if (!property_exists($obj, 'bridehood')) { | |
| 16881 | + throw new Exception("Missing required property"); | |
| 16882 | + } | |
| 16883 | + if (!property_exists($obj, 'Castoroides')) { | |
| 16884 | + throw new Exception("Missing required property"); | |
| 16885 | + } | |
| 16886 | + if (!property_exists($obj, 'Czechoslovak')) { | |
| 16887 | + throw new Exception("Missing required property"); | |
| 16888 | + } | |
| 16889 | + if (!property_exists($obj, 'diagenesis')) { | |
| 16890 | + throw new Exception("Missing required property"); | |
| 16891 | + } | |
| 16892 | + if (!property_exists($obj, 'dihexahedron')) { | |
| 16893 | + throw new Exception("Missing required property"); | |
| 16894 | + } | |
| 16895 | + if (!property_exists($obj, 'dopester')) { | |
| 16896 | + throw new Exception("Missing required property"); | |
| 16897 | + } | |
| 16898 | + if (!property_exists($obj, 'eumerism')) { | |
| 16899 | + throw new Exception("Missing required property"); | |
| 16900 | + } | |
| 16901 | + if (!property_exists($obj, 'flyness')) { | |
| 16902 | + throw new Exception("Missing required property"); | |
| 16903 | + } | |
| 16904 | + if (!property_exists($obj, 'fouler')) { | |
| 16905 | + throw new Exception("Missing required property"); | |
| 16906 | + } | |
| 16907 | + if (!property_exists($obj, 'laudanosine')) { | |
| 16908 | + throw new Exception("Missing required property"); | |
| 16909 | + } | |
| 16910 | + if (!property_exists($obj, 'Lingulidae')) { | |
| 16911 | + throw new Exception("Missing required property"); | |
| 16912 | + } | |
| 16913 | + if (!property_exists($obj, 'minutary')) { | |
| 16914 | + throw new Exception("Missing required property"); | |
| 16915 | + } | |
| 16916 | + if (!property_exists($obj, 'mitra')) { | |
| 16917 | + throw new Exception("Missing required property"); | |
| 16918 | + } | |
| 16919 | + if (!property_exists($obj, 'opisthorchiasis')) { | |
| 16920 | + throw new Exception("Missing required property"); | |
| 16921 | + } | |
| 16922 | + if (!property_exists($obj, 'pensively')) { | |
| 16923 | + throw new Exception("Missing required property"); | |
| 16924 | + } | |
| 16925 | + if (!property_exists($obj, 'pubigerous')) { | |
| 16926 | + throw new Exception("Missing required property"); | |
| 16927 | + } | |
| 16928 | + if (!property_exists($obj, 'rebellious')) { | |
| 16929 | + throw new Exception("Missing required property"); | |
| 16930 | + } | |
| 16931 | + if (!property_exists($obj, 'recodify')) { | |
| 16932 | + throw new Exception("Missing required property"); | |
| 16933 | + } | |
| 16934 | + if (!property_exists($obj, 'unpaced')) { | |
| 16935 | + throw new Exception("Missing required property"); | |
| 16936 | + } | |
| 16481 | 16937 | return new Outrival( |
| 16482 | 16938 | Outrival::fromAdroitly($obj->{'adroitly'}) |
| 16483 | 16939 | ,Outrival::fromBridehood($obj->{'bridehood'}) |
| @@ -20796,6 +21252,66 @@ class Potwhisky { | ||
| 20796 | 21252 | * @throws Exception |
| 20797 | 21253 | */ |
| 20798 | 21254 | public static function from(stdClass $obj): Potwhisky { |
| 21255 | + if (!property_exists($obj, 'arciform')) { | |
| 21256 | + throw new Exception("Missing required property"); | |
| 21257 | + } | |
| 21258 | + if (!property_exists($obj, 'cresolin')) { | |
| 21259 | + throw new Exception("Missing required property"); | |
| 21260 | + } | |
| 21261 | + if (!property_exists($obj, 'disheartener')) { | |
| 21262 | + throw new Exception("Missing required property"); | |
| 21263 | + } | |
| 21264 | + if (!property_exists($obj, 'disproportionable')) { | |
| 21265 | + throw new Exception("Missing required property"); | |
| 21266 | + } | |
| 21267 | + if (!property_exists($obj, 'Euchorda')) { | |
| 21268 | + throw new Exception("Missing required property"); | |
| 21269 | + } | |
| 21270 | + if (!property_exists($obj, 'ferryway')) { | |
| 21271 | + throw new Exception("Missing required property"); | |
| 21272 | + } | |
| 21273 | + if (!property_exists($obj, 'filamentiferous')) { | |
| 21274 | + throw new Exception("Missing required property"); | |
| 21275 | + } | |
| 21276 | + if (!property_exists($obj, 'flemish')) { | |
| 21277 | + throw new Exception("Missing required property"); | |
| 21278 | + } | |
| 21279 | + if (!property_exists($obj, 'forgainst')) { | |
| 21280 | + throw new Exception("Missing required property"); | |
| 21281 | + } | |
| 21282 | + if (!property_exists($obj, 'grainering')) { | |
| 21283 | + throw new Exception("Missing required property"); | |
| 21284 | + } | |
| 21285 | + if (!property_exists($obj, 'irrevoluble')) { | |
| 21286 | + throw new Exception("Missing required property"); | |
| 21287 | + } | |
| 21288 | + if (!property_exists($obj, 'kindredship')) { | |
| 21289 | + throw new Exception("Missing required property"); | |
| 21290 | + } | |
| 21291 | + if (!property_exists($obj, 'pinguitudinous')) { | |
| 21292 | + throw new Exception("Missing required property"); | |
| 21293 | + } | |
| 21294 | + if (!property_exists($obj, 'simpletonic')) { | |
| 21295 | + throw new Exception("Missing required property"); | |
| 21296 | + } | |
| 21297 | + if (!property_exists($obj, 'singsong')) { | |
| 21298 | + throw new Exception("Missing required property"); | |
| 21299 | + } | |
| 21300 | + if (!property_exists($obj, 'submergement')) { | |
| 21301 | + throw new Exception("Missing required property"); | |
| 21302 | + } | |
| 21303 | + if (!property_exists($obj, 'supraoesophagal')) { | |
| 21304 | + throw new Exception("Missing required property"); | |
| 21305 | + } | |
| 21306 | + if (!property_exists($obj, 'thrashel')) { | |
| 21307 | + throw new Exception("Missing required property"); | |
| 21308 | + } | |
| 21309 | + if (!property_exists($obj, 'tyremesis')) { | |
| 21310 | + throw new Exception("Missing required property"); | |
| 21311 | + } | |
| 21312 | + if (!property_exists($obj, 'Yoruba')) { | |
| 21313 | + throw new Exception("Missing required property"); | |
| 21314 | + } | |
| 20799 | 21315 | return new Potwhisky( |
| 20800 | 21316 | Potwhisky::fromArciform($obj->{'arciform'}) |
| 20801 | 21317 | ,Potwhisky::fromCresolin($obj->{'cresolin'}) |
| @@ -21980,6 +22496,66 @@ class Prefreshman { | ||
| 21980 | 22496 | * @throws Exception |
| 21981 | 22497 | */ |
| 21982 | 22498 | public static function from(stdClass $obj): Prefreshman { |
| 22499 | + if (!property_exists($obj, 'azorubine')) { | |
| 22500 | + throw new Exception("Missing required property"); | |
| 22501 | + } | |
| 22502 | + if (!property_exists($obj, 'choroiditis')) { | |
| 22503 | + throw new Exception("Missing required property"); | |
| 22504 | + } | |
| 22505 | + if (!property_exists($obj, 'coagulatory')) { | |
| 22506 | + throw new Exception("Missing required property"); | |
| 22507 | + } | |
| 22508 | + if (!property_exists($obj, 'cyclorama')) { | |
| 22509 | + throw new Exception("Missing required property"); | |
| 22510 | + } | |
| 22511 | + if (!property_exists($obj, 'Dolphus')) { | |
| 22512 | + throw new Exception("Missing required property"); | |
| 22513 | + } | |
| 22514 | + if (!property_exists($obj, 'duckhearted')) { | |
| 22515 | + throw new Exception("Missing required property"); | |
| 22516 | + } | |
| 22517 | + if (!property_exists($obj, 'Ficus')) { | |
| 22518 | + throw new Exception("Missing required property"); | |
| 22519 | + } | |
| 22520 | + if (!property_exists($obj, 'Gemaric')) { | |
| 22521 | + throw new Exception("Missing required property"); | |
| 22522 | + } | |
| 22523 | + if (!property_exists($obj, 'jugation')) { | |
| 22524 | + throw new Exception("Missing required property"); | |
| 22525 | + } | |
| 22526 | + if (!property_exists($obj, 'myoliposis')) { | |
| 22527 | + throw new Exception("Missing required property"); | |
| 22528 | + } | |
| 22529 | + if (!property_exists($obj, 'nonnomination')) { | |
| 22530 | + throw new Exception("Missing required property"); | |
| 22531 | + } | |
| 22532 | + if (!property_exists($obj, 'palay')) { | |
| 22533 | + throw new Exception("Missing required property"); | |
| 22534 | + } | |
| 22535 | + if (!property_exists($obj, 'pentactinal')) { | |
| 22536 | + throw new Exception("Missing required property"); | |
| 22537 | + } | |
| 22538 | + if (!property_exists($obj, 'Phaet')) { | |
| 22539 | + throw new Exception("Missing required property"); | |
| 22540 | + } | |
| 22541 | + if (!property_exists($obj, 'piquant')) { | |
| 22542 | + throw new Exception("Missing required property"); | |
| 22543 | + } | |
| 22544 | + if (!property_exists($obj, 'registration')) { | |
| 22545 | + throw new Exception("Missing required property"); | |
| 22546 | + } | |
| 22547 | + if (!property_exists($obj, 'remancipation')) { | |
| 22548 | + throw new Exception("Missing required property"); | |
| 22549 | + } | |
| 22550 | + if (!property_exists($obj, 'scutatiform')) { | |
| 22551 | + throw new Exception("Missing required property"); | |
| 22552 | + } | |
| 22553 | + if (!property_exists($obj, 'theodolite')) { | |
| 22554 | + throw new Exception("Missing required property"); | |
| 22555 | + } | |
| 22556 | + if (!property_exists($obj, 'underward')) { | |
| 22557 | + throw new Exception("Missing required property"); | |
| 22558 | + } | |
| 21983 | 22559 | return new Prefreshman( |
| 21984 | 22560 | Prefreshman::fromAzorubine($obj->{'azorubine'}) |
| 21985 | 22561 | ,Prefreshman::fromChoroiditis($obj->{'choroiditis'}) |
Test case
1 generated file · +711 −0test/inputs/json/priority/combinations4.json
Mphpdefault / TopLevel.php+711 −0
| @@ -4884,6 +4884,162 @@ class TopLevel { | ||
| 4884 | 4884 | * @throws Exception |
| 4885 | 4885 | */ |
| 4886 | 4886 | public static function from(stdClass $obj): TopLevel { |
| 4887 | + if (!property_exists($obj, 'protrusive')) { | |
| 4888 | + throw new Exception("Missing required property"); | |
| 4889 | + } | |
| 4890 | + if (!property_exists($obj, 'pulpitism')) { | |
| 4891 | + throw new Exception("Missing required property"); | |
| 4892 | + } | |
| 4893 | + if (!property_exists($obj, 'pyodermia')) { | |
| 4894 | + throw new Exception("Missing required property"); | |
| 4895 | + } | |
| 4896 | + if (!property_exists($obj, 'quebrachine')) { | |
| 4897 | + throw new Exception("Missing required property"); | |
| 4898 | + } | |
| 4899 | + if (!property_exists($obj, 'querier')) { | |
| 4900 | + throw new Exception("Missing required property"); | |
| 4901 | + } | |
| 4902 | + if (!property_exists($obj, 'rebarbative')) { | |
| 4903 | + throw new Exception("Missing required property"); | |
| 4904 | + } | |
| 4905 | + if (!property_exists($obj, 'reimagine')) { | |
| 4906 | + throw new Exception("Missing required property"); | |
| 4907 | + } | |
| 4908 | + if (!property_exists($obj, 'ressaut')) { | |
| 4909 | + throw new Exception("Missing required property"); | |
| 4910 | + } | |
| 4911 | + if (!property_exists($obj, 'retrocervical')) { | |
| 4912 | + throw new Exception("Missing required property"); | |
| 4913 | + } | |
| 4914 | + if (!property_exists($obj, 'revert')) { | |
| 4915 | + throw new Exception("Missing required property"); | |
| 4916 | + } | |
| 4917 | + if (!property_exists($obj, 'rewrite')) { | |
| 4918 | + throw new Exception("Missing required property"); | |
| 4919 | + } | |
| 4920 | + if (!property_exists($obj, 'saccoderm')) { | |
| 4921 | + throw new Exception("Missing required property"); | |
| 4922 | + } | |
| 4923 | + if (!property_exists($obj, 'santir')) { | |
| 4924 | + throw new Exception("Missing required property"); | |
| 4925 | + } | |
| 4926 | + if (!property_exists($obj, 'saprophilous')) { | |
| 4927 | + throw new Exception("Missing required property"); | |
| 4928 | + } | |
| 4929 | + if (!property_exists($obj, 'saxten')) { | |
| 4930 | + throw new Exception("Missing required property"); | |
| 4931 | + } | |
| 4932 | + if (!property_exists($obj, 'scatty')) { | |
| 4933 | + throw new Exception("Missing required property"); | |
| 4934 | + } | |
| 4935 | + if (!property_exists($obj, 'scoffer')) { | |
| 4936 | + throw new Exception("Missing required property"); | |
| 4937 | + } | |
| 4938 | + if (!property_exists($obj, 'scrampum')) { | |
| 4939 | + throw new Exception("Missing required property"); | |
| 4940 | + } | |
| 4941 | + if (!property_exists($obj, 'semantic')) { | |
| 4942 | + throw new Exception("Missing required property"); | |
| 4943 | + } | |
| 4944 | + if (!property_exists($obj, 'serpentinic')) { | |
| 4945 | + throw new Exception("Missing required property"); | |
| 4946 | + } | |
| 4947 | + if (!property_exists($obj, 'shadowable')) { | |
| 4948 | + throw new Exception("Missing required property"); | |
| 4949 | + } | |
| 4950 | + if (!property_exists($obj, 'sistering')) { | |
| 4951 | + throw new Exception("Missing required property"); | |
| 4952 | + } | |
| 4953 | + if (!property_exists($obj, 'staghunting')) { | |
| 4954 | + throw new Exception("Missing required property"); | |
| 4955 | + } | |
| 4956 | + if (!property_exists($obj, 'stagmometer')) { | |
| 4957 | + throw new Exception("Missing required property"); | |
| 4958 | + } | |
| 4959 | + if (!property_exists($obj, 'stimulability')) { | |
| 4960 | + throw new Exception("Missing required property"); | |
| 4961 | + } | |
| 4962 | + if (!property_exists($obj, 'strangleable')) { | |
| 4963 | + throw new Exception("Missing required property"); | |
| 4964 | + } | |
| 4965 | + if (!property_exists($obj, 'strenuosity')) { | |
| 4966 | + throw new Exception("Missing required property"); | |
| 4967 | + } | |
| 4968 | + if (!property_exists($obj, 'tabaxir')) { | |
| 4969 | + throw new Exception("Missing required property"); | |
| 4970 | + } | |
| 4971 | + if (!property_exists($obj, 'talpiform')) { | |
| 4972 | + throw new Exception("Missing required property"); | |
| 4973 | + } | |
| 4974 | + if (!property_exists($obj, 'thwack')) { | |
| 4975 | + throw new Exception("Missing required property"); | |
| 4976 | + } | |
| 4977 | + if (!property_exists($obj, 'to')) { | |
| 4978 | + throw new Exception("Missing required property"); | |
| 4979 | + } | |
| 4980 | + if (!property_exists($obj, 'tortricine')) { | |
| 4981 | + throw new Exception("Missing required property"); | |
| 4982 | + } | |
| 4983 | + if (!property_exists($obj, 'truantcy')) { | |
| 4984 | + throw new Exception("Missing required property"); | |
| 4985 | + } | |
| 4986 | + if (!property_exists($obj, 'turgesce')) { | |
| 4987 | + throw new Exception("Missing required property"); | |
| 4988 | + } | |
| 4989 | + if (!property_exists($obj, 'unbeginning')) { | |
| 4990 | + throw new Exception("Missing required property"); | |
| 4991 | + } | |
| 4992 | + if (!property_exists($obj, 'underdunged')) { | |
| 4993 | + throw new Exception("Missing required property"); | |
| 4994 | + } | |
| 4995 | + if (!property_exists($obj, 'undesirability')) { | |
| 4996 | + throw new Exception("Missing required property"); | |
| 4997 | + } | |
| 4998 | + if (!property_exists($obj, 'unerasing')) { | |
| 4999 | + throw new Exception("Missing required property"); | |
| 5000 | + } | |
| 5001 | + if (!property_exists($obj, 'unguentarium')) { | |
| 5002 | + throw new Exception("Missing required property"); | |
| 5003 | + } | |
| 5004 | + if (!property_exists($obj, 'unimpeachably')) { | |
| 5005 | + throw new Exception("Missing required property"); | |
| 5006 | + } | |
| 5007 | + if (!property_exists($obj, 'unmortgaged')) { | |
| 5008 | + throw new Exception("Missing required property"); | |
| 5009 | + } | |
| 5010 | + if (!property_exists($obj, 'unobstructed')) { | |
| 5011 | + throw new Exception("Missing required property"); | |
| 5012 | + } | |
| 5013 | + if (!property_exists($obj, 'unreceptivity')) { | |
| 5014 | + throw new Exception("Missing required property"); | |
| 5015 | + } | |
| 5016 | + if (!property_exists($obj, 'unsatisfactoriness')) { | |
| 5017 | + throw new Exception("Missing required property"); | |
| 5018 | + } | |
| 5019 | + if (!property_exists($obj, 'unsecurity')) { | |
| 5020 | + throw new Exception("Missing required property"); | |
| 5021 | + } | |
| 5022 | + if (!property_exists($obj, 'unstressed')) { | |
| 5023 | + throw new Exception("Missing required property"); | |
| 5024 | + } | |
| 5025 | + if (!property_exists($obj, 'untasked')) { | |
| 5026 | + throw new Exception("Missing required property"); | |
| 5027 | + } | |
| 5028 | + if (!property_exists($obj, 'unvarying')) { | |
| 5029 | + throw new Exception("Missing required property"); | |
| 5030 | + } | |
| 5031 | + if (!property_exists($obj, 'vehemently')) { | |
| 5032 | + throw new Exception("Missing required property"); | |
| 5033 | + } | |
| 5034 | + if (!property_exists($obj, 'warriorship')) { | |
| 5035 | + throw new Exception("Missing required property"); | |
| 5036 | + } | |
| 5037 | + if (!property_exists($obj, 'whitepot')) { | |
| 5038 | + throw new Exception("Missing required property"); | |
| 5039 | + } | |
| 5040 | + if (!property_exists($obj, 'wrothy')) { | |
| 5041 | + throw new Exception("Missing required property"); | |
| 5042 | + } | |
| 4887 | 5043 | return new TopLevel( |
| 4888 | 5044 | TopLevel::fromProtrusive($obj->{'protrusive'}) |
| 4889 | 5045 | ,TopLevel::fromPulpitism($obj->{'pulpitism'}) |
| @@ -6132,6 +6288,66 @@ class Pulpitism { | ||
| 6132 | 6288 | * @throws Exception |
| 6133 | 6289 | */ |
| 6134 | 6290 | public static function from(stdClass $obj): Pulpitism { |
| 6291 | + if (!property_exists($obj, 'abnet')) { | |
| 6292 | + throw new Exception("Missing required property"); | |
| 6293 | + } | |
| 6294 | + if (!property_exists($obj, 'buckhorn')) { | |
| 6295 | + throw new Exception("Missing required property"); | |
| 6296 | + } | |
| 6297 | + if (!property_exists($obj, 'calciform')) { | |
| 6298 | + throw new Exception("Missing required property"); | |
| 6299 | + } | |
| 6300 | + if (!property_exists($obj, 'chelophore')) { | |
| 6301 | + throw new Exception("Missing required property"); | |
| 6302 | + } | |
| 6303 | + if (!property_exists($obj, 'cogitation')) { | |
| 6304 | + throw new Exception("Missing required property"); | |
| 6305 | + } | |
| 6306 | + if (!property_exists($obj, 'decreeable')) { | |
| 6307 | + throw new Exception("Missing required property"); | |
| 6308 | + } | |
| 6309 | + if (!property_exists($obj, 'despicable')) { | |
| 6310 | + throw new Exception("Missing required property"); | |
| 6311 | + } | |
| 6312 | + if (!property_exists($obj, 'isodiazo')) { | |
| 6313 | + throw new Exception("Missing required property"); | |
| 6314 | + } | |
| 6315 | + if (!property_exists($obj, 'jadedly')) { | |
| 6316 | + throw new Exception("Missing required property"); | |
| 6317 | + } | |
| 6318 | + if (!property_exists($obj, 'leptochlorite')) { | |
| 6319 | + throw new Exception("Missing required property"); | |
| 6320 | + } | |
| 6321 | + if (!property_exists($obj, 'nursling')) { | |
| 6322 | + throw new Exception("Missing required property"); | |
| 6323 | + } | |
| 6324 | + if (!property_exists($obj, 'palamedean')) { | |
| 6325 | + throw new Exception("Missing required property"); | |
| 6326 | + } | |
| 6327 | + if (!property_exists($obj, 'photoheliograph')) { | |
| 6328 | + throw new Exception("Missing required property"); | |
| 6329 | + } | |
| 6330 | + if (!property_exists($obj, 'pipewood')) { | |
| 6331 | + throw new Exception("Missing required property"); | |
| 6332 | + } | |
| 6333 | + if (!property_exists($obj, 'roberd')) { | |
| 6334 | + throw new Exception("Missing required property"); | |
| 6335 | + } | |
| 6336 | + if (!property_exists($obj, 'statable')) { | |
| 6337 | + throw new Exception("Missing required property"); | |
| 6338 | + } | |
| 6339 | + if (!property_exists($obj, 'superassume')) { | |
| 6340 | + throw new Exception("Missing required property"); | |
| 6341 | + } | |
| 6342 | + if (!property_exists($obj, 'syllabe')) { | |
| 6343 | + throw new Exception("Missing required property"); | |
| 6344 | + } | |
| 6345 | + if (!property_exists($obj, 'toughhead')) { | |
| 6346 | + throw new Exception("Missing required property"); | |
| 6347 | + } | |
| 6348 | + if (!property_exists($obj, 'underburn')) { | |
| 6349 | + throw new Exception("Missing required property"); | |
| 6350 | + } | |
| 6135 | 6351 | return new Pulpitism( |
| 6136 | 6352 | Pulpitism::fromAbnet($obj->{'abnet'}) |
| 6137 | 6353 | ,Pulpitism::fromBuckhorn($obj->{'buckhorn'}) |
| @@ -7316,6 +7532,66 @@ class Pyodermia { | ||
| 7316 | 7532 | * @throws Exception |
| 7317 | 7533 | */ |
| 7318 | 7534 | public static function from(stdClass $obj): Pyodermia { |
| 7535 | + if (!property_exists($obj, 'aphoristically')) { | |
| 7536 | + throw new Exception("Missing required property"); | |
| 7537 | + } | |
| 7538 | + if (!property_exists($obj, 'apophyllous')) { | |
| 7539 | + throw new Exception("Missing required property"); | |
| 7540 | + } | |
| 7541 | + if (!property_exists($obj, 'cognize')) { | |
| 7542 | + throw new Exception("Missing required property"); | |
| 7543 | + } | |
| 7544 | + if (!property_exists($obj, 'dermonosology')) { | |
| 7545 | + throw new Exception("Missing required property"); | |
| 7546 | + } | |
| 7547 | + if (!property_exists($obj, 'Gyppo')) { | |
| 7548 | + throw new Exception("Missing required property"); | |
| 7549 | + } | |
| 7550 | + if (!property_exists($obj, 'ither')) { | |
| 7551 | + throw new Exception("Missing required property"); | |
| 7552 | + } | |
| 7553 | + if (!property_exists($obj, 'juglandaceous')) { | |
| 7554 | + throw new Exception("Missing required property"); | |
| 7555 | + } | |
| 7556 | + if (!property_exists($obj, 'litho')) { | |
| 7557 | + throw new Exception("Missing required property"); | |
| 7558 | + } | |
| 7559 | + if (!property_exists($obj, 'macropterous')) { | |
| 7560 | + throw new Exception("Missing required property"); | |
| 7561 | + } | |
| 7562 | + if (!property_exists($obj, 'photographer')) { | |
| 7563 | + throw new Exception("Missing required property"); | |
| 7564 | + } | |
| 7565 | + if (!property_exists($obj, 'romancing')) { | |
| 7566 | + throw new Exception("Missing required property"); | |
| 7567 | + } | |
| 7568 | + if (!property_exists($obj, 'rumness')) { | |
| 7569 | + throw new Exception("Missing required property"); | |
| 7570 | + } | |
| 7571 | + if (!property_exists($obj, 'somniloquist')) { | |
| 7572 | + throw new Exception("Missing required property"); | |
| 7573 | + } | |
| 7574 | + if (!property_exists($obj, 'stressfully')) { | |
| 7575 | + throw new Exception("Missing required property"); | |
| 7576 | + } | |
| 7577 | + if (!property_exists($obj, 'tactically')) { | |
| 7578 | + throw new Exception("Missing required property"); | |
| 7579 | + } | |
| 7580 | + if (!property_exists($obj, 'tracheophony')) { | |
| 7581 | + throw new Exception("Missing required property"); | |
| 7582 | + } | |
| 7583 | + if (!property_exists($obj, 'unappositely')) { | |
| 7584 | + throw new Exception("Missing required property"); | |
| 7585 | + } | |
| 7586 | + if (!property_exists($obj, 'unclothedly')) { | |
| 7587 | + throw new Exception("Missing required property"); | |
| 7588 | + } | |
| 7589 | + if (!property_exists($obj, 'unimplied')) { | |
| 7590 | + throw new Exception("Missing required property"); | |
| 7591 | + } | |
| 7592 | + if (!property_exists($obj, 'unsyncopated')) { | |
| 7593 | + throw new Exception("Missing required property"); | |
| 7594 | + } | |
| 7319 | 7595 | return new Pyodermia( |
| 7320 | 7596 | Pyodermia::fromAphoristically($obj->{'aphoristically'}) |
| 7321 | 7597 | ,Pyodermia::fromApophyllous($obj->{'apophyllous'}) |
| @@ -7663,6 +7939,21 @@ class Quebrachine { | ||
| 7663 | 7939 | * @throws Exception |
| 7664 | 7940 | */ |
| 7665 | 7941 | public static function from(stdClass $obj): Quebrachine { |
| 7942 | + if (!property_exists($obj, 'catharticalness')) { | |
| 7943 | + throw new Exception("Missing required property"); | |
| 7944 | + } | |
| 7945 | + if (!property_exists($obj, 'Chirotherium')) { | |
| 7946 | + throw new Exception("Missing required property"); | |
| 7947 | + } | |
| 7948 | + if (!property_exists($obj, 'disdiapason')) { | |
| 7949 | + throw new Exception("Missing required property"); | |
| 7950 | + } | |
| 7951 | + if (!property_exists($obj, 'homocerc')) { | |
| 7952 | + throw new Exception("Missing required property"); | |
| 7953 | + } | |
| 7954 | + if (!property_exists($obj, 'nonbookish')) { | |
| 7955 | + throw new Exception("Missing required property"); | |
| 7956 | + } | |
| 7666 | 7957 | return new Quebrachine( |
| 7667 | 7958 | Quebrachine::fromCatharticalness($obj->{'catharticalness'}) |
| 7668 | 7959 | ,Quebrachine::fromChirotherium($obj->{'Chirotherium'}) |
| @@ -10254,6 +10545,66 @@ class Ressaut { | ||
| 10254 | 10545 | * @throws Exception |
| 10255 | 10546 | */ |
| 10256 | 10547 | public static function from(stdClass $obj): Ressaut { |
| 10548 | + if (!property_exists($obj, 'apperceptive')) { | |
| 10549 | + throw new Exception("Missing required property"); | |
| 10550 | + } | |
| 10551 | + if (!property_exists($obj, 'cuttoo')) { | |
| 10552 | + throw new Exception("Missing required property"); | |
| 10553 | + } | |
| 10554 | + if (!property_exists($obj, 'douser')) { | |
| 10555 | + throw new Exception("Missing required property"); | |
| 10556 | + } | |
| 10557 | + if (!property_exists($obj, 'drinkproof')) { | |
| 10558 | + throw new Exception("Missing required property"); | |
| 10559 | + } | |
| 10560 | + if (!property_exists($obj, 'forementioned')) { | |
| 10561 | + throw new Exception("Missing required property"); | |
| 10562 | + } | |
| 10563 | + if (!property_exists($obj, 'Freesia')) { | |
| 10564 | + throw new Exception("Missing required property"); | |
| 10565 | + } | |
| 10566 | + if (!property_exists($obj, 'Genevieve')) { | |
| 10567 | + throw new Exception("Missing required property"); | |
| 10568 | + } | |
| 10569 | + if (!property_exists($obj, 'hyperdiabolical')) { | |
| 10570 | + throw new Exception("Missing required property"); | |
| 10571 | + } | |
| 10572 | + if (!property_exists($obj, 'hypocone')) { | |
| 10573 | + throw new Exception("Missing required property"); | |
| 10574 | + } | |
| 10575 | + if (!property_exists($obj, 'irreverentially')) { | |
| 10576 | + throw new Exception("Missing required property"); | |
| 10577 | + } | |
| 10578 | + if (!property_exists($obj, 'jumart')) { | |
| 10579 | + throw new Exception("Missing required property"); | |
| 10580 | + } | |
| 10581 | + if (!property_exists($obj, 'Mimosaceae')) { | |
| 10582 | + throw new Exception("Missing required property"); | |
| 10583 | + } | |
| 10584 | + if (!property_exists($obj, 'mollicrush')) { | |
| 10585 | + throw new Exception("Missing required property"); | |
| 10586 | + } | |
| 10587 | + if (!property_exists($obj, 'nedder')) { | |
| 10588 | + throw new Exception("Missing required property"); | |
| 10589 | + } | |
| 10590 | + if (!property_exists($obj, 'retinasphalt')) { | |
| 10591 | + throw new Exception("Missing required property"); | |
| 10592 | + } | |
| 10593 | + if (!property_exists($obj, 'sough')) { | |
| 10594 | + throw new Exception("Missing required property"); | |
| 10595 | + } | |
| 10596 | + if (!property_exists($obj, 'steading')) { | |
| 10597 | + throw new Exception("Missing required property"); | |
| 10598 | + } | |
| 10599 | + if (!property_exists($obj, 'Theopaschitism')) { | |
| 10600 | + throw new Exception("Missing required property"); | |
| 10601 | + } | |
| 10602 | + if (!property_exists($obj, 'undurableness')) { | |
| 10603 | + throw new Exception("Missing required property"); | |
| 10604 | + } | |
| 10605 | + if (!property_exists($obj, 'unmingleable')) { | |
| 10606 | + throw new Exception("Missing required property"); | |
| 10607 | + } | |
| 10257 | 10608 | return new Ressaut( |
| 10258 | 10609 | Ressaut::fromApperceptive($obj->{'apperceptive'}) |
| 10259 | 10610 | ,Ressaut::fromCuttoo($obj->{'cuttoo'}) |
| @@ -11438,6 +11789,66 @@ class Rewrite { | ||
| 11438 | 11789 | * @throws Exception |
| 11439 | 11790 | */ |
| 11440 | 11791 | public static function from(stdClass $obj): Rewrite { |
| 11792 | + if (!property_exists($obj, 'accountancy')) { | |
| 11793 | + throw new Exception("Missing required property"); | |
| 11794 | + } | |
| 11795 | + if (!property_exists($obj, 'cacotrophic')) { | |
| 11796 | + throw new Exception("Missing required property"); | |
| 11797 | + } | |
| 11798 | + if (!property_exists($obj, 'contest')) { | |
| 11799 | + throw new Exception("Missing required property"); | |
| 11800 | + } | |
| 11801 | + if (!property_exists($obj, 'couthily')) { | |
| 11802 | + throw new Exception("Missing required property"); | |
| 11803 | + } | |
| 11804 | + if (!property_exists($obj, 'falculate')) { | |
| 11805 | + throw new Exception("Missing required property"); | |
| 11806 | + } | |
| 11807 | + if (!property_exists($obj, 'foreseize')) { | |
| 11808 | + throw new Exception("Missing required property"); | |
| 11809 | + } | |
| 11810 | + if (!property_exists($obj, 'Hyades')) { | |
| 11811 | + throw new Exception("Missing required property"); | |
| 11812 | + } | |
| 11813 | + if (!property_exists($obj, 'lemnad')) { | |
| 11814 | + throw new Exception("Missing required property"); | |
| 11815 | + } | |
| 11816 | + if (!property_exists($obj, 'monotheistically')) { | |
| 11817 | + throw new Exception("Missing required property"); | |
| 11818 | + } | |
| 11819 | + if (!property_exists($obj, 'nonflying')) { | |
| 11820 | + throw new Exception("Missing required property"); | |
| 11821 | + } | |
| 11822 | + if (!property_exists($obj, 'Ptenoglossa')) { | |
| 11823 | + throw new Exception("Missing required property"); | |
| 11824 | + } | |
| 11825 | + if (!property_exists($obj, 'repatch')) { | |
| 11826 | + throw new Exception("Missing required property"); | |
| 11827 | + } | |
| 11828 | + if (!property_exists($obj, 'rodman')) { | |
| 11829 | + throw new Exception("Missing required property"); | |
| 11830 | + } | |
| 11831 | + if (!property_exists($obj, 'strung')) { | |
| 11832 | + throw new Exception("Missing required property"); | |
| 11833 | + } | |
| 11834 | + if (!property_exists($obj, 'titmal')) { | |
| 11835 | + throw new Exception("Missing required property"); | |
| 11836 | + } | |
| 11837 | + if (!property_exists($obj, 'twalpennyworth')) { | |
| 11838 | + throw new Exception("Missing required property"); | |
| 11839 | + } | |
| 11840 | + if (!property_exists($obj, 'unblamable')) { | |
| 11841 | + throw new Exception("Missing required property"); | |
| 11842 | + } | |
| 11843 | + if (!property_exists($obj, 'vertical')) { | |
| 11844 | + throw new Exception("Missing required property"); | |
| 11845 | + } | |
| 11846 | + if (!property_exists($obj, 'Whiggification')) { | |
| 11847 | + throw new Exception("Missing required property"); | |
| 11848 | + } | |
| 11849 | + if (!property_exists($obj, 'yardman')) { | |
| 11850 | + throw new Exception("Missing required property"); | |
| 11851 | + } | |
| 11441 | 11852 | return new Rewrite( |
| 11442 | 11853 | Rewrite::fromAccountancy($obj->{'accountancy'}) |
| 11443 | 11854 | ,Rewrite::fromCacotrophic($obj->{'cacotrophic'}) |
| @@ -12622,6 +13033,66 @@ class Santir { | ||
| 12622 | 13033 | * @throws Exception |
| 12623 | 13034 | */ |
| 12624 | 13035 | public static function from(stdClass $obj): Santir { |
| 13036 | + if (!property_exists($obj, 'admiredly')) { | |
| 13037 | + throw new Exception("Missing required property"); | |
| 13038 | + } | |
| 13039 | + if (!property_exists($obj, 'demicaponier')) { | |
| 13040 | + throw new Exception("Missing required property"); | |
| 13041 | + } | |
| 13042 | + if (!property_exists($obj, 'epitympanic')) { | |
| 13043 | + throw new Exception("Missing required property"); | |
| 13044 | + } | |
| 13045 | + if (!property_exists($obj, 'investitor')) { | |
| 13046 | + throw new Exception("Missing required property"); | |
| 13047 | + } | |
| 13048 | + if (!property_exists($obj, 'lupiform')) { | |
| 13049 | + throw new Exception("Missing required property"); | |
| 13050 | + } | |
| 13051 | + if (!property_exists($obj, 'monoflagellate')) { | |
| 13052 | + throw new Exception("Missing required property"); | |
| 13053 | + } | |
| 13054 | + if (!property_exists($obj, 'paleoethnic')) { | |
| 13055 | + throw new Exception("Missing required property"); | |
| 13056 | + } | |
| 13057 | + if (!property_exists($obj, 'prediscountable')) { | |
| 13058 | + throw new Exception("Missing required property"); | |
| 13059 | + } | |
| 13060 | + if (!property_exists($obj, 'rhetoricals')) { | |
| 13061 | + throw new Exception("Missing required property"); | |
| 13062 | + } | |
| 13063 | + if (!property_exists($obj, 'roomth')) { | |
| 13064 | + throw new Exception("Missing required property"); | |
| 13065 | + } | |
| 13066 | + if (!property_exists($obj, 'saccharose')) { | |
| 13067 | + throw new Exception("Missing required property"); | |
| 13068 | + } | |
| 13069 | + if (!property_exists($obj, 'septonasal')) { | |
| 13070 | + throw new Exception("Missing required property"); | |
| 13071 | + } | |
| 13072 | + if (!property_exists($obj, 'serpenticide')) { | |
| 13073 | + throw new Exception("Missing required property"); | |
| 13074 | + } | |
| 13075 | + if (!property_exists($obj, 'setarious')) { | |
| 13076 | + throw new Exception("Missing required property"); | |
| 13077 | + } | |
| 13078 | + if (!property_exists($obj, 'spaework')) { | |
| 13079 | + throw new Exception("Missing required property"); | |
| 13080 | + } | |
| 13081 | + if (!property_exists($obj, 'stylite')) { | |
| 13082 | + throw new Exception("Missing required property"); | |
| 13083 | + } | |
| 13084 | + if (!property_exists($obj, 'Suessiones')) { | |
| 13085 | + throw new Exception("Missing required property"); | |
| 13086 | + } | |
| 13087 | + if (!property_exists($obj, 'timelily')) { | |
| 13088 | + throw new Exception("Missing required property"); | |
| 13089 | + } | |
| 13090 | + if (!property_exists($obj, 'unprofaned')) { | |
| 13091 | + throw new Exception("Missing required property"); | |
| 13092 | + } | |
| 13093 | + if (!property_exists($obj, 'vorticular')) { | |
| 13094 | + throw new Exception("Missing required property"); | |
| 13095 | + } | |
| 12625 | 13096 | return new Santir( |
| 12626 | 13097 | Santir::fromAdmiredly($obj->{'admiredly'}) |
| 12627 | 13098 | ,Santir::fromDemicaponier($obj->{'demicaponier'}) |
| @@ -15303,6 +15774,66 @@ class Scatty { | ||
| 15303 | 15774 | * @throws Exception |
| 15304 | 15775 | */ |
| 15305 | 15776 | public static function from(stdClass $obj): Scatty { |
| 15777 | + if (!property_exists($obj, 'aeriferous')) { | |
| 15778 | + throw new Exception("Missing required property"); | |
| 15779 | + } | |
| 15780 | + if (!property_exists($obj, 'antical')) { | |
| 15781 | + throw new Exception("Missing required property"); | |
| 15782 | + } | |
| 15783 | + if (!property_exists($obj, 'antighostism')) { | |
| 15784 | + throw new Exception("Missing required property"); | |
| 15785 | + } | |
| 15786 | + if (!property_exists($obj, 'arcanum')) { | |
| 15787 | + throw new Exception("Missing required property"); | |
| 15788 | + } | |
| 15789 | + if (!property_exists($obj, 'autotrophy')) { | |
| 15790 | + throw new Exception("Missing required property"); | |
| 15791 | + } | |
| 15792 | + if (!property_exists($obj, 'baronial')) { | |
| 15793 | + throw new Exception("Missing required property"); | |
| 15794 | + } | |
| 15795 | + if (!property_exists($obj, 'caffeine')) { | |
| 15796 | + throw new Exception("Missing required property"); | |
| 15797 | + } | |
| 15798 | + if (!property_exists($obj, 'gorgoniacean')) { | |
| 15799 | + throw new Exception("Missing required property"); | |
| 15800 | + } | |
| 15801 | + if (!property_exists($obj, 'heroical')) { | |
| 15802 | + throw new Exception("Missing required property"); | |
| 15803 | + } | |
| 15804 | + if (!property_exists($obj, 'hydropical')) { | |
| 15805 | + throw new Exception("Missing required property"); | |
| 15806 | + } | |
| 15807 | + if (!property_exists($obj, 'mechanology')) { | |
| 15808 | + throw new Exception("Missing required property"); | |
| 15809 | + } | |
| 15810 | + if (!property_exists($obj, 'musicopoetic')) { | |
| 15811 | + throw new Exception("Missing required property"); | |
| 15812 | + } | |
| 15813 | + if (!property_exists($obj, 'officiality')) { | |
| 15814 | + throw new Exception("Missing required property"); | |
| 15815 | + } | |
| 15816 | + if (!property_exists($obj, 'oftentimes')) { | |
| 15817 | + throw new Exception("Missing required property"); | |
| 15818 | + } | |
| 15819 | + if (!property_exists($obj, 'ophthalmotonometer')) { | |
| 15820 | + throw new Exception("Missing required property"); | |
| 15821 | + } | |
| 15822 | + if (!property_exists($obj, 'reflectively')) { | |
| 15823 | + throw new Exception("Missing required property"); | |
| 15824 | + } | |
| 15825 | + if (!property_exists($obj, 'springer')) { | |
| 15826 | + throw new Exception("Missing required property"); | |
| 15827 | + } | |
| 15828 | + if (!property_exists($obj, 'Tabasco')) { | |
| 15829 | + throw new Exception("Missing required property"); | |
| 15830 | + } | |
| 15831 | + if (!property_exists($obj, 'teleianthous')) { | |
| 15832 | + throw new Exception("Missing required property"); | |
| 15833 | + } | |
| 15834 | + if (!property_exists($obj, 'uncombated')) { | |
| 15835 | + throw new Exception("Missing required property"); | |
| 15836 | + } | |
| 15306 | 15837 | return new Scatty( |
| 15307 | 15838 | Scatty::fromAeriferous($obj->{'aeriferous'}) |
| 15308 | 15839 | ,Scatty::fromAntical($obj->{'antical'}) |
| @@ -16487,6 +17018,66 @@ class Sistering { | ||
| 16487 | 17018 | * @throws Exception |
| 16488 | 17019 | */ |
| 16489 | 17020 | public static function from(stdClass $obj): Sistering { |
| 17021 | + if (!property_exists($obj, 'amphicarpic')) { | |
| 17022 | + throw new Exception("Missing required property"); | |
| 17023 | + } | |
| 17024 | + if (!property_exists($obj, 'Chianti')) { | |
| 17025 | + throw new Exception("Missing required property"); | |
| 17026 | + } | |
| 17027 | + if (!property_exists($obj, 'frigorific')) { | |
| 17028 | + throw new Exception("Missing required property"); | |
| 17029 | + } | |
| 17030 | + if (!property_exists($obj, 'Haplomi')) { | |
| 17031 | + throw new Exception("Missing required property"); | |
| 17032 | + } | |
| 17033 | + if (!property_exists($obj, 'hyperkinesis')) { | |
| 17034 | + throw new Exception("Missing required property"); | |
| 17035 | + } | |
| 17036 | + if (!property_exists($obj, 'laudable')) { | |
| 17037 | + throw new Exception("Missing required property"); | |
| 17038 | + } | |
| 17039 | + if (!property_exists($obj, 'madwoman')) { | |
| 17040 | + throw new Exception("Missing required property"); | |
| 17041 | + } | |
| 17042 | + if (!property_exists($obj, 'maimedly')) { | |
| 17043 | + throw new Exception("Missing required property"); | |
| 17044 | + } | |
| 17045 | + if (!property_exists($obj, 'Micropterygidae')) { | |
| 17046 | + throw new Exception("Missing required property"); | |
| 17047 | + } | |
| 17048 | + if (!property_exists($obj, 'microrhabdus')) { | |
| 17049 | + throw new Exception("Missing required property"); | |
| 17050 | + } | |
| 17051 | + if (!property_exists($obj, 'nondense')) { | |
| 17052 | + throw new Exception("Missing required property"); | |
| 17053 | + } | |
| 17054 | + if (!property_exists($obj, 'phlebemphraxis')) { | |
| 17055 | + throw new Exception("Missing required property"); | |
| 17056 | + } | |
| 17057 | + if (!property_exists($obj, 'redsear')) { | |
| 17058 | + throw new Exception("Missing required property"); | |
| 17059 | + } | |
| 17060 | + if (!property_exists($obj, 'schismatical')) { | |
| 17061 | + throw new Exception("Missing required property"); | |
| 17062 | + } | |
| 17063 | + if (!property_exists($obj, 'tartryl')) { | |
| 17064 | + throw new Exception("Missing required property"); | |
| 17065 | + } | |
| 17066 | + if (!property_exists($obj, 'unabhorred')) { | |
| 17067 | + throw new Exception("Missing required property"); | |
| 17068 | + } | |
| 17069 | + if (!property_exists($obj, 'undeliberateness')) { | |
| 17070 | + throw new Exception("Missing required property"); | |
| 17071 | + } | |
| 17072 | + if (!property_exists($obj, 'unmixable')) { | |
| 17073 | + throw new Exception("Missing required property"); | |
| 17074 | + } | |
| 17075 | + if (!property_exists($obj, 'untruckling')) { | |
| 17076 | + throw new Exception("Missing required property"); | |
| 17077 | + } | |
| 17078 | + if (!property_exists($obj, 'vineal')) { | |
| 17079 | + throw new Exception("Missing required property"); | |
| 17080 | + } | |
| 16490 | 17081 | return new Sistering( |
| 16491 | 17082 | Sistering::fromAmphicarpic($obj->{'amphicarpic'}) |
| 16492 | 17083 | ,Sistering::fromChianti($obj->{'Chianti'}) |
| @@ -24079,6 +24670,66 @@ class Unstressed { | ||
| 24079 | 24670 | * @throws Exception |
| 24080 | 24671 | */ |
| 24081 | 24672 | public static function from(stdClass $obj): Unstressed { |
| 24673 | + if (!property_exists($obj, 'Alain')) { | |
| 24674 | + throw new Exception("Missing required property"); | |
| 24675 | + } | |
| 24676 | + if (!property_exists($obj, 'Amphirhina')) { | |
| 24677 | + throw new Exception("Missing required property"); | |
| 24678 | + } | |
| 24679 | + if (!property_exists($obj, 'antimachinery')) { | |
| 24680 | + throw new Exception("Missing required property"); | |
| 24681 | + } | |
| 24682 | + if (!property_exists($obj, 'coldish')) { | |
| 24683 | + throw new Exception("Missing required property"); | |
| 24684 | + } | |
| 24685 | + if (!property_exists($obj, 'crantara')) { | |
| 24686 | + throw new Exception("Missing required property"); | |
| 24687 | + } | |
| 24688 | + if (!property_exists($obj, 'distinguishing')) { | |
| 24689 | + throw new Exception("Missing required property"); | |
| 24690 | + } | |
| 24691 | + if (!property_exists($obj, 'elytroposis')) { | |
| 24692 | + throw new Exception("Missing required property"); | |
| 24693 | + } | |
| 24694 | + if (!property_exists($obj, 'gentianwort')) { | |
| 24695 | + throw new Exception("Missing required property"); | |
| 24696 | + } | |
| 24697 | + if (!property_exists($obj, 'heliosis')) { | |
| 24698 | + throw new Exception("Missing required property"); | |
| 24699 | + } | |
| 24700 | + if (!property_exists($obj, 'instrumental')) { | |
| 24701 | + throw new Exception("Missing required property"); | |
| 24702 | + } | |
| 24703 | + if (!property_exists($obj, 'introinflection')) { | |
| 24704 | + throw new Exception("Missing required property"); | |
| 24705 | + } | |
| 24706 | + if (!property_exists($obj, 'kala')) { | |
| 24707 | + throw new Exception("Missing required property"); | |
| 24708 | + } | |
| 24709 | + if (!property_exists($obj, 'Lincolnian')) { | |
| 24710 | + throw new Exception("Missing required property"); | |
| 24711 | + } | |
| 24712 | + if (!property_exists($obj, 'metad')) { | |
| 24713 | + throw new Exception("Missing required property"); | |
| 24714 | + } | |
| 24715 | + if (!property_exists($obj, 'Sarcophilus')) { | |
| 24716 | + throw new Exception("Missing required property"); | |
| 24717 | + } | |
| 24718 | + if (!property_exists($obj, 'swingingly')) { | |
| 24719 | + throw new Exception("Missing required property"); | |
| 24720 | + } | |
| 24721 | + if (!property_exists($obj, 'unconformity')) { | |
| 24722 | + throw new Exception("Missing required property"); | |
| 24723 | + } | |
| 24724 | + if (!property_exists($obj, 'undecreed')) { | |
| 24725 | + throw new Exception("Missing required property"); | |
| 24726 | + } | |
| 24727 | + if (!property_exists($obj, 'venerable')) { | |
| 24728 | + throw new Exception("Missing required property"); | |
| 24729 | + } | |
| 24730 | + if (!property_exists($obj, 'vowellessness')) { | |
| 24731 | + throw new Exception("Missing required property"); | |
| 24732 | + } | |
| 24082 | 24733 | return new Unstressed( |
| 24083 | 24734 | Unstressed::fromAlain($obj->{'Alain'}) |
| 24084 | 24735 | ,Unstressed::fromAmphirhina($obj->{'Amphirhina'}) |
| @@ -25263,6 +25914,66 @@ class Wrothy { | ||
| 25263 | 25914 | * @throws Exception |
| 25264 | 25915 | */ |
| 25265 | 25916 | public static function from(stdClass $obj): Wrothy { |
| 25917 | + if (!property_exists($obj, 'Aeschynanthus')) { | |
| 25918 | + throw new Exception("Missing required property"); | |
| 25919 | + } | |
| 25920 | + if (!property_exists($obj, 'aquiferous')) { | |
| 25921 | + throw new Exception("Missing required property"); | |
| 25922 | + } | |
| 25923 | + if (!property_exists($obj, 'cheapener')) { | |
| 25924 | + throw new Exception("Missing required property"); | |
| 25925 | + } | |
| 25926 | + if (!property_exists($obj, 'enumeration')) { | |
| 25927 | + throw new Exception("Missing required property"); | |
| 25928 | + } | |
| 25929 | + if (!property_exists($obj, 'Ephesine')) { | |
| 25930 | + throw new Exception("Missing required property"); | |
| 25931 | + } | |
| 25932 | + if (!property_exists($obj, 'escadrille')) { | |
| 25933 | + throw new Exception("Missing required property"); | |
| 25934 | + } | |
| 25935 | + if (!property_exists($obj, 'estrous')) { | |
| 25936 | + throw new Exception("Missing required property"); | |
| 25937 | + } | |
| 25938 | + if (!property_exists($obj, 'interestedly')) { | |
| 25939 | + throw new Exception("Missing required property"); | |
| 25940 | + } | |
| 25941 | + if (!property_exists($obj, 'katakinetomer')) { | |
| 25942 | + throw new Exception("Missing required property"); | |
| 25943 | + } | |
| 25944 | + if (!property_exists($obj, 'mortification')) { | |
| 25945 | + throw new Exception("Missing required property"); | |
| 25946 | + } | |
| 25947 | + if (!property_exists($obj, 'morula')) { | |
| 25948 | + throw new Exception("Missing required property"); | |
| 25949 | + } | |
| 25950 | + if (!property_exists($obj, 'orthosymmetrical')) { | |
| 25951 | + throw new Exception("Missing required property"); | |
| 25952 | + } | |
| 25953 | + if (!property_exists($obj, 'overbark')) { | |
| 25954 | + throw new Exception("Missing required property"); | |
| 25955 | + } | |
| 25956 | + if (!property_exists($obj, 'politist')) { | |
| 25957 | + throw new Exception("Missing required property"); | |
| 25958 | + } | |
| 25959 | + if (!property_exists($obj, 'qualified')) { | |
| 25960 | + throw new Exception("Missing required property"); | |
| 25961 | + } | |
| 25962 | + if (!property_exists($obj, 'sphenomalar')) { | |
| 25963 | + throw new Exception("Missing required property"); | |
| 25964 | + } | |
| 25965 | + if (!property_exists($obj, 'throatful')) { | |
| 25966 | + throw new Exception("Missing required property"); | |
| 25967 | + } | |
| 25968 | + if (!property_exists($obj, 'transhumance')) { | |
| 25969 | + throw new Exception("Missing required property"); | |
| 25970 | + } | |
| 25971 | + if (!property_exists($obj, 'triandrian')) { | |
| 25972 | + throw new Exception("Missing required property"); | |
| 25973 | + } | |
| 25974 | + if (!property_exists($obj, 'unbooked')) { | |
| 25975 | + throw new Exception("Missing required property"); | |
| 25976 | + } | |
| 25266 | 25977 | return new Wrothy( |
| 25267 | 25978 | Wrothy::fromAeschynanthus($obj->{'Aeschynanthus'}) |
| 25268 | 25979 | ,Wrothy::fromAquiferous($obj->{'aquiferous'}) |
Test case
1 generated file · +9 −0test/inputs/json/priority/combined-enum.json
Mphpdefault / TopLevel.php+9 −0
| @@ -160,6 +160,12 @@ class TopLevel { | ||
| 160 | 160 | * @throws Exception |
| 161 | 161 | */ |
| 162 | 162 | public static function from(stdClass $obj): TopLevel { |
| 163 | + if (!property_exists($obj, 'bar')) { | |
| 164 | + throw new Exception("Missing required property"); | |
| 165 | + } | |
| 166 | + if (!property_exists($obj, 'foo')) { | |
| 167 | + throw new Exception("Missing required property"); | |
| 168 | + } | |
| 163 | 169 | return new TopLevel( |
| 164 | 170 | TopLevel::fromBar($obj->{'bar'}) |
| 165 | 171 | ,TopLevel::fromFoo($obj->{'foo'}) |
| @@ -261,6 +267,9 @@ class Bar { | ||
| 261 | 267 | * @throws Exception |
| 262 | 268 | */ |
| 263 | 269 | public static function from(stdClass $obj): Bar { |
| 270 | + if (!property_exists($obj, 'x')) { | |
| 271 | + throw new Exception("Missing required property"); | |
| 272 | + } | |
| 264 | 273 | return new Bar( |
| 265 | 274 | Bar::fromX($obj->{'x'}) |
| 266 | 275 | ); |
Test case
1 generated file · +12 −0test/inputs/json/priority/direct-recursive.json
Mphpdefault / TopLevel.php+12 −0
| @@ -303,6 +303,18 @@ class TopLevel { | ||
| 303 | 303 | * @throws Exception |
| 304 | 304 | */ |
| 305 | 305 | public static function from(stdClass $obj): TopLevel { |
| 306 | + if (!property_exists($obj, 'bar')) { | |
| 307 | + throw new Exception("Missing required property"); | |
| 308 | + } | |
| 309 | + if (!property_exists($obj, 'foo')) { | |
| 310 | + throw new Exception("Missing required property"); | |
| 311 | + } | |
| 312 | + if (!property_exists($obj, 'moo')) { | |
| 313 | + throw new Exception("Missing required property"); | |
| 314 | + } | |
| 315 | + if (!property_exists($obj, 'quux')) { | |
| 316 | + throw new Exception("Missing required property"); | |
| 317 | + } | |
| 306 | 318 | return new TopLevel( |
| 307 | 319 | TopLevel::fromAlso($obj->{'also'}) |
| 308 | 320 | ,TopLevel::fromBar($obj->{'bar'}) |
Test case
1 generated file · +3 −0test/inputs/json/priority/empty-enum.json
Mphpdefault / TopLevel.php+3 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'foo')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromFoo($obj->{'foo'}) |
| 101 | 104 | ); |
Test case
1 generated file · +42 −0test/inputs/json/priority/identifiers.json
Mphpdefault / TopLevel.php+42 −0
| @@ -349,6 +349,24 @@ class TopLevel { | ||
| 349 | 349 | * @throws Exception |
| 350 | 350 | */ |
| 351 | 351 | public static function from(stdClass $obj): TopLevel { |
| 352 | + if (!property_exists($obj, 'bla')) { | |
| 353 | + throw new Exception("Missing required property"); | |
| 354 | + } | |
| 355 | + if (!property_exists($obj, '')) { | |
| 356 | + throw new Exception("Missing required property"); | |
| 357 | + } | |
| 358 | + if (!property_exists($obj, 'foo')) { | |
| 359 | + throw new Exception("Missing required property"); | |
| 360 | + } | |
| 361 | + if (!property_exists($obj, 'ThisIsA😜Tough"' . "\n" . '' . "\n" . 'One')) { | |
| 362 | + throw new Exception("Missing required property"); | |
| 363 | + } | |
| 364 | + if (!property_exists($obj, '!')) { | |
| 365 | + throw new Exception("Missing required property"); | |
| 366 | + } | |
| 367 | + if (!property_exists($obj, 'Empty')) { | |
| 368 | + throw new Exception("Missing required property"); | |
| 369 | + } | |
| 352 | 370 | return new TopLevel( |
| 353 | 371 | TopLevel::fromBla($obj->{'bla'}) |
| 354 | 372 | ,TopLevel::fromEmpty($obj->{''}) |
| @@ -457,6 +475,9 @@ class TopLevelBla { | ||
| 457 | 475 | * @throws Exception |
| 458 | 476 | */ |
| 459 | 477 | public static function from(stdClass $obj): TopLevelBla { |
| 478 | + if (!property_exists($obj, 'bar')) { | |
| 479 | + throw new Exception("Missing required property"); | |
| 480 | + } | |
| 460 | 481 | return new TopLevelBla( |
| 461 | 482 | TopLevelBla::fromBar($obj->{'bar'}) |
| 462 | 483 | ); |
| @@ -555,6 +576,9 @@ class TopLevelClass { | ||
| 555 | 576 | * @throws Exception |
| 556 | 577 | */ |
| 557 | 578 | public static function from(stdClass $obj): TopLevelClass { |
| 579 | + if (!property_exists($obj, 'x')) { | |
| 580 | + throw new Exception("Missing required property"); | |
| 581 | + } | |
| 558 | 582 | return new TopLevelClass( |
| 559 | 583 | TopLevelClass::fromX($obj->{'x'}) |
| 560 | 584 | ); |
| @@ -758,6 +782,15 @@ class Foo { | ||
| 758 | 782 | * @throws Exception |
| 759 | 783 | */ |
| 760 | 784 | public static function from(stdClass $obj): Foo { |
| 785 | + if (!property_exists($obj, 'bla')) { | |
| 786 | + throw new Exception("Missing required property"); | |
| 787 | + } | |
| 788 | + if (!property_exists($obj, '_')) { | |
| 789 | + throw new Exception("Missing required property"); | |
| 790 | + } | |
| 791 | + if (!property_exists($obj, '__')) { | |
| 792 | + throw new Exception("Missing required property"); | |
| 793 | + } | |
| 761 | 794 | return new Foo( |
| 762 | 795 | Foo::fromBla($obj->{'bla'}) |
| 763 | 796 | ,Foo::fromEmpty($obj->{'_'}) |
| @@ -957,6 +990,12 @@ class ThisIsAToughOne { | ||
| 957 | 990 | * @throws Exception |
| 958 | 991 | */ |
| 959 | 992 | public static function from(stdClass $obj): ThisIsAToughOne { |
| 993 | + if (!property_exists($obj, '' . "\n" . '' . "\n" . '' . "\n" . '')) { | |
| 994 | + throw new Exception("Missing required property"); | |
| 995 | + } | |
| 996 | + if (!property_exists($obj, '"')) { | |
| 997 | + throw new Exception("Missing required property"); | |
| 998 | + } | |
| 960 | 999 | return new ThisIsAToughOne( |
| 961 | 1000 | ThisIsAToughOne::fromEmpty($obj->{'' . "\n" . '' . "\n" . '' . "\n" . ''}) |
| 962 | 1001 | ,ThisIsAToughOne::fromThisIsAToughOne($obj->{'"'}) |
| @@ -1057,6 +1096,9 @@ class EmptyClass { | ||
| 1057 | 1096 | * @throws Exception |
| 1058 | 1097 | */ |
| 1059 | 1098 | public static function from(stdClass $obj): EmptyClass { |
| 1099 | + if (!property_exists($obj, 'y')) { | |
| 1100 | + throw new Exception("Missing required property"); | |
| 1101 | + } | |
| 1060 | 1102 | return new EmptyClass( |
| 1061 | 1103 | EmptyClass::fromY($obj->{'y'}) |
| 1062 | 1104 | ); |
Test case
1 generated file · +3 −0test/inputs/json/priority/issue2680-object-array.json
Mphpdefault / TopLevel.php+3 −0
| @@ -84,6 +84,9 @@ class TopLevel { | ||
| 84 | 84 | * @throws Exception |
| 85 | 85 | */ |
| 86 | 86 | public static function from(stdClass $obj): TopLevel { |
| 87 | + if (!property_exists($obj, 'key')) { | |
| 88 | + throw new Exception("Missing required property"); | |
| 89 | + } | |
| 87 | 90 | return new TopLevel( |
| 88 | 91 | TopLevel::fromKey($obj->{'key'}) |
| 89 | 92 | ); |
Test case
1 generated file · +1,707 −0test/inputs/json/priority/keywords.json
Mphpdefault / TopLevel.php+1,707 −0
| @@ -349,6 +349,24 @@ class TopLevel { | ||
| 349 | 349 | * @throws Exception |
| 350 | 350 | */ |
| 351 | 351 | public static function from(stdClass $obj): TopLevel { |
| 352 | + if (!property_exists($obj, 'dummy')) { | |
| 353 | + throw new Exception("Missing required property"); | |
| 354 | + } | |
| 355 | + if (!property_exists($obj, 'obj1')) { | |
| 356 | + throw new Exception("Missing required property"); | |
| 357 | + } | |
| 358 | + if (!property_exists($obj, 'obj2')) { | |
| 359 | + throw new Exception("Missing required property"); | |
| 360 | + } | |
| 361 | + if (!property_exists($obj, 'obj3')) { | |
| 362 | + throw new Exception("Missing required property"); | |
| 363 | + } | |
| 364 | + if (!property_exists($obj, 'obj4')) { | |
| 365 | + throw new Exception("Missing required property"); | |
| 366 | + } | |
| 367 | + if (!property_exists($obj, 'obj5')) { | |
| 368 | + throw new Exception("Missing required property"); | |
| 369 | + } | |
| 352 | 370 | return new TopLevel( |
| 353 | 371 | TopLevel::fromDummy($obj->{'dummy'}) |
| 354 | 372 | ,TopLevel::fromObj1($obj->{'obj1'}) |
| @@ -3902,6 +3920,204 @@ class Obj1 { | ||
| 3902 | 3920 | * @throws Exception |
| 3903 | 3921 | */ |
| 3904 | 3922 | public static function from(stdClass $obj): Obj1 { |
| 3923 | + if (!property_exists($obj, 'abstract')) { | |
| 3924 | + throw new Exception("Missing required property"); | |
| 3925 | + } | |
| 3926 | + if (!property_exists($obj, 'alignas')) { | |
| 3927 | + throw new Exception("Missing required property"); | |
| 3928 | + } | |
| 3929 | + if (!property_exists($obj, 'alignof')) { | |
| 3930 | + throw new Exception("Missing required property"); | |
| 3931 | + } | |
| 3932 | + if (!property_exists($obj, 'and')) { | |
| 3933 | + throw new Exception("Missing required property"); | |
| 3934 | + } | |
| 3935 | + if (!property_exists($obj, 'and_eq')) { | |
| 3936 | + throw new Exception("Missing required property"); | |
| 3937 | + } | |
| 3938 | + if (!property_exists($obj, 'Any')) { | |
| 3939 | + throw new Exception("Missing required property"); | |
| 3940 | + } | |
| 3941 | + if (!property_exists($obj, 'array')) { | |
| 3942 | + throw new Exception("Missing required property"); | |
| 3943 | + } | |
| 3944 | + if (!property_exists($obj, 'as')) { | |
| 3945 | + throw new Exception("Missing required property"); | |
| 3946 | + } | |
| 3947 | + if (!property_exists($obj, 'asm')) { | |
| 3948 | + throw new Exception("Missing required property"); | |
| 3949 | + } | |
| 3950 | + if (!property_exists($obj, 'assert')) { | |
| 3951 | + throw new Exception("Missing required property"); | |
| 3952 | + } | |
| 3953 | + if (!property_exists($obj, 'associatedtype')) { | |
| 3954 | + throw new Exception("Missing required property"); | |
| 3955 | + } | |
| 3956 | + if (!property_exists($obj, 'associativity')) { | |
| 3957 | + throw new Exception("Missing required property"); | |
| 3958 | + } | |
| 3959 | + if (!property_exists($obj, 'async')) { | |
| 3960 | + throw new Exception("Missing required property"); | |
| 3961 | + } | |
| 3962 | + if (!property_exists($obj, 'atomic')) { | |
| 3963 | + throw new Exception("Missing required property"); | |
| 3964 | + } | |
| 3965 | + if (!property_exists($obj, 'atomic_cancel')) { | |
| 3966 | + throw new Exception("Missing required property"); | |
| 3967 | + } | |
| 3968 | + if (!property_exists($obj, 'atomic_commit')) { | |
| 3969 | + throw new Exception("Missing required property"); | |
| 3970 | + } | |
| 3971 | + if (!property_exists($obj, 'atomic_noexcept')) { | |
| 3972 | + throw new Exception("Missing required property"); | |
| 3973 | + } | |
| 3974 | + if (!property_exists($obj, 'auto')) { | |
| 3975 | + throw new Exception("Missing required property"); | |
| 3976 | + } | |
| 3977 | + if (!property_exists($obj, 'await')) { | |
| 3978 | + throw new Exception("Missing required property"); | |
| 3979 | + } | |
| 3980 | + if (!property_exists($obj, 'base')) { | |
| 3981 | + throw new Exception("Missing required property"); | |
| 3982 | + } | |
| 3983 | + if (!property_exists($obj, 'bitand')) { | |
| 3984 | + throw new Exception("Missing required property"); | |
| 3985 | + } | |
| 3986 | + if (!property_exists($obj, 'bitor')) { | |
| 3987 | + throw new Exception("Missing required property"); | |
| 3988 | + } | |
| 3989 | + if (!property_exists($obj, 'BOOL')) { | |
| 3990 | + throw new Exception("Missing required property"); | |
| 3991 | + } | |
| 3992 | + if (!property_exists($obj, 'boolean')) { | |
| 3993 | + throw new Exception("Missing required property"); | |
| 3994 | + } | |
| 3995 | + if (!property_exists($obj, 'break')) { | |
| 3996 | + throw new Exception("Missing required property"); | |
| 3997 | + } | |
| 3998 | + if (!property_exists($obj, 'bycopy')) { | |
| 3999 | + throw new Exception("Missing required property"); | |
| 4000 | + } | |
| 4001 | + if (!property_exists($obj, 'byref')) { | |
| 4002 | + throw new Exception("Missing required property"); | |
| 4003 | + } | |
| 4004 | + if (!property_exists($obj, 'byte')) { | |
| 4005 | + throw new Exception("Missing required property"); | |
| 4006 | + } | |
| 4007 | + if (!property_exists($obj, 'case')) { | |
| 4008 | + throw new Exception("Missing required property"); | |
| 4009 | + } | |
| 4010 | + if (!property_exists($obj, 'catch')) { | |
| 4011 | + throw new Exception("Missing required property"); | |
| 4012 | + } | |
| 4013 | + if (!property_exists($obj, 'chan')) { | |
| 4014 | + throw new Exception("Missing required property"); | |
| 4015 | + } | |
| 4016 | + if (!property_exists($obj, 'char')) { | |
| 4017 | + throw new Exception("Missing required property"); | |
| 4018 | + } | |
| 4019 | + if (!property_exists($obj, 'char16_t')) { | |
| 4020 | + throw new Exception("Missing required property"); | |
| 4021 | + } | |
| 4022 | + if (!property_exists($obj, 'char32_t')) { | |
| 4023 | + throw new Exception("Missing required property"); | |
| 4024 | + } | |
| 4025 | + if (!property_exists($obj, 'checked')) { | |
| 4026 | + throw new Exception("Missing required property"); | |
| 4027 | + } | |
| 4028 | + if (!property_exists($obj, 'Class')) { | |
| 4029 | + throw new Exception("Missing required property"); | |
| 4030 | + } | |
| 4031 | + if (!property_exists($obj, 'clone')) { | |
| 4032 | + throw new Exception("Missing required property"); | |
| 4033 | + } | |
| 4034 | + if (!property_exists($obj, 'co_await')) { | |
| 4035 | + throw new Exception("Missing required property"); | |
| 4036 | + } | |
| 4037 | + if (!property_exists($obj, 'co_return')) { | |
| 4038 | + throw new Exception("Missing required property"); | |
| 4039 | + } | |
| 4040 | + if (!property_exists($obj, 'co_yield')) { | |
| 4041 | + throw new Exception("Missing required property"); | |
| 4042 | + } | |
| 4043 | + if (!property_exists($obj, 'compl')) { | |
| 4044 | + throw new Exception("Missing required property"); | |
| 4045 | + } | |
| 4046 | + if (!property_exists($obj, '_Complex')) { | |
| 4047 | + throw new Exception("Missing required property"); | |
| 4048 | + } | |
| 4049 | + if (!property_exists($obj, 'concept')) { | |
| 4050 | + throw new Exception("Missing required property"); | |
| 4051 | + } | |
| 4052 | + if (!property_exists($obj, 'console')) { | |
| 4053 | + throw new Exception("Missing required property"); | |
| 4054 | + } | |
| 4055 | + if (!property_exists($obj, 'const')) { | |
| 4056 | + throw new Exception("Missing required property"); | |
| 4057 | + } | |
| 4058 | + if (!property_exists($obj, 'const_cast')) { | |
| 4059 | + throw new Exception("Missing required property"); | |
| 4060 | + } | |
| 4061 | + if (!property_exists($obj, 'constexpr')) { | |
| 4062 | + throw new Exception("Missing required property"); | |
| 4063 | + } | |
| 4064 | + if (!property_exists($obj, 'constructor')) { | |
| 4065 | + throw new Exception("Missing required property"); | |
| 4066 | + } | |
| 4067 | + if (!property_exists($obj, 'continue')) { | |
| 4068 | + throw new Exception("Missing required property"); | |
| 4069 | + } | |
| 4070 | + if (!property_exists($obj, 'convenience')) { | |
| 4071 | + throw new Exception("Missing required property"); | |
| 4072 | + } | |
| 4073 | + if (!property_exists($obj, 'convert')) { | |
| 4074 | + throw new Exception("Missing required property"); | |
| 4075 | + } | |
| 4076 | + if (!property_exists($obj, 'converter')) { | |
| 4077 | + throw new Exception("Missing required property"); | |
| 4078 | + } | |
| 4079 | + if (!property_exists($obj, 'date')) { | |
| 4080 | + throw new Exception("Missing required property"); | |
| 4081 | + } | |
| 4082 | + if (!property_exists($obj, 'date_parse_handling')) { | |
| 4083 | + throw new Exception("Missing required property"); | |
| 4084 | + } | |
| 4085 | + if (!property_exists($obj, 'debugger')) { | |
| 4086 | + throw new Exception("Missing required property"); | |
| 4087 | + } | |
| 4088 | + if (!property_exists($obj, 'decimal')) { | |
| 4089 | + throw new Exception("Missing required property"); | |
| 4090 | + } | |
| 4091 | + if (!property_exists($obj, 'declare')) { | |
| 4092 | + throw new Exception("Missing required property"); | |
| 4093 | + } | |
| 4094 | + if (!property_exists($obj, 'decltype')) { | |
| 4095 | + throw new Exception("Missing required property"); | |
| 4096 | + } | |
| 4097 | + if (!property_exists($obj, 'decode_string')) { | |
| 4098 | + throw new Exception("Missing required property"); | |
| 4099 | + } | |
| 4100 | + if (!property_exists($obj, 'dummy')) { | |
| 4101 | + throw new Exception("Missing required property"); | |
| 4102 | + } | |
| 4103 | + if (!property_exists($obj, '_')) { | |
| 4104 | + throw new Exception("Missing required property"); | |
| 4105 | + } | |
| 4106 | + if (!property_exists($obj, '_Imaginery')) { | |
| 4107 | + throw new Exception("Missing required property"); | |
| 4108 | + } | |
| 4109 | + if (!property_exists($obj, 'any')) { | |
| 4110 | + throw new Exception("Missing required property"); | |
| 4111 | + } | |
| 4112 | + if (!property_exists($obj, '_Bool')) { | |
| 4113 | + throw new Exception("Missing required property"); | |
| 4114 | + } | |
| 4115 | + if (!property_exists($obj, 'class')) { | |
| 4116 | + throw new Exception("Missing required property"); | |
| 4117 | + } | |
| 4118 | + if (!property_exists($obj, 'bool')) { | |
| 4119 | + throw new Exception("Missing required property"); | |
| 4120 | + } | |
| 3905 | 4121 | return new Obj1( |
| 3906 | 4122 | Obj1::fromAbstract($obj->{'abstract'}) |
| 3907 | 4123 | ,Obj1::fromAlignas($obj->{'alignas'}) |
| @@ -4130,6 +4346,9 @@ class AbstractClass { | ||
| 4130 | 4346 | * @throws Exception |
| 4131 | 4347 | */ |
| 4132 | 4348 | public static function from(stdClass $obj): AbstractClass { |
| 4349 | + if (!property_exists($obj, 'abstract')) { | |
| 4350 | + throw new Exception("Missing required property"); | |
| 4351 | + } | |
| 4133 | 4352 | return new AbstractClass( |
| 4134 | 4353 | AbstractClass::fromAbstract($obj->{'abstract'}) |
| 4135 | 4354 | ); |
| @@ -4228,6 +4447,9 @@ class Alignas { | ||
| 4228 | 4447 | * @throws Exception |
| 4229 | 4448 | */ |
| 4230 | 4449 | public static function from(stdClass $obj): Alignas { |
| 4450 | + if (!property_exists($obj, 'alignas')) { | |
| 4451 | + throw new Exception("Missing required property"); | |
| 4452 | + } | |
| 4231 | 4453 | return new Alignas( |
| 4232 | 4454 | Alignas::fromAlignas($obj->{'alignas'}) |
| 4233 | 4455 | ); |
| @@ -4326,6 +4548,9 @@ class Alignof { | ||
| 4326 | 4548 | * @throws Exception |
| 4327 | 4549 | */ |
| 4328 | 4550 | public static function from(stdClass $obj): Alignof { |
| 4551 | + if (!property_exists($obj, 'alignof')) { | |
| 4552 | + throw new Exception("Missing required property"); | |
| 4553 | + } | |
| 4329 | 4554 | return new Alignof( |
| 4330 | 4555 | Alignof::fromAlignof($obj->{'alignof'}) |
| 4331 | 4556 | ); |
| @@ -4424,6 +4649,9 @@ class AndClass { | ||
| 4424 | 4649 | * @throws Exception |
| 4425 | 4650 | */ |
| 4426 | 4651 | public static function from(stdClass $obj): AndClass { |
| 4652 | + if (!property_exists($obj, 'and')) { | |
| 4653 | + throw new Exception("Missing required property"); | |
| 4654 | + } | |
| 4427 | 4655 | return new AndClass( |
| 4428 | 4656 | AndClass::fromAnd($obj->{'and'}) |
| 4429 | 4657 | ); |
| @@ -4522,6 +4750,9 @@ class AndEq { | ||
| 4522 | 4750 | * @throws Exception |
| 4523 | 4751 | */ |
| 4524 | 4752 | public static function from(stdClass $obj): AndEq { |
| 4753 | + if (!property_exists($obj, 'and_eq')) { | |
| 4754 | + throw new Exception("Missing required property"); | |
| 4755 | + } | |
| 4525 | 4756 | return new AndEq( |
| 4526 | 4757 | AndEq::fromAndEq($obj->{'and_eq'}) |
| 4527 | 4758 | ); |
| @@ -4620,6 +4851,9 @@ class Any { | ||
| 4620 | 4851 | * @throws Exception |
| 4621 | 4852 | */ |
| 4622 | 4853 | public static function from(stdClass $obj): Any { |
| 4854 | + if (!property_exists($obj, 'Any')) { | |
| 4855 | + throw new Exception("Missing required property"); | |
| 4856 | + } | |
| 4623 | 4857 | return new Any( |
| 4624 | 4858 | Any::fromAny($obj->{'Any'}) |
| 4625 | 4859 | ); |
| @@ -4718,6 +4952,9 @@ class ArrayClass { | ||
| 4718 | 4952 | * @throws Exception |
| 4719 | 4953 | */ |
| 4720 | 4954 | public static function from(stdClass $obj): ArrayClass { |
| 4955 | + if (!property_exists($obj, 'array')) { | |
| 4956 | + throw new Exception("Missing required property"); | |
| 4957 | + } | |
| 4721 | 4958 | return new ArrayClass( |
| 4722 | 4959 | ArrayClass::fromArray($obj->{'array'}) |
| 4723 | 4960 | ); |
| @@ -4816,6 +5053,9 @@ class AsClass { | ||
| 4816 | 5053 | * @throws Exception |
| 4817 | 5054 | */ |
| 4818 | 5055 | public static function from(stdClass $obj): AsClass { |
| 5056 | + if (!property_exists($obj, 'as')) { | |
| 5057 | + throw new Exception("Missing required property"); | |
| 5058 | + } | |
| 4819 | 5059 | return new AsClass( |
| 4820 | 5060 | AsClass::fromAs($obj->{'as'}) |
| 4821 | 5061 | ); |
| @@ -4914,6 +5154,9 @@ class ASM { | ||
| 4914 | 5154 | * @throws Exception |
| 4915 | 5155 | */ |
| 4916 | 5156 | public static function from(stdClass $obj): ASM { |
| 5157 | + if (!property_exists($obj, 'asm')) { | |
| 5158 | + throw new Exception("Missing required property"); | |
| 5159 | + } | |
| 4917 | 5160 | return new ASM( |
| 4918 | 5161 | ASM::fromASM($obj->{'asm'}) |
| 4919 | 5162 | ); |
| @@ -5012,6 +5255,9 @@ class Assert { | ||
| 5012 | 5255 | * @throws Exception |
| 5013 | 5256 | */ |
| 5014 | 5257 | public static function from(stdClass $obj): Assert { |
| 5258 | + if (!property_exists($obj, 'assert')) { | |
| 5259 | + throw new Exception("Missing required property"); | |
| 5260 | + } | |
| 5015 | 5261 | return new Assert( |
| 5016 | 5262 | Assert::fromAssert($obj->{'assert'}) |
| 5017 | 5263 | ); |
| @@ -5110,6 +5356,9 @@ class Associatedtype { | ||
| 5110 | 5356 | * @throws Exception |
| 5111 | 5357 | */ |
| 5112 | 5358 | public static function from(stdClass $obj): Associatedtype { |
| 5359 | + if (!property_exists($obj, 'associatedtype')) { | |
| 5360 | + throw new Exception("Missing required property"); | |
| 5361 | + } | |
| 5113 | 5362 | return new Associatedtype( |
| 5114 | 5363 | Associatedtype::fromAssociatedtype($obj->{'associatedtype'}) |
| 5115 | 5364 | ); |
| @@ -5208,6 +5457,9 @@ class Associativity { | ||
| 5208 | 5457 | * @throws Exception |
| 5209 | 5458 | */ |
| 5210 | 5459 | public static function from(stdClass $obj): Associativity { |
| 5460 | + if (!property_exists($obj, 'associativity')) { | |
| 5461 | + throw new Exception("Missing required property"); | |
| 5462 | + } | |
| 5211 | 5463 | return new Associativity( |
| 5212 | 5464 | Associativity::fromAssociativity($obj->{'associativity'}) |
| 5213 | 5465 | ); |
| @@ -5306,6 +5558,9 @@ class Async { | ||
| 5306 | 5558 | * @throws Exception |
| 5307 | 5559 | */ |
| 5308 | 5560 | public static function from(stdClass $obj): Async { |
| 5561 | + if (!property_exists($obj, 'async')) { | |
| 5562 | + throw new Exception("Missing required property"); | |
| 5563 | + } | |
| 5309 | 5564 | return new Async( |
| 5310 | 5565 | Async::fromAsync($obj->{'async'}) |
| 5311 | 5566 | ); |
| @@ -5404,6 +5659,9 @@ class Atomic { | ||
| 5404 | 5659 | * @throws Exception |
| 5405 | 5660 | */ |
| 5406 | 5661 | public static function from(stdClass $obj): Atomic { |
| 5662 | + if (!property_exists($obj, 'atomic')) { | |
| 5663 | + throw new Exception("Missing required property"); | |
| 5664 | + } | |
| 5407 | 5665 | return new Atomic( |
| 5408 | 5666 | Atomic::fromAtomic($obj->{'atomic'}) |
| 5409 | 5667 | ); |
| @@ -5502,6 +5760,9 @@ class AtomicCancel { | ||
| 5502 | 5760 | * @throws Exception |
| 5503 | 5761 | */ |
| 5504 | 5762 | public static function from(stdClass $obj): AtomicCancel { |
| 5763 | + if (!property_exists($obj, 'atomic_cancel')) { | |
| 5764 | + throw new Exception("Missing required property"); | |
| 5765 | + } | |
| 5505 | 5766 | return new AtomicCancel( |
| 5506 | 5767 | AtomicCancel::fromAtomicCancel($obj->{'atomic_cancel'}) |
| 5507 | 5768 | ); |
| @@ -5600,6 +5861,9 @@ class AtomicCommit { | ||
| 5600 | 5861 | * @throws Exception |
| 5601 | 5862 | */ |
| 5602 | 5863 | public static function from(stdClass $obj): AtomicCommit { |
| 5864 | + if (!property_exists($obj, 'atomic_commit')) { | |
| 5865 | + throw new Exception("Missing required property"); | |
| 5866 | + } | |
| 5603 | 5867 | return new AtomicCommit( |
| 5604 | 5868 | AtomicCommit::fromAtomicCommit($obj->{'atomic_commit'}) |
| 5605 | 5869 | ); |
| @@ -5698,6 +5962,9 @@ class AtomicNoexcept { | ||
| 5698 | 5962 | * @throws Exception |
| 5699 | 5963 | */ |
| 5700 | 5964 | public static function from(stdClass $obj): AtomicNoexcept { |
| 5965 | + if (!property_exists($obj, 'atomic_noexcept')) { | |
| 5966 | + throw new Exception("Missing required property"); | |
| 5967 | + } | |
| 5701 | 5968 | return new AtomicNoexcept( |
| 5702 | 5969 | AtomicNoexcept::fromAtomicNoexcept($obj->{'atomic_noexcept'}) |
| 5703 | 5970 | ); |
| @@ -5796,6 +6063,9 @@ class Auto { | ||
| 5796 | 6063 | * @throws Exception |
| 5797 | 6064 | */ |
| 5798 | 6065 | public static function from(stdClass $obj): Auto { |
| 6066 | + if (!property_exists($obj, 'auto')) { | |
| 6067 | + throw new Exception("Missing required property"); | |
| 6068 | + } | |
| 5799 | 6069 | return new Auto( |
| 5800 | 6070 | Auto::fromAuto($obj->{'auto'}) |
| 5801 | 6071 | ); |
| @@ -5894,6 +6164,9 @@ class Await { | ||
| 5894 | 6164 | * @throws Exception |
| 5895 | 6165 | */ |
| 5896 | 6166 | public static function from(stdClass $obj): Await { |
| 6167 | + if (!property_exists($obj, 'await')) { | |
| 6168 | + throw new Exception("Missing required property"); | |
| 6169 | + } | |
| 5897 | 6170 | return new Await( |
| 5898 | 6171 | Await::fromAwait($obj->{'await'}) |
| 5899 | 6172 | ); |
| @@ -5992,6 +6265,9 @@ class Base { | ||
| 5992 | 6265 | * @throws Exception |
| 5993 | 6266 | */ |
| 5994 | 6267 | public static function from(stdClass $obj): Base { |
| 6268 | + if (!property_exists($obj, 'base')) { | |
| 6269 | + throw new Exception("Missing required property"); | |
| 6270 | + } | |
| 5995 | 6271 | return new Base( |
| 5996 | 6272 | Base::fromBase($obj->{'base'}) |
| 5997 | 6273 | ); |
| @@ -6090,6 +6366,9 @@ class Bitand { | ||
| 6090 | 6366 | * @throws Exception |
| 6091 | 6367 | */ |
| 6092 | 6368 | public static function from(stdClass $obj): Bitand { |
| 6369 | + if (!property_exists($obj, 'bitand')) { | |
| 6370 | + throw new Exception("Missing required property"); | |
| 6371 | + } | |
| 6093 | 6372 | return new Bitand( |
| 6094 | 6373 | Bitand::fromBitand($obj->{'bitand'}) |
| 6095 | 6374 | ); |
| @@ -6188,6 +6467,9 @@ class Bitor { | ||
| 6188 | 6467 | * @throws Exception |
| 6189 | 6468 | */ |
| 6190 | 6469 | public static function from(stdClass $obj): Bitor { |
| 6470 | + if (!property_exists($obj, 'bitor')) { | |
| 6471 | + throw new Exception("Missing required property"); | |
| 6472 | + } | |
| 6191 | 6473 | return new Bitor( |
| 6192 | 6474 | Bitor::fromBitor($obj->{'bitor'}) |
| 6193 | 6475 | ); |
| @@ -6286,6 +6568,9 @@ class BOOLClass { | ||
| 6286 | 6568 | * @throws Exception |
| 6287 | 6569 | */ |
| 6288 | 6570 | public static function from(stdClass $obj): BOOLClass { |
| 6571 | + if (!property_exists($obj, 'BOOL')) { | |
| 6572 | + throw new Exception("Missing required property"); | |
| 6573 | + } | |
| 6289 | 6574 | return new BOOLClass( |
| 6290 | 6575 | BOOLClass::fromBool($obj->{'BOOL'}) |
| 6291 | 6576 | ); |
| @@ -6384,6 +6669,9 @@ class Boolean { | ||
| 6384 | 6669 | * @throws Exception |
| 6385 | 6670 | */ |
| 6386 | 6671 | public static function from(stdClass $obj): Boolean { |
| 6672 | + if (!property_exists($obj, 'boolean')) { | |
| 6673 | + throw new Exception("Missing required property"); | |
| 6674 | + } | |
| 6387 | 6675 | return new Boolean( |
| 6388 | 6676 | Boolean::fromBoolean($obj->{'boolean'}) |
| 6389 | 6677 | ); |
| @@ -6482,6 +6770,9 @@ class BreakClass { | ||
| 6482 | 6770 | * @throws Exception |
| 6483 | 6771 | */ |
| 6484 | 6772 | public static function from(stdClass $obj): BreakClass { |
| 6773 | + if (!property_exists($obj, 'break')) { | |
| 6774 | + throw new Exception("Missing required property"); | |
| 6775 | + } | |
| 6485 | 6776 | return new BreakClass( |
| 6486 | 6777 | BreakClass::fromBreak($obj->{'break'}) |
| 6487 | 6778 | ); |
| @@ -6580,6 +6871,9 @@ class Bycopy { | ||
| 6580 | 6871 | * @throws Exception |
| 6581 | 6872 | */ |
| 6582 | 6873 | public static function from(stdClass $obj): Bycopy { |
| 6874 | + if (!property_exists($obj, 'bycopy')) { | |
| 6875 | + throw new Exception("Missing required property"); | |
| 6876 | + } | |
| 6583 | 6877 | return new Bycopy( |
| 6584 | 6878 | Bycopy::fromBycopy($obj->{'bycopy'}) |
| 6585 | 6879 | ); |
| @@ -6678,6 +6972,9 @@ class Byref { | ||
| 6678 | 6972 | * @throws Exception |
| 6679 | 6973 | */ |
| 6680 | 6974 | public static function from(stdClass $obj): Byref { |
| 6975 | + if (!property_exists($obj, 'byref')) { | |
| 6976 | + throw new Exception("Missing required property"); | |
| 6977 | + } | |
| 6681 | 6978 | return new Byref( |
| 6682 | 6979 | Byref::fromByref($obj->{'byref'}) |
| 6683 | 6980 | ); |
| @@ -6776,6 +7073,9 @@ class Byte { | ||
| 6776 | 7073 | * @throws Exception |
| 6777 | 7074 | */ |
| 6778 | 7075 | public static function from(stdClass $obj): Byte { |
| 7076 | + if (!property_exists($obj, 'byte')) { | |
| 7077 | + throw new Exception("Missing required property"); | |
| 7078 | + } | |
| 6779 | 7079 | return new Byte( |
| 6780 | 7080 | Byte::fromByte($obj->{'byte'}) |
| 6781 | 7081 | ); |
| @@ -6874,6 +7174,9 @@ class CaseClass { | ||
| 6874 | 7174 | * @throws Exception |
| 6875 | 7175 | */ |
| 6876 | 7176 | public static function from(stdClass $obj): CaseClass { |
| 7177 | + if (!property_exists($obj, 'case')) { | |
| 7178 | + throw new Exception("Missing required property"); | |
| 7179 | + } | |
| 6877 | 7180 | return new CaseClass( |
| 6878 | 7181 | CaseClass::fromCase($obj->{'case'}) |
| 6879 | 7182 | ); |
| @@ -6972,6 +7275,9 @@ class CatchClass { | ||
| 6972 | 7275 | * @throws Exception |
| 6973 | 7276 | */ |
| 6974 | 7277 | public static function from(stdClass $obj): CatchClass { |
| 7278 | + if (!property_exists($obj, 'catch')) { | |
| 7279 | + throw new Exception("Missing required property"); | |
| 7280 | + } | |
| 6975 | 7281 | return new CatchClass( |
| 6976 | 7282 | CatchClass::fromCatch($obj->{'catch'}) |
| 6977 | 7283 | ); |
| @@ -7070,6 +7376,9 @@ class Chan { | ||
| 7070 | 7376 | * @throws Exception |
| 7071 | 7377 | */ |
| 7072 | 7378 | public static function from(stdClass $obj): Chan { |
| 7379 | + if (!property_exists($obj, 'chan')) { | |
| 7380 | + throw new Exception("Missing required property"); | |
| 7381 | + } | |
| 7073 | 7382 | return new Chan( |
| 7074 | 7383 | Chan::fromChan($obj->{'chan'}) |
| 7075 | 7384 | ); |
| @@ -7168,6 +7477,9 @@ class Char { | ||
| 7168 | 7477 | * @throws Exception |
| 7169 | 7478 | */ |
| 7170 | 7479 | public static function from(stdClass $obj): Char { |
| 7480 | + if (!property_exists($obj, 'char')) { | |
| 7481 | + throw new Exception("Missing required property"); | |
| 7482 | + } | |
| 7171 | 7483 | return new Char( |
| 7172 | 7484 | Char::fromChar($obj->{'char'}) |
| 7173 | 7485 | ); |
| @@ -7266,6 +7578,9 @@ class Char16T { | ||
| 7266 | 7578 | * @throws Exception |
| 7267 | 7579 | */ |
| 7268 | 7580 | public static function from(stdClass $obj): Char16T { |
| 7581 | + if (!property_exists($obj, 'char16_t')) { | |
| 7582 | + throw new Exception("Missing required property"); | |
| 7583 | + } | |
| 7269 | 7584 | return new Char16T( |
| 7270 | 7585 | Char16T::fromChar16T($obj->{'char16_t'}) |
| 7271 | 7586 | ); |
| @@ -7364,6 +7679,9 @@ class Char32T { | ||
| 7364 | 7679 | * @throws Exception |
| 7365 | 7680 | */ |
| 7366 | 7681 | public static function from(stdClass $obj): Char32T { |
| 7682 | + if (!property_exists($obj, 'char32_t')) { | |
| 7683 | + throw new Exception("Missing required property"); | |
| 7684 | + } | |
| 7367 | 7685 | return new Char32T( |
| 7368 | 7686 | Char32T::fromChar32T($obj->{'char32_t'}) |
| 7369 | 7687 | ); |
| @@ -7462,6 +7780,9 @@ class Checked { | ||
| 7462 | 7780 | * @throws Exception |
| 7463 | 7781 | */ |
| 7464 | 7782 | public static function from(stdClass $obj): Checked { |
| 7783 | + if (!property_exists($obj, 'checked')) { | |
| 7784 | + throw new Exception("Missing required property"); | |
| 7785 | + } | |
| 7465 | 7786 | return new Checked( |
| 7466 | 7787 | Checked::fromChecked($obj->{'checked'}) |
| 7467 | 7788 | ); |
| @@ -7560,6 +7881,9 @@ class ClassClass { | ||
| 7560 | 7881 | * @throws Exception |
| 7561 | 7882 | */ |
| 7562 | 7883 | public static function from(stdClass $obj): ClassClass { |
| 7884 | + if (!property_exists($obj, 'Class')) { | |
| 7885 | + throw new Exception("Missing required property"); | |
| 7886 | + } | |
| 7563 | 7887 | return new ClassClass( |
| 7564 | 7888 | ClassClass::fromClass($obj->{'Class'}) |
| 7565 | 7889 | ); |
| @@ -7658,6 +7982,9 @@ class CloneClass { | ||
| 7658 | 7982 | * @throws Exception |
| 7659 | 7983 | */ |
| 7660 | 7984 | public static function from(stdClass $obj): CloneClass { |
| 7985 | + if (!property_exists($obj, 'clone')) { | |
| 7986 | + throw new Exception("Missing required property"); | |
| 7987 | + } | |
| 7661 | 7988 | return new CloneClass( |
| 7662 | 7989 | CloneClass::fromClone($obj->{'clone'}) |
| 7663 | 7990 | ); |
| @@ -7756,6 +8083,9 @@ class CoAwait { | ||
| 7756 | 8083 | * @throws Exception |
| 7757 | 8084 | */ |
| 7758 | 8085 | public static function from(stdClass $obj): CoAwait { |
| 8086 | + if (!property_exists($obj, 'co_await')) { | |
| 8087 | + throw new Exception("Missing required property"); | |
| 8088 | + } | |
| 7759 | 8089 | return new CoAwait( |
| 7760 | 8090 | CoAwait::fromCoAwait($obj->{'co_await'}) |
| 7761 | 8091 | ); |
| @@ -7854,6 +8184,9 @@ class CoReturn { | ||
| 7854 | 8184 | * @throws Exception |
| 7855 | 8185 | */ |
| 7856 | 8186 | public static function from(stdClass $obj): CoReturn { |
| 8187 | + if (!property_exists($obj, 'co_return')) { | |
| 8188 | + throw new Exception("Missing required property"); | |
| 8189 | + } | |
| 7857 | 8190 | return new CoReturn( |
| 7858 | 8191 | CoReturn::fromCoReturn($obj->{'co_return'}) |
| 7859 | 8192 | ); |
| @@ -7952,6 +8285,9 @@ class CoYield { | ||
| 7952 | 8285 | * @throws Exception |
| 7953 | 8286 | */ |
| 7954 | 8287 | public static function from(stdClass $obj): CoYield { |
| 8288 | + if (!property_exists($obj, 'co_yield')) { | |
| 8289 | + throw new Exception("Missing required property"); | |
| 8290 | + } | |
| 7955 | 8291 | return new CoYield( |
| 7956 | 8292 | CoYield::fromCoYield($obj->{'co_yield'}) |
| 7957 | 8293 | ); |
| @@ -8050,6 +8386,9 @@ class Compl { | ||
| 8050 | 8386 | * @throws Exception |
| 8051 | 8387 | */ |
| 8052 | 8388 | public static function from(stdClass $obj): Compl { |
| 8389 | + if (!property_exists($obj, 'compl')) { | |
| 8390 | + throw new Exception("Missing required property"); | |
| 8391 | + } | |
| 8053 | 8392 | return new Compl( |
| 8054 | 8393 | Compl::fromCompl($obj->{'compl'}) |
| 8055 | 8394 | ); |
| @@ -8148,6 +8487,9 @@ class Complex { | ||
| 8148 | 8487 | * @throws Exception |
| 8149 | 8488 | */ |
| 8150 | 8489 | public static function from(stdClass $obj): Complex { |
| 8490 | + if (!property_exists($obj, '_Complex')) { | |
| 8491 | + throw new Exception("Missing required property"); | |
| 8492 | + } | |
| 8151 | 8493 | return new Complex( |
| 8152 | 8494 | Complex::fromComplex($obj->{'_Complex'}) |
| 8153 | 8495 | ); |
| @@ -8246,6 +8588,9 @@ class Concept { | ||
| 8246 | 8588 | * @throws Exception |
| 8247 | 8589 | */ |
| 8248 | 8590 | public static function from(stdClass $obj): Concept { |
| 8591 | + if (!property_exists($obj, 'concept')) { | |
| 8592 | + throw new Exception("Missing required property"); | |
| 8593 | + } | |
| 8249 | 8594 | return new Concept( |
| 8250 | 8595 | Concept::fromConcept($obj->{'concept'}) |
| 8251 | 8596 | ); |
| @@ -8344,6 +8689,9 @@ class Console { | ||
| 8344 | 8689 | * @throws Exception |
| 8345 | 8690 | */ |
| 8346 | 8691 | public static function from(stdClass $obj): Console { |
| 8692 | + if (!property_exists($obj, 'console')) { | |
| 8693 | + throw new Exception("Missing required property"); | |
| 8694 | + } | |
| 8347 | 8695 | return new Console( |
| 8348 | 8696 | Console::fromConsole($obj->{'console'}) |
| 8349 | 8697 | ); |
| @@ -8442,6 +8790,9 @@ class ConstClass { | ||
| 8442 | 8790 | * @throws Exception |
| 8443 | 8791 | */ |
| 8444 | 8792 | public static function from(stdClass $obj): ConstClass { |
| 8793 | + if (!property_exists($obj, 'const')) { | |
| 8794 | + throw new Exception("Missing required property"); | |
| 8795 | + } | |
| 8445 | 8796 | return new ConstClass( |
| 8446 | 8797 | ConstClass::fromConst($obj->{'const'}) |
| 8447 | 8798 | ); |
| @@ -8540,6 +8891,9 @@ class ConstCast { | ||
| 8540 | 8891 | * @throws Exception |
| 8541 | 8892 | */ |
| 8542 | 8893 | public static function from(stdClass $obj): ConstCast { |
| 8894 | + if (!property_exists($obj, 'const_cast')) { | |
| 8895 | + throw new Exception("Missing required property"); | |
| 8896 | + } | |
| 8543 | 8897 | return new ConstCast( |
| 8544 | 8898 | ConstCast::fromConstCast($obj->{'const_cast'}) |
| 8545 | 8899 | ); |
| @@ -8638,6 +8992,9 @@ class Constexpr { | ||
| 8638 | 8992 | * @throws Exception |
| 8639 | 8993 | */ |
| 8640 | 8994 | public static function from(stdClass $obj): Constexpr { |
| 8995 | + if (!property_exists($obj, 'constexpr')) { | |
| 8996 | + throw new Exception("Missing required property"); | |
| 8997 | + } | |
| 8641 | 8998 | return new Constexpr( |
| 8642 | 8999 | Constexpr::fromConstexpr($obj->{'constexpr'}) |
| 8643 | 9000 | ); |
| @@ -8736,6 +9093,9 @@ class Constructor { | ||
| 8736 | 9093 | * @throws Exception |
| 8737 | 9094 | */ |
| 8738 | 9095 | public static function from(stdClass $obj): Constructor { |
| 9096 | + if (!property_exists($obj, 'constructor')) { | |
| 9097 | + throw new Exception("Missing required property"); | |
| 9098 | + } | |
| 8739 | 9099 | return new Constructor( |
| 8740 | 9100 | Constructor::fromConstructor($obj->{'constructor'}) |
| 8741 | 9101 | ); |
| @@ -8834,6 +9194,9 @@ class ContinueClass { | ||
| 8834 | 9194 | * @throws Exception |
| 8835 | 9195 | */ |
| 8836 | 9196 | public static function from(stdClass $obj): ContinueClass { |
| 9197 | + if (!property_exists($obj, 'continue')) { | |
| 9198 | + throw new Exception("Missing required property"); | |
| 9199 | + } | |
| 8837 | 9200 | return new ContinueClass( |
| 8838 | 9201 | ContinueClass::fromContinue($obj->{'continue'}) |
| 8839 | 9202 | ); |
| @@ -8932,6 +9295,9 @@ class Convenience { | ||
| 8932 | 9295 | * @throws Exception |
| 8933 | 9296 | */ |
| 8934 | 9297 | public static function from(stdClass $obj): Convenience { |
| 9298 | + if (!property_exists($obj, 'convenience')) { | |
| 9299 | + throw new Exception("Missing required property"); | |
| 9300 | + } | |
| 8935 | 9301 | return new Convenience( |
| 8936 | 9302 | Convenience::fromConvenience($obj->{'convenience'}) |
| 8937 | 9303 | ); |
| @@ -9030,6 +9396,9 @@ class Convert { | ||
| 9030 | 9396 | * @throws Exception |
| 9031 | 9397 | */ |
| 9032 | 9398 | public static function from(stdClass $obj): Convert { |
| 9399 | + if (!property_exists($obj, 'convert')) { | |
| 9400 | + throw new Exception("Missing required property"); | |
| 9401 | + } | |
| 9033 | 9402 | return new Convert( |
| 9034 | 9403 | Convert::fromConvert($obj->{'convert'}) |
| 9035 | 9404 | ); |
| @@ -9128,6 +9497,9 @@ class ConverterClass { | ||
| 9128 | 9497 | * @throws Exception |
| 9129 | 9498 | */ |
| 9130 | 9499 | public static function from(stdClass $obj): ConverterClass { |
| 9500 | + if (!property_exists($obj, 'converter')) { | |
| 9501 | + throw new Exception("Missing required property"); | |
| 9502 | + } | |
| 9131 | 9503 | return new ConverterClass( |
| 9132 | 9504 | ConverterClass::fromConverter($obj->{'converter'}) |
| 9133 | 9505 | ); |
| @@ -9226,6 +9598,9 @@ class Date { | ||
| 9226 | 9598 | * @throws Exception |
| 9227 | 9599 | */ |
| 9228 | 9600 | public static function from(stdClass $obj): Date { |
| 9601 | + if (!property_exists($obj, 'date')) { | |
| 9602 | + throw new Exception("Missing required property"); | |
| 9603 | + } | |
| 9229 | 9604 | return new Date( |
| 9230 | 9605 | Date::fromDate($obj->{'date'}) |
| 9231 | 9606 | ); |
| @@ -9324,6 +9699,9 @@ class DateParseHandling { | ||
| 9324 | 9699 | * @throws Exception |
| 9325 | 9700 | */ |
| 9326 | 9701 | public static function from(stdClass $obj): DateParseHandling { |
| 9702 | + if (!property_exists($obj, 'date_parse_handling')) { | |
| 9703 | + throw new Exception("Missing required property"); | |
| 9704 | + } | |
| 9327 | 9705 | return new DateParseHandling( |
| 9328 | 9706 | DateParseHandling::fromDateParseHandling($obj->{'date_parse_handling'}) |
| 9329 | 9707 | ); |
| @@ -9422,6 +9800,9 @@ class Debugger { | ||
| 9422 | 9800 | * @throws Exception |
| 9423 | 9801 | */ |
| 9424 | 9802 | public static function from(stdClass $obj): Debugger { |
| 9803 | + if (!property_exists($obj, 'debugger')) { | |
| 9804 | + throw new Exception("Missing required property"); | |
| 9805 | + } | |
| 9425 | 9806 | return new Debugger( |
| 9426 | 9807 | Debugger::fromDebugger($obj->{'debugger'}) |
| 9427 | 9808 | ); |
| @@ -9520,6 +9901,9 @@ class Decimal { | ||
| 9520 | 9901 | * @throws Exception |
| 9521 | 9902 | */ |
| 9522 | 9903 | public static function from(stdClass $obj): Decimal { |
| 9904 | + if (!property_exists($obj, 'decimal')) { | |
| 9905 | + throw new Exception("Missing required property"); | |
| 9906 | + } | |
| 9523 | 9907 | return new Decimal( |
| 9524 | 9908 | Decimal::fromDecimal($obj->{'decimal'}) |
| 9525 | 9909 | ); |
| @@ -9618,6 +10002,9 @@ class DeclareClass { | ||
| 9618 | 10002 | * @throws Exception |
| 9619 | 10003 | */ |
| 9620 | 10004 | public static function from(stdClass $obj): DeclareClass { |
| 10005 | + if (!property_exists($obj, 'declare')) { | |
| 10006 | + throw new Exception("Missing required property"); | |
| 10007 | + } | |
| 9621 | 10008 | return new DeclareClass( |
| 9622 | 10009 | DeclareClass::fromDeclare($obj->{'declare'}) |
| 9623 | 10010 | ); |
| @@ -9716,6 +10103,9 @@ class Decltype { | ||
| 9716 | 10103 | * @throws Exception |
| 9717 | 10104 | */ |
| 9718 | 10105 | public static function from(stdClass $obj): Decltype { |
| 10106 | + if (!property_exists($obj, 'decltype')) { | |
| 10107 | + throw new Exception("Missing required property"); | |
| 10108 | + } | |
| 9719 | 10109 | return new Decltype( |
| 9720 | 10110 | Decltype::fromDecltype($obj->{'decltype'}) |
| 9721 | 10111 | ); |
| @@ -9814,6 +10204,9 @@ class DecodeString { | ||
| 9814 | 10204 | * @throws Exception |
| 9815 | 10205 | */ |
| 9816 | 10206 | public static function from(stdClass $obj): DecodeString { |
| 10207 | + if (!property_exists($obj, 'decode_string')) { | |
| 10208 | + throw new Exception("Missing required property"); | |
| 10209 | + } | |
| 9817 | 10210 | return new DecodeString( |
| 9818 | 10211 | DecodeString::fromDecodeString($obj->{'decode_string'}) |
| 9819 | 10212 | ); |
| @@ -9912,6 +10305,9 @@ class Purple { | ||
| 9912 | 10305 | * @throws Exception |
| 9913 | 10306 | */ |
| 9914 | 10307 | public static function from(stdClass $obj): Purple { |
| 10308 | + if (!property_exists($obj, '_')) { | |
| 10309 | + throw new Exception("Missing required property"); | |
| 10310 | + } | |
| 9915 | 10311 | return new Purple( |
| 9916 | 10312 | Purple::fromEmpty($obj->{'_'}) |
| 9917 | 10313 | ); |
| @@ -10010,6 +10406,9 @@ class Imaginery { | ||
| 10010 | 10406 | * @throws Exception |
| 10011 | 10407 | */ |
| 10012 | 10408 | public static function from(stdClass $obj): Imaginery { |
| 10409 | + if (!property_exists($obj, '_Imaginery')) { | |
| 10410 | + throw new Exception("Missing required property"); | |
| 10411 | + } | |
| 10013 | 10412 | return new Imaginery( |
| 10014 | 10413 | Imaginery::fromImaginery($obj->{'_Imaginery'}) |
| 10015 | 10414 | ); |
| @@ -10108,6 +10507,9 @@ class AnyClass { | ||
| 10108 | 10507 | * @throws Exception |
| 10109 | 10508 | */ |
| 10110 | 10509 | public static function from(stdClass $obj): AnyClass { |
| 10510 | + if (!property_exists($obj, 'any')) { | |
| 10511 | + throw new Exception("Missing required property"); | |
| 10512 | + } | |
| 10111 | 10513 | return new AnyClass( |
| 10112 | 10514 | AnyClass::fromAny($obj->{'any'}) |
| 10113 | 10515 | ); |
| @@ -10206,6 +10608,9 @@ class Obj1Bool { | ||
| 10206 | 10608 | * @throws Exception |
| 10207 | 10609 | */ |
| 10208 | 10610 | public static function from(stdClass $obj): Obj1Bool { |
| 10611 | + if (!property_exists($obj, '_Bool')) { | |
| 10612 | + throw new Exception("Missing required property"); | |
| 10613 | + } | |
| 10209 | 10614 | return new Obj1Bool( |
| 10210 | 10615 | Obj1Bool::fromBool($obj->{'_Bool'}) |
| 10211 | 10616 | ); |
| @@ -10304,6 +10709,9 @@ class Obj1Class { | ||
| 10304 | 10709 | * @throws Exception |
| 10305 | 10710 | */ |
| 10306 | 10711 | public static function from(stdClass $obj): Obj1Class { |
| 10712 | + if (!property_exists($obj, 'class')) { | |
| 10713 | + throw new Exception("Missing required property"); | |
| 10714 | + } | |
| 10307 | 10715 | return new Obj1Class( |
| 10308 | 10716 | Obj1Class::fromClass($obj->{'class'}) |
| 10309 | 10717 | ); |
| @@ -10402,6 +10810,9 @@ class Obj1BoolClass { | ||
| 10402 | 10810 | * @throws Exception |
| 10403 | 10811 | */ |
| 10404 | 10812 | public static function from(stdClass $obj): Obj1BoolClass { |
| 10813 | + if (!property_exists($obj, 'bool')) { | |
| 10814 | + throw new Exception("Missing required property"); | |
| 10815 | + } | |
| 10405 | 10816 | return new Obj1BoolClass( |
| 10406 | 10817 | Obj1BoolClass::fromBool($obj->{'bool'}) |
| 10407 | 10818 | ); |
| @@ -13945,6 +14356,204 @@ class Obj2 { | ||
| 13945 | 14356 | * @throws Exception |
| 13946 | 14357 | */ |
| 13947 | 14358 | public static function from(stdClass $obj): Obj2 { |
| 14359 | + if (!property_exists($obj, 'def')) { | |
| 14360 | + throw new Exception("Missing required property"); | |
| 14361 | + } | |
| 14362 | + if (!property_exists($obj, 'default')) { | |
| 14363 | + throw new Exception("Missing required property"); | |
| 14364 | + } | |
| 14365 | + if (!property_exists($obj, 'defer')) { | |
| 14366 | + throw new Exception("Missing required property"); | |
| 14367 | + } | |
| 14368 | + if (!property_exists($obj, 'deinit')) { | |
| 14369 | + throw new Exception("Missing required property"); | |
| 14370 | + } | |
| 14371 | + if (!property_exists($obj, 'del')) { | |
| 14372 | + throw new Exception("Missing required property"); | |
| 14373 | + } | |
| 14374 | + if (!property_exists($obj, 'delegate')) { | |
| 14375 | + throw new Exception("Missing required property"); | |
| 14376 | + } | |
| 14377 | + if (!property_exists($obj, 'delete')) { | |
| 14378 | + throw new Exception("Missing required property"); | |
| 14379 | + } | |
| 14380 | + if (!property_exists($obj, 'dict')) { | |
| 14381 | + throw new Exception("Missing required property"); | |
| 14382 | + } | |
| 14383 | + if (!property_exists($obj, 'dictionary')) { | |
| 14384 | + throw new Exception("Missing required property"); | |
| 14385 | + } | |
| 14386 | + if (!property_exists($obj, 'didSet')) { | |
| 14387 | + throw new Exception("Missing required property"); | |
| 14388 | + } | |
| 14389 | + if (!property_exists($obj, 'do')) { | |
| 14390 | + throw new Exception("Missing required property"); | |
| 14391 | + } | |
| 14392 | + if (!property_exists($obj, 'double')) { | |
| 14393 | + throw new Exception("Missing required property"); | |
| 14394 | + } | |
| 14395 | + if (!property_exists($obj, 'dummy')) { | |
| 14396 | + throw new Exception("Missing required property"); | |
| 14397 | + } | |
| 14398 | + if (!property_exists($obj, 'dynamic')) { | |
| 14399 | + throw new Exception("Missing required property"); | |
| 14400 | + } | |
| 14401 | + if (!property_exists($obj, 'dynamic_cast')) { | |
| 14402 | + throw new Exception("Missing required property"); | |
| 14403 | + } | |
| 14404 | + if (!property_exists($obj, 'elif')) { | |
| 14405 | + throw new Exception("Missing required property"); | |
| 14406 | + } | |
| 14407 | + if (!property_exists($obj, 'else')) { | |
| 14408 | + throw new Exception("Missing required property"); | |
| 14409 | + } | |
| 14410 | + if (!property_exists($obj, 'encode_quick_type')) { | |
| 14411 | + throw new Exception("Missing required property"); | |
| 14412 | + } | |
| 14413 | + if (!property_exists($obj, 'enum')) { | |
| 14414 | + throw new Exception("Missing required property"); | |
| 14415 | + } | |
| 14416 | + if (!property_exists($obj, 'equalityContract')) { | |
| 14417 | + throw new Exception("Missing required property"); | |
| 14418 | + } | |
| 14419 | + if (!property_exists($obj, 'event')) { | |
| 14420 | + throw new Exception("Missing required property"); | |
| 14421 | + } | |
| 14422 | + if (!property_exists($obj, 'except')) { | |
| 14423 | + throw new Exception("Missing required property"); | |
| 14424 | + } | |
| 14425 | + if (!property_exists($obj, 'exception')) { | |
| 14426 | + throw new Exception("Missing required property"); | |
| 14427 | + } | |
| 14428 | + if (!property_exists($obj, 'explicit')) { | |
| 14429 | + throw new Exception("Missing required property"); | |
| 14430 | + } | |
| 14431 | + if (!property_exists($obj, 'export')) { | |
| 14432 | + throw new Exception("Missing required property"); | |
| 14433 | + } | |
| 14434 | + if (!property_exists($obj, 'exposing')) { | |
| 14435 | + throw new Exception("Missing required property"); | |
| 14436 | + } | |
| 14437 | + if (!property_exists($obj, 'extends')) { | |
| 14438 | + throw new Exception("Missing required property"); | |
| 14439 | + } | |
| 14440 | + if (!property_exists($obj, 'extension')) { | |
| 14441 | + throw new Exception("Missing required property"); | |
| 14442 | + } | |
| 14443 | + if (!property_exists($obj, 'extern')) { | |
| 14444 | + throw new Exception("Missing required property"); | |
| 14445 | + } | |
| 14446 | + if (!property_exists($obj, 'fallthrough')) { | |
| 14447 | + throw new Exception("Missing required property"); | |
| 14448 | + } | |
| 14449 | + if (!property_exists($obj, 'False')) { | |
| 14450 | + throw new Exception("Missing required property"); | |
| 14451 | + } | |
| 14452 | + if (!property_exists($obj, 'fileprivate')) { | |
| 14453 | + throw new Exception("Missing required property"); | |
| 14454 | + } | |
| 14455 | + if (!property_exists($obj, 'final')) { | |
| 14456 | + throw new Exception("Missing required property"); | |
| 14457 | + } | |
| 14458 | + if (!property_exists($obj, 'finally')) { | |
| 14459 | + throw new Exception("Missing required property"); | |
| 14460 | + } | |
| 14461 | + if (!property_exists($obj, 'fixed')) { | |
| 14462 | + throw new Exception("Missing required property"); | |
| 14463 | + } | |
| 14464 | + if (!property_exists($obj, 'float')) { | |
| 14465 | + throw new Exception("Missing required property"); | |
| 14466 | + } | |
| 14467 | + if (!property_exists($obj, 'for')) { | |
| 14468 | + throw new Exception("Missing required property"); | |
| 14469 | + } | |
| 14470 | + if (!property_exists($obj, 'foreach')) { | |
| 14471 | + throw new Exception("Missing required property"); | |
| 14472 | + } | |
| 14473 | + if (!property_exists($obj, 'friend')) { | |
| 14474 | + throw new Exception("Missing required property"); | |
| 14475 | + } | |
| 14476 | + if (!property_exists($obj, 'from')) { | |
| 14477 | + throw new Exception("Missing required property"); | |
| 14478 | + } | |
| 14479 | + if (!property_exists($obj, 'from_json')) { | |
| 14480 | + throw new Exception("Missing required property"); | |
| 14481 | + } | |
| 14482 | + if (!property_exists($obj, 'func')) { | |
| 14483 | + throw new Exception("Missing required property"); | |
| 14484 | + } | |
| 14485 | + if (!property_exists($obj, 'function')) { | |
| 14486 | + throw new Exception("Missing required property"); | |
| 14487 | + } | |
| 14488 | + if (!property_exists($obj, 'get')) { | |
| 14489 | + throw new Exception("Missing required property"); | |
| 14490 | + } | |
| 14491 | + if (!property_exists($obj, 'global')) { | |
| 14492 | + throw new Exception("Missing required property"); | |
| 14493 | + } | |
| 14494 | + if (!property_exists($obj, 'go')) { | |
| 14495 | + throw new Exception("Missing required property"); | |
| 14496 | + } | |
| 14497 | + if (!property_exists($obj, 'goto')) { | |
| 14498 | + throw new Exception("Missing required property"); | |
| 14499 | + } | |
| 14500 | + if (!property_exists($obj, 'guard')) { | |
| 14501 | + throw new Exception("Missing required property"); | |
| 14502 | + } | |
| 14503 | + if (!property_exists($obj, 'hasOwnProperty')) { | |
| 14504 | + throw new Exception("Missing required property"); | |
| 14505 | + } | |
| 14506 | + if (!property_exists($obj, 'id')) { | |
| 14507 | + throw new Exception("Missing required property"); | |
| 14508 | + } | |
| 14509 | + if (!property_exists($obj, 'if')) { | |
| 14510 | + throw new Exception("Missing required property"); | |
| 14511 | + } | |
| 14512 | + if (!property_exists($obj, 'IMP')) { | |
| 14513 | + throw new Exception("Missing required property"); | |
| 14514 | + } | |
| 14515 | + if (!property_exists($obj, 'implements')) { | |
| 14516 | + throw new Exception("Missing required property"); | |
| 14517 | + } | |
| 14518 | + if (!property_exists($obj, 'implicit')) { | |
| 14519 | + throw new Exception("Missing required property"); | |
| 14520 | + } | |
| 14521 | + if (!property_exists($obj, 'import')) { | |
| 14522 | + throw new Exception("Missing required property"); | |
| 14523 | + } | |
| 14524 | + if (!property_exists($obj, 'in')) { | |
| 14525 | + throw new Exception("Missing required property"); | |
| 14526 | + } | |
| 14527 | + if (!property_exists($obj, 'indirect')) { | |
| 14528 | + throw new Exception("Missing required property"); | |
| 14529 | + } | |
| 14530 | + if (!property_exists($obj, 'infix')) { | |
| 14531 | + throw new Exception("Missing required property"); | |
| 14532 | + } | |
| 14533 | + if (!property_exists($obj, 'init')) { | |
| 14534 | + throw new Exception("Missing required property"); | |
| 14535 | + } | |
| 14536 | + if (!property_exists($obj, 'inline')) { | |
| 14537 | + throw new Exception("Missing required property"); | |
| 14538 | + } | |
| 14539 | + if (!property_exists($obj, 'inout')) { | |
| 14540 | + throw new Exception("Missing required property"); | |
| 14541 | + } | |
| 14542 | + if (!property_exists($obj, 'instanceof')) { | |
| 14543 | + throw new Exception("Missing required property"); | |
| 14544 | + } | |
| 14545 | + if (!property_exists($obj, 'int')) { | |
| 14546 | + throw new Exception("Missing required property"); | |
| 14547 | + } | |
| 14548 | + if (!property_exists($obj, 'interface')) { | |
| 14549 | + throw new Exception("Missing required property"); | |
| 14550 | + } | |
| 14551 | + if (!property_exists($obj, 'internal')) { | |
| 14552 | + throw new Exception("Missing required property"); | |
| 14553 | + } | |
| 14554 | + if (!property_exists($obj, 'false')) { | |
| 14555 | + throw new Exception("Missing required property"); | |
| 14556 | + } | |
| 13948 | 14557 | return new Obj2( |
| 13949 | 14558 | Obj2::fromDef($obj->{'def'}) |
| 13950 | 14559 | ,Obj2::fromDefault($obj->{'default'}) |
| @@ -14173,6 +14782,9 @@ class Def { | ||
| 14173 | 14782 | * @throws Exception |
| 14174 | 14783 | */ |
| 14175 | 14784 | public static function from(stdClass $obj): Def { |
| 14785 | + if (!property_exists($obj, 'def')) { | |
| 14786 | + throw new Exception("Missing required property"); | |
| 14787 | + } | |
| 14176 | 14788 | return new Def( |
| 14177 | 14789 | Def::fromDef($obj->{'def'}) |
| 14178 | 14790 | ); |
| @@ -14271,6 +14883,9 @@ class DefaultClass { | ||
| 14271 | 14883 | * @throws Exception |
| 14272 | 14884 | */ |
| 14273 | 14885 | public static function from(stdClass $obj): DefaultClass { |
| 14886 | + if (!property_exists($obj, 'default')) { | |
| 14887 | + throw new Exception("Missing required property"); | |
| 14888 | + } | |
| 14274 | 14889 | return new DefaultClass( |
| 14275 | 14890 | DefaultClass::fromDefault($obj->{'default'}) |
| 14276 | 14891 | ); |
| @@ -14369,6 +14984,9 @@ class Defer { | ||
| 14369 | 14984 | * @throws Exception |
| 14370 | 14985 | */ |
| 14371 | 14986 | public static function from(stdClass $obj): Defer { |
| 14987 | + if (!property_exists($obj, 'defer')) { | |
| 14988 | + throw new Exception("Missing required property"); | |
| 14989 | + } | |
| 14372 | 14990 | return new Defer( |
| 14373 | 14991 | Defer::fromDefer($obj->{'defer'}) |
| 14374 | 14992 | ); |
| @@ -14467,6 +15085,9 @@ class Deinit { | ||
| 14467 | 15085 | * @throws Exception |
| 14468 | 15086 | */ |
| 14469 | 15087 | public static function from(stdClass $obj): Deinit { |
| 15088 | + if (!property_exists($obj, 'deinit')) { | |
| 15089 | + throw new Exception("Missing required property"); | |
| 15090 | + } | |
| 14470 | 15091 | return new Deinit( |
| 14471 | 15092 | Deinit::fromDeinit($obj->{'deinit'}) |
| 14472 | 15093 | ); |
| @@ -14565,6 +15186,9 @@ class Del { | ||
| 14565 | 15186 | * @throws Exception |
| 14566 | 15187 | */ |
| 14567 | 15188 | public static function from(stdClass $obj): Del { |
| 15189 | + if (!property_exists($obj, 'del')) { | |
| 15190 | + throw new Exception("Missing required property"); | |
| 15191 | + } | |
| 14568 | 15192 | return new Del( |
| 14569 | 15193 | Del::fromDel($obj->{'del'}) |
| 14570 | 15194 | ); |
| @@ -14663,6 +15287,9 @@ class Delegate { | ||
| 14663 | 15287 | * @throws Exception |
| 14664 | 15288 | */ |
| 14665 | 15289 | public static function from(stdClass $obj): Delegate { |
| 15290 | + if (!property_exists($obj, 'delegate')) { | |
| 15291 | + throw new Exception("Missing required property"); | |
| 15292 | + } | |
| 14666 | 15293 | return new Delegate( |
| 14667 | 15294 | Delegate::fromDelegate($obj->{'delegate'}) |
| 14668 | 15295 | ); |
| @@ -14761,6 +15388,9 @@ class Delete { | ||
| 14761 | 15388 | * @throws Exception |
| 14762 | 15389 | */ |
| 14763 | 15390 | public static function from(stdClass $obj): Delete { |
| 15391 | + if (!property_exists($obj, 'delete')) { | |
| 15392 | + throw new Exception("Missing required property"); | |
| 15393 | + } | |
| 14764 | 15394 | return new Delete( |
| 14765 | 15395 | Delete::fromDelete($obj->{'delete'}) |
| 14766 | 15396 | ); |
| @@ -14859,6 +15489,9 @@ class Dict { | ||
| 14859 | 15489 | * @throws Exception |
| 14860 | 15490 | */ |
| 14861 | 15491 | public static function from(stdClass $obj): Dict { |
| 15492 | + if (!property_exists($obj, 'dict')) { | |
| 15493 | + throw new Exception("Missing required property"); | |
| 15494 | + } | |
| 14862 | 15495 | return new Dict( |
| 14863 | 15496 | Dict::fromDict($obj->{'dict'}) |
| 14864 | 15497 | ); |
| @@ -14957,6 +15590,9 @@ class Dictionary { | ||
| 14957 | 15590 | * @throws Exception |
| 14958 | 15591 | */ |
| 14959 | 15592 | public static function from(stdClass $obj): Dictionary { |
| 15593 | + if (!property_exists($obj, 'dictionary')) { | |
| 15594 | + throw new Exception("Missing required property"); | |
| 15595 | + } | |
| 14960 | 15596 | return new Dictionary( |
| 14961 | 15597 | Dictionary::fromDictionary($obj->{'dictionary'}) |
| 14962 | 15598 | ); |
| @@ -15055,6 +15691,9 @@ class DidSet { | ||
| 15055 | 15691 | * @throws Exception |
| 15056 | 15692 | */ |
| 15057 | 15693 | public static function from(stdClass $obj): DidSet { |
| 15694 | + if (!property_exists($obj, 'didSet')) { | |
| 15695 | + throw new Exception("Missing required property"); | |
| 15696 | + } | |
| 15058 | 15697 | return new DidSet( |
| 15059 | 15698 | DidSet::fromDidSet($obj->{'didSet'}) |
| 15060 | 15699 | ); |
| @@ -15153,6 +15792,9 @@ class DoClass { | ||
| 15153 | 15792 | * @throws Exception |
| 15154 | 15793 | */ |
| 15155 | 15794 | public static function from(stdClass $obj): DoClass { |
| 15795 | + if (!property_exists($obj, 'do')) { | |
| 15796 | + throw new Exception("Missing required property"); | |
| 15797 | + } | |
| 15156 | 15798 | return new DoClass( |
| 15157 | 15799 | DoClass::fromDo($obj->{'do'}) |
| 15158 | 15800 | ); |
| @@ -15251,6 +15893,9 @@ class Double { | ||
| 15251 | 15893 | * @throws Exception |
| 15252 | 15894 | */ |
| 15253 | 15895 | public static function from(stdClass $obj): Double { |
| 15896 | + if (!property_exists($obj, 'double')) { | |
| 15897 | + throw new Exception("Missing required property"); | |
| 15898 | + } | |
| 15254 | 15899 | return new Double( |
| 15255 | 15900 | Double::fromDouble($obj->{'double'}) |
| 15256 | 15901 | ); |
| @@ -15349,6 +15994,9 @@ class Dynamic { | ||
| 15349 | 15994 | * @throws Exception |
| 15350 | 15995 | */ |
| 15351 | 15996 | public static function from(stdClass $obj): Dynamic { |
| 15997 | + if (!property_exists($obj, 'dynamic')) { | |
| 15998 | + throw new Exception("Missing required property"); | |
| 15999 | + } | |
| 15352 | 16000 | return new Dynamic( |
| 15353 | 16001 | Dynamic::fromDynamic($obj->{'dynamic'}) |
| 15354 | 16002 | ); |
| @@ -15447,6 +16095,9 @@ class DynamicCast { | ||
| 15447 | 16095 | * @throws Exception |
| 15448 | 16096 | */ |
| 15449 | 16097 | public static function from(stdClass $obj): DynamicCast { |
| 16098 | + if (!property_exists($obj, 'dynamic_cast')) { | |
| 16099 | + throw new Exception("Missing required property"); | |
| 16100 | + } | |
| 15450 | 16101 | return new DynamicCast( |
| 15451 | 16102 | DynamicCast::fromDynamicCast($obj->{'dynamic_cast'}) |
| 15452 | 16103 | ); |
| @@ -15545,6 +16196,9 @@ class Elif { | ||
| 15545 | 16196 | * @throws Exception |
| 15546 | 16197 | */ |
| 15547 | 16198 | public static function from(stdClass $obj): Elif { |
| 16199 | + if (!property_exists($obj, 'elif')) { | |
| 16200 | + throw new Exception("Missing required property"); | |
| 16201 | + } | |
| 15548 | 16202 | return new Elif( |
| 15549 | 16203 | Elif::fromElif($obj->{'elif'}) |
| 15550 | 16204 | ); |
| @@ -15643,6 +16297,9 @@ class ElseClass { | ||
| 15643 | 16297 | * @throws Exception |
| 15644 | 16298 | */ |
| 15645 | 16299 | public static function from(stdClass $obj): ElseClass { |
| 16300 | + if (!property_exists($obj, 'else')) { | |
| 16301 | + throw new Exception("Missing required property"); | |
| 16302 | + } | |
| 15646 | 16303 | return new ElseClass( |
| 15647 | 16304 | ElseClass::fromElse($obj->{'else'}) |
| 15648 | 16305 | ); |
| @@ -15741,6 +16398,9 @@ class EncodeQuickType { | ||
| 15741 | 16398 | * @throws Exception |
| 15742 | 16399 | */ |
| 15743 | 16400 | public static function from(stdClass $obj): EncodeQuickType { |
| 16401 | + if (!property_exists($obj, 'encode_quick_type')) { | |
| 16402 | + throw new Exception("Missing required property"); | |
| 16403 | + } | |
| 15744 | 16404 | return new EncodeQuickType( |
| 15745 | 16405 | EncodeQuickType::fromEncodeQuickType($obj->{'encode_quick_type'}) |
| 15746 | 16406 | ); |
| @@ -15839,6 +16499,9 @@ class EnumClass { | ||
| 15839 | 16499 | * @throws Exception |
| 15840 | 16500 | */ |
| 15841 | 16501 | public static function from(stdClass $obj): EnumClass { |
| 16502 | + if (!property_exists($obj, 'enum')) { | |
| 16503 | + throw new Exception("Missing required property"); | |
| 16504 | + } | |
| 15842 | 16505 | return new EnumClass( |
| 15843 | 16506 | EnumClass::fromEnum($obj->{'enum'}) |
| 15844 | 16507 | ); |
| @@ -15937,6 +16600,9 @@ class EqualityContract { | ||
| 15937 | 16600 | * @throws Exception |
| 15938 | 16601 | */ |
| 15939 | 16602 | public static function from(stdClass $obj): EqualityContract { |
| 16603 | + if (!property_exists($obj, 'equalityContract')) { | |
| 16604 | + throw new Exception("Missing required property"); | |
| 16605 | + } | |
| 15940 | 16606 | return new EqualityContract( |
| 15941 | 16607 | EqualityContract::fromEqualityContract($obj->{'equalityContract'}) |
| 15942 | 16608 | ); |
| @@ -16035,6 +16701,9 @@ class Event { | ||
| 16035 | 16701 | * @throws Exception |
| 16036 | 16702 | */ |
| 16037 | 16703 | public static function from(stdClass $obj): Event { |
| 16704 | + if (!property_exists($obj, 'event')) { | |
| 16705 | + throw new Exception("Missing required property"); | |
| 16706 | + } | |
| 16038 | 16707 | return new Event( |
| 16039 | 16708 | Event::fromEvent($obj->{'event'}) |
| 16040 | 16709 | ); |
| @@ -16133,6 +16802,9 @@ class Except { | ||
| 16133 | 16802 | * @throws Exception |
| 16134 | 16803 | */ |
| 16135 | 16804 | public static function from(stdClass $obj): Except { |
| 16805 | + if (!property_exists($obj, 'except')) { | |
| 16806 | + throw new Exception("Missing required property"); | |
| 16807 | + } | |
| 16136 | 16808 | return new Except( |
| 16137 | 16809 | Except::fromExcept($obj->{'except'}) |
| 16138 | 16810 | ); |
| @@ -16231,6 +16903,9 @@ class ExceptionClass { | ||
| 16231 | 16903 | * @throws Exception |
| 16232 | 16904 | */ |
| 16233 | 16905 | public static function from(stdClass $obj): ExceptionClass { |
| 16906 | + if (!property_exists($obj, 'exception')) { | |
| 16907 | + throw new Exception("Missing required property"); | |
| 16908 | + } | |
| 16234 | 16909 | return new ExceptionClass( |
| 16235 | 16910 | ExceptionClass::fromException($obj->{'exception'}) |
| 16236 | 16911 | ); |
| @@ -16329,6 +17004,9 @@ class Explicit { | ||
| 16329 | 17004 | * @throws Exception |
| 16330 | 17005 | */ |
| 16331 | 17006 | public static function from(stdClass $obj): Explicit { |
| 17007 | + if (!property_exists($obj, 'explicit')) { | |
| 17008 | + throw new Exception("Missing required property"); | |
| 17009 | + } | |
| 16332 | 17010 | return new Explicit( |
| 16333 | 17011 | Explicit::fromExplicit($obj->{'explicit'}) |
| 16334 | 17012 | ); |
| @@ -16427,6 +17105,9 @@ class Export { | ||
| 16427 | 17105 | * @throws Exception |
| 16428 | 17106 | */ |
| 16429 | 17107 | public static function from(stdClass $obj): Export { |
| 17108 | + if (!property_exists($obj, 'export')) { | |
| 17109 | + throw new Exception("Missing required property"); | |
| 17110 | + } | |
| 16430 | 17111 | return new Export( |
| 16431 | 17112 | Export::fromExport($obj->{'export'}) |
| 16432 | 17113 | ); |
| @@ -16525,6 +17206,9 @@ class Exposing { | ||
| 16525 | 17206 | * @throws Exception |
| 16526 | 17207 | */ |
| 16527 | 17208 | public static function from(stdClass $obj): Exposing { |
| 17209 | + if (!property_exists($obj, 'exposing')) { | |
| 17210 | + throw new Exception("Missing required property"); | |
| 17211 | + } | |
| 16528 | 17212 | return new Exposing( |
| 16529 | 17213 | Exposing::fromExposing($obj->{'exposing'}) |
| 16530 | 17214 | ); |
| @@ -16623,6 +17307,9 @@ class ExtendsClass { | ||
| 16623 | 17307 | * @throws Exception |
| 16624 | 17308 | */ |
| 16625 | 17309 | public static function from(stdClass $obj): ExtendsClass { |
| 17310 | + if (!property_exists($obj, 'extends')) { | |
| 17311 | + throw new Exception("Missing required property"); | |
| 17312 | + } | |
| 16626 | 17313 | return new ExtendsClass( |
| 16627 | 17314 | ExtendsClass::fromExtends($obj->{'extends'}) |
| 16628 | 17315 | ); |
| @@ -16721,6 +17408,9 @@ class Extension { | ||
| 16721 | 17408 | * @throws Exception |
| 16722 | 17409 | */ |
| 16723 | 17410 | public static function from(stdClass $obj): Extension { |
| 17411 | + if (!property_exists($obj, 'extension')) { | |
| 17412 | + throw new Exception("Missing required property"); | |
| 17413 | + } | |
| 16724 | 17414 | return new Extension( |
| 16725 | 17415 | Extension::fromExtension($obj->{'extension'}) |
| 16726 | 17416 | ); |
| @@ -16819,6 +17509,9 @@ class Extern { | ||
| 16819 | 17509 | * @throws Exception |
| 16820 | 17510 | */ |
| 16821 | 17511 | public static function from(stdClass $obj): Extern { |
| 17512 | + if (!property_exists($obj, 'extern')) { | |
| 17513 | + throw new Exception("Missing required property"); | |
| 17514 | + } | |
| 16822 | 17515 | return new Extern( |
| 16823 | 17516 | Extern::fromExtern($obj->{'extern'}) |
| 16824 | 17517 | ); |
| @@ -16917,6 +17610,9 @@ class Fallthrough { | ||
| 16917 | 17610 | * @throws Exception |
| 16918 | 17611 | */ |
| 16919 | 17612 | public static function from(stdClass $obj): Fallthrough { |
| 17613 | + if (!property_exists($obj, 'fallthrough')) { | |
| 17614 | + throw new Exception("Missing required property"); | |
| 17615 | + } | |
| 16920 | 17616 | return new Fallthrough( |
| 16921 | 17617 | Fallthrough::fromFallthrough($obj->{'fallthrough'}) |
| 16922 | 17618 | ); |
| @@ -17015,6 +17711,9 @@ class FalseClass { | ||
| 17015 | 17711 | * @throws Exception |
| 17016 | 17712 | */ |
| 17017 | 17713 | public static function from(stdClass $obj): FalseClass { |
| 17714 | + if (!property_exists($obj, 'False')) { | |
| 17715 | + throw new Exception("Missing required property"); | |
| 17716 | + } | |
| 17018 | 17717 | return new FalseClass( |
| 17019 | 17718 | FalseClass::fromFalse($obj->{'False'}) |
| 17020 | 17719 | ); |
| @@ -17113,6 +17812,9 @@ class Fileprivate { | ||
| 17113 | 17812 | * @throws Exception |
| 17114 | 17813 | */ |
| 17115 | 17814 | public static function from(stdClass $obj): Fileprivate { |
| 17815 | + if (!property_exists($obj, 'fileprivate')) { | |
| 17816 | + throw new Exception("Missing required property"); | |
| 17817 | + } | |
| 17116 | 17818 | return new Fileprivate( |
| 17117 | 17819 | Fileprivate::fromFileprivate($obj->{'fileprivate'}) |
| 17118 | 17820 | ); |
| @@ -17211,6 +17913,9 @@ class FinalClass { | ||
| 17211 | 17913 | * @throws Exception |
| 17212 | 17914 | */ |
| 17213 | 17915 | public static function from(stdClass $obj): FinalClass { |
| 17916 | + if (!property_exists($obj, 'final')) { | |
| 17917 | + throw new Exception("Missing required property"); | |
| 17918 | + } | |
| 17214 | 17919 | return new FinalClass( |
| 17215 | 17920 | FinalClass::fromFinal($obj->{'final'}) |
| 17216 | 17921 | ); |
| @@ -17309,6 +18014,9 @@ class FinallyClass { | ||
| 17309 | 18014 | * @throws Exception |
| 17310 | 18015 | */ |
| 17311 | 18016 | public static function from(stdClass $obj): FinallyClass { |
| 18017 | + if (!property_exists($obj, 'finally')) { | |
| 18018 | + throw new Exception("Missing required property"); | |
| 18019 | + } | |
| 17312 | 18020 | return new FinallyClass( |
| 17313 | 18021 | FinallyClass::fromFinally($obj->{'finally'}) |
| 17314 | 18022 | ); |
| @@ -17407,6 +18115,9 @@ class Fixed { | ||
| 17407 | 18115 | * @throws Exception |
| 17408 | 18116 | */ |
| 17409 | 18117 | public static function from(stdClass $obj): Fixed { |
| 18118 | + if (!property_exists($obj, 'fixed')) { | |
| 18119 | + throw new Exception("Missing required property"); | |
| 18120 | + } | |
| 17410 | 18121 | return new Fixed( |
| 17411 | 18122 | Fixed::fromFixed($obj->{'fixed'}) |
| 17412 | 18123 | ); |
| @@ -17505,6 +18216,9 @@ class FloatClass { | ||
| 17505 | 18216 | * @throws Exception |
| 17506 | 18217 | */ |
| 17507 | 18218 | public static function from(stdClass $obj): FloatClass { |
| 18219 | + if (!property_exists($obj, 'float')) { | |
| 18220 | + throw new Exception("Missing required property"); | |
| 18221 | + } | |
| 17508 | 18222 | return new FloatClass( |
| 17509 | 18223 | FloatClass::fromFloat($obj->{'float'}) |
| 17510 | 18224 | ); |
| @@ -17603,6 +18317,9 @@ class ForClass { | ||
| 17603 | 18317 | * @throws Exception |
| 17604 | 18318 | */ |
| 17605 | 18319 | public static function from(stdClass $obj): ForClass { |
| 18320 | + if (!property_exists($obj, 'for')) { | |
| 18321 | + throw new Exception("Missing required property"); | |
| 18322 | + } | |
| 17606 | 18323 | return new ForClass( |
| 17607 | 18324 | ForClass::fromFor($obj->{'for'}) |
| 17608 | 18325 | ); |
| @@ -17701,6 +18418,9 @@ class ForeachClass { | ||
| 17701 | 18418 | * @throws Exception |
| 17702 | 18419 | */ |
| 17703 | 18420 | public static function from(stdClass $obj): ForeachClass { |
| 18421 | + if (!property_exists($obj, 'foreach')) { | |
| 18422 | + throw new Exception("Missing required property"); | |
| 18423 | + } | |
| 17704 | 18424 | return new ForeachClass( |
| 17705 | 18425 | ForeachClass::fromForeach($obj->{'foreach'}) |
| 17706 | 18426 | ); |
| @@ -17799,6 +18519,9 @@ class Friend { | ||
| 17799 | 18519 | * @throws Exception |
| 17800 | 18520 | */ |
| 17801 | 18521 | public static function from(stdClass $obj): Friend { |
| 18522 | + if (!property_exists($obj, 'friend')) { | |
| 18523 | + throw new Exception("Missing required property"); | |
| 18524 | + } | |
| 17802 | 18525 | return new Friend( |
| 17803 | 18526 | Friend::fromFriend($obj->{'friend'}) |
| 17804 | 18527 | ); |
| @@ -17897,6 +18620,9 @@ class From { | ||
| 17897 | 18620 | * @throws Exception |
| 17898 | 18621 | */ |
| 17899 | 18622 | public static function from(stdClass $obj): From { |
| 18623 | + if (!property_exists($obj, 'from')) { | |
| 18624 | + throw new Exception("Missing required property"); | |
| 18625 | + } | |
| 17900 | 18626 | return new From( |
| 17901 | 18627 | From::fromFrom($obj->{'from'}) |
| 17902 | 18628 | ); |
| @@ -17995,6 +18721,9 @@ class FromJSON { | ||
| 17995 | 18721 | * @throws Exception |
| 17996 | 18722 | */ |
| 17997 | 18723 | public static function from(stdClass $obj): FromJSON { |
| 18724 | + if (!property_exists($obj, 'from_json')) { | |
| 18725 | + throw new Exception("Missing required property"); | |
| 18726 | + } | |
| 17998 | 18727 | return new FromJSON( |
| 17999 | 18728 | FromJSON::fromFromJSON($obj->{'from_json'}) |
| 18000 | 18729 | ); |
| @@ -18093,6 +18822,9 @@ class Func { | ||
| 18093 | 18822 | * @throws Exception |
| 18094 | 18823 | */ |
| 18095 | 18824 | public static function from(stdClass $obj): Func { |
| 18825 | + if (!property_exists($obj, 'func')) { | |
| 18826 | + throw new Exception("Missing required property"); | |
| 18827 | + } | |
| 18096 | 18828 | return new Func( |
| 18097 | 18829 | Func::fromFunc($obj->{'func'}) |
| 18098 | 18830 | ); |
| @@ -18191,6 +18923,9 @@ class FunctionClass { | ||
| 18191 | 18923 | * @throws Exception |
| 18192 | 18924 | */ |
| 18193 | 18925 | public static function from(stdClass $obj): FunctionClass { |
| 18926 | + if (!property_exists($obj, 'function')) { | |
| 18927 | + throw new Exception("Missing required property"); | |
| 18928 | + } | |
| 18194 | 18929 | return new FunctionClass( |
| 18195 | 18930 | FunctionClass::fromFunction($obj->{'function'}) |
| 18196 | 18931 | ); |
| @@ -18289,6 +19024,9 @@ class Get { | ||
| 18289 | 19024 | * @throws Exception |
| 18290 | 19025 | */ |
| 18291 | 19026 | public static function from(stdClass $obj): Get { |
| 19027 | + if (!property_exists($obj, 'get')) { | |
| 19028 | + throw new Exception("Missing required property"); | |
| 19029 | + } | |
| 18292 | 19030 | return new Get( |
| 18293 | 19031 | Get::fromGet($obj->{'get'}) |
| 18294 | 19032 | ); |
| @@ -18387,6 +19125,9 @@ class GlobalClass { | ||
| 18387 | 19125 | * @throws Exception |
| 18388 | 19126 | */ |
| 18389 | 19127 | public static function from(stdClass $obj): GlobalClass { |
| 19128 | + if (!property_exists($obj, 'global')) { | |
| 19129 | + throw new Exception("Missing required property"); | |
| 19130 | + } | |
| 18390 | 19131 | return new GlobalClass( |
| 18391 | 19132 | GlobalClass::fromGlobal($obj->{'global'}) |
| 18392 | 19133 | ); |
| @@ -18485,6 +19226,9 @@ class Go { | ||
| 18485 | 19226 | * @throws Exception |
| 18486 | 19227 | */ |
| 18487 | 19228 | public static function from(stdClass $obj): Go { |
| 19229 | + if (!property_exists($obj, 'go')) { | |
| 19230 | + throw new Exception("Missing required property"); | |
| 19231 | + } | |
| 18488 | 19232 | return new Go( |
| 18489 | 19233 | Go::fromGo($obj->{'go'}) |
| 18490 | 19234 | ); |
| @@ -18583,6 +19327,9 @@ class GotoClass { | ||
| 18583 | 19327 | * @throws Exception |
| 18584 | 19328 | */ |
| 18585 | 19329 | public static function from(stdClass $obj): GotoClass { |
| 19330 | + if (!property_exists($obj, 'goto')) { | |
| 19331 | + throw new Exception("Missing required property"); | |
| 19332 | + } | |
| 18586 | 19333 | return new GotoClass( |
| 18587 | 19334 | GotoClass::fromGoto($obj->{'goto'}) |
| 18588 | 19335 | ); |
| @@ -18681,6 +19428,9 @@ class Guard { | ||
| 18681 | 19428 | * @throws Exception |
| 18682 | 19429 | */ |
| 18683 | 19430 | public static function from(stdClass $obj): Guard { |
| 19431 | + if (!property_exists($obj, 'guard')) { | |
| 19432 | + throw new Exception("Missing required property"); | |
| 19433 | + } | |
| 18684 | 19434 | return new Guard( |
| 18685 | 19435 | Guard::fromGuard($obj->{'guard'}) |
| 18686 | 19436 | ); |
| @@ -18779,6 +19529,9 @@ class HasOwnProperty { | ||
| 18779 | 19529 | * @throws Exception |
| 18780 | 19530 | */ |
| 18781 | 19531 | public static function from(stdClass $obj): HasOwnProperty { |
| 19532 | + if (!property_exists($obj, 'hasOwnProperty')) { | |
| 19533 | + throw new Exception("Missing required property"); | |
| 19534 | + } | |
| 18782 | 19535 | return new HasOwnProperty( |
| 18783 | 19536 | HasOwnProperty::fromHasOwnProperty($obj->{'hasOwnProperty'}) |
| 18784 | 19537 | ); |
| @@ -18877,6 +19630,9 @@ class ID { | ||
| 18877 | 19630 | * @throws Exception |
| 18878 | 19631 | */ |
| 18879 | 19632 | public static function from(stdClass $obj): ID { |
| 19633 | + if (!property_exists($obj, 'id')) { | |
| 19634 | + throw new Exception("Missing required property"); | |
| 19635 | + } | |
| 18880 | 19636 | return new ID( |
| 18881 | 19637 | ID::fromID($obj->{'id'}) |
| 18882 | 19638 | ); |
| @@ -18975,6 +19731,9 @@ class IfClass { | ||
| 18975 | 19731 | * @throws Exception |
| 18976 | 19732 | */ |
| 18977 | 19733 | public static function from(stdClass $obj): IfClass { |
| 19734 | + if (!property_exists($obj, 'if')) { | |
| 19735 | + throw new Exception("Missing required property"); | |
| 19736 | + } | |
| 18978 | 19737 | return new IfClass( |
| 18979 | 19738 | IfClass::fromIf($obj->{'if'}) |
| 18980 | 19739 | ); |
| @@ -19073,6 +19832,9 @@ class Imp { | ||
| 19073 | 19832 | * @throws Exception |
| 19074 | 19833 | */ |
| 19075 | 19834 | public static function from(stdClass $obj): Imp { |
| 19835 | + if (!property_exists($obj, 'IMP')) { | |
| 19836 | + throw new Exception("Missing required property"); | |
| 19837 | + } | |
| 19076 | 19838 | return new Imp( |
| 19077 | 19839 | Imp::fromImp($obj->{'IMP'}) |
| 19078 | 19840 | ); |
| @@ -19171,6 +19933,9 @@ class ImplementsClass { | ||
| 19171 | 19933 | * @throws Exception |
| 19172 | 19934 | */ |
| 19173 | 19935 | public static function from(stdClass $obj): ImplementsClass { |
| 19936 | + if (!property_exists($obj, 'implements')) { | |
| 19937 | + throw new Exception("Missing required property"); | |
| 19938 | + } | |
| 19174 | 19939 | return new ImplementsClass( |
| 19175 | 19940 | ImplementsClass::fromImplements($obj->{'implements'}) |
| 19176 | 19941 | ); |
| @@ -19269,6 +20034,9 @@ class Implicit { | ||
| 19269 | 20034 | * @throws Exception |
| 19270 | 20035 | */ |
| 19271 | 20036 | public static function from(stdClass $obj): Implicit { |
| 20037 | + if (!property_exists($obj, 'implicit')) { | |
| 20038 | + throw new Exception("Missing required property"); | |
| 20039 | + } | |
| 19272 | 20040 | return new Implicit( |
| 19273 | 20041 | Implicit::fromImplicit($obj->{'implicit'}) |
| 19274 | 20042 | ); |
| @@ -19367,6 +20135,9 @@ class Import { | ||
| 19367 | 20135 | * @throws Exception |
| 19368 | 20136 | */ |
| 19369 | 20137 | public static function from(stdClass $obj): Import { |
| 20138 | + if (!property_exists($obj, 'import')) { | |
| 20139 | + throw new Exception("Missing required property"); | |
| 20140 | + } | |
| 19370 | 20141 | return new Import( |
| 19371 | 20142 | Import::fromImport($obj->{'import'}) |
| 19372 | 20143 | ); |
| @@ -19465,6 +20236,9 @@ class In { | ||
| 19465 | 20236 | * @throws Exception |
| 19466 | 20237 | */ |
| 19467 | 20238 | public static function from(stdClass $obj): In { |
| 20239 | + if (!property_exists($obj, 'in')) { | |
| 20240 | + throw new Exception("Missing required property"); | |
| 20241 | + } | |
| 19468 | 20242 | return new In( |
| 19469 | 20243 | In::fromIn($obj->{'in'}) |
| 19470 | 20244 | ); |
| @@ -19563,6 +20337,9 @@ class Indirect { | ||
| 19563 | 20337 | * @throws Exception |
| 19564 | 20338 | */ |
| 19565 | 20339 | public static function from(stdClass $obj): Indirect { |
| 20340 | + if (!property_exists($obj, 'indirect')) { | |
| 20341 | + throw new Exception("Missing required property"); | |
| 20342 | + } | |
| 19566 | 20343 | return new Indirect( |
| 19567 | 20344 | Indirect::fromIndirect($obj->{'indirect'}) |
| 19568 | 20345 | ); |
| @@ -19661,6 +20438,9 @@ class Infix { | ||
| 19661 | 20438 | * @throws Exception |
| 19662 | 20439 | */ |
| 19663 | 20440 | public static function from(stdClass $obj): Infix { |
| 20441 | + if (!property_exists($obj, 'infix')) { | |
| 20442 | + throw new Exception("Missing required property"); | |
| 20443 | + } | |
| 19664 | 20444 | return new Infix( |
| 19665 | 20445 | Infix::fromInfix($obj->{'infix'}) |
| 19666 | 20446 | ); |
| @@ -19759,6 +20539,9 @@ class Init { | ||
| 19759 | 20539 | * @throws Exception |
| 19760 | 20540 | */ |
| 19761 | 20541 | public static function from(stdClass $obj): Init { |
| 20542 | + if (!property_exists($obj, 'init')) { | |
| 20543 | + throw new Exception("Missing required property"); | |
| 20544 | + } | |
| 19762 | 20545 | return new Init( |
| 19763 | 20546 | Init::fromInit($obj->{'init'}) |
| 19764 | 20547 | ); |
| @@ -19857,6 +20640,9 @@ class Inline { | ||
| 19857 | 20640 | * @throws Exception |
| 19858 | 20641 | */ |
| 19859 | 20642 | public static function from(stdClass $obj): Inline { |
| 20643 | + if (!property_exists($obj, 'inline')) { | |
| 20644 | + throw new Exception("Missing required property"); | |
| 20645 | + } | |
| 19860 | 20646 | return new Inline( |
| 19861 | 20647 | Inline::fromInline($obj->{'inline'}) |
| 19862 | 20648 | ); |
| @@ -19955,6 +20741,9 @@ class Inout { | ||
| 19955 | 20741 | * @throws Exception |
| 19956 | 20742 | */ |
| 19957 | 20743 | public static function from(stdClass $obj): Inout { |
| 20744 | + if (!property_exists($obj, 'inout')) { | |
| 20745 | + throw new Exception("Missing required property"); | |
| 20746 | + } | |
| 19958 | 20747 | return new Inout( |
| 19959 | 20748 | Inout::fromInout($obj->{'inout'}) |
| 19960 | 20749 | ); |
| @@ -20053,6 +20842,9 @@ class InstanceofClass { | ||
| 20053 | 20842 | * @throws Exception |
| 20054 | 20843 | */ |
| 20055 | 20844 | public static function from(stdClass $obj): InstanceofClass { |
| 20845 | + if (!property_exists($obj, 'instanceof')) { | |
| 20846 | + throw new Exception("Missing required property"); | |
| 20847 | + } | |
| 20056 | 20848 | return new InstanceofClass( |
| 20057 | 20849 | InstanceofClass::fromInstanceof($obj->{'instanceof'}) |
| 20058 | 20850 | ); |
| @@ -20151,6 +20943,9 @@ class IntClass { | ||
| 20151 | 20943 | * @throws Exception |
| 20152 | 20944 | */ |
| 20153 | 20945 | public static function from(stdClass $obj): IntClass { |
| 20946 | + if (!property_exists($obj, 'int')) { | |
| 20947 | + throw new Exception("Missing required property"); | |
| 20948 | + } | |
| 20154 | 20949 | return new IntClass( |
| 20155 | 20950 | IntClass::fromInt($obj->{'int'}) |
| 20156 | 20951 | ); |
| @@ -20249,6 +21044,9 @@ class InterfaceClass { | ||
| 20249 | 21044 | * @throws Exception |
| 20250 | 21045 | */ |
| 20251 | 21046 | public static function from(stdClass $obj): InterfaceClass { |
| 21047 | + if (!property_exists($obj, 'interface')) { | |
| 21048 | + throw new Exception("Missing required property"); | |
| 21049 | + } | |
| 20252 | 21050 | return new InterfaceClass( |
| 20253 | 21051 | InterfaceClass::fromInterface($obj->{'interface'}) |
| 20254 | 21052 | ); |
| @@ -20347,6 +21145,9 @@ class Internal { | ||
| 20347 | 21145 | * @throws Exception |
| 20348 | 21146 | */ |
| 20349 | 21147 | public static function from(stdClass $obj): Internal { |
| 21148 | + if (!property_exists($obj, 'internal')) { | |
| 21149 | + throw new Exception("Missing required property"); | |
| 21150 | + } | |
| 20350 | 21151 | return new Internal( |
| 20351 | 21152 | Internal::fromInternal($obj->{'internal'}) |
| 20352 | 21153 | ); |
| @@ -20445,6 +21246,9 @@ class Obj2False { | ||
| 20445 | 21246 | * @throws Exception |
| 20446 | 21247 | */ |
| 20447 | 21248 | public static function from(stdClass $obj): Obj2False { |
| 21249 | + if (!property_exists($obj, 'false')) { | |
| 21250 | + throw new Exception("Missing required property"); | |
| 21251 | + } | |
| 20448 | 21252 | return new Obj2False( |
| 20449 | 21253 | Obj2False::fromFalse($obj->{'false'}) |
| 20450 | 21254 | ); |
| @@ -23988,6 +24792,204 @@ class Obj3 { | ||
| 23988 | 24792 | * @throws Exception |
| 23989 | 24793 | */ |
| 23990 | 24794 | public static function from(stdClass $obj): Obj3 { |
| 24795 | + if (!property_exists($obj, 'dummy')) { | |
| 24796 | + throw new Exception("Missing required property"); | |
| 24797 | + } | |
| 24798 | + if (!property_exists($obj, 'is')) { | |
| 24799 | + throw new Exception("Missing required property"); | |
| 24800 | + } | |
| 24801 | + if (!property_exists($obj, 'iterable')) { | |
| 24802 | + throw new Exception("Missing required property"); | |
| 24803 | + } | |
| 24804 | + if (!property_exists($obj, 'jdec')) { | |
| 24805 | + throw new Exception("Missing required property"); | |
| 24806 | + } | |
| 24807 | + if (!property_exists($obj, 'jenc')) { | |
| 24808 | + throw new Exception("Missing required property"); | |
| 24809 | + } | |
| 24810 | + if (!property_exists($obj, 'jpipe')) { | |
| 24811 | + throw new Exception("Missing required property"); | |
| 24812 | + } | |
| 24813 | + if (!property_exists($obj, 'json')) { | |
| 24814 | + throw new Exception("Missing required property"); | |
| 24815 | + } | |
| 24816 | + if (!property_exists($obj, 'json_converter')) { | |
| 24817 | + throw new Exception("Missing required property"); | |
| 24818 | + } | |
| 24819 | + if (!property_exists($obj, 'json_serializer')) { | |
| 24820 | + throw new Exception("Missing required property"); | |
| 24821 | + } | |
| 24822 | + if (!property_exists($obj, 'json_token')) { | |
| 24823 | + throw new Exception("Missing required property"); | |
| 24824 | + } | |
| 24825 | + if (!property_exists($obj, 'json_writer')) { | |
| 24826 | + throw new Exception("Missing required property"); | |
| 24827 | + } | |
| 24828 | + if (!property_exists($obj, 'lambda')) { | |
| 24829 | + throw new Exception("Missing required property"); | |
| 24830 | + } | |
| 24831 | + if (!property_exists($obj, 'lazy')) { | |
| 24832 | + throw new Exception("Missing required property"); | |
| 24833 | + } | |
| 24834 | + if (!property_exists($obj, 'left')) { | |
| 24835 | + throw new Exception("Missing required property"); | |
| 24836 | + } | |
| 24837 | + if (!property_exists($obj, 'let')) { | |
| 24838 | + throw new Exception("Missing required property"); | |
| 24839 | + } | |
| 24840 | + if (!property_exists($obj, 'list')) { | |
| 24841 | + throw new Exception("Missing required property"); | |
| 24842 | + } | |
| 24843 | + if (!property_exists($obj, 'lock')) { | |
| 24844 | + throw new Exception("Missing required property"); | |
| 24845 | + } | |
| 24846 | + if (!property_exists($obj, 'long')) { | |
| 24847 | + throw new Exception("Missing required property"); | |
| 24848 | + } | |
| 24849 | + if (!property_exists($obj, 'map')) { | |
| 24850 | + throw new Exception("Missing required property"); | |
| 24851 | + } | |
| 24852 | + if (!property_exists($obj, 'metadata_property_handling')) { | |
| 24853 | + throw new Exception("Missing required property"); | |
| 24854 | + } | |
| 24855 | + if (!property_exists($obj, 'module')) { | |
| 24856 | + throw new Exception("Missing required property"); | |
| 24857 | + } | |
| 24858 | + if (!property_exists($obj, 'mutable')) { | |
| 24859 | + throw new Exception("Missing required property"); | |
| 24860 | + } | |
| 24861 | + if (!property_exists($obj, 'mutating')) { | |
| 24862 | + throw new Exception("Missing required property"); | |
| 24863 | + } | |
| 24864 | + if (!property_exists($obj, 'namespace')) { | |
| 24865 | + throw new Exception("Missing required property"); | |
| 24866 | + } | |
| 24867 | + if (!property_exists($obj, 'native')) { | |
| 24868 | + throw new Exception("Missing required property"); | |
| 24869 | + } | |
| 24870 | + if (!property_exists($obj, 'new')) { | |
| 24871 | + throw new Exception("Missing required property"); | |
| 24872 | + } | |
| 24873 | + if (!property_exists($obj, 'newtonsoft')) { | |
| 24874 | + throw new Exception("Missing required property"); | |
| 24875 | + } | |
| 24876 | + if (!property_exists($obj, 'nil')) { | |
| 24877 | + throw new Exception("Missing required property"); | |
| 24878 | + } | |
| 24879 | + if (!property_exists($obj, 'NO')) { | |
| 24880 | + throw new Exception("Missing required property"); | |
| 24881 | + } | |
| 24882 | + if (!property_exists($obj, 'noexcept')) { | |
| 24883 | + throw new Exception("Missing required property"); | |
| 24884 | + } | |
| 24885 | + if (!property_exists($obj, 'nonatomic')) { | |
| 24886 | + throw new Exception("Missing required property"); | |
| 24887 | + } | |
| 24888 | + if (!property_exists($obj, 'None')) { | |
| 24889 | + throw new Exception("Missing required property"); | |
| 24890 | + } | |
| 24891 | + if (!property_exists($obj, 'nonlocal')) { | |
| 24892 | + throw new Exception("Missing required property"); | |
| 24893 | + } | |
| 24894 | + if (!property_exists($obj, 'nonmutating')) { | |
| 24895 | + throw new Exception("Missing required property"); | |
| 24896 | + } | |
| 24897 | + if (!property_exists($obj, 'not')) { | |
| 24898 | + throw new Exception("Missing required property"); | |
| 24899 | + } | |
| 24900 | + if (!property_exists($obj, 'not_eq')) { | |
| 24901 | + throw new Exception("Missing required property"); | |
| 24902 | + } | |
| 24903 | + if (!property_exists($obj, 'NSString')) { | |
| 24904 | + throw new Exception("Missing required property"); | |
| 24905 | + } | |
| 24906 | + if (!property_exists($obj, 'NULL')) { | |
| 24907 | + throw new Exception("Missing required property"); | |
| 24908 | + } | |
| 24909 | + if (!property_exists($obj, 'nullptr')) { | |
| 24910 | + throw new Exception("Missing required property"); | |
| 24911 | + } | |
| 24912 | + if (!property_exists($obj, 'number')) { | |
| 24913 | + throw new Exception("Missing required property"); | |
| 24914 | + } | |
| 24915 | + if (!property_exists($obj, 'none')) { | |
| 24916 | + throw new Exception("Missing required property"); | |
| 24917 | + } | |
| 24918 | + if (!property_exists($obj, 'null')) { | |
| 24919 | + throw new Exception("Missing required property"); | |
| 24920 | + } | |
| 24921 | + if (!property_exists($obj, 'protocol')) { | |
| 24922 | + throw new Exception("Missing required property"); | |
| 24923 | + } | |
| 24924 | + if (!property_exists($obj, 'object')) { | |
| 24925 | + throw new Exception("Missing required property"); | |
| 24926 | + } | |
| 24927 | + if (!property_exists($obj, 'of')) { | |
| 24928 | + throw new Exception("Missing required property"); | |
| 24929 | + } | |
| 24930 | + if (!property_exists($obj, 'oneway')) { | |
| 24931 | + throw new Exception("Missing required property"); | |
| 24932 | + } | |
| 24933 | + if (!property_exists($obj, 'open')) { | |
| 24934 | + throw new Exception("Missing required property"); | |
| 24935 | + } | |
| 24936 | + if (!property_exists($obj, 'operator')) { | |
| 24937 | + throw new Exception("Missing required property"); | |
| 24938 | + } | |
| 24939 | + if (!property_exists($obj, 'optional')) { | |
| 24940 | + throw new Exception("Missing required property"); | |
| 24941 | + } | |
| 24942 | + if (!property_exists($obj, 'or')) { | |
| 24943 | + throw new Exception("Missing required property"); | |
| 24944 | + } | |
| 24945 | + if (!property_exists($obj, 'or_eq')) { | |
| 24946 | + throw new Exception("Missing required property"); | |
| 24947 | + } | |
| 24948 | + if (!property_exists($obj, 'out')) { | |
| 24949 | + throw new Exception("Missing required property"); | |
| 24950 | + } | |
| 24951 | + if (!property_exists($obj, 'override')) { | |
| 24952 | + throw new Exception("Missing required property"); | |
| 24953 | + } | |
| 24954 | + if (!property_exists($obj, 'package')) { | |
| 24955 | + throw new Exception("Missing required property"); | |
| 24956 | + } | |
| 24957 | + if (!property_exists($obj, 'params')) { | |
| 24958 | + throw new Exception("Missing required property"); | |
| 24959 | + } | |
| 24960 | + if (!property_exists($obj, 'pass')) { | |
| 24961 | + throw new Exception("Missing required property"); | |
| 24962 | + } | |
| 24963 | + if (!property_exists($obj, 'port')) { | |
| 24964 | + throw new Exception("Missing required property"); | |
| 24965 | + } | |
| 24966 | + if (!property_exists($obj, 'postfix')) { | |
| 24967 | + throw new Exception("Missing required property"); | |
| 24968 | + } | |
| 24969 | + if (!property_exists($obj, 'precedence')) { | |
| 24970 | + throw new Exception("Missing required property"); | |
| 24971 | + } | |
| 24972 | + if (!property_exists($obj, 'prefix')) { | |
| 24973 | + throw new Exception("Missing required property"); | |
| 24974 | + } | |
| 24975 | + if (!property_exists($obj, 'print')) { | |
| 24976 | + throw new Exception("Missing required property"); | |
| 24977 | + } | |
| 24978 | + if (!property_exists($obj, 'printMembers')) { | |
| 24979 | + throw new Exception("Missing required property"); | |
| 24980 | + } | |
| 24981 | + if (!property_exists($obj, 'printf')) { | |
| 24982 | + throw new Exception("Missing required property"); | |
| 24983 | + } | |
| 24984 | + if (!property_exists($obj, 'private')) { | |
| 24985 | + throw new Exception("Missing required property"); | |
| 24986 | + } | |
| 24987 | + if (!property_exists($obj, 'protected')) { | |
| 24988 | + throw new Exception("Missing required property"); | |
| 24989 | + } | |
| 24990 | + if (!property_exists($obj, 'Protocol')) { | |
| 24991 | + throw new Exception("Missing required property"); | |
| 24992 | + } | |
| 23991 | 24993 | return new Obj3( |
| 23992 | 24994 | Obj3::fromDummy($obj->{'dummy'}) |
| 23993 | 24995 | ,Obj3::fromIs($obj->{'is'}) |
| @@ -24216,6 +25218,9 @@ class Is { | ||
| 24216 | 25218 | * @throws Exception |
| 24217 | 25219 | */ |
| 24218 | 25220 | public static function from(stdClass $obj): Is { |
| 25221 | + if (!property_exists($obj, 'is')) { | |
| 25222 | + throw new Exception("Missing required property"); | |
| 25223 | + } | |
| 24219 | 25224 | return new Is( |
| 24220 | 25225 | Is::fromIs($obj->{'is'}) |
| 24221 | 25226 | ); |
| @@ -24314,6 +25319,9 @@ class IterableClass { | ||
| 24314 | 25319 | * @throws Exception |
| 24315 | 25320 | */ |
| 24316 | 25321 | public static function from(stdClass $obj): IterableClass { |
| 25322 | + if (!property_exists($obj, 'iterable')) { | |
| 25323 | + throw new Exception("Missing required property"); | |
| 25324 | + } | |
| 24317 | 25325 | return new IterableClass( |
| 24318 | 25326 | IterableClass::fromIterable($obj->{'iterable'}) |
| 24319 | 25327 | ); |
| @@ -24412,6 +25420,9 @@ class Jdec { | ||
| 24412 | 25420 | * @throws Exception |
| 24413 | 25421 | */ |
| 24414 | 25422 | public static function from(stdClass $obj): Jdec { |
| 25423 | + if (!property_exists($obj, 'jdec')) { | |
| 25424 | + throw new Exception("Missing required property"); | |
| 25425 | + } | |
| 24415 | 25426 | return new Jdec( |
| 24416 | 25427 | Jdec::fromJdec($obj->{'jdec'}) |
| 24417 | 25428 | ); |
| @@ -24510,6 +25521,9 @@ class Jenc { | ||
| 24510 | 25521 | * @throws Exception |
| 24511 | 25522 | */ |
| 24512 | 25523 | public static function from(stdClass $obj): Jenc { |
| 25524 | + if (!property_exists($obj, 'jenc')) { | |
| 25525 | + throw new Exception("Missing required property"); | |
| 25526 | + } | |
| 24513 | 25527 | return new Jenc( |
| 24514 | 25528 | Jenc::fromJenc($obj->{'jenc'}) |
| 24515 | 25529 | ); |
| @@ -24608,6 +25622,9 @@ class Jpipe { | ||
| 24608 | 25622 | * @throws Exception |
| 24609 | 25623 | */ |
| 24610 | 25624 | public static function from(stdClass $obj): Jpipe { |
| 25625 | + if (!property_exists($obj, 'jpipe')) { | |
| 25626 | + throw new Exception("Missing required property"); | |
| 25627 | + } | |
| 24611 | 25628 | return new Jpipe( |
| 24612 | 25629 | Jpipe::fromJpipe($obj->{'jpipe'}) |
| 24613 | 25630 | ); |
| @@ -24706,6 +25723,9 @@ class JSON { | ||
| 24706 | 25723 | * @throws Exception |
| 24707 | 25724 | */ |
| 24708 | 25725 | public static function from(stdClass $obj): JSON { |
| 25726 | + if (!property_exists($obj, 'json')) { | |
| 25727 | + throw new Exception("Missing required property"); | |
| 25728 | + } | |
| 24709 | 25729 | return new JSON( |
| 24710 | 25730 | JSON::fromJSON($obj->{'json'}) |
| 24711 | 25731 | ); |
| @@ -24804,6 +25824,9 @@ class JSONConverter { | ||
| 24804 | 25824 | * @throws Exception |
| 24805 | 25825 | */ |
| 24806 | 25826 | public static function from(stdClass $obj): JSONConverter { |
| 25827 | + if (!property_exists($obj, 'json_converter')) { | |
| 25828 | + throw new Exception("Missing required property"); | |
| 25829 | + } | |
| 24807 | 25830 | return new JSONConverter( |
| 24808 | 25831 | JSONConverter::fromJSONConverter($obj->{'json_converter'}) |
| 24809 | 25832 | ); |
| @@ -24902,6 +25925,9 @@ class JSONSerializer { | ||
| 24902 | 25925 | * @throws Exception |
| 24903 | 25926 | */ |
| 24904 | 25927 | public static function from(stdClass $obj): JSONSerializer { |
| 25928 | + if (!property_exists($obj, 'json_serializer')) { | |
| 25929 | + throw new Exception("Missing required property"); | |
| 25930 | + } | |
| 24905 | 25931 | return new JSONSerializer( |
| 24906 | 25932 | JSONSerializer::fromJSONSerializer($obj->{'json_serializer'}) |
| 24907 | 25933 | ); |
| @@ -25000,6 +26026,9 @@ class JSONToken { | ||
| 25000 | 26026 | * @throws Exception |
| 25001 | 26027 | */ |
| 25002 | 26028 | public static function from(stdClass $obj): JSONToken { |
| 26029 | + if (!property_exists($obj, 'json_token')) { | |
| 26030 | + throw new Exception("Missing required property"); | |
| 26031 | + } | |
| 25003 | 26032 | return new JSONToken( |
| 25004 | 26033 | JSONToken::fromJSONToken($obj->{'json_token'}) |
| 25005 | 26034 | ); |
| @@ -25098,6 +26127,9 @@ class JSONWriter { | ||
| 25098 | 26127 | * @throws Exception |
| 25099 | 26128 | */ |
| 25100 | 26129 | public static function from(stdClass $obj): JSONWriter { |
| 26130 | + if (!property_exists($obj, 'json_writer')) { | |
| 26131 | + throw new Exception("Missing required property"); | |
| 26132 | + } | |
| 25101 | 26133 | return new JSONWriter( |
| 25102 | 26134 | JSONWriter::fromJSONWriter($obj->{'json_writer'}) |
| 25103 | 26135 | ); |
| @@ -25196,6 +26228,9 @@ class Lambda { | ||
| 25196 | 26228 | * @throws Exception |
| 25197 | 26229 | */ |
| 25198 | 26230 | public static function from(stdClass $obj): Lambda { |
| 26231 | + if (!property_exists($obj, 'lambda')) { | |
| 26232 | + throw new Exception("Missing required property"); | |
| 26233 | + } | |
| 25199 | 26234 | return new Lambda( |
| 25200 | 26235 | Lambda::fromLambda($obj->{'lambda'}) |
| 25201 | 26236 | ); |
| @@ -25294,6 +26329,9 @@ class Lazy { | ||
| 25294 | 26329 | * @throws Exception |
| 25295 | 26330 | */ |
| 25296 | 26331 | public static function from(stdClass $obj): Lazy { |
| 26332 | + if (!property_exists($obj, 'lazy')) { | |
| 26333 | + throw new Exception("Missing required property"); | |
| 26334 | + } | |
| 25297 | 26335 | return new Lazy( |
| 25298 | 26336 | Lazy::fromLazy($obj->{'lazy'}) |
| 25299 | 26337 | ); |
| @@ -25392,6 +26430,9 @@ class Left { | ||
| 25392 | 26430 | * @throws Exception |
| 25393 | 26431 | */ |
| 25394 | 26432 | public static function from(stdClass $obj): Left { |
| 26433 | + if (!property_exists($obj, 'left')) { | |
| 26434 | + throw new Exception("Missing required property"); | |
| 26435 | + } | |
| 25395 | 26436 | return new Left( |
| 25396 | 26437 | Left::fromLeft($obj->{'left'}) |
| 25397 | 26438 | ); |
| @@ -25490,6 +26531,9 @@ class Let { | ||
| 25490 | 26531 | * @throws Exception |
| 25491 | 26532 | */ |
| 25492 | 26533 | public static function from(stdClass $obj): Let { |
| 26534 | + if (!property_exists($obj, 'let')) { | |
| 26535 | + throw new Exception("Missing required property"); | |
| 26536 | + } | |
| 25493 | 26537 | return new Let( |
| 25494 | 26538 | Let::fromLet($obj->{'let'}) |
| 25495 | 26539 | ); |
| @@ -25588,6 +26632,9 @@ class ListClass { | ||
| 25588 | 26632 | * @throws Exception |
| 25589 | 26633 | */ |
| 25590 | 26634 | public static function from(stdClass $obj): ListClass { |
| 26635 | + if (!property_exists($obj, 'list')) { | |
| 26636 | + throw new Exception("Missing required property"); | |
| 26637 | + } | |
| 25591 | 26638 | return new ListClass( |
| 25592 | 26639 | ListClass::fromList($obj->{'list'}) |
| 25593 | 26640 | ); |
| @@ -25686,6 +26733,9 @@ class Lock { | ||
| 25686 | 26733 | * @throws Exception |
| 25687 | 26734 | */ |
| 25688 | 26735 | public static function from(stdClass $obj): Lock { |
| 26736 | + if (!property_exists($obj, 'lock')) { | |
| 26737 | + throw new Exception("Missing required property"); | |
| 26738 | + } | |
| 25689 | 26739 | return new Lock( |
| 25690 | 26740 | Lock::fromLock($obj->{'lock'}) |
| 25691 | 26741 | ); |
| @@ -25784,6 +26834,9 @@ class Long { | ||
| 25784 | 26834 | * @throws Exception |
| 25785 | 26835 | */ |
| 25786 | 26836 | public static function from(stdClass $obj): Long { |
| 26837 | + if (!property_exists($obj, 'long')) { | |
| 26838 | + throw new Exception("Missing required property"); | |
| 26839 | + } | |
| 25787 | 26840 | return new Long( |
| 25788 | 26841 | Long::fromLong($obj->{'long'}) |
| 25789 | 26842 | ); |
| @@ -25882,6 +26935,9 @@ class Map { | ||
| 25882 | 26935 | * @throws Exception |
| 25883 | 26936 | */ |
| 25884 | 26937 | public static function from(stdClass $obj): Map { |
| 26938 | + if (!property_exists($obj, 'map')) { | |
| 26939 | + throw new Exception("Missing required property"); | |
| 26940 | + } | |
| 25885 | 26941 | return new Map( |
| 25886 | 26942 | Map::fromMap($obj->{'map'}) |
| 25887 | 26943 | ); |
| @@ -25980,6 +27036,9 @@ class MetadataPropertyHandling { | ||
| 25980 | 27036 | * @throws Exception |
| 25981 | 27037 | */ |
| 25982 | 27038 | public static function from(stdClass $obj): MetadataPropertyHandling { |
| 27039 | + if (!property_exists($obj, 'metadata_property_handling')) { | |
| 27040 | + throw new Exception("Missing required property"); | |
| 27041 | + } | |
| 25983 | 27042 | return new MetadataPropertyHandling( |
| 25984 | 27043 | MetadataPropertyHandling::fromMetadataPropertyHandling($obj->{'metadata_property_handling'}) |
| 25985 | 27044 | ); |
| @@ -26078,6 +27137,9 @@ class Module { | ||
| 26078 | 27137 | * @throws Exception |
| 26079 | 27138 | */ |
| 26080 | 27139 | public static function from(stdClass $obj): Module { |
| 27140 | + if (!property_exists($obj, 'module')) { | |
| 27141 | + throw new Exception("Missing required property"); | |
| 27142 | + } | |
| 26081 | 27143 | return new Module( |
| 26082 | 27144 | Module::fromModule($obj->{'module'}) |
| 26083 | 27145 | ); |
| @@ -26176,6 +27238,9 @@ class Mutable { | ||
| 26176 | 27238 | * @throws Exception |
| 26177 | 27239 | */ |
| 26178 | 27240 | public static function from(stdClass $obj): Mutable { |
| 27241 | + if (!property_exists($obj, 'mutable')) { | |
| 27242 | + throw new Exception("Missing required property"); | |
| 27243 | + } | |
| 26179 | 27244 | return new Mutable( |
| 26180 | 27245 | Mutable::fromMutable($obj->{'mutable'}) |
| 26181 | 27246 | ); |
| @@ -26274,6 +27339,9 @@ class Mutating { | ||
| 26274 | 27339 | * @throws Exception |
| 26275 | 27340 | */ |
| 26276 | 27341 | public static function from(stdClass $obj): Mutating { |
| 27342 | + if (!property_exists($obj, 'mutating')) { | |
| 27343 | + throw new Exception("Missing required property"); | |
| 27344 | + } | |
| 26277 | 27345 | return new Mutating( |
| 26278 | 27346 | Mutating::fromMutating($obj->{'mutating'}) |
| 26279 | 27347 | ); |
| @@ -26372,6 +27440,9 @@ class NamespaceClass { | ||
| 26372 | 27440 | * @throws Exception |
| 26373 | 27441 | */ |
| 26374 | 27442 | public static function from(stdClass $obj): NamespaceClass { |
| 27443 | + if (!property_exists($obj, 'namespace')) { | |
| 27444 | + throw new Exception("Missing required property"); | |
| 27445 | + } | |
| 26375 | 27446 | return new NamespaceClass( |
| 26376 | 27447 | NamespaceClass::fromNamespace($obj->{'namespace'}) |
| 26377 | 27448 | ); |
| @@ -26470,6 +27541,9 @@ class Native { | ||
| 26470 | 27541 | * @throws Exception |
| 26471 | 27542 | */ |
| 26472 | 27543 | public static function from(stdClass $obj): Native { |
| 27544 | + if (!property_exists($obj, 'native')) { | |
| 27545 | + throw new Exception("Missing required property"); | |
| 27546 | + } | |
| 26473 | 27547 | return new Native( |
| 26474 | 27548 | Native::fromNative($obj->{'native'}) |
| 26475 | 27549 | ); |
| @@ -26568,6 +27642,9 @@ class NewClass { | ||
| 26568 | 27642 | * @throws Exception |
| 26569 | 27643 | */ |
| 26570 | 27644 | public static function from(stdClass $obj): NewClass { |
| 27645 | + if (!property_exists($obj, 'new')) { | |
| 27646 | + throw new Exception("Missing required property"); | |
| 27647 | + } | |
| 26571 | 27648 | return new NewClass( |
| 26572 | 27649 | NewClass::fromNew($obj->{'new'}) |
| 26573 | 27650 | ); |
| @@ -26666,6 +27743,9 @@ class Newtonsoft { | ||
| 26666 | 27743 | * @throws Exception |
| 26667 | 27744 | */ |
| 26668 | 27745 | public static function from(stdClass $obj): Newtonsoft { |
| 27746 | + if (!property_exists($obj, 'newtonsoft')) { | |
| 27747 | + throw new Exception("Missing required property"); | |
| 27748 | + } | |
| 26669 | 27749 | return new Newtonsoft( |
| 26670 | 27750 | Newtonsoft::fromNewtonsoft($obj->{'newtonsoft'}) |
| 26671 | 27751 | ); |
| @@ -26764,6 +27844,9 @@ class Nil { | ||
| 26764 | 27844 | * @throws Exception |
| 26765 | 27845 | */ |
| 26766 | 27846 | public static function from(stdClass $obj): Nil { |
| 27847 | + if (!property_exists($obj, 'nil')) { | |
| 27848 | + throw new Exception("Missing required property"); | |
| 27849 | + } | |
| 26767 | 27850 | return new Nil( |
| 26768 | 27851 | Nil::fromNil($obj->{'nil'}) |
| 26769 | 27852 | ); |
| @@ -26862,6 +27945,9 @@ class No { | ||
| 26862 | 27945 | * @throws Exception |
| 26863 | 27946 | */ |
| 26864 | 27947 | public static function from(stdClass $obj): No { |
| 27948 | + if (!property_exists($obj, 'NO')) { | |
| 27949 | + throw new Exception("Missing required property"); | |
| 27950 | + } | |
| 26865 | 27951 | return new No( |
| 26866 | 27952 | No::fromNo($obj->{'NO'}) |
| 26867 | 27953 | ); |
| @@ -26960,6 +28046,9 @@ class Noexcept { | ||
| 26960 | 28046 | * @throws Exception |
| 26961 | 28047 | */ |
| 26962 | 28048 | public static function from(stdClass $obj): Noexcept { |
| 28049 | + if (!property_exists($obj, 'noexcept')) { | |
| 28050 | + throw new Exception("Missing required property"); | |
| 28051 | + } | |
| 26963 | 28052 | return new Noexcept( |
| 26964 | 28053 | Noexcept::fromNoexcept($obj->{'noexcept'}) |
| 26965 | 28054 | ); |
| @@ -27058,6 +28147,9 @@ class Nonatomic { | ||
| 27058 | 28147 | * @throws Exception |
| 27059 | 28148 | */ |
| 27060 | 28149 | public static function from(stdClass $obj): Nonatomic { |
| 28150 | + if (!property_exists($obj, 'nonatomic')) { | |
| 28151 | + throw new Exception("Missing required property"); | |
| 28152 | + } | |
| 27061 | 28153 | return new Nonatomic( |
| 27062 | 28154 | Nonatomic::fromNonatomic($obj->{'nonatomic'}) |
| 27063 | 28155 | ); |
| @@ -27156,6 +28248,9 @@ class None { | ||
| 27156 | 28248 | * @throws Exception |
| 27157 | 28249 | */ |
| 27158 | 28250 | public static function from(stdClass $obj): None { |
| 28251 | + if (!property_exists($obj, 'None')) { | |
| 28252 | + throw new Exception("Missing required property"); | |
| 28253 | + } | |
| 27159 | 28254 | return new None( |
| 27160 | 28255 | None::fromNone($obj->{'None'}) |
| 27161 | 28256 | ); |
| @@ -27254,6 +28349,9 @@ class Nonlocal { | ||
| 27254 | 28349 | * @throws Exception |
| 27255 | 28350 | */ |
| 27256 | 28351 | public static function from(stdClass $obj): Nonlocal { |
| 28352 | + if (!property_exists($obj, 'nonlocal')) { | |
| 28353 | + throw new Exception("Missing required property"); | |
| 28354 | + } | |
| 27257 | 28355 | return new Nonlocal( |
| 27258 | 28356 | Nonlocal::fromNonlocal($obj->{'nonlocal'}) |
| 27259 | 28357 | ); |
| @@ -27352,6 +28450,9 @@ class Nonmutating { | ||
| 27352 | 28450 | * @throws Exception |
| 27353 | 28451 | */ |
| 27354 | 28452 | public static function from(stdClass $obj): Nonmutating { |
| 28453 | + if (!property_exists($obj, 'nonmutating')) { | |
| 28454 | + throw new Exception("Missing required property"); | |
| 28455 | + } | |
| 27355 | 28456 | return new Nonmutating( |
| 27356 | 28457 | Nonmutating::fromNonmutating($obj->{'nonmutating'}) |
| 27357 | 28458 | ); |
| @@ -27450,6 +28551,9 @@ class Not { | ||
| 27450 | 28551 | * @throws Exception |
| 27451 | 28552 | */ |
| 27452 | 28553 | public static function from(stdClass $obj): Not { |
| 28554 | + if (!property_exists($obj, 'not')) { | |
| 28555 | + throw new Exception("Missing required property"); | |
| 28556 | + } | |
| 27453 | 28557 | return new Not( |
| 27454 | 28558 | Not::fromNot($obj->{'not'}) |
| 27455 | 28559 | ); |
| @@ -27548,6 +28652,9 @@ class NotEq { | ||
| 27548 | 28652 | * @throws Exception |
| 27549 | 28653 | */ |
| 27550 | 28654 | public static function from(stdClass $obj): NotEq { |
| 28655 | + if (!property_exists($obj, 'not_eq')) { | |
| 28656 | + throw new Exception("Missing required property"); | |
| 28657 | + } | |
| 27551 | 28658 | return new NotEq( |
| 27552 | 28659 | NotEq::fromNotEq($obj->{'not_eq'}) |
| 27553 | 28660 | ); |
| @@ -27646,6 +28753,9 @@ class NSString { | ||
| 27646 | 28753 | * @throws Exception |
| 27647 | 28754 | */ |
| 27648 | 28755 | public static function from(stdClass $obj): NSString { |
| 28756 | + if (!property_exists($obj, 'NSString')) { | |
| 28757 | + throw new Exception("Missing required property"); | |
| 28758 | + } | |
| 27649 | 28759 | return new NSString( |
| 27650 | 28760 | NSString::fromNSString($obj->{'NSString'}) |
| 27651 | 28761 | ); |
| @@ -27744,6 +28854,9 @@ class NULLClass { | ||
| 27744 | 28854 | * @throws Exception |
| 27745 | 28855 | */ |
| 27746 | 28856 | public static function from(stdClass $obj): NULLClass { |
| 28857 | + if (!property_exists($obj, 'NULL')) { | |
| 28858 | + throw new Exception("Missing required property"); | |
| 28859 | + } | |
| 27747 | 28860 | return new NULLClass( |
| 27748 | 28861 | NULLClass::fromNull($obj->{'NULL'}) |
| 27749 | 28862 | ); |
| @@ -27842,6 +28955,9 @@ class Nullptr { | ||
| 27842 | 28955 | * @throws Exception |
| 27843 | 28956 | */ |
| 27844 | 28957 | public static function from(stdClass $obj): Nullptr { |
| 28958 | + if (!property_exists($obj, 'nullptr')) { | |
| 28959 | + throw new Exception("Missing required property"); | |
| 28960 | + } | |
| 27845 | 28961 | return new Nullptr( |
| 27846 | 28962 | Nullptr::fromNullptr($obj->{'nullptr'}) |
| 27847 | 28963 | ); |
| @@ -27940,6 +29056,9 @@ class Number { | ||
| 27940 | 29056 | * @throws Exception |
| 27941 | 29057 | */ |
| 27942 | 29058 | public static function from(stdClass $obj): Number { |
| 29059 | + if (!property_exists($obj, 'number')) { | |
| 29060 | + throw new Exception("Missing required property"); | |
| 29061 | + } | |
| 27943 | 29062 | return new Number( |
| 27944 | 29063 | Number::fromNumber($obj->{'number'}) |
| 27945 | 29064 | ); |
| @@ -28038,6 +29157,9 @@ class NoneClass { | ||
| 28038 | 29157 | * @throws Exception |
| 28039 | 29158 | */ |
| 28040 | 29159 | public static function from(stdClass $obj): NoneClass { |
| 29160 | + if (!property_exists($obj, 'none')) { | |
| 29161 | + throw new Exception("Missing required property"); | |
| 29162 | + } | |
| 28041 | 29163 | return new NoneClass( |
| 28042 | 29164 | NoneClass::fromNone($obj->{'none'}) |
| 28043 | 29165 | ); |
| @@ -28136,6 +29258,9 @@ class Obj3Null { | ||
| 28136 | 29258 | * @throws Exception |
| 28137 | 29259 | */ |
| 28138 | 29260 | public static function from(stdClass $obj): Obj3Null { |
| 29261 | + if (!property_exists($obj, 'null')) { | |
| 29262 | + throw new Exception("Missing required property"); | |
| 29263 | + } | |
| 28139 | 29264 | return new Obj3Null( |
| 28140 | 29265 | Obj3Null::fromNull($obj->{'null'}) |
| 28141 | 29266 | ); |
| @@ -28234,6 +29359,9 @@ class ProtocolClass { | ||
| 28234 | 29359 | * @throws Exception |
| 28235 | 29360 | */ |
| 28236 | 29361 | public static function from(stdClass $obj): ProtocolClass { |
| 29362 | + if (!property_exists($obj, 'protocol')) { | |
| 29363 | + throw new Exception("Missing required property"); | |
| 29364 | + } | |
| 28237 | 29365 | return new ProtocolClass( |
| 28238 | 29366 | ProtocolClass::fromProtocol($obj->{'protocol'}) |
| 28239 | 29367 | ); |
| @@ -28332,6 +29460,9 @@ class ObjectClass { | ||
| 28332 | 29460 | * @throws Exception |
| 28333 | 29461 | */ |
| 28334 | 29462 | public static function from(stdClass $obj): ObjectClass { |
| 29463 | + if (!property_exists($obj, 'object')) { | |
| 29464 | + throw new Exception("Missing required property"); | |
| 29465 | + } | |
| 28335 | 29466 | return new ObjectClass( |
| 28336 | 29467 | ObjectClass::fromObject($obj->{'object'}) |
| 28337 | 29468 | ); |
| @@ -28430,6 +29561,9 @@ class Of { | ||
| 28430 | 29561 | * @throws Exception |
| 28431 | 29562 | */ |
| 28432 | 29563 | public static function from(stdClass $obj): Of { |
| 29564 | + if (!property_exists($obj, 'of')) { | |
| 29565 | + throw new Exception("Missing required property"); | |
| 29566 | + } | |
| 28433 | 29567 | return new Of( |
| 28434 | 29568 | Of::fromOf($obj->{'of'}) |
| 28435 | 29569 | ); |
| @@ -28528,6 +29662,9 @@ class Oneway { | ||
| 28528 | 29662 | * @throws Exception |
| 28529 | 29663 | */ |
| 28530 | 29664 | public static function from(stdClass $obj): Oneway { |
| 29665 | + if (!property_exists($obj, 'oneway')) { | |
| 29666 | + throw new Exception("Missing required property"); | |
| 29667 | + } | |
| 28531 | 29668 | return new Oneway( |
| 28532 | 29669 | Oneway::fromOneway($obj->{'oneway'}) |
| 28533 | 29670 | ); |
| @@ -28626,6 +29763,9 @@ class Open { | ||
| 28626 | 29763 | * @throws Exception |
| 28627 | 29764 | */ |
| 28628 | 29765 | public static function from(stdClass $obj): Open { |
| 29766 | + if (!property_exists($obj, 'open')) { | |
| 29767 | + throw new Exception("Missing required property"); | |
| 29768 | + } | |
| 28629 | 29769 | return new Open( |
| 28630 | 29770 | Open::fromOpen($obj->{'open'}) |
| 28631 | 29771 | ); |
| @@ -28724,6 +29864,9 @@ class Operator { | ||
| 28724 | 29864 | * @throws Exception |
| 28725 | 29865 | */ |
| 28726 | 29866 | public static function from(stdClass $obj): Operator { |
| 29867 | + if (!property_exists($obj, 'operator')) { | |
| 29868 | + throw new Exception("Missing required property"); | |
| 29869 | + } | |
| 28727 | 29870 | return new Operator( |
| 28728 | 29871 | Operator::fromOperator($obj->{'operator'}) |
| 28729 | 29872 | ); |
| @@ -28822,6 +29965,9 @@ class Optional { | ||
| 28822 | 29965 | * @throws Exception |
| 28823 | 29966 | */ |
| 28824 | 29967 | public static function from(stdClass $obj): Optional { |
| 29968 | + if (!property_exists($obj, 'optional')) { | |
| 29969 | + throw new Exception("Missing required property"); | |
| 29970 | + } | |
| 28825 | 29971 | return new Optional( |
| 28826 | 29972 | Optional::fromOptional($obj->{'optional'}) |
| 28827 | 29973 | ); |
| @@ -28920,6 +30066,9 @@ class OrClass { | ||
| 28920 | 30066 | * @throws Exception |
| 28921 | 30067 | */ |
| 28922 | 30068 | public static function from(stdClass $obj): OrClass { |
| 30069 | + if (!property_exists($obj, 'or')) { | |
| 30070 | + throw new Exception("Missing required property"); | |
| 30071 | + } | |
| 28923 | 30072 | return new OrClass( |
| 28924 | 30073 | OrClass::fromOr($obj->{'or'}) |
| 28925 | 30074 | ); |
| @@ -29018,6 +30167,9 @@ class OrEq { | ||
| 29018 | 30167 | * @throws Exception |
| 29019 | 30168 | */ |
| 29020 | 30169 | public static function from(stdClass $obj): OrEq { |
| 30170 | + if (!property_exists($obj, 'or_eq')) { | |
| 30171 | + throw new Exception("Missing required property"); | |
| 30172 | + } | |
| 29021 | 30173 | return new OrEq( |
| 29022 | 30174 | OrEq::fromOrEq($obj->{'or_eq'}) |
| 29023 | 30175 | ); |
| @@ -29116,6 +30268,9 @@ class Out { | ||
| 29116 | 30268 | * @throws Exception |
| 29117 | 30269 | */ |
| 29118 | 30270 | public static function from(stdClass $obj): Out { |
| 30271 | + if (!property_exists($obj, 'out')) { | |
| 30272 | + throw new Exception("Missing required property"); | |
| 30273 | + } | |
| 29119 | 30274 | return new Out( |
| 29120 | 30275 | Out::fromOut($obj->{'out'}) |
| 29121 | 30276 | ); |
| @@ -29214,6 +30369,9 @@ class OverrideClass { | ||
| 29214 | 30369 | * @throws Exception |
| 29215 | 30370 | */ |
| 29216 | 30371 | public static function from(stdClass $obj): OverrideClass { |
| 30372 | + if (!property_exists($obj, 'override')) { | |
| 30373 | + throw new Exception("Missing required property"); | |
| 30374 | + } | |
| 29217 | 30375 | return new OverrideClass( |
| 29218 | 30376 | OverrideClass::fromOverride($obj->{'override'}) |
| 29219 | 30377 | ); |
| @@ -29312,6 +30470,9 @@ class Package { | ||
| 29312 | 30470 | * @throws Exception |
| 29313 | 30471 | */ |
| 29314 | 30472 | public static function from(stdClass $obj): Package { |
| 30473 | + if (!property_exists($obj, 'package')) { | |
| 30474 | + throw new Exception("Missing required property"); | |
| 30475 | + } | |
| 29315 | 30476 | return new Package( |
| 29316 | 30477 | Package::fromPackage($obj->{'package'}) |
| 29317 | 30478 | ); |
| @@ -29410,6 +30571,9 @@ class Params { | ||
| 29410 | 30571 | * @throws Exception |
| 29411 | 30572 | */ |
| 29412 | 30573 | public static function from(stdClass $obj): Params { |
| 30574 | + if (!property_exists($obj, 'params')) { | |
| 30575 | + throw new Exception("Missing required property"); | |
| 30576 | + } | |
| 29413 | 30577 | return new Params( |
| 29414 | 30578 | Params::fromParams($obj->{'params'}) |
| 29415 | 30579 | ); |
| @@ -29508,6 +30672,9 @@ class Pass { | ||
| 29508 | 30672 | * @throws Exception |
| 29509 | 30673 | */ |
| 29510 | 30674 | public static function from(stdClass $obj): Pass { |
| 30675 | + if (!property_exists($obj, 'pass')) { | |
| 30676 | + throw new Exception("Missing required property"); | |
| 30677 | + } | |
| 29511 | 30678 | return new Pass( |
| 29512 | 30679 | Pass::fromPass($obj->{'pass'}) |
| 29513 | 30680 | ); |
| @@ -29606,6 +30773,9 @@ class Port { | ||
| 29606 | 30773 | * @throws Exception |
| 29607 | 30774 | */ |
| 29608 | 30775 | public static function from(stdClass $obj): Port { |
| 30776 | + if (!property_exists($obj, 'port')) { | |
| 30777 | + throw new Exception("Missing required property"); | |
| 30778 | + } | |
| 29609 | 30779 | return new Port( |
| 29610 | 30780 | Port::fromPort($obj->{'port'}) |
| 29611 | 30781 | ); |
| @@ -29704,6 +30874,9 @@ class Postfix { | ||
| 29704 | 30874 | * @throws Exception |
| 29705 | 30875 | */ |
| 29706 | 30876 | public static function from(stdClass $obj): Postfix { |
| 30877 | + if (!property_exists($obj, 'postfix')) { | |
| 30878 | + throw new Exception("Missing required property"); | |
| 30879 | + } | |
| 29707 | 30880 | return new Postfix( |
| 29708 | 30881 | Postfix::fromPostfix($obj->{'postfix'}) |
| 29709 | 30882 | ); |
| @@ -29802,6 +30975,9 @@ class Precedence { | ||
| 29802 | 30975 | * @throws Exception |
| 29803 | 30976 | */ |
| 29804 | 30977 | public static function from(stdClass $obj): Precedence { |
| 30978 | + if (!property_exists($obj, 'precedence')) { | |
| 30979 | + throw new Exception("Missing required property"); | |
| 30980 | + } | |
| 29805 | 30981 | return new Precedence( |
| 29806 | 30982 | Precedence::fromPrecedence($obj->{'precedence'}) |
| 29807 | 30983 | ); |
| @@ -29900,6 +31076,9 @@ class Prefix { | ||
| 29900 | 31076 | * @throws Exception |
| 29901 | 31077 | */ |
| 29902 | 31078 | public static function from(stdClass $obj): Prefix { |
| 31079 | + if (!property_exists($obj, 'prefix')) { | |
| 31080 | + throw new Exception("Missing required property"); | |
| 31081 | + } | |
| 29903 | 31082 | return new Prefix( |
| 29904 | 31083 | Prefix::fromPrefix($obj->{'prefix'}) |
| 29905 | 31084 | ); |
| @@ -29998,6 +31177,9 @@ class PrintClass { | ||
| 29998 | 31177 | * @throws Exception |
| 29999 | 31178 | */ |
| 30000 | 31179 | public static function from(stdClass $obj): PrintClass { |
| 31180 | + if (!property_exists($obj, 'print')) { | |
| 31181 | + throw new Exception("Missing required property"); | |
| 31182 | + } | |
| 30001 | 31183 | return new PrintClass( |
| 30002 | 31184 | PrintClass::fromPrint($obj->{'print'}) |
| 30003 | 31185 | ); |
| @@ -30096,6 +31278,9 @@ class PrintMembers { | ||
| 30096 | 31278 | * @throws Exception |
| 30097 | 31279 | */ |
| 30098 | 31280 | public static function from(stdClass $obj): PrintMembers { |
| 31281 | + if (!property_exists($obj, 'printMembers')) { | |
| 31282 | + throw new Exception("Missing required property"); | |
| 31283 | + } | |
| 30099 | 31284 | return new PrintMembers( |
| 30100 | 31285 | PrintMembers::fromPrintMembers($obj->{'printMembers'}) |
| 30101 | 31286 | ); |
| @@ -30194,6 +31379,9 @@ class Printf { | ||
| 30194 | 31379 | * @throws Exception |
| 30195 | 31380 | */ |
| 30196 | 31381 | public static function from(stdClass $obj): Printf { |
| 31382 | + if (!property_exists($obj, 'printf')) { | |
| 31383 | + throw new Exception("Missing required property"); | |
| 31384 | + } | |
| 30197 | 31385 | return new Printf( |
| 30198 | 31386 | Printf::fromPrintf($obj->{'printf'}) |
| 30199 | 31387 | ); |
| @@ -30292,6 +31480,9 @@ class PrivateClass { | ||
| 30292 | 31480 | * @throws Exception |
| 30293 | 31481 | */ |
| 30294 | 31482 | public static function from(stdClass $obj): PrivateClass { |
| 31483 | + if (!property_exists($obj, 'private')) { | |
| 31484 | + throw new Exception("Missing required property"); | |
| 31485 | + } | |
| 30295 | 31486 | return new PrivateClass( |
| 30296 | 31487 | PrivateClass::fromPrivate($obj->{'private'}) |
| 30297 | 31488 | ); |
| @@ -30390,6 +31581,9 @@ class ProtectedClass { | ||
| 30390 | 31581 | * @throws Exception |
| 30391 | 31582 | */ |
| 30392 | 31583 | public static function from(stdClass $obj): ProtectedClass { |
| 31584 | + if (!property_exists($obj, 'protected')) { | |
| 31585 | + throw new Exception("Missing required property"); | |
| 31586 | + } | |
| 30393 | 31587 | return new ProtectedClass( |
| 30394 | 31588 | ProtectedClass::fromProtected($obj->{'protected'}) |
| 30395 | 31589 | ); |
| @@ -30488,6 +31682,9 @@ class Protocol { | ||
| 30488 | 31682 | * @throws Exception |
| 30489 | 31683 | */ |
| 30490 | 31684 | public static function from(stdClass $obj): Protocol { |
| 31685 | + if (!property_exists($obj, 'Protocol')) { | |
| 31686 | + throw new Exception("Missing required property"); | |
| 31687 | + } | |
| 30491 | 31688 | return new Protocol( |
| 30492 | 31689 | Protocol::fromProtocol($obj->{'Protocol'}) |
| 30493 | 31690 | ); |
| @@ -33978,6 +35175,201 @@ class Obj4 { | ||
| 33978 | 35175 | * @throws Exception |
| 33979 | 35176 | */ |
| 33980 | 35177 | public static function from(stdClass $obj): Obj4 { |
| 35178 | + if (!property_exists($obj, 'dummy')) { | |
| 35179 | + throw new Exception("Missing required property"); | |
| 35180 | + } | |
| 35181 | + if (!property_exists($obj, 'self')) { | |
| 35182 | + throw new Exception("Missing required property"); | |
| 35183 | + } | |
| 35184 | + if (!property_exists($obj, 'this')) { | |
| 35185 | + throw new Exception("Missing required property"); | |
| 35186 | + } | |
| 35187 | + if (!property_exists($obj, 'true')) { | |
| 35188 | + throw new Exception("Missing required property"); | |
| 35189 | + } | |
| 35190 | + if (!property_exists($obj, 'type')) { | |
| 35191 | + throw new Exception("Missing required property"); | |
| 35192 | + } | |
| 35193 | + if (!property_exists($obj, 'public')) { | |
| 35194 | + throw new Exception("Missing required property"); | |
| 35195 | + } | |
| 35196 | + if (!property_exists($obj, 'quicktype')) { | |
| 35197 | + throw new Exception("Missing required property"); | |
| 35198 | + } | |
| 35199 | + if (!property_exists($obj, 'raise')) { | |
| 35200 | + throw new Exception("Missing required property"); | |
| 35201 | + } | |
| 35202 | + if (!property_exists($obj, 'range')) { | |
| 35203 | + throw new Exception("Missing required property"); | |
| 35204 | + } | |
| 35205 | + if (!property_exists($obj, 'readonly')) { | |
| 35206 | + throw new Exception("Missing required property"); | |
| 35207 | + } | |
| 35208 | + if (!property_exists($obj, 'ref')) { | |
| 35209 | + throw new Exception("Missing required property"); | |
| 35210 | + } | |
| 35211 | + if (!property_exists($obj, 'register')) { | |
| 35212 | + throw new Exception("Missing required property"); | |
| 35213 | + } | |
| 35214 | + if (!property_exists($obj, 'reinterpret_cast')) { | |
| 35215 | + throw new Exception("Missing required property"); | |
| 35216 | + } | |
| 35217 | + if (!property_exists($obj, 'repeat')) { | |
| 35218 | + throw new Exception("Missing required property"); | |
| 35219 | + } | |
| 35220 | + if (!property_exists($obj, 'require')) { | |
| 35221 | + throw new Exception("Missing required property"); | |
| 35222 | + } | |
| 35223 | + if (!property_exists($obj, 'required')) { | |
| 35224 | + throw new Exception("Missing required property"); | |
| 35225 | + } | |
| 35226 | + if (!property_exists($obj, 'requires')) { | |
| 35227 | + throw new Exception("Missing required property"); | |
| 35228 | + } | |
| 35229 | + if (!property_exists($obj, 'restrict')) { | |
| 35230 | + throw new Exception("Missing required property"); | |
| 35231 | + } | |
| 35232 | + if (!property_exists($obj, 'retain')) { | |
| 35233 | + throw new Exception("Missing required property"); | |
| 35234 | + } | |
| 35235 | + if (!property_exists($obj, 'rethrows')) { | |
| 35236 | + throw new Exception("Missing required property"); | |
| 35237 | + } | |
| 35238 | + if (!property_exists($obj, 'return')) { | |
| 35239 | + throw new Exception("Missing required property"); | |
| 35240 | + } | |
| 35241 | + if (!property_exists($obj, 'right')) { | |
| 35242 | + throw new Exception("Missing required property"); | |
| 35243 | + } | |
| 35244 | + if (!property_exists($obj, 'sbyte')) { | |
| 35245 | + throw new Exception("Missing required property"); | |
| 35246 | + } | |
| 35247 | + if (!property_exists($obj, 'sealed')) { | |
| 35248 | + throw new Exception("Missing required property"); | |
| 35249 | + } | |
| 35250 | + if (!property_exists($obj, 'SEL')) { | |
| 35251 | + throw new Exception("Missing required property"); | |
| 35252 | + } | |
| 35253 | + if (!property_exists($obj, 'select')) { | |
| 35254 | + throw new Exception("Missing required property"); | |
| 35255 | + } | |
| 35256 | + if (!property_exists($obj, 'Self')) { | |
| 35257 | + throw new Exception("Missing required property"); | |
| 35258 | + } | |
| 35259 | + if (!property_exists($obj, 'serialize')) { | |
| 35260 | + throw new Exception("Missing required property"); | |
| 35261 | + } | |
| 35262 | + if (!property_exists($obj, 'set')) { | |
| 35263 | + throw new Exception("Missing required property"); | |
| 35264 | + } | |
| 35265 | + if (!property_exists($obj, 'short')) { | |
| 35266 | + throw new Exception("Missing required property"); | |
| 35267 | + } | |
| 35268 | + if (!property_exists($obj, 'signed')) { | |
| 35269 | + throw new Exception("Missing required property"); | |
| 35270 | + } | |
| 35271 | + if (!property_exists($obj, 'sizeof')) { | |
| 35272 | + throw new Exception("Missing required property"); | |
| 35273 | + } | |
| 35274 | + if (!property_exists($obj, 'stackalloc')) { | |
| 35275 | + throw new Exception("Missing required property"); | |
| 35276 | + } | |
| 35277 | + if (!property_exists($obj, 'static')) { | |
| 35278 | + throw new Exception("Missing required property"); | |
| 35279 | + } | |
| 35280 | + if (!property_exists($obj, 'static_assert')) { | |
| 35281 | + throw new Exception("Missing required property"); | |
| 35282 | + } | |
| 35283 | + if (!property_exists($obj, 'static_cast')) { | |
| 35284 | + throw new Exception("Missing required property"); | |
| 35285 | + } | |
| 35286 | + if (!property_exists($obj, 'strictfp')) { | |
| 35287 | + throw new Exception("Missing required property"); | |
| 35288 | + } | |
| 35289 | + if (!property_exists($obj, 'string')) { | |
| 35290 | + throw new Exception("Missing required property"); | |
| 35291 | + } | |
| 35292 | + if (!property_exists($obj, 'struct')) { | |
| 35293 | + throw new Exception("Missing required property"); | |
| 35294 | + } | |
| 35295 | + if (!property_exists($obj, 'subscript')) { | |
| 35296 | + throw new Exception("Missing required property"); | |
| 35297 | + } | |
| 35298 | + if (!property_exists($obj, 'super')) { | |
| 35299 | + throw new Exception("Missing required property"); | |
| 35300 | + } | |
| 35301 | + if (!property_exists($obj, 'switch')) { | |
| 35302 | + throw new Exception("Missing required property"); | |
| 35303 | + } | |
| 35304 | + if (!property_exists($obj, 'symbol')) { | |
| 35305 | + throw new Exception("Missing required property"); | |
| 35306 | + } | |
| 35307 | + if (!property_exists($obj, 'synchronized')) { | |
| 35308 | + throw new Exception("Missing required property"); | |
| 35309 | + } | |
| 35310 | + if (!property_exists($obj, 'system')) { | |
| 35311 | + throw new Exception("Missing required property"); | |
| 35312 | + } | |
| 35313 | + if (!property_exists($obj, 'template')) { | |
| 35314 | + throw new Exception("Missing required property"); | |
| 35315 | + } | |
| 35316 | + if (!property_exists($obj, 'then')) { | |
| 35317 | + throw new Exception("Missing required property"); | |
| 35318 | + } | |
| 35319 | + if (!property_exists($obj, 'thread_local')) { | |
| 35320 | + throw new Exception("Missing required property"); | |
| 35321 | + } | |
| 35322 | + if (!property_exists($obj, 'throw')) { | |
| 35323 | + throw new Exception("Missing required property"); | |
| 35324 | + } | |
| 35325 | + if (!property_exists($obj, 'throws')) { | |
| 35326 | + throw new Exception("Missing required property"); | |
| 35327 | + } | |
| 35328 | + if (!property_exists($obj, 'to_json')) { | |
| 35329 | + throw new Exception("Missing required property"); | |
| 35330 | + } | |
| 35331 | + if (!property_exists($obj, 'top_level')) { | |
| 35332 | + throw new Exception("Missing required property"); | |
| 35333 | + } | |
| 35334 | + if (!property_exists($obj, 'transient')) { | |
| 35335 | + throw new Exception("Missing required property"); | |
| 35336 | + } | |
| 35337 | + if (!property_exists($obj, 'True')) { | |
| 35338 | + throw new Exception("Missing required property"); | |
| 35339 | + } | |
| 35340 | + if (!property_exists($obj, 'try')) { | |
| 35341 | + throw new Exception("Missing required property"); | |
| 35342 | + } | |
| 35343 | + if (!property_exists($obj, 'Type')) { | |
| 35344 | + throw new Exception("Missing required property"); | |
| 35345 | + } | |
| 35346 | + if (!property_exists($obj, 'typealias')) { | |
| 35347 | + throw new Exception("Missing required property"); | |
| 35348 | + } | |
| 35349 | + if (!property_exists($obj, 'typedef')) { | |
| 35350 | + throw new Exception("Missing required property"); | |
| 35351 | + } | |
| 35352 | + if (!property_exists($obj, 'typeid')) { | |
| 35353 | + throw new Exception("Missing required property"); | |
| 35354 | + } | |
| 35355 | + if (!property_exists($obj, 'typename')) { | |
| 35356 | + throw new Exception("Missing required property"); | |
| 35357 | + } | |
| 35358 | + if (!property_exists($obj, 'typeof')) { | |
| 35359 | + throw new Exception("Missing required property"); | |
| 35360 | + } | |
| 35361 | + if (!property_exists($obj, 'uint')) { | |
| 35362 | + throw new Exception("Missing required property"); | |
| 35363 | + } | |
| 35364 | + if (!property_exists($obj, 'ulong')) { | |
| 35365 | + throw new Exception("Missing required property"); | |
| 35366 | + } | |
| 35367 | + if (!property_exists($obj, 'unchecked')) { | |
| 35368 | + throw new Exception("Missing required property"); | |
| 35369 | + } | |
| 35370 | + if (!property_exists($obj, 'undefined')) { | |
| 35371 | + throw new Exception("Missing required property"); | |
| 35372 | + } | |
| 33981 | 35373 | return new Obj4( |
| 33982 | 35374 | Obj4::fromDummy($obj->{'dummy'}) |
| 33983 | 35375 | ,Obj4::fromObj4Self($obj->{'self'}) |
| @@ -34204,6 +35596,9 @@ class Obj4Self { | ||
| 34204 | 35596 | * @throws Exception |
| 34205 | 35597 | */ |
| 34206 | 35598 | public static function from(stdClass $obj): Obj4Self { |
| 35599 | + if (!property_exists($obj, 'self')) { | |
| 35600 | + throw new Exception("Missing required property"); | |
| 35601 | + } | |
| 34207 | 35602 | return new Obj4Self( |
| 34208 | 35603 | Obj4Self::fromSelf($obj->{'self'}) |
| 34209 | 35604 | ); |
| @@ -34302,6 +35697,9 @@ class This { | ||
| 34302 | 35697 | * @throws Exception |
| 34303 | 35698 | */ |
| 34304 | 35699 | public static function from(stdClass $obj): This { |
| 35700 | + if (!property_exists($obj, 'this')) { | |
| 35701 | + throw new Exception("Missing required property"); | |
| 35702 | + } | |
| 34305 | 35703 | return new This( |
| 34306 | 35704 | This::fromThisThis($obj->{'this'}) |
| 34307 | 35705 | ); |
| @@ -34400,6 +35798,9 @@ class Obj4True { | ||
| 34400 | 35798 | * @throws Exception |
| 34401 | 35799 | */ |
| 34402 | 35800 | public static function from(stdClass $obj): Obj4True { |
| 35801 | + if (!property_exists($obj, 'true')) { | |
| 35802 | + throw new Exception("Missing required property"); | |
| 35803 | + } | |
| 34403 | 35804 | return new Obj4True( |
| 34404 | 35805 | Obj4True::fromTrue($obj->{'true'}) |
| 34405 | 35806 | ); |
| @@ -34498,6 +35899,9 @@ class TypeClass { | ||
| 34498 | 35899 | * @throws Exception |
| 34499 | 35900 | */ |
| 34500 | 35901 | public static function from(stdClass $obj): TypeClass { |
| 35902 | + if (!property_exists($obj, 'type')) { | |
| 35903 | + throw new Exception("Missing required property"); | |
| 35904 | + } | |
| 34501 | 35905 | return new TypeClass( |
| 34502 | 35906 | TypeClass::fromType($obj->{'type'}) |
| 34503 | 35907 | ); |
| @@ -34596,6 +36000,9 @@ class PublicClass { | ||
| 34596 | 36000 | * @throws Exception |
| 34597 | 36001 | */ |
| 34598 | 36002 | public static function from(stdClass $obj): PublicClass { |
| 36003 | + if (!property_exists($obj, 'public')) { | |
| 36004 | + throw new Exception("Missing required property"); | |
| 36005 | + } | |
| 34599 | 36006 | return new PublicClass( |
| 34600 | 36007 | PublicClass::fromPublic($obj->{'public'}) |
| 34601 | 36008 | ); |
| @@ -34694,6 +36101,9 @@ class Quicktype { | ||
| 34694 | 36101 | * @throws Exception |
| 34695 | 36102 | */ |
| 34696 | 36103 | public static function from(stdClass $obj): Quicktype { |
| 36104 | + if (!property_exists($obj, 'quicktype')) { | |
| 36105 | + throw new Exception("Missing required property"); | |
| 36106 | + } | |
| 34697 | 36107 | return new Quicktype( |
| 34698 | 36108 | Quicktype::fromQuicktype($obj->{'quicktype'}) |
| 34699 | 36109 | ); |
| @@ -34792,6 +36202,9 @@ class Raise { | ||
| 34792 | 36202 | * @throws Exception |
| 34793 | 36203 | */ |
| 34794 | 36204 | public static function from(stdClass $obj): Raise { |
| 36205 | + if (!property_exists($obj, 'raise')) { | |
| 36206 | + throw new Exception("Missing required property"); | |
| 36207 | + } | |
| 34795 | 36208 | return new Raise( |
| 34796 | 36209 | Raise::fromRaise($obj->{'raise'}) |
| 34797 | 36210 | ); |
| @@ -34890,6 +36303,9 @@ class Range { | ||
| 34890 | 36303 | * @throws Exception |
| 34891 | 36304 | */ |
| 34892 | 36305 | public static function from(stdClass $obj): Range { |
| 36306 | + if (!property_exists($obj, 'range')) { | |
| 36307 | + throw new Exception("Missing required property"); | |
| 36308 | + } | |
| 34893 | 36309 | return new Range( |
| 34894 | 36310 | Range::fromRange($obj->{'range'}) |
| 34895 | 36311 | ); |
| @@ -34988,6 +36404,9 @@ class ReadonlyClass { | ||
| 34988 | 36404 | * @throws Exception |
| 34989 | 36405 | */ |
| 34990 | 36406 | public static function from(stdClass $obj): ReadonlyClass { |
| 36407 | + if (!property_exists($obj, 'readonly')) { | |
| 36408 | + throw new Exception("Missing required property"); | |
| 36409 | + } | |
| 34991 | 36410 | return new ReadonlyClass( |
| 34992 | 36411 | ReadonlyClass::fromReadonly($obj->{'readonly'}) |
| 34993 | 36412 | ); |
| @@ -35086,6 +36505,9 @@ class Ref { | ||
| 35086 | 36505 | * @throws Exception |
| 35087 | 36506 | */ |
| 35088 | 36507 | public static function from(stdClass $obj): Ref { |
| 36508 | + if (!property_exists($obj, 'ref')) { | |
| 36509 | + throw new Exception("Missing required property"); | |
| 36510 | + } | |
| 35089 | 36511 | return new Ref( |
| 35090 | 36512 | Ref::fromRef($obj->{'ref'}) |
| 35091 | 36513 | ); |
| @@ -35184,6 +36606,9 @@ class Register { | ||
| 35184 | 36606 | * @throws Exception |
| 35185 | 36607 | */ |
| 35186 | 36608 | public static function from(stdClass $obj): Register { |
| 36609 | + if (!property_exists($obj, 'register')) { | |
| 36610 | + throw new Exception("Missing required property"); | |
| 36611 | + } | |
| 35187 | 36612 | return new Register( |
| 35188 | 36613 | Register::fromRegister($obj->{'register'}) |
| 35189 | 36614 | ); |
| @@ -35282,6 +36707,9 @@ class ReinterpretCast { | ||
| 35282 | 36707 | * @throws Exception |
| 35283 | 36708 | */ |
| 35284 | 36709 | public static function from(stdClass $obj): ReinterpretCast { |
| 36710 | + if (!property_exists($obj, 'reinterpret_cast')) { | |
| 36711 | + throw new Exception("Missing required property"); | |
| 36712 | + } | |
| 35285 | 36713 | return new ReinterpretCast( |
| 35286 | 36714 | ReinterpretCast::fromReinterpretCast($obj->{'reinterpret_cast'}) |
| 35287 | 36715 | ); |
| @@ -35380,6 +36808,9 @@ class Repeat { | ||
| 35380 | 36808 | * @throws Exception |
| 35381 | 36809 | */ |
| 35382 | 36810 | public static function from(stdClass $obj): Repeat { |
| 36811 | + if (!property_exists($obj, 'repeat')) { | |
| 36812 | + throw new Exception("Missing required property"); | |
| 36813 | + } | |
| 35383 | 36814 | return new Repeat( |
| 35384 | 36815 | Repeat::fromRepeat($obj->{'repeat'}) |
| 35385 | 36816 | ); |
| @@ -35478,6 +36909,9 @@ class RequireClass { | ||
| 35478 | 36909 | * @throws Exception |
| 35479 | 36910 | */ |
| 35480 | 36911 | public static function from(stdClass $obj): RequireClass { |
| 36912 | + if (!property_exists($obj, 'require')) { | |
| 36913 | + throw new Exception("Missing required property"); | |
| 36914 | + } | |
| 35481 | 36915 | return new RequireClass( |
| 35482 | 36916 | RequireClass::fromRequire($obj->{'require'}) |
| 35483 | 36917 | ); |
| @@ -35576,6 +37010,9 @@ class Required { | ||
| 35576 | 37010 | * @throws Exception |
| 35577 | 37011 | */ |
| 35578 | 37012 | public static function from(stdClass $obj): Required { |
| 37013 | + if (!property_exists($obj, 'required')) { | |
| 37014 | + throw new Exception("Missing required property"); | |
| 37015 | + } | |
| 35579 | 37016 | return new Required( |
| 35580 | 37017 | Required::fromRequired($obj->{'required'}) |
| 35581 | 37018 | ); |
| @@ -35674,6 +37111,9 @@ class Requires { | ||
| 35674 | 37111 | * @throws Exception |
| 35675 | 37112 | */ |
| 35676 | 37113 | public static function from(stdClass $obj): Requires { |
| 37114 | + if (!property_exists($obj, 'requires')) { | |
| 37115 | + throw new Exception("Missing required property"); | |
| 37116 | + } | |
| 35677 | 37117 | return new Requires( |
| 35678 | 37118 | Requires::fromRequires($obj->{'requires'}) |
| 35679 | 37119 | ); |
| @@ -35772,6 +37212,9 @@ class Restrict { | ||
| 35772 | 37212 | * @throws Exception |
| 35773 | 37213 | */ |
| 35774 | 37214 | public static function from(stdClass $obj): Restrict { |
| 37215 | + if (!property_exists($obj, 'restrict')) { | |
| 37216 | + throw new Exception("Missing required property"); | |
| 37217 | + } | |
| 35775 | 37218 | return new Restrict( |
| 35776 | 37219 | Restrict::fromRestrict($obj->{'restrict'}) |
| 35777 | 37220 | ); |
| @@ -35870,6 +37313,9 @@ class Retain { | ||
| 35870 | 37313 | * @throws Exception |
| 35871 | 37314 | */ |
| 35872 | 37315 | public static function from(stdClass $obj): Retain { |
| 37316 | + if (!property_exists($obj, 'retain')) { | |
| 37317 | + throw new Exception("Missing required property"); | |
| 37318 | + } | |
| 35873 | 37319 | return new Retain( |
| 35874 | 37320 | Retain::fromRetain($obj->{'retain'}) |
| 35875 | 37321 | ); |
| @@ -35968,6 +37414,9 @@ class Rethrows { | ||
| 35968 | 37414 | * @throws Exception |
| 35969 | 37415 | */ |
| 35970 | 37416 | public static function from(stdClass $obj): Rethrows { |
| 37417 | + if (!property_exists($obj, 'rethrows')) { | |
| 37418 | + throw new Exception("Missing required property"); | |
| 37419 | + } | |
| 35971 | 37420 | return new Rethrows( |
| 35972 | 37421 | Rethrows::fromRethrows($obj->{'rethrows'}) |
| 35973 | 37422 | ); |
| @@ -36066,6 +37515,9 @@ class ReturnClass { | ||
| 36066 | 37515 | * @throws Exception |
| 36067 | 37516 | */ |
| 36068 | 37517 | public static function from(stdClass $obj): ReturnClass { |
| 37518 | + if (!property_exists($obj, 'return')) { | |
| 37519 | + throw new Exception("Missing required property"); | |
| 37520 | + } | |
| 36069 | 37521 | return new ReturnClass( |
| 36070 | 37522 | ReturnClass::fromReturn($obj->{'return'}) |
| 36071 | 37523 | ); |
| @@ -36164,6 +37616,9 @@ class Right { | ||
| 36164 | 37616 | * @throws Exception |
| 36165 | 37617 | */ |
| 36166 | 37618 | public static function from(stdClass $obj): Right { |
| 37619 | + if (!property_exists($obj, 'right')) { | |
| 37620 | + throw new Exception("Missing required property"); | |
| 37621 | + } | |
| 36167 | 37622 | return new Right( |
| 36168 | 37623 | Right::fromRight($obj->{'right'}) |
| 36169 | 37624 | ); |
| @@ -36262,6 +37717,9 @@ class Sbyte { | ||
| 36262 | 37717 | * @throws Exception |
| 36263 | 37718 | */ |
| 36264 | 37719 | public static function from(stdClass $obj): Sbyte { |
| 37720 | + if (!property_exists($obj, 'sbyte')) { | |
| 37721 | + throw new Exception("Missing required property"); | |
| 37722 | + } | |
| 36265 | 37723 | return new Sbyte( |
| 36266 | 37724 | Sbyte::fromSbyte($obj->{'sbyte'}) |
| 36267 | 37725 | ); |
| @@ -36360,6 +37818,9 @@ class Sealed { | ||
| 36360 | 37818 | * @throws Exception |
| 36361 | 37819 | */ |
| 36362 | 37820 | public static function from(stdClass $obj): Sealed { |
| 37821 | + if (!property_exists($obj, 'sealed')) { | |
| 37822 | + throw new Exception("Missing required property"); | |
| 37823 | + } | |
| 36363 | 37824 | return new Sealed( |
| 36364 | 37825 | Sealed::fromSealed($obj->{'sealed'}) |
| 36365 | 37826 | ); |
| @@ -36458,6 +37919,9 @@ class Sel { | ||
| 36458 | 37919 | * @throws Exception |
| 36459 | 37920 | */ |
| 36460 | 37921 | public static function from(stdClass $obj): Sel { |
| 37922 | + if (!property_exists($obj, 'SEL')) { | |
| 37923 | + throw new Exception("Missing required property"); | |
| 37924 | + } | |
| 36461 | 37925 | return new Sel( |
| 36462 | 37926 | Sel::fromSel($obj->{'SEL'}) |
| 36463 | 37927 | ); |
| @@ -36556,6 +38020,9 @@ class Select { | ||
| 36556 | 38020 | * @throws Exception |
| 36557 | 38021 | */ |
| 36558 | 38022 | public static function from(stdClass $obj): Select { |
| 38023 | + if (!property_exists($obj, 'select')) { | |
| 38024 | + throw new Exception("Missing required property"); | |
| 38025 | + } | |
| 36559 | 38026 | return new Select( |
| 36560 | 38027 | Select::fromSelect($obj->{'select'}) |
| 36561 | 38028 | ); |
| @@ -36654,6 +38121,9 @@ class SelfClass { | ||
| 36654 | 38121 | * @throws Exception |
| 36655 | 38122 | */ |
| 36656 | 38123 | public static function from(stdClass $obj): SelfClass { |
| 38124 | + if (!property_exists($obj, 'Self')) { | |
| 38125 | + throw new Exception("Missing required property"); | |
| 38126 | + } | |
| 36657 | 38127 | return new SelfClass( |
| 36658 | 38128 | SelfClass::fromSelf($obj->{'Self'}) |
| 36659 | 38129 | ); |
| @@ -36752,6 +38222,9 @@ class Serialize { | ||
| 36752 | 38222 | * @throws Exception |
| 36753 | 38223 | */ |
| 36754 | 38224 | public static function from(stdClass $obj): Serialize { |
| 38225 | + if (!property_exists($obj, 'serialize')) { | |
| 38226 | + throw new Exception("Missing required property"); | |
| 38227 | + } | |
| 36755 | 38228 | return new Serialize( |
| 36756 | 38229 | Serialize::fromSerialize($obj->{'serialize'}) |
| 36757 | 38230 | ); |
| @@ -36850,6 +38323,9 @@ class Set { | ||
| 36850 | 38323 | * @throws Exception |
| 36851 | 38324 | */ |
| 36852 | 38325 | public static function from(stdClass $obj): Set { |
| 38326 | + if (!property_exists($obj, 'set')) { | |
| 38327 | + throw new Exception("Missing required property"); | |
| 38328 | + } | |
| 36853 | 38329 | return new Set( |
| 36854 | 38330 | Set::fromSet($obj->{'set'}) |
| 36855 | 38331 | ); |
| @@ -36948,6 +38424,9 @@ class Short { | ||
| 36948 | 38424 | * @throws Exception |
| 36949 | 38425 | */ |
| 36950 | 38426 | public static function from(stdClass $obj): Short { |
| 38427 | + if (!property_exists($obj, 'short')) { | |
| 38428 | + throw new Exception("Missing required property"); | |
| 38429 | + } | |
| 36951 | 38430 | return new Short( |
| 36952 | 38431 | Short::fromShort($obj->{'short'}) |
| 36953 | 38432 | ); |
| @@ -37046,6 +38525,9 @@ class Signed { | ||
| 37046 | 38525 | * @throws Exception |
| 37047 | 38526 | */ |
| 37048 | 38527 | public static function from(stdClass $obj): Signed { |
| 38528 | + if (!property_exists($obj, 'signed')) { | |
| 38529 | + throw new Exception("Missing required property"); | |
| 38530 | + } | |
| 37049 | 38531 | return new Signed( |
| 37050 | 38532 | Signed::fromSigned($obj->{'signed'}) |
| 37051 | 38533 | ); |
| @@ -37144,6 +38626,9 @@ class Sizeof { | ||
| 37144 | 38626 | * @throws Exception |
| 37145 | 38627 | */ |
| 37146 | 38628 | public static function from(stdClass $obj): Sizeof { |
| 38629 | + if (!property_exists($obj, 'sizeof')) { | |
| 38630 | + throw new Exception("Missing required property"); | |
| 38631 | + } | |
| 37147 | 38632 | return new Sizeof( |
| 37148 | 38633 | Sizeof::fromSizeof($obj->{'sizeof'}) |
| 37149 | 38634 | ); |
| @@ -37242,6 +38727,9 @@ class Stackalloc { | ||
| 37242 | 38727 | * @throws Exception |
| 37243 | 38728 | */ |
| 37244 | 38729 | public static function from(stdClass $obj): Stackalloc { |
| 38730 | + if (!property_exists($obj, 'stackalloc')) { | |
| 38731 | + throw new Exception("Missing required property"); | |
| 38732 | + } | |
| 37245 | 38733 | return new Stackalloc( |
| 37246 | 38734 | Stackalloc::fromStackalloc($obj->{'stackalloc'}) |
| 37247 | 38735 | ); |
| @@ -37340,6 +38828,9 @@ class StaticClass { | ||
| 37340 | 38828 | * @throws Exception |
| 37341 | 38829 | */ |
| 37342 | 38830 | public static function from(stdClass $obj): StaticClass { |
| 38831 | + if (!property_exists($obj, 'static')) { | |
| 38832 | + throw new Exception("Missing required property"); | |
| 38833 | + } | |
| 37343 | 38834 | return new StaticClass( |
| 37344 | 38835 | StaticClass::fromStatic($obj->{'static'}) |
| 37345 | 38836 | ); |
| @@ -37438,6 +38929,9 @@ class StaticAssert { | ||
| 37438 | 38929 | * @throws Exception |
| 37439 | 38930 | */ |
| 37440 | 38931 | public static function from(stdClass $obj): StaticAssert { |
| 38932 | + if (!property_exists($obj, 'static_assert')) { | |
| 38933 | + throw new Exception("Missing required property"); | |
| 38934 | + } | |
| 37441 | 38935 | return new StaticAssert( |
| 37442 | 38936 | StaticAssert::fromStaticAssert($obj->{'static_assert'}) |
| 37443 | 38937 | ); |
| @@ -37536,6 +39030,9 @@ class StaticCast { | ||
| 37536 | 39030 | * @throws Exception |
| 37537 | 39031 | */ |
| 37538 | 39032 | public static function from(stdClass $obj): StaticCast { |
| 39033 | + if (!property_exists($obj, 'static_cast')) { | |
| 39034 | + throw new Exception("Missing required property"); | |
| 39035 | + } | |
| 37539 | 39036 | return new StaticCast( |
| 37540 | 39037 | StaticCast::fromStaticCast($obj->{'static_cast'}) |
| 37541 | 39038 | ); |
| @@ -37634,6 +39131,9 @@ class Strictfp { | ||
| 37634 | 39131 | * @throws Exception |
| 37635 | 39132 | */ |
| 37636 | 39133 | public static function from(stdClass $obj): Strictfp { |
| 39134 | + if (!property_exists($obj, 'strictfp')) { | |
| 39135 | + throw new Exception("Missing required property"); | |
| 39136 | + } | |
| 37637 | 39137 | return new Strictfp( |
| 37638 | 39138 | Strictfp::fromStrictfp($obj->{'strictfp'}) |
| 37639 | 39139 | ); |
| @@ -37732,6 +39232,9 @@ class StringClass { | ||
| 37732 | 39232 | * @throws Exception |
| 37733 | 39233 | */ |
| 37734 | 39234 | public static function from(stdClass $obj): StringClass { |
| 39235 | + if (!property_exists($obj, 'string')) { | |
| 39236 | + throw new Exception("Missing required property"); | |
| 39237 | + } | |
| 37735 | 39238 | return new StringClass( |
| 37736 | 39239 | StringClass::fromString($obj->{'string'}) |
| 37737 | 39240 | ); |
| @@ -37830,6 +39333,9 @@ class Struct { | ||
| 37830 | 39333 | * @throws Exception |
| 37831 | 39334 | */ |
| 37832 | 39335 | public static function from(stdClass $obj): Struct { |
| 39336 | + if (!property_exists($obj, 'struct')) { | |
| 39337 | + throw new Exception("Missing required property"); | |
| 39338 | + } | |
| 37833 | 39339 | return new Struct( |
| 37834 | 39340 | Struct::fromStruct($obj->{'struct'}) |
| 37835 | 39341 | ); |
| @@ -37928,6 +39434,9 @@ class Subscript { | ||
| 37928 | 39434 | * @throws Exception |
| 37929 | 39435 | */ |
| 37930 | 39436 | public static function from(stdClass $obj): Subscript { |
| 39437 | + if (!property_exists($obj, 'subscript')) { | |
| 39438 | + throw new Exception("Missing required property"); | |
| 39439 | + } | |
| 37931 | 39440 | return new Subscript( |
| 37932 | 39441 | Subscript::fromSubscript($obj->{'subscript'}) |
| 37933 | 39442 | ); |
| @@ -38026,6 +39535,9 @@ class Super { | ||
| 38026 | 39535 | * @throws Exception |
| 38027 | 39536 | */ |
| 38028 | 39537 | public static function from(stdClass $obj): Super { |
| 39538 | + if (!property_exists($obj, 'super')) { | |
| 39539 | + throw new Exception("Missing required property"); | |
| 39540 | + } | |
| 38029 | 39541 | return new Super( |
| 38030 | 39542 | Super::fromSuper($obj->{'super'}) |
| 38031 | 39543 | ); |
| @@ -38124,6 +39636,9 @@ class SwitchClass { | ||
| 38124 | 39636 | * @throws Exception |
| 38125 | 39637 | */ |
| 38126 | 39638 | public static function from(stdClass $obj): SwitchClass { |
| 39639 | + if (!property_exists($obj, 'switch')) { | |
| 39640 | + throw new Exception("Missing required property"); | |
| 39641 | + } | |
| 38127 | 39642 | return new SwitchClass( |
| 38128 | 39643 | SwitchClass::fromSwitch($obj->{'switch'}) |
| 38129 | 39644 | ); |
| @@ -38222,6 +39737,9 @@ class Symbol { | ||
| 38222 | 39737 | * @throws Exception |
| 38223 | 39738 | */ |
| 38224 | 39739 | public static function from(stdClass $obj): Symbol { |
| 39740 | + if (!property_exists($obj, 'symbol')) { | |
| 39741 | + throw new Exception("Missing required property"); | |
| 39742 | + } | |
| 38225 | 39743 | return new Symbol( |
| 38226 | 39744 | Symbol::fromSymbol($obj->{'symbol'}) |
| 38227 | 39745 | ); |
| @@ -38320,6 +39838,9 @@ class Synchronized { | ||
| 38320 | 39838 | * @throws Exception |
| 38321 | 39839 | */ |
| 38322 | 39840 | public static function from(stdClass $obj): Synchronized { |
| 39841 | + if (!property_exists($obj, 'synchronized')) { | |
| 39842 | + throw new Exception("Missing required property"); | |
| 39843 | + } | |
| 38323 | 39844 | return new Synchronized( |
| 38324 | 39845 | Synchronized::fromSynchronized($obj->{'synchronized'}) |
| 38325 | 39846 | ); |
| @@ -38418,6 +39939,9 @@ class System { | ||
| 38418 | 39939 | * @throws Exception |
| 38419 | 39940 | */ |
| 38420 | 39941 | public static function from(stdClass $obj): System { |
| 39942 | + if (!property_exists($obj, 'system')) { | |
| 39943 | + throw new Exception("Missing required property"); | |
| 39944 | + } | |
| 38421 | 39945 | return new System( |
| 38422 | 39946 | System::fromSystem($obj->{'system'}) |
| 38423 | 39947 | ); |
| @@ -38516,6 +40040,9 @@ class Template { | ||
| 38516 | 40040 | * @throws Exception |
| 38517 | 40041 | */ |
| 38518 | 40042 | public static function from(stdClass $obj): Template { |
| 40043 | + if (!property_exists($obj, 'template')) { | |
| 40044 | + throw new Exception("Missing required property"); | |
| 40045 | + } | |
| 38519 | 40046 | return new Template( |
| 38520 | 40047 | Template::fromTemplate($obj->{'template'}) |
| 38521 | 40048 | ); |
| @@ -38614,6 +40141,9 @@ class Then { | ||
| 38614 | 40141 | * @throws Exception |
| 38615 | 40142 | */ |
| 38616 | 40143 | public static function from(stdClass $obj): Then { |
| 40144 | + if (!property_exists($obj, 'then')) { | |
| 40145 | + throw new Exception("Missing required property"); | |
| 40146 | + } | |
| 38617 | 40147 | return new Then( |
| 38618 | 40148 | Then::fromThen($obj->{'then'}) |
| 38619 | 40149 | ); |
| @@ -38712,6 +40242,9 @@ class ThreadLocal { | ||
| 38712 | 40242 | * @throws Exception |
| 38713 | 40243 | */ |
| 38714 | 40244 | public static function from(stdClass $obj): ThreadLocal { |
| 40245 | + if (!property_exists($obj, 'thread_local')) { | |
| 40246 | + throw new Exception("Missing required property"); | |
| 40247 | + } | |
| 38715 | 40248 | return new ThreadLocal( |
| 38716 | 40249 | ThreadLocal::fromThreadLocal($obj->{'thread_local'}) |
| 38717 | 40250 | ); |
| @@ -38810,6 +40343,9 @@ class ThrowClass { | ||
| 38810 | 40343 | * @throws Exception |
| 38811 | 40344 | */ |
| 38812 | 40345 | public static function from(stdClass $obj): ThrowClass { |
| 40346 | + if (!property_exists($obj, 'throw')) { | |
| 40347 | + throw new Exception("Missing required property"); | |
| 40348 | + } | |
| 38813 | 40349 | return new ThrowClass( |
| 38814 | 40350 | ThrowClass::fromThrow($obj->{'throw'}) |
| 38815 | 40351 | ); |
| @@ -38908,6 +40444,9 @@ class Throws { | ||
| 38908 | 40444 | * @throws Exception |
| 38909 | 40445 | */ |
| 38910 | 40446 | public static function from(stdClass $obj): Throws { |
| 40447 | + if (!property_exists($obj, 'throws')) { | |
| 40448 | + throw new Exception("Missing required property"); | |
| 40449 | + } | |
| 38911 | 40450 | return new Throws( |
| 38912 | 40451 | Throws::fromThrows($obj->{'throws'}) |
| 38913 | 40452 | ); |
| @@ -39006,6 +40545,9 @@ class ToJSON { | ||
| 39006 | 40545 | * @throws Exception |
| 39007 | 40546 | */ |
| 39008 | 40547 | public static function from(stdClass $obj): ToJSON { |
| 40548 | + if (!property_exists($obj, 'to_json')) { | |
| 40549 | + throw new Exception("Missing required property"); | |
| 40550 | + } | |
| 39009 | 40551 | return new ToJSON( |
| 39010 | 40552 | ToJSON::fromToJSON($obj->{'to_json'}) |
| 39011 | 40553 | ); |
| @@ -39104,6 +40646,9 @@ class TopLevelClass { | ||
| 39104 | 40646 | * @throws Exception |
| 39105 | 40647 | */ |
| 39106 | 40648 | public static function from(stdClass $obj): TopLevelClass { |
| 40649 | + if (!property_exists($obj, 'top_level')) { | |
| 40650 | + throw new Exception("Missing required property"); | |
| 40651 | + } | |
| 39107 | 40652 | return new TopLevelClass( |
| 39108 | 40653 | TopLevelClass::fromTopLevel($obj->{'top_level'}) |
| 39109 | 40654 | ); |
| @@ -39202,6 +40747,9 @@ class Transient { | ||
| 39202 | 40747 | * @throws Exception |
| 39203 | 40748 | */ |
| 39204 | 40749 | public static function from(stdClass $obj): Transient { |
| 40750 | + if (!property_exists($obj, 'transient')) { | |
| 40751 | + throw new Exception("Missing required property"); | |
| 40752 | + } | |
| 39205 | 40753 | return new Transient( |
| 39206 | 40754 | Transient::fromTransient($obj->{'transient'}) |
| 39207 | 40755 | ); |
| @@ -39300,6 +40848,9 @@ class TrueClass { | ||
| 39300 | 40848 | * @throws Exception |
| 39301 | 40849 | */ |
| 39302 | 40850 | public static function from(stdClass $obj): TrueClass { |
| 40851 | + if (!property_exists($obj, 'True')) { | |
| 40852 | + throw new Exception("Missing required property"); | |
| 40853 | + } | |
| 39303 | 40854 | return new TrueClass( |
| 39304 | 40855 | TrueClass::fromTrue($obj->{'True'}) |
| 39305 | 40856 | ); |
| @@ -39398,6 +40949,9 @@ class TryClass { | ||
| 39398 | 40949 | * @throws Exception |
| 39399 | 40950 | */ |
| 39400 | 40951 | public static function from(stdClass $obj): TryClass { |
| 40952 | + if (!property_exists($obj, 'try')) { | |
| 40953 | + throw new Exception("Missing required property"); | |
| 40954 | + } | |
| 39401 | 40955 | return new TryClass( |
| 39402 | 40956 | TryClass::fromTry($obj->{'try'}) |
| 39403 | 40957 | ); |
| @@ -39496,6 +41050,9 @@ class Type { | ||
| 39496 | 41050 | * @throws Exception |
| 39497 | 41051 | */ |
| 39498 | 41052 | public static function from(stdClass $obj): Type { |
| 41053 | + if (!property_exists($obj, 'Type')) { | |
| 41054 | + throw new Exception("Missing required property"); | |
| 41055 | + } | |
| 39499 | 41056 | return new Type( |
| 39500 | 41057 | Type::fromType($obj->{'Type'}) |
| 39501 | 41058 | ); |
| @@ -39594,6 +41151,9 @@ class Typealias { | ||
| 39594 | 41151 | * @throws Exception |
| 39595 | 41152 | */ |
| 39596 | 41153 | public static function from(stdClass $obj): Typealias { |
| 41154 | + if (!property_exists($obj, 'typealias')) { | |
| 41155 | + throw new Exception("Missing required property"); | |
| 41156 | + } | |
| 39597 | 41157 | return new Typealias( |
| 39598 | 41158 | Typealias::fromTypealias($obj->{'typealias'}) |
| 39599 | 41159 | ); |
| @@ -39692,6 +41252,9 @@ class Typedef { | ||
| 39692 | 41252 | * @throws Exception |
| 39693 | 41253 | */ |
| 39694 | 41254 | public static function from(stdClass $obj): Typedef { |
| 41255 | + if (!property_exists($obj, 'typedef')) { | |
| 41256 | + throw new Exception("Missing required property"); | |
| 41257 | + } | |
| 39695 | 41258 | return new Typedef( |
| 39696 | 41259 | Typedef::fromTypedef($obj->{'typedef'}) |
| 39697 | 41260 | ); |
| @@ -39790,6 +41353,9 @@ class Typeid { | ||
| 39790 | 41353 | * @throws Exception |
| 39791 | 41354 | */ |
| 39792 | 41355 | public static function from(stdClass $obj): Typeid { |
| 41356 | + if (!property_exists($obj, 'typeid')) { | |
| 41357 | + throw new Exception("Missing required property"); | |
| 41358 | + } | |
| 39793 | 41359 | return new Typeid( |
| 39794 | 41360 | Typeid::fromTypeid($obj->{'typeid'}) |
| 39795 | 41361 | ); |
| @@ -39888,6 +41454,9 @@ class Typename { | ||
| 39888 | 41454 | * @throws Exception |
| 39889 | 41455 | */ |
| 39890 | 41456 | public static function from(stdClass $obj): Typename { |
| 41457 | + if (!property_exists($obj, 'typename')) { | |
| 41458 | + throw new Exception("Missing required property"); | |
| 41459 | + } | |
| 39891 | 41460 | return new Typename( |
| 39892 | 41461 | Typename::fromTypename($obj->{'typename'}) |
| 39893 | 41462 | ); |
| @@ -39986,6 +41555,9 @@ class Typeof { | ||
| 39986 | 41555 | * @throws Exception |
| 39987 | 41556 | */ |
| 39988 | 41557 | public static function from(stdClass $obj): Typeof { |
| 41558 | + if (!property_exists($obj, 'typeof')) { | |
| 41559 | + throw new Exception("Missing required property"); | |
| 41560 | + } | |
| 39989 | 41561 | return new Typeof( |
| 39990 | 41562 | Typeof::fromTypeof($obj->{'typeof'}) |
| 39991 | 41563 | ); |
| @@ -40084,6 +41656,9 @@ class Uint { | ||
| 40084 | 41656 | * @throws Exception |
| 40085 | 41657 | */ |
| 40086 | 41658 | public static function from(stdClass $obj): Uint { |
| 41659 | + if (!property_exists($obj, 'uint')) { | |
| 41660 | + throw new Exception("Missing required property"); | |
| 41661 | + } | |
| 40087 | 41662 | return new Uint( |
| 40088 | 41663 | Uint::fromUint($obj->{'uint'}) |
| 40089 | 41664 | ); |
| @@ -40182,6 +41757,9 @@ class Ulong { | ||
| 40182 | 41757 | * @throws Exception |
| 40183 | 41758 | */ |
| 40184 | 41759 | public static function from(stdClass $obj): Ulong { |
| 41760 | + if (!property_exists($obj, 'ulong')) { | |
| 41761 | + throw new Exception("Missing required property"); | |
| 41762 | + } | |
| 40185 | 41763 | return new Ulong( |
| 40186 | 41764 | Ulong::fromUlong($obj->{'ulong'}) |
| 40187 | 41765 | ); |
| @@ -40280,6 +41858,9 @@ class Unchecked { | ||
| 40280 | 41858 | * @throws Exception |
| 40281 | 41859 | */ |
| 40282 | 41860 | public static function from(stdClass $obj): Unchecked { |
| 41861 | + if (!property_exists($obj, 'unchecked')) { | |
| 41862 | + throw new Exception("Missing required property"); | |
| 41863 | + } | |
| 40283 | 41864 | return new Unchecked( |
| 40284 | 41865 | Unchecked::fromUnchecked($obj->{'unchecked'}) |
| 40285 | 41866 | ); |
| @@ -40378,6 +41959,9 @@ class Undefined { | ||
| 40378 | 41959 | * @throws Exception |
| 40379 | 41960 | */ |
| 40380 | 41961 | public static function from(stdClass $obj): Undefined { |
| 41962 | + if (!property_exists($obj, 'undefined')) { | |
| 41963 | + throw new Exception("Missing required property"); | |
| 41964 | + } | |
| 40381 | 41965 | return new Undefined( |
| 40382 | 41966 | Undefined::fromUndefined($obj->{'undefined'}) |
| 40383 | 41967 | ); |
| @@ -41536,6 +43120,69 @@ class Obj5 { | ||
| 41536 | 43120 | * @throws Exception |
| 41537 | 43121 | */ |
| 41538 | 43122 | public static function from(stdClass $obj): Obj5 { |
| 43123 | + if (!property_exists($obj, 'dummy')) { | |
| 43124 | + throw new Exception("Missing required property"); | |
| 43125 | + } | |
| 43126 | + if (!property_exists($obj, 'union')) { | |
| 43127 | + throw new Exception("Missing required property"); | |
| 43128 | + } | |
| 43129 | + if (!property_exists($obj, 'unowned')) { | |
| 43130 | + throw new Exception("Missing required property"); | |
| 43131 | + } | |
| 43132 | + if (!property_exists($obj, 'unsafe')) { | |
| 43133 | + throw new Exception("Missing required property"); | |
| 43134 | + } | |
| 43135 | + if (!property_exists($obj, 'unsigned')) { | |
| 43136 | + throw new Exception("Missing required property"); | |
| 43137 | + } | |
| 43138 | + if (!property_exists($obj, 'ushort')) { | |
| 43139 | + throw new Exception("Missing required property"); | |
| 43140 | + } | |
| 43141 | + if (!property_exists($obj, 'using')) { | |
| 43142 | + throw new Exception("Missing required property"); | |
| 43143 | + } | |
| 43144 | + if (!property_exists($obj, 'var')) { | |
| 43145 | + throw new Exception("Missing required property"); | |
| 43146 | + } | |
| 43147 | + if (!property_exists($obj, 'virtual')) { | |
| 43148 | + throw new Exception("Missing required property"); | |
| 43149 | + } | |
| 43150 | + if (!property_exists($obj, 'void')) { | |
| 43151 | + throw new Exception("Missing required property"); | |
| 43152 | + } | |
| 43153 | + if (!property_exists($obj, 'volatile')) { | |
| 43154 | + throw new Exception("Missing required property"); | |
| 43155 | + } | |
| 43156 | + if (!property_exists($obj, 'wchar_t')) { | |
| 43157 | + throw new Exception("Missing required property"); | |
| 43158 | + } | |
| 43159 | + if (!property_exists($obj, 'weak')) { | |
| 43160 | + throw new Exception("Missing required property"); | |
| 43161 | + } | |
| 43162 | + if (!property_exists($obj, 'where')) { | |
| 43163 | + throw new Exception("Missing required property"); | |
| 43164 | + } | |
| 43165 | + if (!property_exists($obj, 'while')) { | |
| 43166 | + throw new Exception("Missing required property"); | |
| 43167 | + } | |
| 43168 | + if (!property_exists($obj, 'willSet')) { | |
| 43169 | + throw new Exception("Missing required property"); | |
| 43170 | + } | |
| 43171 | + if (!property_exists($obj, 'with')) { | |
| 43172 | + throw new Exception("Missing required property"); | |
| 43173 | + } | |
| 43174 | + if (!property_exists($obj, 'xor')) { | |
| 43175 | + throw new Exception("Missing required property"); | |
| 43176 | + } | |
| 43177 | + if (!property_exists($obj, 'xor_eq')) { | |
| 43178 | + throw new Exception("Missing required property"); | |
| 43179 | + } | |
| 43180 | + if (!property_exists($obj, 'YES')) { | |
| 43181 | + throw new Exception("Missing required property"); | |
| 43182 | + } | |
| 43183 | + if (!property_exists($obj, 'yield')) { | |
| 43184 | + throw new Exception("Missing required property"); | |
| 43185 | + } | |
| 41539 | 43186 | return new Obj5( |
| 41540 | 43187 | Obj5::fromDummy($obj->{'dummy'}) |
| 41541 | 43188 | ,Obj5::fromUnion($obj->{'union'}) |
| @@ -41674,6 +43321,9 @@ class Union { | ||
| 41674 | 43321 | * @throws Exception |
| 41675 | 43322 | */ |
| 41676 | 43323 | public static function from(stdClass $obj): Union { |
| 43324 | + if (!property_exists($obj, 'union')) { | |
| 43325 | + throw new Exception("Missing required property"); | |
| 43326 | + } | |
| 41677 | 43327 | return new Union( |
| 41678 | 43328 | Union::fromUnion($obj->{'union'}) |
| 41679 | 43329 | ); |
| @@ -41772,6 +43422,9 @@ class Unowned { | ||
| 41772 | 43422 | * @throws Exception |
| 41773 | 43423 | */ |
| 41774 | 43424 | public static function from(stdClass $obj): Unowned { |
| 43425 | + if (!property_exists($obj, 'unowned')) { | |
| 43426 | + throw new Exception("Missing required property"); | |
| 43427 | + } | |
| 41775 | 43428 | return new Unowned( |
| 41776 | 43429 | Unowned::fromUnowned($obj->{'unowned'}) |
| 41777 | 43430 | ); |
| @@ -41870,6 +43523,9 @@ class Unsafe { | ||
| 41870 | 43523 | * @throws Exception |
| 41871 | 43524 | */ |
| 41872 | 43525 | public static function from(stdClass $obj): Unsafe { |
| 43526 | + if (!property_exists($obj, 'unsafe')) { | |
| 43527 | + throw new Exception("Missing required property"); | |
| 43528 | + } | |
| 41873 | 43529 | return new Unsafe( |
| 41874 | 43530 | Unsafe::fromUnsafe($obj->{'unsafe'}) |
| 41875 | 43531 | ); |
| @@ -41968,6 +43624,9 @@ class Unsigned { | ||
| 41968 | 43624 | * @throws Exception |
| 41969 | 43625 | */ |
| 41970 | 43626 | public static function from(stdClass $obj): Unsigned { |
| 43627 | + if (!property_exists($obj, 'unsigned')) { | |
| 43628 | + throw new Exception("Missing required property"); | |
| 43629 | + } | |
| 41971 | 43630 | return new Unsigned( |
| 41972 | 43631 | Unsigned::fromUnsigned($obj->{'unsigned'}) |
| 41973 | 43632 | ); |
| @@ -42066,6 +43725,9 @@ class Ushort { | ||
| 42066 | 43725 | * @throws Exception |
| 42067 | 43726 | */ |
| 42068 | 43727 | public static function from(stdClass $obj): Ushort { |
| 43728 | + if (!property_exists($obj, 'ushort')) { | |
| 43729 | + throw new Exception("Missing required property"); | |
| 43730 | + } | |
| 42069 | 43731 | return new Ushort( |
| 42070 | 43732 | Ushort::fromUshort($obj->{'ushort'}) |
| 42071 | 43733 | ); |
| @@ -42164,6 +43826,9 @@ class Using { | ||
| 42164 | 43826 | * @throws Exception |
| 42165 | 43827 | */ |
| 42166 | 43828 | public static function from(stdClass $obj): Using { |
| 43829 | + if (!property_exists($obj, 'using')) { | |
| 43830 | + throw new Exception("Missing required property"); | |
| 43831 | + } | |
| 42167 | 43832 | return new Using( |
| 42168 | 43833 | Using::fromUsing($obj->{'using'}) |
| 42169 | 43834 | ); |
| @@ -42262,6 +43927,9 @@ class VarClass { | ||
| 42262 | 43927 | * @throws Exception |
| 42263 | 43928 | */ |
| 42264 | 43929 | public static function from(stdClass $obj): VarClass { |
| 43930 | + if (!property_exists($obj, 'var')) { | |
| 43931 | + throw new Exception("Missing required property"); | |
| 43932 | + } | |
| 42265 | 43933 | return new VarClass( |
| 42266 | 43934 | VarClass::fromVar($obj->{'var'}) |
| 42267 | 43935 | ); |
| @@ -42360,6 +44028,9 @@ class Virtual { | ||
| 42360 | 44028 | * @throws Exception |
| 42361 | 44029 | */ |
| 42362 | 44030 | public static function from(stdClass $obj): Virtual { |
| 44031 | + if (!property_exists($obj, 'virtual')) { | |
| 44032 | + throw new Exception("Missing required property"); | |
| 44033 | + } | |
| 42363 | 44034 | return new Virtual( |
| 42364 | 44035 | Virtual::fromVirtual($obj->{'virtual'}) |
| 42365 | 44036 | ); |
| @@ -42458,6 +44129,9 @@ class VoidClass { | ||
| 42458 | 44129 | * @throws Exception |
| 42459 | 44130 | */ |
| 42460 | 44131 | public static function from(stdClass $obj): VoidClass { |
| 44132 | + if (!property_exists($obj, 'void')) { | |
| 44133 | + throw new Exception("Missing required property"); | |
| 44134 | + } | |
| 42461 | 44135 | return new VoidClass( |
| 42462 | 44136 | VoidClass::fromVoid($obj->{'void'}) |
| 42463 | 44137 | ); |
| @@ -42556,6 +44230,9 @@ class Volatile { | ||
| 42556 | 44230 | * @throws Exception |
| 42557 | 44231 | */ |
| 42558 | 44232 | public static function from(stdClass $obj): Volatile { |
| 44233 | + if (!property_exists($obj, 'volatile')) { | |
| 44234 | + throw new Exception("Missing required property"); | |
| 44235 | + } | |
| 42559 | 44236 | return new Volatile( |
| 42560 | 44237 | Volatile::fromVolatile($obj->{'volatile'}) |
| 42561 | 44238 | ); |
| @@ -42654,6 +44331,9 @@ class WcharT { | ||
| 42654 | 44331 | * @throws Exception |
| 42655 | 44332 | */ |
| 42656 | 44333 | public static function from(stdClass $obj): WcharT { |
| 44334 | + if (!property_exists($obj, 'wchar_t')) { | |
| 44335 | + throw new Exception("Missing required property"); | |
| 44336 | + } | |
| 42657 | 44337 | return new WcharT( |
| 42658 | 44338 | WcharT::fromWcharT($obj->{'wchar_t'}) |
| 42659 | 44339 | ); |
| @@ -42752,6 +44432,9 @@ class Weak { | ||
| 42752 | 44432 | * @throws Exception |
| 42753 | 44433 | */ |
| 42754 | 44434 | public static function from(stdClass $obj): Weak { |
| 44435 | + if (!property_exists($obj, 'weak')) { | |
| 44436 | + throw new Exception("Missing required property"); | |
| 44437 | + } | |
| 42755 | 44438 | return new Weak( |
| 42756 | 44439 | Weak::fromWeak($obj->{'weak'}) |
| 42757 | 44440 | ); |
| @@ -42850,6 +44533,9 @@ class Where { | ||
| 42850 | 44533 | * @throws Exception |
| 42851 | 44534 | */ |
| 42852 | 44535 | public static function from(stdClass $obj): Where { |
| 44536 | + if (!property_exists($obj, 'where')) { | |
| 44537 | + throw new Exception("Missing required property"); | |
| 44538 | + } | |
| 42853 | 44539 | return new Where( |
| 42854 | 44540 | Where::fromWhere($obj->{'where'}) |
| 42855 | 44541 | ); |
| @@ -42948,6 +44634,9 @@ class WhileClass { | ||
| 42948 | 44634 | * @throws Exception |
| 42949 | 44635 | */ |
| 42950 | 44636 | public static function from(stdClass $obj): WhileClass { |
| 44637 | + if (!property_exists($obj, 'while')) { | |
| 44638 | + throw new Exception("Missing required property"); | |
| 44639 | + } | |
| 42951 | 44640 | return new WhileClass( |
| 42952 | 44641 | WhileClass::fromWhile($obj->{'while'}) |
| 42953 | 44642 | ); |
| @@ -43046,6 +44735,9 @@ class WillSet { | ||
| 43046 | 44735 | * @throws Exception |
| 43047 | 44736 | */ |
| 43048 | 44737 | public static function from(stdClass $obj): WillSet { |
| 44738 | + if (!property_exists($obj, 'willSet')) { | |
| 44739 | + throw new Exception("Missing required property"); | |
| 44740 | + } | |
| 43049 | 44741 | return new WillSet( |
| 43050 | 44742 | WillSet::fromWillSet($obj->{'willSet'}) |
| 43051 | 44743 | ); |
| @@ -43144,6 +44836,9 @@ class With { | ||
| 43144 | 44836 | * @throws Exception |
| 43145 | 44837 | */ |
| 43146 | 44838 | public static function from(stdClass $obj): With { |
| 44839 | + if (!property_exists($obj, 'with')) { | |
| 44840 | + throw new Exception("Missing required property"); | |
| 44841 | + } | |
| 43147 | 44842 | return new With( |
| 43148 | 44843 | With::fromWith($obj->{'with'}) |
| 43149 | 44844 | ); |
| @@ -43242,6 +44937,9 @@ class XorClass { | ||
| 43242 | 44937 | * @throws Exception |
| 43243 | 44938 | */ |
| 43244 | 44939 | public static function from(stdClass $obj): XorClass { |
| 44940 | + if (!property_exists($obj, 'xor')) { | |
| 44941 | + throw new Exception("Missing required property"); | |
| 44942 | + } | |
| 43245 | 44943 | return new XorClass( |
| 43246 | 44944 | XorClass::fromXor($obj->{'xor'}) |
| 43247 | 44945 | ); |
| @@ -43340,6 +45038,9 @@ class XorEq { | ||
| 43340 | 45038 | * @throws Exception |
| 43341 | 45039 | */ |
| 43342 | 45040 | public static function from(stdClass $obj): XorEq { |
| 45041 | + if (!property_exists($obj, 'xor_eq')) { | |
| 45042 | + throw new Exception("Missing required property"); | |
| 45043 | + } | |
| 43343 | 45044 | return new XorEq( |
| 43344 | 45045 | XorEq::fromXorEq($obj->{'xor_eq'}) |
| 43345 | 45046 | ); |
| @@ -43438,6 +45139,9 @@ class Yes { | ||
| 43438 | 45139 | * @throws Exception |
| 43439 | 45140 | */ |
| 43440 | 45141 | public static function from(stdClass $obj): Yes { |
| 45142 | + if (!property_exists($obj, 'YES')) { | |
| 45143 | + throw new Exception("Missing required property"); | |
| 45144 | + } | |
| 43441 | 45145 | return new Yes( |
| 43442 | 45146 | Yes::fromYes($obj->{'YES'}) |
| 43443 | 45147 | ); |
| @@ -43536,6 +45240,9 @@ class YieldClass { | ||
| 43536 | 45240 | * @throws Exception |
| 43537 | 45241 | */ |
| 43538 | 45242 | public static function from(stdClass $obj): YieldClass { |
| 45243 | + if (!property_exists($obj, 'yield')) { | |
| 45244 | + throw new Exception("Missing required property"); | |
| 45245 | + } | |
| 43539 | 45246 | return new YieldClass( |
| 43540 | 45247 | YieldClass::fromYield($obj->{'yield'}) |
| 43541 | 45248 | ); |
Test case
1 generated file · +3 −0test/inputs/json/priority/kotlin-enum-class-case-collision.json
Mphpdefault / TopLevel.php+3 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'category')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromCategory($obj->{'category'}) |
| 90 | 93 | ); |
Test case
1 generated file · +6 −0test/inputs/json/priority/list.json
Mphpdefault / TopLevel.php+6 −0
| @@ -147,6 +147,12 @@ class TopLevel { | ||
| 147 | 147 | * @throws Exception |
| 148 | 148 | */ |
| 149 | 149 | public static function from(stdClass $obj): TopLevel { |
| 150 | + if (!property_exists($obj, 'data')) { | |
| 151 | + throw new Exception("Missing required property"); | |
| 152 | + } | |
| 153 | + if (!property_exists($obj, 'next')) { | |
| 154 | + throw new Exception("Missing required property"); | |
| 155 | + } | |
| 150 | 156 | return new TopLevel( |
| 151 | 157 | TopLevel::fromData($obj->{'data'}) |
| 152 | 158 | ,TopLevel::fromNext($obj->{'next'}) |
Test case
1 generated file · +21 −0test/inputs/json/priority/name-style.json
Mphpdefault / TopLevel.php+21 −0
| @@ -396,6 +396,27 @@ class TopLevel { | ||
| 396 | 396 | * @throws Exception |
| 397 | 397 | */ |
| 398 | 398 | public static function from(stdClass $obj): TopLevel { |
| 399 | + if (!property_exists($obj, 'anEasyOne')) { | |
| 400 | + throw new Exception("Missing required property"); | |
| 401 | + } | |
| 402 | + if (!property_exists($obj, 'isMNISTLetter')) { | |
| 403 | + throw new Exception("Missing required property"); | |
| 404 | + } | |
| 405 | + if (!property_exists($obj, 'JSONString')) { | |
| 406 | + throw new Exception("Missing required property"); | |
| 407 | + } | |
| 408 | + if (!property_exists($obj, 'PrettyEasyToo')) { | |
| 409 | + throw new Exception("Missing required property"); | |
| 410 | + } | |
| 411 | + if (!property_exists($obj, 'should_know_that_id_is_an_initialism')) { | |
| 412 | + throw new Exception("Missing required property"); | |
| 413 | + } | |
| 414 | + if (!property_exists($obj, ' spaces are separators too ')) { | |
| 415 | + throw new Exception("Missing required property"); | |
| 416 | + } | |
| 417 | + if (!property_exists($obj, 'ZSR_HH_DEMO3_DELMATNR')) { | |
| 418 | + throw new Exception("Missing required property"); | |
| 419 | + } | |
| 399 | 420 | return new TopLevel( |
| 400 | 421 | TopLevel::fromAnEasyOne($obj->{'anEasyOne'}) |
| 401 | 422 | ,TopLevel::fromIsMNISTLetter($obj->{'isMNISTLetter'}) |
Test case
1 generated file · +588 −0test/inputs/json/priority/nbl-stats.json
Mphpdefault / TopLevel.php+588 −0
| @@ -1193,6 +1193,66 @@ class TopLevel { | ||
| 1193 | 1193 | * @throws Exception |
| 1194 | 1194 | */ |
| 1195 | 1195 | public static function from(stdClass $obj): TopLevel { |
| 1196 | + if (!property_exists($obj, 'attendance')) { | |
| 1197 | + throw new Exception("Missing required property"); | |
| 1198 | + } | |
| 1199 | + if (!property_exists($obj, 'clock')) { | |
| 1200 | + throw new Exception("Missing required property"); | |
| 1201 | + } | |
| 1202 | + if (!property_exists($obj, 'disableMatch')) { | |
| 1203 | + throw new Exception("Missing required property"); | |
| 1204 | + } | |
| 1205 | + if (!property_exists($obj, 'inOT')) { | |
| 1206 | + throw new Exception("Missing required property"); | |
| 1207 | + } | |
| 1208 | + if (!property_exists($obj, 'leaddata')) { | |
| 1209 | + throw new Exception("Missing required property"); | |
| 1210 | + } | |
| 1211 | + if (!property_exists($obj, 'officials_referee1')) { | |
| 1212 | + throw new Exception("Missing required property"); | |
| 1213 | + } | |
| 1214 | + if (!property_exists($obj, 'officials_referee2')) { | |
| 1215 | + throw new Exception("Missing required property"); | |
| 1216 | + } | |
| 1217 | + if (!property_exists($obj, 'officials_referee3')) { | |
| 1218 | + throw new Exception("Missing required property"); | |
| 1219 | + } | |
| 1220 | + if (!property_exists($obj, 'othermatches')) { | |
| 1221 | + throw new Exception("Missing required property"); | |
| 1222 | + } | |
| 1223 | + if (!property_exists($obj, 'pbp')) { | |
| 1224 | + throw new Exception("Missing required property"); | |
| 1225 | + } | |
| 1226 | + if (!property_exists($obj, 'period')) { | |
| 1227 | + throw new Exception("Missing required property"); | |
| 1228 | + } | |
| 1229 | + if (!property_exists($obj, 'periodLengthOVERTIME')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1232 | + if (!property_exists($obj, 'periodLengthREGULAR')) { | |
| 1233 | + throw new Exception("Missing required property"); | |
| 1234 | + } | |
| 1235 | + if (!property_exists($obj, 'periodType')) { | |
| 1236 | + throw new Exception("Missing required property"); | |
| 1237 | + } | |
| 1238 | + if (!property_exists($obj, 'periodsMax')) { | |
| 1239 | + throw new Exception("Missing required property"); | |
| 1240 | + } | |
| 1241 | + if (!property_exists($obj, 'scorers')) { | |
| 1242 | + throw new Exception("Missing required property"); | |
| 1243 | + } | |
| 1244 | + if (!property_exists($obj, 'timeline')) { | |
| 1245 | + throw new Exception("Missing required property"); | |
| 1246 | + } | |
| 1247 | + if (!property_exists($obj, 'tm')) { | |
| 1248 | + throw new Exception("Missing required property"); | |
| 1249 | + } | |
| 1250 | + if (!property_exists($obj, 'totalTimeAdded')) { | |
| 1251 | + throw new Exception("Missing required property"); | |
| 1252 | + } | |
| 1253 | + if (!property_exists($obj, 'totallds')) { | |
| 1254 | + throw new Exception("Missing required property"); | |
| 1255 | + } | |
| 1196 | 1256 | return new TopLevel( |
| 1197 | 1257 | TopLevel::fromAttendance($obj->{'attendance'}) |
| 1198 | 1258 | ,TopLevel::fromClock($obj->{'clock'}) |
| @@ -1913,6 +1973,39 @@ class Othermatch { | ||
| 1913 | 1973 | * @throws Exception |
| 1914 | 1974 | */ |
| 1915 | 1975 | public static function from(stdClass $obj): Othermatch { |
| 1976 | + if (!property_exists($obj, 'clock')) { | |
| 1977 | + throw new Exception("Missing required property"); | |
| 1978 | + } | |
| 1979 | + if (!property_exists($obj, 'competitionName')) { | |
| 1980 | + throw new Exception("Missing required property"); | |
| 1981 | + } | |
| 1982 | + if (!property_exists($obj, 'id')) { | |
| 1983 | + throw new Exception("Missing required property"); | |
| 1984 | + } | |
| 1985 | + if (!property_exists($obj, 'period')) { | |
| 1986 | + throw new Exception("Missing required property"); | |
| 1987 | + } | |
| 1988 | + if (!property_exists($obj, 'periodType')) { | |
| 1989 | + throw new Exception("Missing required property"); | |
| 1990 | + } | |
| 1991 | + if (!property_exists($obj, 'team1')) { | |
| 1992 | + throw new Exception("Missing required property"); | |
| 1993 | + } | |
| 1994 | + if (!property_exists($obj, 'team1Name')) { | |
| 1995 | + throw new Exception("Missing required property"); | |
| 1996 | + } | |
| 1997 | + if (!property_exists($obj, 'team1Score')) { | |
| 1998 | + throw new Exception("Missing required property"); | |
| 1999 | + } | |
| 2000 | + if (!property_exists($obj, 'team2')) { | |
| 2001 | + throw new Exception("Missing required property"); | |
| 2002 | + } | |
| 2003 | + if (!property_exists($obj, 'team2Name')) { | |
| 2004 | + throw new Exception("Missing required property"); | |
| 2005 | + } | |
| 2006 | + if (!property_exists($obj, 'team2Score')) { | |
| 2007 | + throw new Exception("Missing required property"); | |
| 2008 | + } | |
| 1916 | 2009 | return new Othermatch( |
| 1917 | 2010 | Othermatch::fromClock($obj->{'clock'}) |
| 1918 | 2011 | ,Othermatch::fromCompetitionName($obj->{'competitionName'}) |
| @@ -2232,6 +2325,18 @@ class Team { | ||
| 2232 | 2325 | * @throws Exception |
| 2233 | 2326 | */ |
| 2234 | 2327 | public static function from(stdClass $obj): Team { |
| 2328 | + if (!property_exists($obj, 'teamCode')) { | |
| 2329 | + throw new Exception("Missing required property"); | |
| 2330 | + } | |
| 2331 | + if (!property_exists($obj, 'teamCodeInternational')) { | |
| 2332 | + throw new Exception("Missing required property"); | |
| 2333 | + } | |
| 2334 | + if (!property_exists($obj, 'teamName')) { | |
| 2335 | + throw new Exception("Missing required property"); | |
| 2336 | + } | |
| 2337 | + if (!property_exists($obj, 'teamNameInternational')) { | |
| 2338 | + throw new Exception("Missing required property"); | |
| 2339 | + } | |
| 2235 | 2340 | return new Team( |
| 2236 | 2341 | Team::fromTeamCode($obj->{'teamCode'}) |
| 2237 | 2342 | ,Team::fromTeamCodeInternational($obj->{'teamCodeInternational'}) |
| @@ -3629,6 +3734,51 @@ class Pbp { | ||
| 3629 | 3734 | * @throws Exception |
| 3630 | 3735 | */ |
| 3631 | 3736 | public static function from(stdClass $obj): Pbp { |
| 3737 | + if (!property_exists($obj, 'actionType')) { | |
| 3738 | + throw new Exception("Missing required property"); | |
| 3739 | + } | |
| 3740 | + if (!property_exists($obj, 'gt')) { | |
| 3741 | + throw new Exception("Missing required property"); | |
| 3742 | + } | |
| 3743 | + if (!property_exists($obj, 'lead')) { | |
| 3744 | + throw new Exception("Missing required property"); | |
| 3745 | + } | |
| 3746 | + if (!property_exists($obj, 'period')) { | |
| 3747 | + throw new Exception("Missing required property"); | |
| 3748 | + } | |
| 3749 | + if (!property_exists($obj, 'periodType')) { | |
| 3750 | + throw new Exception("Missing required property"); | |
| 3751 | + } | |
| 3752 | + if (!property_exists($obj, 'player')) { | |
| 3753 | + throw new Exception("Missing required property"); | |
| 3754 | + } | |
| 3755 | + if (!property_exists($obj, 'pno')) { | |
| 3756 | + throw new Exception("Missing required property"); | |
| 3757 | + } | |
| 3758 | + if (!property_exists($obj, 'qualifier')) { | |
| 3759 | + throw new Exception("Missing required property"); | |
| 3760 | + } | |
| 3761 | + if (!property_exists($obj, 's1')) { | |
| 3762 | + throw new Exception("Missing required property"); | |
| 3763 | + } | |
| 3764 | + if (!property_exists($obj, 's2')) { | |
| 3765 | + throw new Exception("Missing required property"); | |
| 3766 | + } | |
| 3767 | + if (!property_exists($obj, 'scoring')) { | |
| 3768 | + throw new Exception("Missing required property"); | |
| 3769 | + } | |
| 3770 | + if (!property_exists($obj, 'shirtNumber')) { | |
| 3771 | + throw new Exception("Missing required property"); | |
| 3772 | + } | |
| 3773 | + if (!property_exists($obj, 'subType')) { | |
| 3774 | + throw new Exception("Missing required property"); | |
| 3775 | + } | |
| 3776 | + if (!property_exists($obj, 'success')) { | |
| 3777 | + throw new Exception("Missing required property"); | |
| 3778 | + } | |
| 3779 | + if (!property_exists($obj, 'tno')) { | |
| 3780 | + throw new Exception("Missing required property"); | |
| 3781 | + } | |
| 3632 | 3782 | return new Pbp( |
| 3633 | 3783 | Pbp::fromActionType($obj->{'actionType'}) |
| 3634 | 3784 | ,Pbp::fromFamilyName($obj->{'familyName'}) |
| @@ -5297,6 +5447,15 @@ class Scorer { | ||
| 5297 | 5447 | * @throws Exception |
| 5298 | 5448 | */ |
| 5299 | 5449 | public static function from(stdClass $obj): Scorer { |
| 5450 | + if (!property_exists($obj, 'pno')) { | |
| 5451 | + throw new Exception("Missing required property"); | |
| 5452 | + } | |
| 5453 | + if (!property_exists($obj, 'shirtNumber')) { | |
| 5454 | + throw new Exception("Missing required property"); | |
| 5455 | + } | |
| 5456 | + if (!property_exists($obj, 'tno')) { | |
| 5457 | + throw new Exception("Missing required property"); | |
| 5458 | + } | |
| 5300 | 5459 | return new Scorer( |
| 5301 | 5460 | Scorer::fromFamilyName($obj->{'familyName'}) |
| 5302 | 5461 | ,Scorer::fromFamilyNameInitial($obj->{'familyNameInitial'}) |
| @@ -5538,6 +5697,15 @@ class Time { | ||
| 5538 | 5697 | * @throws Exception |
| 5539 | 5698 | */ |
| 5540 | 5699 | public static function from(stdClass $obj): Time { |
| 5700 | + if (!property_exists($obj, 'gt')) { | |
| 5701 | + throw new Exception("Missing required property"); | |
| 5702 | + } | |
| 5703 | + if (!property_exists($obj, 'per')) { | |
| 5704 | + throw new Exception("Missing required property"); | |
| 5705 | + } | |
| 5706 | + if (!property_exists($obj, 'perType')) { | |
| 5707 | + throw new Exception("Missing required property"); | |
| 5708 | + } | |
| 5541 | 5709 | return new Time( |
| 5542 | 5710 | Time::fromGt($obj->{'gt'}) |
| 5543 | 5711 | ,Time::fromPer($obj->{'per'}) |
| @@ -9008,6 +9176,201 @@ class Tm { | ||
| 9008 | 9176 | * @throws Exception |
| 9009 | 9177 | */ |
| 9010 | 9178 | public static function from(stdClass $obj): Tm { |
| 9179 | + if (!property_exists($obj, 'code')) { | |
| 9180 | + throw new Exception("Missing required property"); | |
| 9181 | + } | |
| 9182 | + if (!property_exists($obj, 'codeInternational')) { | |
| 9183 | + throw new Exception("Missing required property"); | |
| 9184 | + } | |
| 9185 | + if (!property_exists($obj, 'fouls')) { | |
| 9186 | + throw new Exception("Missing required property"); | |
| 9187 | + } | |
| 9188 | + if (!property_exists($obj, 'full_score')) { | |
| 9189 | + throw new Exception("Missing required property"); | |
| 9190 | + } | |
| 9191 | + if (!property_exists($obj, 'lds')) { | |
| 9192 | + throw new Exception("Missing required property"); | |
| 9193 | + } | |
| 9194 | + if (!property_exists($obj, 'logo')) { | |
| 9195 | + throw new Exception("Missing required property"); | |
| 9196 | + } | |
| 9197 | + if (!property_exists($obj, 'name')) { | |
| 9198 | + throw new Exception("Missing required property"); | |
| 9199 | + } | |
| 9200 | + if (!property_exists($obj, 'nameInternational')) { | |
| 9201 | + throw new Exception("Missing required property"); | |
| 9202 | + } | |
| 9203 | + if (!property_exists($obj, 'p1_score')) { | |
| 9204 | + throw new Exception("Missing required property"); | |
| 9205 | + } | |
| 9206 | + if (!property_exists($obj, 'p2_score')) { | |
| 9207 | + throw new Exception("Missing required property"); | |
| 9208 | + } | |
| 9209 | + if (!property_exists($obj, 'p3_score')) { | |
| 9210 | + throw new Exception("Missing required property"); | |
| 9211 | + } | |
| 9212 | + if (!property_exists($obj, 'p4_score')) { | |
| 9213 | + throw new Exception("Missing required property"); | |
| 9214 | + } | |
| 9215 | + if (!property_exists($obj, 'pl')) { | |
| 9216 | + throw new Exception("Missing required property"); | |
| 9217 | + } | |
| 9218 | + if (!property_exists($obj, 'score')) { | |
| 9219 | + throw new Exception("Missing required property"); | |
| 9220 | + } | |
| 9221 | + if (!property_exists($obj, 'scoring')) { | |
| 9222 | + throw new Exception("Missing required property"); | |
| 9223 | + } | |
| 9224 | + if (!property_exists($obj, 'shortName')) { | |
| 9225 | + throw new Exception("Missing required property"); | |
| 9226 | + } | |
| 9227 | + if (!property_exists($obj, 'shortNameInternational')) { | |
| 9228 | + throw new Exception("Missing required property"); | |
| 9229 | + } | |
| 9230 | + if (!property_exists($obj, 'shot')) { | |
| 9231 | + throw new Exception("Missing required property"); | |
| 9232 | + } | |
| 9233 | + if (!property_exists($obj, 'timeouts')) { | |
| 9234 | + throw new Exception("Missing required property"); | |
| 9235 | + } | |
| 9236 | + if (!property_exists($obj, 'tot_eff_1')) { | |
| 9237 | + throw new Exception("Missing required property"); | |
| 9238 | + } | |
| 9239 | + if (!property_exists($obj, 'tot_eff_2')) { | |
| 9240 | + throw new Exception("Missing required property"); | |
| 9241 | + } | |
| 9242 | + if (!property_exists($obj, 'tot_eff_3')) { | |
| 9243 | + throw new Exception("Missing required property"); | |
| 9244 | + } | |
| 9245 | + if (!property_exists($obj, 'tot_eff_4')) { | |
| 9246 | + throw new Exception("Missing required property"); | |
| 9247 | + } | |
| 9248 | + if (!property_exists($obj, 'tot_eff_5')) { | |
| 9249 | + throw new Exception("Missing required property"); | |
| 9250 | + } | |
| 9251 | + if (!property_exists($obj, 'tot_eff_6')) { | |
| 9252 | + throw new Exception("Missing required property"); | |
| 9253 | + } | |
| 9254 | + if (!property_exists($obj, 'tot_eff_7')) { | |
| 9255 | + throw new Exception("Missing required property"); | |
| 9256 | + } | |
| 9257 | + if (!property_exists($obj, 'tot_sAssists')) { | |
| 9258 | + throw new Exception("Missing required property"); | |
| 9259 | + } | |
| 9260 | + if (!property_exists($obj, 'tot_sBenchPoints')) { | |
| 9261 | + throw new Exception("Missing required property"); | |
| 9262 | + } | |
| 9263 | + if (!property_exists($obj, 'tot_sBiggestLead')) { | |
| 9264 | + throw new Exception("Missing required property"); | |
| 9265 | + } | |
| 9266 | + if (!property_exists($obj, 'tot_sBiggestScoringRun')) { | |
| 9267 | + throw new Exception("Missing required property"); | |
| 9268 | + } | |
| 9269 | + if (!property_exists($obj, 'tot_sBlocks')) { | |
| 9270 | + throw new Exception("Missing required property"); | |
| 9271 | + } | |
| 9272 | + if (!property_exists($obj, 'tot_sBlocksReceived')) { | |
| 9273 | + throw new Exception("Missing required property"); | |
| 9274 | + } | |
| 9275 | + if (!property_exists($obj, 'tot_sFieldGoalsAttempted')) { | |
| 9276 | + throw new Exception("Missing required property"); | |
| 9277 | + } | |
| 9278 | + if (!property_exists($obj, 'tot_sFieldGoalsMade')) { | |
| 9279 | + throw new Exception("Missing required property"); | |
| 9280 | + } | |
| 9281 | + if (!property_exists($obj, 'tot_sFieldGoalsPercentage')) { | |
| 9282 | + throw new Exception("Missing required property"); | |
| 9283 | + } | |
| 9284 | + if (!property_exists($obj, 'tot_sFoulsOn')) { | |
| 9285 | + throw new Exception("Missing required property"); | |
| 9286 | + } | |
| 9287 | + if (!property_exists($obj, 'tot_sFoulsPersonal')) { | |
| 9288 | + throw new Exception("Missing required property"); | |
| 9289 | + } | |
| 9290 | + if (!property_exists($obj, 'tot_sFoulsTeam')) { | |
| 9291 | + throw new Exception("Missing required property"); | |
| 9292 | + } | |
| 9293 | + if (!property_exists($obj, 'tot_sFreeThrowsAttempted')) { | |
| 9294 | + throw new Exception("Missing required property"); | |
| 9295 | + } | |
| 9296 | + if (!property_exists($obj, 'tot_sFreeThrowsMade')) { | |
| 9297 | + throw new Exception("Missing required property"); | |
| 9298 | + } | |
| 9299 | + if (!property_exists($obj, 'tot_sFreeThrowsPercentage')) { | |
| 9300 | + throw new Exception("Missing required property"); | |
| 9301 | + } | |
| 9302 | + if (!property_exists($obj, 'tot_sLeadChanges')) { | |
| 9303 | + throw new Exception("Missing required property"); | |
| 9304 | + } | |
| 9305 | + if (!property_exists($obj, 'tot_sMinutes')) { | |
| 9306 | + throw new Exception("Missing required property"); | |
| 9307 | + } | |
| 9308 | + if (!property_exists($obj, 'tot_sPoints')) { | |
| 9309 | + throw new Exception("Missing required property"); | |
| 9310 | + } | |
| 9311 | + if (!property_exists($obj, 'tot_sPointsFastBreak')) { | |
| 9312 | + throw new Exception("Missing required property"); | |
| 9313 | + } | |
| 9314 | + if (!property_exists($obj, 'tot_sPointsFromTurnovers')) { | |
| 9315 | + throw new Exception("Missing required property"); | |
| 9316 | + } | |
| 9317 | + if (!property_exists($obj, 'tot_sPointsInThePaint')) { | |
| 9318 | + throw new Exception("Missing required property"); | |
| 9319 | + } | |
| 9320 | + if (!property_exists($obj, 'tot_sPointsSecondChance')) { | |
| 9321 | + throw new Exception("Missing required property"); | |
| 9322 | + } | |
| 9323 | + if (!property_exists($obj, 'tot_sReboundsDefensive')) { | |
| 9324 | + throw new Exception("Missing required property"); | |
| 9325 | + } | |
| 9326 | + if (!property_exists($obj, 'tot_sReboundsOffensive')) { | |
| 9327 | + throw new Exception("Missing required property"); | |
| 9328 | + } | |
| 9329 | + if (!property_exists($obj, 'tot_sReboundsTeam')) { | |
| 9330 | + throw new Exception("Missing required property"); | |
| 9331 | + } | |
| 9332 | + if (!property_exists($obj, 'tot_sReboundsTeamDefensive')) { | |
| 9333 | + throw new Exception("Missing required property"); | |
| 9334 | + } | |
| 9335 | + if (!property_exists($obj, 'tot_sReboundsTeamOffensive')) { | |
| 9336 | + throw new Exception("Missing required property"); | |
| 9337 | + } | |
| 9338 | + if (!property_exists($obj, 'tot_sReboundsTotal')) { | |
| 9339 | + throw new Exception("Missing required property"); | |
| 9340 | + } | |
| 9341 | + if (!property_exists($obj, 'tot_sSteals')) { | |
| 9342 | + throw new Exception("Missing required property"); | |
| 9343 | + } | |
| 9344 | + if (!property_exists($obj, 'tot_sThreePointersAttempted')) { | |
| 9345 | + throw new Exception("Missing required property"); | |
| 9346 | + } | |
| 9347 | + if (!property_exists($obj, 'tot_sThreePointersMade')) { | |
| 9348 | + throw new Exception("Missing required property"); | |
| 9349 | + } | |
| 9350 | + if (!property_exists($obj, 'tot_sThreePointersPercentage')) { | |
| 9351 | + throw new Exception("Missing required property"); | |
| 9352 | + } | |
| 9353 | + if (!property_exists($obj, 'tot_sTimeLeading')) { | |
| 9354 | + throw new Exception("Missing required property"); | |
| 9355 | + } | |
| 9356 | + if (!property_exists($obj, 'tot_sTimesScoresLevel')) { | |
| 9357 | + throw new Exception("Missing required property"); | |
| 9358 | + } | |
| 9359 | + if (!property_exists($obj, 'tot_sTurnovers')) { | |
| 9360 | + throw new Exception("Missing required property"); | |
| 9361 | + } | |
| 9362 | + if (!property_exists($obj, 'tot_sTurnoversTeam')) { | |
| 9363 | + throw new Exception("Missing required property"); | |
| 9364 | + } | |
| 9365 | + if (!property_exists($obj, 'tot_sTwoPointersAttempted')) { | |
| 9366 | + throw new Exception("Missing required property"); | |
| 9367 | + } | |
| 9368 | + if (!property_exists($obj, 'tot_sTwoPointersMade')) { | |
| 9369 | + throw new Exception("Missing required property"); | |
| 9370 | + } | |
| 9371 | + if (!property_exists($obj, 'tot_sTwoPointersPercentage')) { | |
| 9372 | + throw new Exception("Missing required property"); | |
| 9373 | + } | |
| 9011 | 9374 | return new Tm( |
| 9012 | 9375 | Tm::fromCode($obj->{'code'}) |
| 9013 | 9376 | ,Tm::fromCodeInternational($obj->{'codeInternational'}) |
| @@ -9503,6 +9866,21 @@ class Lds { | ||
| 9503 | 9866 | * @throws Exception |
| 9504 | 9867 | */ |
| 9505 | 9868 | public static function from(stdClass $obj): Lds { |
| 9869 | + if (!property_exists($obj, 'sAssists')) { | |
| 9870 | + throw new Exception("Missing required property"); | |
| 9871 | + } | |
| 9872 | + if (!property_exists($obj, 'sBlocks')) { | |
| 9873 | + throw new Exception("Missing required property"); | |
| 9874 | + } | |
| 9875 | + if (!property_exists($obj, 'sPoints')) { | |
| 9876 | + throw new Exception("Missing required property"); | |
| 9877 | + } | |
| 9878 | + if (!property_exists($obj, 'sReboundsTotal')) { | |
| 9879 | + throw new Exception("Missing required property"); | |
| 9880 | + } | |
| 9881 | + if (!property_exists($obj, 'sSteals')) { | |
| 9882 | + throw new Exception("Missing required property"); | |
| 9883 | + } | |
| 9506 | 9884 | return new Lds( |
| 9507 | 9885 | Lds::fromSAssists($obj->{'sAssists'}) |
| 9508 | 9886 | ,Lds::fromSBlocks($obj->{'sBlocks'}) |
| @@ -9610,6 +9988,9 @@ class SBlocks { | ||
| 9610 | 9988 | * @throws Exception |
| 9611 | 9989 | */ |
| 9612 | 9990 | public static function from(stdClass $obj): SBlocks { |
| 9991 | + if (!property_exists($obj, '1')) { | |
| 9992 | + throw new Exception("Missing required property"); | |
| 9993 | + } | |
| 9613 | 9994 | return new SBlocks( |
| 9614 | 9995 | SBlocks::fromThe1($obj->{'1'}) |
| 9615 | 9996 | ); |
| @@ -12304,6 +12685,150 @@ class Pl { | ||
| 12304 | 12685 | * @throws Exception |
| 12305 | 12686 | */ |
| 12306 | 12687 | public static function from(stdClass $obj): Pl { |
| 12688 | + if (!property_exists($obj, 'active')) { | |
| 12689 | + throw new Exception("Missing required property"); | |
| 12690 | + } | |
| 12691 | + if (!property_exists($obj, 'eff_1')) { | |
| 12692 | + throw new Exception("Missing required property"); | |
| 12693 | + } | |
| 12694 | + if (!property_exists($obj, 'eff_2')) { | |
| 12695 | + throw new Exception("Missing required property"); | |
| 12696 | + } | |
| 12697 | + if (!property_exists($obj, 'eff_3')) { | |
| 12698 | + throw new Exception("Missing required property"); | |
| 12699 | + } | |
| 12700 | + if (!property_exists($obj, 'eff_4')) { | |
| 12701 | + throw new Exception("Missing required property"); | |
| 12702 | + } | |
| 12703 | + if (!property_exists($obj, 'eff_5')) { | |
| 12704 | + throw new Exception("Missing required property"); | |
| 12705 | + } | |
| 12706 | + if (!property_exists($obj, 'eff_6')) { | |
| 12707 | + throw new Exception("Missing required property"); | |
| 12708 | + } | |
| 12709 | + if (!property_exists($obj, 'eff_7')) { | |
| 12710 | + throw new Exception("Missing required property"); | |
| 12711 | + } | |
| 12712 | + if (!property_exists($obj, 'familyName')) { | |
| 12713 | + throw new Exception("Missing required property"); | |
| 12714 | + } | |
| 12715 | + if (!property_exists($obj, 'familyNameInitial')) { | |
| 12716 | + throw new Exception("Missing required property"); | |
| 12717 | + } | |
| 12718 | + if (!property_exists($obj, 'firstName')) { | |
| 12719 | + throw new Exception("Missing required property"); | |
| 12720 | + } | |
| 12721 | + if (!property_exists($obj, 'firstNameInitial')) { | |
| 12722 | + throw new Exception("Missing required property"); | |
| 12723 | + } | |
| 12724 | + if (!property_exists($obj, 'internationalFamilyName')) { | |
| 12725 | + throw new Exception("Missing required property"); | |
| 12726 | + } | |
| 12727 | + if (!property_exists($obj, 'internationalFamilyNameInitial')) { | |
| 12728 | + throw new Exception("Missing required property"); | |
| 12729 | + } | |
| 12730 | + if (!property_exists($obj, 'internationalFirstName')) { | |
| 12731 | + throw new Exception("Missing required property"); | |
| 12732 | + } | |
| 12733 | + if (!property_exists($obj, 'internationalFirstNameInitial')) { | |
| 12734 | + throw new Exception("Missing required property"); | |
| 12735 | + } | |
| 12736 | + if (!property_exists($obj, 'name')) { | |
| 12737 | + throw new Exception("Missing required property"); | |
| 12738 | + } | |
| 12739 | + if (!property_exists($obj, 'playingPosition')) { | |
| 12740 | + throw new Exception("Missing required property"); | |
| 12741 | + } | |
| 12742 | + if (!property_exists($obj, 'sAssists')) { | |
| 12743 | + throw new Exception("Missing required property"); | |
| 12744 | + } | |
| 12745 | + if (!property_exists($obj, 'sBlocks')) { | |
| 12746 | + throw new Exception("Missing required property"); | |
| 12747 | + } | |
| 12748 | + if (!property_exists($obj, 'sBlocksReceived')) { | |
| 12749 | + throw new Exception("Missing required property"); | |
| 12750 | + } | |
| 12751 | + if (!property_exists($obj, 'sFieldGoalsAttempted')) { | |
| 12752 | + throw new Exception("Missing required property"); | |
| 12753 | + } | |
| 12754 | + if (!property_exists($obj, 'sFieldGoalsMade')) { | |
| 12755 | + throw new Exception("Missing required property"); | |
| 12756 | + } | |
| 12757 | + if (!property_exists($obj, 'sFieldGoalsPercentage')) { | |
| 12758 | + throw new Exception("Missing required property"); | |
| 12759 | + } | |
| 12760 | + if (!property_exists($obj, 'sFoulsOn')) { | |
| 12761 | + throw new Exception("Missing required property"); | |
| 12762 | + } | |
| 12763 | + if (!property_exists($obj, 'sFoulsPersonal')) { | |
| 12764 | + throw new Exception("Missing required property"); | |
| 12765 | + } | |
| 12766 | + if (!property_exists($obj, 'sFreeThrowsAttempted')) { | |
| 12767 | + throw new Exception("Missing required property"); | |
| 12768 | + } | |
| 12769 | + if (!property_exists($obj, 'sFreeThrowsMade')) { | |
| 12770 | + throw new Exception("Missing required property"); | |
| 12771 | + } | |
| 12772 | + if (!property_exists($obj, 'sFreeThrowsPercentage')) { | |
| 12773 | + throw new Exception("Missing required property"); | |
| 12774 | + } | |
| 12775 | + if (!property_exists($obj, 'sMinutes')) { | |
| 12776 | + throw new Exception("Missing required property"); | |
| 12777 | + } | |
| 12778 | + if (!property_exists($obj, 'sPlusMinusPoints')) { | |
| 12779 | + throw new Exception("Missing required property"); | |
| 12780 | + } | |
| 12781 | + if (!property_exists($obj, 'sPoints')) { | |
| 12782 | + throw new Exception("Missing required property"); | |
| 12783 | + } | |
| 12784 | + if (!property_exists($obj, 'sPointsFastBreak')) { | |
| 12785 | + throw new Exception("Missing required property"); | |
| 12786 | + } | |
| 12787 | + if (!property_exists($obj, 'sPointsInThePaint')) { | |
| 12788 | + throw new Exception("Missing required property"); | |
| 12789 | + } | |
| 12790 | + if (!property_exists($obj, 'sPointsSecondChance')) { | |
| 12791 | + throw new Exception("Missing required property"); | |
| 12792 | + } | |
| 12793 | + if (!property_exists($obj, 'sReboundsDefensive')) { | |
| 12794 | + throw new Exception("Missing required property"); | |
| 12795 | + } | |
| 12796 | + if (!property_exists($obj, 'sReboundsOffensive')) { | |
| 12797 | + throw new Exception("Missing required property"); | |
| 12798 | + } | |
| 12799 | + if (!property_exists($obj, 'sReboundsTotal')) { | |
| 12800 | + throw new Exception("Missing required property"); | |
| 12801 | + } | |
| 12802 | + if (!property_exists($obj, 'sSteals')) { | |
| 12803 | + throw new Exception("Missing required property"); | |
| 12804 | + } | |
| 12805 | + if (!property_exists($obj, 'sThreePointersAttempted')) { | |
| 12806 | + throw new Exception("Missing required property"); | |
| 12807 | + } | |
| 12808 | + if (!property_exists($obj, 'sThreePointersMade')) { | |
| 12809 | + throw new Exception("Missing required property"); | |
| 12810 | + } | |
| 12811 | + if (!property_exists($obj, 'sThreePointersPercentage')) { | |
| 12812 | + throw new Exception("Missing required property"); | |
| 12813 | + } | |
| 12814 | + if (!property_exists($obj, 'sTurnovers')) { | |
| 12815 | + throw new Exception("Missing required property"); | |
| 12816 | + } | |
| 12817 | + if (!property_exists($obj, 'sTwoPointersAttempted')) { | |
| 12818 | + throw new Exception("Missing required property"); | |
| 12819 | + } | |
| 12820 | + if (!property_exists($obj, 'sTwoPointersMade')) { | |
| 12821 | + throw new Exception("Missing required property"); | |
| 12822 | + } | |
| 12823 | + if (!property_exists($obj, 'sTwoPointersPercentage')) { | |
| 12824 | + throw new Exception("Missing required property"); | |
| 12825 | + } | |
| 12826 | + if (!property_exists($obj, 'shirtNumber')) { | |
| 12827 | + throw new Exception("Missing required property"); | |
| 12828 | + } | |
| 12829 | + if (!property_exists($obj, 'starter')) { | |
| 12830 | + throw new Exception("Missing required property"); | |
| 12831 | + } | |
| 12307 | 12832 | return new Pl( |
| 12308 | 12833 | Pl::fromActive($obj->{'active'}) |
| 12309 | 12834 | ,Pl::fromCaptain($obj->{'captain'}) |
| @@ -12656,6 +13181,18 @@ class Comp { | ||
| 12656 | 13181 | * @throws Exception |
| 12657 | 13182 | */ |
| 12658 | 13183 | public static function from(stdClass $obj): Comp { |
| 13184 | + if (!property_exists($obj, 'sAssistsAverage')) { | |
| 13185 | + throw new Exception("Missing required property"); | |
| 13186 | + } | |
| 13187 | + if (!property_exists($obj, 'sMinutesAverage')) { | |
| 13188 | + throw new Exception("Missing required property"); | |
| 13189 | + } | |
| 13190 | + if (!property_exists($obj, 'sPointsAverage')) { | |
| 13191 | + throw new Exception("Missing required property"); | |
| 13192 | + } | |
| 13193 | + if (!property_exists($obj, 'sReboundsTotalAverage')) { | |
| 13194 | + throw new Exception("Missing required property"); | |
| 13195 | + } | |
| 12659 | 13196 | return new Comp( |
| 12660 | 13197 | Comp::fromSAssistsAverage($obj->{'sAssistsAverage'}) |
| 12661 | 13198 | ,Comp::fromSMinutesAverage($obj->{'sMinutesAverage'}) |
| @@ -13335,6 +13872,42 @@ class Shot { | ||
| 13335 | 13872 | * @throws Exception |
| 13336 | 13873 | */ |
| 13337 | 13874 | public static function from(stdClass $obj): Shot { |
| 13875 | + if (!property_exists($obj, 'actionType')) { | |
| 13876 | + throw new Exception("Missing required property"); | |
| 13877 | + } | |
| 13878 | + if (!property_exists($obj, 'p')) { | |
| 13879 | + throw new Exception("Missing required property"); | |
| 13880 | + } | |
| 13881 | + if (!property_exists($obj, 'per')) { | |
| 13882 | + throw new Exception("Missing required property"); | |
| 13883 | + } | |
| 13884 | + if (!property_exists($obj, 'perType')) { | |
| 13885 | + throw new Exception("Missing required property"); | |
| 13886 | + } | |
| 13887 | + if (!property_exists($obj, 'player')) { | |
| 13888 | + throw new Exception("Missing required property"); | |
| 13889 | + } | |
| 13890 | + if (!property_exists($obj, 'pno')) { | |
| 13891 | + throw new Exception("Missing required property"); | |
| 13892 | + } | |
| 13893 | + if (!property_exists($obj, 'r')) { | |
| 13894 | + throw new Exception("Missing required property"); | |
| 13895 | + } | |
| 13896 | + if (!property_exists($obj, 'shirtNumber')) { | |
| 13897 | + throw new Exception("Missing required property"); | |
| 13898 | + } | |
| 13899 | + if (!property_exists($obj, 'subType')) { | |
| 13900 | + throw new Exception("Missing required property"); | |
| 13901 | + } | |
| 13902 | + if (!property_exists($obj, 'tno')) { | |
| 13903 | + throw new Exception("Missing required property"); | |
| 13904 | + } | |
| 13905 | + if (!property_exists($obj, 'x')) { | |
| 13906 | + throw new Exception("Missing required property"); | |
| 13907 | + } | |
| 13908 | + if (!property_exists($obj, 'y')) { | |
| 13909 | + throw new Exception("Missing required property"); | |
| 13910 | + } | |
| 13338 | 13911 | return new Shot( |
| 13339 | 13912 | Shot::fromActionType($obj->{'actionType'}) |
| 13340 | 13913 | ,Shot::fromP($obj->{'p'}) |
| @@ -13791,6 +14364,21 @@ class Totallds { | ||
| 13791 | 14364 | * @throws Exception |
| 13792 | 14365 | */ |
| 13793 | 14366 | public static function from(stdClass $obj): Totallds { |
| 14367 | + if (!property_exists($obj, 'sAssists')) { | |
| 14368 | + throw new Exception("Missing required property"); | |
| 14369 | + } | |
| 14370 | + if (!property_exists($obj, 'sBlocks')) { | |
| 14371 | + throw new Exception("Missing required property"); | |
| 14372 | + } | |
| 14373 | + if (!property_exists($obj, 'sPoints')) { | |
| 14374 | + throw new Exception("Missing required property"); | |
| 14375 | + } | |
| 14376 | + if (!property_exists($obj, 'sReboundsTotal')) { | |
| 14377 | + throw new Exception("Missing required property"); | |
| 14378 | + } | |
| 14379 | + if (!property_exists($obj, 'sSteals')) { | |
| 14380 | + throw new Exception("Missing required property"); | |
| 14381 | + } | |
| 13794 | 14382 | return new Totallds( |
| 13795 | 14383 | Totallds::fromSAssists($obj->{'sAssists'}) |
| 13796 | 14384 | ,Totallds::fromSBlocks($obj->{'sBlocks'}) |
Test case
1 generated file · +6 −0test/inputs/json/priority/nested-objects.json
Mphpdefault / TopLevel.php+6 −0
| @@ -170,6 +170,12 @@ class TopLevel { | ||
| 170 | 170 | * @throws Exception |
| 171 | 171 | */ |
| 172 | 172 | public static function from(stdClass $obj): TopLevel { |
| 173 | + if (!property_exists($obj, 'a')) { | |
| 174 | + throw new Exception("Missing required property"); | |
| 175 | + } | |
| 176 | + if (!property_exists($obj, 'b')) { | |
| 177 | + throw new Exception("Missing required property"); | |
| 178 | + } | |
| 173 | 179 | return new TopLevel( |
| 174 | 180 | TopLevel::fromA($obj->{'a'}) |
| 175 | 181 | ,TopLevel::fromB($obj->{'b'}) |
Test case
1 generated file · +318 −0test/inputs/json/priority/nst-test-suite.json
Mphpdefault / TopLevel.php+318 −0
| @@ -5977,6 +5977,285 @@ class TopLevel { | ||
| 5977 | 5977 | * @throws Exception |
| 5978 | 5978 | */ |
| 5979 | 5979 | public static function from(stdClass $obj): TopLevel { |
| 5980 | + if (!property_exists($obj, 'y_number_0e1.json')) { | |
| 5981 | + throw new Exception("Missing required property"); | |
| 5982 | + } | |
| 5983 | + if (!property_exists($obj, 'y_array_arraysWithSpaces.json')) { | |
| 5984 | + throw new Exception("Missing required property"); | |
| 5985 | + } | |
| 5986 | + if (!property_exists($obj, 'y_array_empty.json')) { | |
| 5987 | + throw new Exception("Missing required property"); | |
| 5988 | + } | |
| 5989 | + if (!property_exists($obj, 'y_array_empty-string.json')) { | |
| 5990 | + throw new Exception("Missing required property"); | |
| 5991 | + } | |
| 5992 | + if (!property_exists($obj, 'y_array_ending_with_newline.json')) { | |
| 5993 | + throw new Exception("Missing required property"); | |
| 5994 | + } | |
| 5995 | + if (!property_exists($obj, 'y_array_false.json')) { | |
| 5996 | + throw new Exception("Missing required property"); | |
| 5997 | + } | |
| 5998 | + if (!property_exists($obj, 'y_array_heterogeneous.json')) { | |
| 5999 | + throw new Exception("Missing required property"); | |
| 6000 | + } | |
| 6001 | + if (!property_exists($obj, 'y_array_null.json')) { | |
| 6002 | + throw new Exception("Missing required property"); | |
| 6003 | + } | |
| 6004 | + if (!property_exists($obj, 'y_array_with_1_and_newline.json')) { | |
| 6005 | + throw new Exception("Missing required property"); | |
| 6006 | + } | |
| 6007 | + if (!property_exists($obj, 'y_array_with_leading_space.json')) { | |
| 6008 | + throw new Exception("Missing required property"); | |
| 6009 | + } | |
| 6010 | + if (!property_exists($obj, 'y_array_with_several_null.json')) { | |
| 6011 | + throw new Exception("Missing required property"); | |
| 6012 | + } | |
| 6013 | + if (!property_exists($obj, 'y_array_with_trailing_space.json')) { | |
| 6014 | + throw new Exception("Missing required property"); | |
| 6015 | + } | |
| 6016 | + if (!property_exists($obj, 'y_number_0e+1.json')) { | |
| 6017 | + throw new Exception("Missing required property"); | |
| 6018 | + } | |
| 6019 | + if (!property_exists($obj, 'y_number_after_space.json')) { | |
| 6020 | + throw new Exception("Missing required property"); | |
| 6021 | + } | |
| 6022 | + if (!property_exists($obj, 'y_number_double_close_to_zero.json')) { | |
| 6023 | + throw new Exception("Missing required property"); | |
| 6024 | + } | |
| 6025 | + if (!property_exists($obj, 'y_number_int_with_exp.json')) { | |
| 6026 | + throw new Exception("Missing required property"); | |
| 6027 | + } | |
| 6028 | + if (!property_exists($obj, 'y_number.json')) { | |
| 6029 | + throw new Exception("Missing required property"); | |
| 6030 | + } | |
| 6031 | + if (!property_exists($obj, 'y_number_minus_zero.json')) { | |
| 6032 | + throw new Exception("Missing required property"); | |
| 6033 | + } | |
| 6034 | + if (!property_exists($obj, 'y_number_negative_int.json')) { | |
| 6035 | + throw new Exception("Missing required property"); | |
| 6036 | + } | |
| 6037 | + if (!property_exists($obj, 'y_number_negative_one.json')) { | |
| 6038 | + throw new Exception("Missing required property"); | |
| 6039 | + } | |
| 6040 | + if (!property_exists($obj, 'y_number_negative_zero.json')) { | |
| 6041 | + throw new Exception("Missing required property"); | |
| 6042 | + } | |
| 6043 | + if (!property_exists($obj, 'y_number_real_capital_e.json')) { | |
| 6044 | + throw new Exception("Missing required property"); | |
| 6045 | + } | |
| 6046 | + if (!property_exists($obj, 'y_number_real_capital_e_neg_exp.json')) { | |
| 6047 | + throw new Exception("Missing required property"); | |
| 6048 | + } | |
| 6049 | + if (!property_exists($obj, 'y_number_real_capital_e_pos_exp.json')) { | |
| 6050 | + throw new Exception("Missing required property"); | |
| 6051 | + } | |
| 6052 | + if (!property_exists($obj, 'y_number_real_exponent.json')) { | |
| 6053 | + throw new Exception("Missing required property"); | |
| 6054 | + } | |
| 6055 | + if (!property_exists($obj, 'y_number_real_fraction_exponent.json')) { | |
| 6056 | + throw new Exception("Missing required property"); | |
| 6057 | + } | |
| 6058 | + if (!property_exists($obj, 'y_number_real_neg_exp.json')) { | |
| 6059 | + throw new Exception("Missing required property"); | |
| 6060 | + } | |
| 6061 | + if (!property_exists($obj, 'y_number_real_pos_exponent.json')) { | |
| 6062 | + throw new Exception("Missing required property"); | |
| 6063 | + } | |
| 6064 | + if (!property_exists($obj, 'y_number_simple_int.json')) { | |
| 6065 | + throw new Exception("Missing required property"); | |
| 6066 | + } | |
| 6067 | + if (!property_exists($obj, 'y_number_simple_real.json')) { | |
| 6068 | + throw new Exception("Missing required property"); | |
| 6069 | + } | |
| 6070 | + if (!property_exists($obj, 'y_object_basic.json')) { | |
| 6071 | + throw new Exception("Missing required property"); | |
| 6072 | + } | |
| 6073 | + if (!property_exists($obj, 'y_object_empty.json')) { | |
| 6074 | + throw new Exception("Missing required property"); | |
| 6075 | + } | |
| 6076 | + if (!property_exists($obj, 'y_object_empty_key.json')) { | |
| 6077 | + throw new Exception("Missing required property"); | |
| 6078 | + } | |
| 6079 | + if (!property_exists($obj, 'y_object_escaped_null_in_key.json')) { | |
| 6080 | + throw new Exception("Missing required property"); | |
| 6081 | + } | |
| 6082 | + if (!property_exists($obj, 'y_object_extreme_numbers.json')) { | |
| 6083 | + throw new Exception("Missing required property"); | |
| 6084 | + } | |
| 6085 | + if (!property_exists($obj, 'y_object.json')) { | |
| 6086 | + throw new Exception("Missing required property"); | |
| 6087 | + } | |
| 6088 | + if (!property_exists($obj, 'y_object_long_strings.json')) { | |
| 6089 | + throw new Exception("Missing required property"); | |
| 6090 | + } | |
| 6091 | + if (!property_exists($obj, 'y_object_simple.json')) { | |
| 6092 | + throw new Exception("Missing required property"); | |
| 6093 | + } | |
| 6094 | + if (!property_exists($obj, 'y_object_string_unicode.json')) { | |
| 6095 | + throw new Exception("Missing required property"); | |
| 6096 | + } | |
| 6097 | + if (!property_exists($obj, 'y_object_with_newlines.json')) { | |
| 6098 | + throw new Exception("Missing required property"); | |
| 6099 | + } | |
| 6100 | + if (!property_exists($obj, 'y_string_1_2_3_bytes_UTF-8_sequences.json')) { | |
| 6101 | + throw new Exception("Missing required property"); | |
| 6102 | + } | |
| 6103 | + if (!property_exists($obj, 'y_string_accepted_surrogate_pair.json')) { | |
| 6104 | + throw new Exception("Missing required property"); | |
| 6105 | + } | |
| 6106 | + if (!property_exists($obj, 'y_string_accepted_surrogate_pairs.json')) { | |
| 6107 | + throw new Exception("Missing required property"); | |
| 6108 | + } | |
| 6109 | + if (!property_exists($obj, 'y_string_allowed_escapes.json')) { | |
| 6110 | + throw new Exception("Missing required property"); | |
| 6111 | + } | |
| 6112 | + if (!property_exists($obj, 'y_string_backslash_and_u_escaped_zero.json')) { | |
| 6113 | + throw new Exception("Missing required property"); | |
| 6114 | + } | |
| 6115 | + if (!property_exists($obj, 'y_string_backslash_doublequotes.json')) { | |
| 6116 | + throw new Exception("Missing required property"); | |
| 6117 | + } | |
| 6118 | + if (!property_exists($obj, 'y_string_comments.json')) { | |
| 6119 | + throw new Exception("Missing required property"); | |
| 6120 | + } | |
| 6121 | + if (!property_exists($obj, 'y_string_double_escape_a.json')) { | |
| 6122 | + throw new Exception("Missing required property"); | |
| 6123 | + } | |
| 6124 | + if (!property_exists($obj, 'y_string_double_escape_n.json')) { | |
| 6125 | + throw new Exception("Missing required property"); | |
| 6126 | + } | |
| 6127 | + if (!property_exists($obj, 'y_string_escaped_control_character.json')) { | |
| 6128 | + throw new Exception("Missing required property"); | |
| 6129 | + } | |
| 6130 | + if (!property_exists($obj, 'y_string_escaped_noncharacter.json')) { | |
| 6131 | + throw new Exception("Missing required property"); | |
| 6132 | + } | |
| 6133 | + if (!property_exists($obj, 'y_string_in_array.json')) { | |
| 6134 | + throw new Exception("Missing required property"); | |
| 6135 | + } | |
| 6136 | + if (!property_exists($obj, 'y_string_in_array_with_leading_space.json')) { | |
| 6137 | + throw new Exception("Missing required property"); | |
| 6138 | + } | |
| 6139 | + if (!property_exists($obj, 'y_string_last_surrogates_1_and_2.json')) { | |
| 6140 | + throw new Exception("Missing required property"); | |
| 6141 | + } | |
| 6142 | + if (!property_exists($obj, 'y_string_nbsp_uescaped.json')) { | |
| 6143 | + throw new Exception("Missing required property"); | |
| 6144 | + } | |
| 6145 | + if (!property_exists($obj, 'y_string_nonCharacterInUTF-8_U+10FFFF.json')) { | |
| 6146 | + throw new Exception("Missing required property"); | |
| 6147 | + } | |
| 6148 | + if (!property_exists($obj, 'y_string_nonCharacterInUTF-8_U+1FFFF.json')) { | |
| 6149 | + throw new Exception("Missing required property"); | |
| 6150 | + } | |
| 6151 | + if (!property_exists($obj, 'y_string_nonCharacterInUTF-8_U+FFFF.json')) { | |
| 6152 | + throw new Exception("Missing required property"); | |
| 6153 | + } | |
| 6154 | + if (!property_exists($obj, 'y_string_null_escape.json')) { | |
| 6155 | + throw new Exception("Missing required property"); | |
| 6156 | + } | |
| 6157 | + if (!property_exists($obj, 'y_string_one-byte-utf-8.json')) { | |
| 6158 | + throw new Exception("Missing required property"); | |
| 6159 | + } | |
| 6160 | + if (!property_exists($obj, 'y_string_pi.json')) { | |
| 6161 | + throw new Exception("Missing required property"); | |
| 6162 | + } | |
| 6163 | + if (!property_exists($obj, 'y_string_simple_ascii.json')) { | |
| 6164 | + throw new Exception("Missing required property"); | |
| 6165 | + } | |
| 6166 | + if (!property_exists($obj, 'y_string_space.json')) { | |
| 6167 | + throw new Exception("Missing required property"); | |
| 6168 | + } | |
| 6169 | + if (!property_exists($obj, 'y_string_surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json')) { | |
| 6170 | + throw new Exception("Missing required property"); | |
| 6171 | + } | |
| 6172 | + if (!property_exists($obj, 'y_string_three-byte-utf-8.json')) { | |
| 6173 | + throw new Exception("Missing required property"); | |
| 6174 | + } | |
| 6175 | + if (!property_exists($obj, 'y_string_two-byte-utf-8.json')) { | |
| 6176 | + throw new Exception("Missing required property"); | |
| 6177 | + } | |
| 6178 | + if (!property_exists($obj, 'y_string_u+2028_line_sep.json')) { | |
| 6179 | + throw new Exception("Missing required property"); | |
| 6180 | + } | |
| 6181 | + if (!property_exists($obj, 'y_string_u+2029_par_sep.json')) { | |
| 6182 | + throw new Exception("Missing required property"); | |
| 6183 | + } | |
| 6184 | + if (!property_exists($obj, 'y_string_uEscape.json')) { | |
| 6185 | + throw new Exception("Missing required property"); | |
| 6186 | + } | |
| 6187 | + if (!property_exists($obj, 'y_string_uescaped_newline.json')) { | |
| 6188 | + throw new Exception("Missing required property"); | |
| 6189 | + } | |
| 6190 | + if (!property_exists($obj, 'y_string_unescaped_char_delete.json')) { | |
| 6191 | + throw new Exception("Missing required property"); | |
| 6192 | + } | |
| 6193 | + if (!property_exists($obj, 'y_string_unicode_2.json')) { | |
| 6194 | + throw new Exception("Missing required property"); | |
| 6195 | + } | |
| 6196 | + if (!property_exists($obj, 'y_string_unicodeEscapedBackslash.json')) { | |
| 6197 | + throw new Exception("Missing required property"); | |
| 6198 | + } | |
| 6199 | + if (!property_exists($obj, 'y_string_unicode_escaped_double_quote.json')) { | |
| 6200 | + throw new Exception("Missing required property"); | |
| 6201 | + } | |
| 6202 | + if (!property_exists($obj, 'y_string_unicode.json')) { | |
| 6203 | + throw new Exception("Missing required property"); | |
| 6204 | + } | |
| 6205 | + if (!property_exists($obj, 'y_string_unicode_U+10FFFE_nonchar.json')) { | |
| 6206 | + throw new Exception("Missing required property"); | |
| 6207 | + } | |
| 6208 | + if (!property_exists($obj, 'y_string_unicode_U+1FFFE_nonchar.json')) { | |
| 6209 | + throw new Exception("Missing required property"); | |
| 6210 | + } | |
| 6211 | + if (!property_exists($obj, 'y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json')) { | |
| 6212 | + throw new Exception("Missing required property"); | |
| 6213 | + } | |
| 6214 | + if (!property_exists($obj, 'y_string_unicode_U+2064_invisible_plus.json')) { | |
| 6215 | + throw new Exception("Missing required property"); | |
| 6216 | + } | |
| 6217 | + if (!property_exists($obj, 'y_string_unicode_U+FDD0_nonchar.json')) { | |
| 6218 | + throw new Exception("Missing required property"); | |
| 6219 | + } | |
| 6220 | + if (!property_exists($obj, 'y_string_unicode_U+FFFE_nonchar.json')) { | |
| 6221 | + throw new Exception("Missing required property"); | |
| 6222 | + } | |
| 6223 | + if (!property_exists($obj, 'y_string_utf8.json')) { | |
| 6224 | + throw new Exception("Missing required property"); | |
| 6225 | + } | |
| 6226 | + if (!property_exists($obj, 'y_string_with_del_character.json')) { | |
| 6227 | + throw new Exception("Missing required property"); | |
| 6228 | + } | |
| 6229 | + if (!property_exists($obj, 'y_structure_lonely_false.json')) { | |
| 6230 | + throw new Exception("Missing required property"); | |
| 6231 | + } | |
| 6232 | + if (!property_exists($obj, 'y_structure_lonely_int.json')) { | |
| 6233 | + throw new Exception("Missing required property"); | |
| 6234 | + } | |
| 6235 | + if (!property_exists($obj, 'y_structure_lonely_negative_real.json')) { | |
| 6236 | + throw new Exception("Missing required property"); | |
| 6237 | + } | |
| 6238 | + if (!property_exists($obj, 'y_structure_lonely_null.json')) { | |
| 6239 | + throw new Exception("Missing required property"); | |
| 6240 | + } | |
| 6241 | + if (!property_exists($obj, 'y_structure_lonely_string.json')) { | |
| 6242 | + throw new Exception("Missing required property"); | |
| 6243 | + } | |
| 6244 | + if (!property_exists($obj, 'y_structure_lonely_true.json')) { | |
| 6245 | + throw new Exception("Missing required property"); | |
| 6246 | + } | |
| 6247 | + if (!property_exists($obj, 'y_structure_string_empty.json')) { | |
| 6248 | + throw new Exception("Missing required property"); | |
| 6249 | + } | |
| 6250 | + if (!property_exists($obj, 'y_structure_trailing_newline.json')) { | |
| 6251 | + throw new Exception("Missing required property"); | |
| 6252 | + } | |
| 6253 | + if (!property_exists($obj, 'y_structure_true_in_array.json')) { | |
| 6254 | + throw new Exception("Missing required property"); | |
| 6255 | + } | |
| 6256 | + if (!property_exists($obj, 'y_structure_whitespace_array.json')) { | |
| 6257 | + throw new Exception("Missing required property"); | |
| 6258 | + } | |
| 5980 | 6259 | return new TopLevel( |
| 5981 | 6260 | TopLevel::fromTopLevelYNumber0E1JSON($obj->{'y_number_0e1.json'}) |
| 5982 | 6261 | ,TopLevel::fromYArrayArraysWithSpacesJSON($obj->{'y_array_arraysWithSpaces.json'}) |
| @@ -6304,6 +6583,9 @@ class YObjectBasicJSON { | ||
| 6304 | 6583 | * @throws Exception |
| 6305 | 6584 | */ |
| 6306 | 6585 | public static function from(stdClass $obj): YObjectBasicJSON { |
| 6586 | + if (!property_exists($obj, 'asd')) { | |
| 6587 | + throw new Exception("Missing required property"); | |
| 6588 | + } | |
| 6307 | 6589 | return new YObjectBasicJSON( |
| 6308 | 6590 | YObjectBasicJSON::fromAsd($obj->{'asd'}) |
| 6309 | 6591 | ); |
| @@ -6402,6 +6684,9 @@ class YObjectEmptyKeyJSON { | ||
| 6402 | 6684 | * @throws Exception |
| 6403 | 6685 | */ |
| 6404 | 6686 | public static function from(stdClass $obj): YObjectEmptyKeyJSON { |
| 6687 | + if (!property_exists($obj, '')) { | |
| 6688 | + throw new Exception("Missing required property"); | |
| 6689 | + } | |
| 6405 | 6690 | return new YObjectEmptyKeyJSON( |
| 6406 | 6691 | YObjectEmptyKeyJSON::fromEmpty($obj->{''}) |
| 6407 | 6692 | ); |
| @@ -6500,6 +6785,9 @@ class YObjectEscapedNullInKeyJSON { | ||
| 6500 | 6785 | * @throws Exception |
| 6501 | 6786 | */ |
| 6502 | 6787 | public static function from(stdClass $obj): YObjectEscapedNullInKeyJSON { |
| 6788 | + if (!property_exists($obj, 'foo bar')) { | |
| 6789 | + throw new Exception("Missing required property"); | |
| 6790 | + } | |
| 6503 | 6791 | return new YObjectEscapedNullInKeyJSON( |
| 6504 | 6792 | YObjectEscapedNullInKeyJSON::fromFooBar($obj->{'foo bar'}) |
| 6505 | 6793 | ); |
| @@ -6650,6 +6938,12 @@ class YObjectExtremeNumbersJSON { | ||
| 6650 | 6938 | * @throws Exception |
| 6651 | 6939 | */ |
| 6652 | 6940 | public static function from(stdClass $obj): YObjectExtremeNumbersJSON { |
| 6941 | + if (!property_exists($obj, 'max')) { | |
| 6942 | + throw new Exception("Missing required property"); | |
| 6943 | + } | |
| 6944 | + if (!property_exists($obj, 'min')) { | |
| 6945 | + throw new Exception("Missing required property"); | |
| 6946 | + } | |
| 6653 | 6947 | return new YObjectExtremeNumbersJSON( |
| 6654 | 6948 | YObjectExtremeNumbersJSON::fromMax($obj->{'max'}) |
| 6655 | 6949 | ,YObjectExtremeNumbersJSON::fromMin($obj->{'min'}) |
| @@ -6802,6 +7096,12 @@ class YObjectJSON { | ||
| 6802 | 7096 | * @throws Exception |
| 6803 | 7097 | */ |
| 6804 | 7098 | public static function from(stdClass $obj): YObjectJSON { |
| 7099 | + if (!property_exists($obj, 'asd')) { | |
| 7100 | + throw new Exception("Missing required property"); | |
| 7101 | + } | |
| 7102 | + if (!property_exists($obj, 'dfg')) { | |
| 7103 | + throw new Exception("Missing required property"); | |
| 7104 | + } | |
| 6805 | 7105 | return new YObjectJSON( |
| 6806 | 7106 | YObjectJSON::fromAsd($obj->{'asd'}) |
| 6807 | 7107 | ,YObjectJSON::fromDfg($obj->{'dfg'}) |
| @@ -6966,6 +7266,12 @@ class YObjectLongStringsJSON { | ||
| 6966 | 7266 | * @throws Exception |
| 6967 | 7267 | */ |
| 6968 | 7268 | public static function from(stdClass $obj): YObjectLongStringsJSON { |
| 7269 | + if (!property_exists($obj, 'id')) { | |
| 7270 | + throw new Exception("Missing required property"); | |
| 7271 | + } | |
| 7272 | + if (!property_exists($obj, 'x')) { | |
| 7273 | + throw new Exception("Missing required property"); | |
| 7274 | + } | |
| 6969 | 7275 | return new YObjectLongStringsJSON( |
| 6970 | 7276 | YObjectLongStringsJSON::fromID($obj->{'id'}) |
| 6971 | 7277 | ,YObjectLongStringsJSON::fromX($obj->{'x'}) |
| @@ -7066,6 +7372,9 @@ class X { | ||
| 7066 | 7372 | * @throws Exception |
| 7067 | 7373 | */ |
| 7068 | 7374 | public static function from(stdClass $obj): X { |
| 7375 | + if (!property_exists($obj, 'id')) { | |
| 7376 | + throw new Exception("Missing required property"); | |
| 7377 | + } | |
| 7069 | 7378 | return new X( |
| 7070 | 7379 | X::fromID($obj->{'id'}) |
| 7071 | 7380 | ); |
| @@ -7175,6 +7484,9 @@ class YObjectSimpleJSON { | ||
| 7175 | 7484 | * @throws Exception |
| 7176 | 7485 | */ |
| 7177 | 7486 | public static function from(stdClass $obj): YObjectSimpleJSON { |
| 7487 | + if (!property_exists($obj, 'a')) { | |
| 7488 | + throw new Exception("Missing required property"); | |
| 7489 | + } | |
| 7178 | 7490 | return new YObjectSimpleJSON( |
| 7179 | 7491 | YObjectSimpleJSON::fromA($obj->{'a'}) |
| 7180 | 7492 | ); |
| @@ -7273,6 +7585,9 @@ class YObjectStringUnicodeJSON { | ||
| 7273 | 7585 | * @throws Exception |
| 7274 | 7586 | */ |
| 7275 | 7587 | public static function from(stdClass $obj): YObjectStringUnicodeJSON { |
| 7588 | + if (!property_exists($obj, 'title')) { | |
| 7589 | + throw new Exception("Missing required property"); | |
| 7590 | + } | |
| 7276 | 7591 | return new YObjectStringUnicodeJSON( |
| 7277 | 7592 | YObjectStringUnicodeJSON::fromTitle($obj->{'title'}) |
| 7278 | 7593 | ); |
| @@ -7371,6 +7686,9 @@ class YObjectWithNewlinesJSON { | ||
| 7371 | 7686 | * @throws Exception |
| 7372 | 7687 | */ |
| 7373 | 7688 | public static function from(stdClass $obj): YObjectWithNewlinesJSON { |
| 7689 | + if (!property_exists($obj, 'a')) { | |
| 7690 | + throw new Exception("Missing required property"); | |
| 7691 | + } | |
| 7374 | 7692 | return new YObjectWithNewlinesJSON( |
| 7375 | 7693 | YObjectWithNewlinesJSON::fromA($obj->{'a'}) |
| 7376 | 7694 | ); |
Test case
1 generated file · +3 −0test/inputs/json/priority/number-map.json
Mphpdefault / TopLevel.php+3 −0
| @@ -101,6 +101,9 @@ class TopLevel { | ||
| 101 | 101 | * @throws Exception |
| 102 | 102 | */ |
| 103 | 103 | public static function from(stdClass $obj): TopLevel { |
| 104 | + if (!property_exists($obj, 'foo')) { | |
| 105 | + throw new Exception("Missing required property"); | |
| 106 | + } | |
| 104 | 107 | return new TopLevel( |
| 105 | 108 | TopLevel::fromFoo($obj->{'foo'}) |
| 106 | 109 | ); |
Test case
1 generated file · +6 −0test/inputs/json/priority/omit-empty.json
Mphpdefault / TopLevel.php+6 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'results')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromResults($obj->{'results'}) |
| 101 | 104 | ); |
| @@ -249,6 +252,9 @@ class Result { | ||
| 249 | 252 | * @throws Exception |
| 250 | 253 | */ |
| 251 | 254 | public static function from(stdClass $obj): Result { |
| 255 | + if (!property_exists($obj, 'age')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 252 | 258 | return new Result( |
| 253 | 259 | Result::fromAge($obj->{'age'}) |
| 254 | 260 | ,Result::fromName($obj->{'name'}) |
Test case
1 generated file · +6 −0test/inputs/json/priority/php-mixed-union.json
Mphpdefault / TopLevel.php+6 −0
| @@ -140,6 +140,9 @@ class TopLevel { | ||
| 140 | 140 | * @throws Exception |
| 141 | 141 | */ |
| 142 | 142 | public static function from(stdClass $obj): TopLevel { |
| 143 | + if (!property_exists($obj, 'mixed')) { | |
| 144 | + throw new Exception("Missing required property"); | |
| 145 | + } | |
| 143 | 146 | return new TopLevel( |
| 144 | 147 | TopLevel::fromMixed($obj->{'mixed'}) |
| 145 | 148 | ); |
| @@ -238,6 +241,9 @@ class MixedClass { | ||
| 238 | 241 | * @throws Exception |
| 239 | 242 | */ |
| 240 | 243 | public static function from(stdClass $obj): MixedClass { |
| 244 | + if (!property_exists($obj, 'nested')) { | |
| 245 | + throw new Exception("Missing required property"); | |
| 246 | + } | |
| 241 | 247 | return new MixedClass( |
| 242 | 248 | MixedClass::fromNested($obj->{'nested'}) |
| 243 | 249 | ); |
Test case
1 generated file · +15 −0test/inputs/json/priority/php-validation.json
Mphpdefault / TopLevel.php+15 −0
| @@ -306,6 +306,21 @@ class TopLevel { | ||
| 306 | 306 | * @throws Exception |
| 307 | 307 | */ |
| 308 | 308 | public static function from(stdClass $obj): TopLevel { |
| 309 | + if (!property_exists($obj, 'boolean')) { | |
| 310 | + throw new Exception("Missing required property"); | |
| 311 | + } | |
| 312 | + if (!property_exists($obj, 'integer')) { | |
| 313 | + throw new Exception("Missing required property"); | |
| 314 | + } | |
| 315 | + if (!property_exists($obj, 'integers')) { | |
| 316 | + throw new Exception("Missing required property"); | |
| 317 | + } | |
| 318 | + if (!property_exists($obj, 'number')) { | |
| 319 | + throw new Exception("Missing required property"); | |
| 320 | + } | |
| 321 | + if (!property_exists($obj, 'string')) { | |
| 322 | + throw new Exception("Missing required property"); | |
| 323 | + } | |
| 309 | 324 | return new TopLevel( |
| 310 | 325 | TopLevel::fromBoolean($obj->{'boolean'}) |
| 311 | 326 | ,TopLevel::fromInteger($obj->{'integer'}) |
Test case
1 generated file · +213 −0test/inputs/json/priority/recursive.json
Mphpdefault / TopLevel.php+213 −0
| @@ -566,6 +566,36 @@ class TopLevel { | ||
| 566 | 566 | * @throws Exception |
| 567 | 567 | */ |
| 568 | 568 | public static function from(stdClass $obj): TopLevel { |
| 569 | + if (!property_exists($obj, 'category')) { | |
| 570 | + throw new Exception("Missing required property"); | |
| 571 | + } | |
| 572 | + if (!property_exists($obj, 'details')) { | |
| 573 | + throw new Exception("Missing required property"); | |
| 574 | + } | |
| 575 | + if (!property_exists($obj, 'match')) { | |
| 576 | + throw new Exception("Missing required property"); | |
| 577 | + } | |
| 578 | + if (!property_exists($obj, 'page')) { | |
| 579 | + throw new Exception("Missing required property"); | |
| 580 | + } | |
| 581 | + if (!property_exists($obj, 'product')) { | |
| 582 | + throw new Exception("Missing required property"); | |
| 583 | + } | |
| 584 | + if (!property_exists($obj, 'schk')) { | |
| 585 | + throw new Exception("Missing required property"); | |
| 586 | + } | |
| 587 | + if (!property_exists($obj, 'totallooseoffers')) { | |
| 588 | + throw new Exception("Missing required property"); | |
| 589 | + } | |
| 590 | + if (!property_exists($obj, 'totalpages')) { | |
| 591 | + throw new Exception("Missing required property"); | |
| 592 | + } | |
| 593 | + if (!property_exists($obj, 'totalresultsavailable')) { | |
| 594 | + throw new Exception("Missing required property"); | |
| 595 | + } | |
| 596 | + if (!property_exists($obj, 'totalresultsreturned')) { | |
| 597 | + throw new Exception("Missing required property"); | |
| 598 | + } | |
| 569 | 599 | return new TopLevel( |
| 570 | 600 | TopLevel::fromCategory($obj->{'category'}) |
| 571 | 601 | ,TopLevel::fromDetails($obj->{'details'}) |
| @@ -1059,6 +1089,30 @@ class Category { | ||
| 1059 | 1089 | * @throws Exception |
| 1060 | 1090 | */ |
| 1061 | 1091 | public static function from(stdClass $obj): Category { |
| 1092 | + if (!property_exists($obj, 'concatenatecategoryname')) { | |
| 1093 | + throw new Exception("Missing required property"); | |
| 1094 | + } | |
| 1095 | + if (!property_exists($obj, 'hasoffer')) { | |
| 1096 | + throw new Exception("Missing required property"); | |
| 1097 | + } | |
| 1098 | + if (!property_exists($obj, 'id')) { | |
| 1099 | + throw new Exception("Missing required property"); | |
| 1100 | + } | |
| 1101 | + if (!property_exists($obj, 'isfinal')) { | |
| 1102 | + throw new Exception("Missing required property"); | |
| 1103 | + } | |
| 1104 | + if (!property_exists($obj, 'links')) { | |
| 1105 | + throw new Exception("Missing required property"); | |
| 1106 | + } | |
| 1107 | + if (!property_exists($obj, 'name')) { | |
| 1108 | + throw new Exception("Missing required property"); | |
| 1109 | + } | |
| 1110 | + if (!property_exists($obj, 'parentcategoryid')) { | |
| 1111 | + throw new Exception("Missing required property"); | |
| 1112 | + } | |
| 1113 | + if (!property_exists($obj, 'thumbnail')) { | |
| 1114 | + throw new Exception("Missing required property"); | |
| 1115 | + } | |
| 1062 | 1116 | return new Category( |
| 1063 | 1117 | Category::fromConcatenatecategoryname($obj->{'concatenatecategoryname'}) |
| 1064 | 1118 | ,Category::fromHasoffer($obj->{'hasoffer'}) |
| @@ -1172,6 +1226,9 @@ class LinkElement { | ||
| 1172 | 1226 | * @throws Exception |
| 1173 | 1227 | */ |
| 1174 | 1228 | public static function from(stdClass $obj): LinkElement { |
| 1229 | + if (!property_exists($obj, 'link')) { | |
| 1230 | + throw new Exception("Missing required property"); | |
| 1231 | + } | |
| 1175 | 1232 | return new LinkElement( |
| 1176 | 1233 | LinkElement::fromLink($obj->{'link'}) |
| 1177 | 1234 | ); |
| @@ -1322,6 +1379,12 @@ class LinkLink { | ||
| 1322 | 1379 | * @throws Exception |
| 1323 | 1380 | */ |
| 1324 | 1381 | public static function from(stdClass $obj): LinkLink { |
| 1382 | + if (!property_exists($obj, 'type')) { | |
| 1383 | + throw new Exception("Missing required property"); | |
| 1384 | + } | |
| 1385 | + if (!property_exists($obj, 'url')) { | |
| 1386 | + throw new Exception("Missing required property"); | |
| 1387 | + } | |
| 1325 | 1388 | return new LinkLink( |
| 1326 | 1389 | LinkLink::fromType($obj->{'type'}) |
| 1327 | 1390 | ,LinkLink::fromURL($obj->{'url'}) |
| @@ -1422,6 +1485,9 @@ class CategoryThumbnail { | ||
| 1422 | 1485 | * @throws Exception |
| 1423 | 1486 | */ |
| 1424 | 1487 | public static function from(stdClass $obj): CategoryThumbnail { |
| 1488 | + if (!property_exists($obj, 'url')) { | |
| 1489 | + throw new Exception("Missing required property"); | |
| 1490 | + } | |
| 1425 | 1491 | return new CategoryThumbnail( |
| 1426 | 1492 | CategoryThumbnail::fromURL($obj->{'url'}) |
| 1427 | 1493 | ); |
| @@ -1833,6 +1899,27 @@ class Details { | ||
| 1833 | 1899 | * @throws Exception |
| 1834 | 1900 | */ |
| 1835 | 1901 | public static function from(stdClass $obj): Details { |
| 1902 | + if (!property_exists($obj, 'applicationid')) { | |
| 1903 | + throw new Exception("Missing required property"); | |
| 1904 | + } | |
| 1905 | + if (!property_exists($obj, 'applicationversion')) { | |
| 1906 | + throw new Exception("Missing required property"); | |
| 1907 | + } | |
| 1908 | + if (!property_exists($obj, 'code')) { | |
| 1909 | + throw new Exception("Missing required property"); | |
| 1910 | + } | |
| 1911 | + if (!property_exists($obj, 'date')) { | |
| 1912 | + throw new Exception("Missing required property"); | |
| 1913 | + } | |
| 1914 | + if (!property_exists($obj, 'elapsedtime')) { | |
| 1915 | + throw new Exception("Missing required property"); | |
| 1916 | + } | |
| 1917 | + if (!property_exists($obj, 'message')) { | |
| 1918 | + throw new Exception("Missing required property"); | |
| 1919 | + } | |
| 1920 | + if (!property_exists($obj, 'status')) { | |
| 1921 | + throw new Exception("Missing required property"); | |
| 1922 | + } | |
| 1836 | 1923 | return new Details( |
| 1837 | 1924 | Details::fromApplicationid($obj->{'applicationid'}) |
| 1838 | 1925 | ,Details::fromApplicationversion($obj->{'applicationversion'}) |
| @@ -2465,6 +2552,39 @@ class Date { | ||
| 2465 | 2552 | * @throws Exception |
| 2466 | 2553 | */ |
| 2467 | 2554 | public static function from(stdClass $obj): Date { |
| 2555 | + if (!property_exists($obj, 'day')) { | |
| 2556 | + throw new Exception("Missing required property"); | |
| 2557 | + } | |
| 2558 | + if (!property_exists($obj, 'eonandyear')) { | |
| 2559 | + throw new Exception("Missing required property"); | |
| 2560 | + } | |
| 2561 | + if (!property_exists($obj, 'hour')) { | |
| 2562 | + throw new Exception("Missing required property"); | |
| 2563 | + } | |
| 2564 | + if (!property_exists($obj, 'millisecond')) { | |
| 2565 | + throw new Exception("Missing required property"); | |
| 2566 | + } | |
| 2567 | + if (!property_exists($obj, 'minute')) { | |
| 2568 | + throw new Exception("Missing required property"); | |
| 2569 | + } | |
| 2570 | + if (!property_exists($obj, 'month')) { | |
| 2571 | + throw new Exception("Missing required property"); | |
| 2572 | + } | |
| 2573 | + if (!property_exists($obj, 'second')) { | |
| 2574 | + throw new Exception("Missing required property"); | |
| 2575 | + } | |
| 2576 | + if (!property_exists($obj, 'timezone')) { | |
| 2577 | + throw new Exception("Missing required property"); | |
| 2578 | + } | |
| 2579 | + if (!property_exists($obj, 'valid')) { | |
| 2580 | + throw new Exception("Missing required property"); | |
| 2581 | + } | |
| 2582 | + if (!property_exists($obj, 'xmlschematype')) { | |
| 2583 | + throw new Exception("Missing required property"); | |
| 2584 | + } | |
| 2585 | + if (!property_exists($obj, 'year')) { | |
| 2586 | + throw new Exception("Missing required property"); | |
| 2587 | + } | |
| 2468 | 2588 | return new Date( |
| 2469 | 2589 | Date::fromDay($obj->{'day'}) |
| 2470 | 2590 | ,Date::fromEonandyear($obj->{'eonandyear'}) |
| @@ -2583,6 +2703,9 @@ class Eonandyear { | ||
| 2583 | 2703 | * @throws Exception |
| 2584 | 2704 | */ |
| 2585 | 2705 | public static function from(stdClass $obj): Eonandyear { |
| 2706 | + if (!property_exists($obj, 'lowestsetbit')) { | |
| 2707 | + throw new Exception("Missing required property"); | |
| 2708 | + } | |
| 2586 | 2709 | return new Eonandyear( |
| 2587 | 2710 | Eonandyear::fromLowestsetbit($obj->{'lowestsetbit'}) |
| 2588 | 2711 | ); |
| @@ -2785,6 +2908,15 @@ class Xmlschematype { | ||
| 2785 | 2908 | * @throws Exception |
| 2786 | 2909 | */ |
| 2787 | 2910 | public static function from(stdClass $obj): Xmlschematype { |
| 2911 | + if (!property_exists($obj, 'localpart')) { | |
| 2912 | + throw new Exception("Missing required property"); | |
| 2913 | + } | |
| 2914 | + if (!property_exists($obj, 'namespaceuri')) { | |
| 2915 | + throw new Exception("Missing required property"); | |
| 2916 | + } | |
| 2917 | + if (!property_exists($obj, 'prefix')) { | |
| 2918 | + throw new Exception("Missing required property"); | |
| 2919 | + } | |
| 2788 | 2920 | return new Xmlschematype( |
| 2789 | 2921 | Xmlschematype::fromLocalpart($obj->{'localpart'}) |
| 2790 | 2922 | ,Xmlschematype::fromNamespaceuri($obj->{'namespaceuri'}) |
| @@ -2888,6 +3020,9 @@ class ProductElement { | ||
| 2888 | 3020 | * @throws Exception |
| 2889 | 3021 | */ |
| 2890 | 3022 | public static function from(stdClass $obj): ProductElement { |
| 3023 | + if (!property_exists($obj, 'product')) { | |
| 3024 | + throw new Exception("Missing required property"); | |
| 3025 | + } | |
| 2891 | 3026 | return new ProductElement( |
| 2892 | 3027 | ProductElement::fromProduct($obj->{'product'}) |
| 2893 | 3028 | ); |
| @@ -3782,6 +3917,54 @@ class ProductProduct { | ||
| 3782 | 3917 | * @throws Exception |
| 3783 | 3918 | */ |
| 3784 | 3919 | public static function from(stdClass $obj): ProductProduct { |
| 3920 | + if (!property_exists($obj, 'categoryid')) { | |
| 3921 | + throw new Exception("Missing required property"); | |
| 3922 | + } | |
| 3923 | + if (!property_exists($obj, 'currency')) { | |
| 3924 | + throw new Exception("Missing required property"); | |
| 3925 | + } | |
| 3926 | + if (!property_exists($obj, 'eco')) { | |
| 3927 | + throw new Exception("Missing required property"); | |
| 3928 | + } | |
| 3929 | + if (!property_exists($obj, 'fulldescription')) { | |
| 3930 | + throw new Exception("Missing required property"); | |
| 3931 | + } | |
| 3932 | + if (!property_exists($obj, 'hasmetasearch')) { | |
| 3933 | + throw new Exception("Missing required property"); | |
| 3934 | + } | |
| 3935 | + if (!property_exists($obj, 'id')) { | |
| 3936 | + throw new Exception("Missing required property"); | |
| 3937 | + } | |
| 3938 | + if (!property_exists($obj, 'links')) { | |
| 3939 | + throw new Exception("Missing required property"); | |
| 3940 | + } | |
| 3941 | + if (!property_exists($obj, 'numoffers')) { | |
| 3942 | + throw new Exception("Missing required property"); | |
| 3943 | + } | |
| 3944 | + if (!property_exists($obj, 'pricemax')) { | |
| 3945 | + throw new Exception("Missing required property"); | |
| 3946 | + } | |
| 3947 | + if (!property_exists($obj, 'pricemin')) { | |
| 3948 | + throw new Exception("Missing required property"); | |
| 3949 | + } | |
| 3950 | + if (!property_exists($obj, 'productname')) { | |
| 3951 | + throw new Exception("Missing required property"); | |
| 3952 | + } | |
| 3953 | + if (!property_exists($obj, 'quantity')) { | |
| 3954 | + throw new Exception("Missing required property"); | |
| 3955 | + } | |
| 3956 | + if (!property_exists($obj, 'rating')) { | |
| 3957 | + throw new Exception("Missing required property"); | |
| 3958 | + } | |
| 3959 | + if (!property_exists($obj, 'specification')) { | |
| 3960 | + throw new Exception("Missing required property"); | |
| 3961 | + } | |
| 3962 | + if (!property_exists($obj, 'thumbnail')) { | |
| 3963 | + throw new Exception("Missing required property"); | |
| 3964 | + } | |
| 3965 | + if (!property_exists($obj, 'totalsellers')) { | |
| 3966 | + throw new Exception("Missing required property"); | |
| 3967 | + } | |
| 3785 | 3968 | return new ProductProduct( |
| 3786 | 3969 | ProductProduct::fromCategoryid($obj->{'categoryid'}) |
| 3787 | 3970 | ,ProductProduct::fromCurrency($obj->{'currency'}) |
| @@ -3910,6 +4093,9 @@ class Currency { | ||
| 3910 | 4093 | * @throws Exception |
| 3911 | 4094 | */ |
| 3912 | 4095 | public static function from(stdClass $obj): Currency { |
| 4096 | + if (!property_exists($obj, 'abbreviation')) { | |
| 4097 | + throw new Exception("Missing required property"); | |
| 4098 | + } | |
| 3913 | 4099 | return new Currency( |
| 3914 | 4100 | Currency::fromAbbreviation($obj->{'abbreviation'}) |
| 3915 | 4101 | ); |
| @@ -4009,6 +4195,9 @@ class Rating { | ||
| 4009 | 4195 | * @throws Exception |
| 4010 | 4196 | */ |
| 4011 | 4197 | public static function from(stdClass $obj): Rating { |
| 4198 | + if (!property_exists($obj, 'useraveragerating')) { | |
| 4199 | + throw new Exception("Missing required property"); | |
| 4200 | + } | |
| 4012 | 4201 | return new Rating( |
| 4013 | 4202 | Rating::fromUseraveragerating($obj->{'useraveragerating'}) |
| 4014 | 4203 | ); |
| @@ -4223,6 +4412,15 @@ class Useraveragerating { | ||
| 4223 | 4412 | * @throws Exception |
| 4224 | 4413 | */ |
| 4225 | 4414 | public static function from(stdClass $obj): Useraveragerating { |
| 4415 | + if (!property_exists($obj, 'links')) { | |
| 4416 | + throw new Exception("Missing required property"); | |
| 4417 | + } | |
| 4418 | + if (!property_exists($obj, 'numcomments')) { | |
| 4419 | + throw new Exception("Missing required property"); | |
| 4420 | + } | |
| 4421 | + if (!property_exists($obj, 'rating')) { | |
| 4422 | + throw new Exception("Missing required property"); | |
| 4423 | + } | |
| 4226 | 4424 | return new Useraveragerating( |
| 4227 | 4425 | Useraveragerating::fromLinks($obj->{'links'}) |
| 4228 | 4426 | ,Useraveragerating::fromNumcomments($obj->{'numcomments'}) |
| @@ -4337,6 +4535,9 @@ class Specification { | ||
| 4337 | 4535 | * @throws Exception |
| 4338 | 4536 | */ |
| 4339 | 4537 | public static function from(stdClass $obj): Specification { |
| 4538 | + if (!property_exists($obj, 'links')) { | |
| 4539 | + throw new Exception("Missing required property"); | |
| 4540 | + } | |
| 4340 | 4541 | return new Specification( |
| 4341 | 4542 | Specification::fromLinks($obj->{'links'}) |
| 4342 | 4543 | ); |
| @@ -4436,6 +4637,9 @@ class Format { | ||
| 4436 | 4637 | * @throws Exception |
| 4437 | 4638 | */ |
| 4438 | 4639 | public static function from(stdClass $obj): Format { |
| 4640 | + if (!property_exists($obj, 'formats')) { | |
| 4641 | + throw new Exception("Missing required property"); | |
| 4642 | + } | |
| 4439 | 4643 | return new Format( |
| 4440 | 4644 | Format::fromFormats($obj->{'formats'}) |
| 4441 | 4645 | ); |
| @@ -4712,6 +4916,15 @@ class FormatsClass { | ||
| 4712 | 4916 | * @throws Exception |
| 4713 | 4917 | */ |
| 4714 | 4918 | public static function from(stdClass $obj): FormatsClass { |
| 4919 | + if (!property_exists($obj, 'height')) { | |
| 4920 | + throw new Exception("Missing required property"); | |
| 4921 | + } | |
| 4922 | + if (!property_exists($obj, 'url')) { | |
| 4923 | + throw new Exception("Missing required property"); | |
| 4924 | + } | |
| 4925 | + if (!property_exists($obj, 'width')) { | |
| 4926 | + throw new Exception("Missing required property"); | |
| 4927 | + } | |
| 4715 | 4928 | return new FormatsClass( |
| 4716 | 4929 | FormatsClass::fromFormats($obj->{'formats'}) |
| 4717 | 4930 | ,FormatsClass::fromHeight($obj->{'height'}) |
Test case
1 generated file · +27 −0test/inputs/json/priority/simple-identifiers.json
Mphpdefault / TopLevel.php+27 −0
| @@ -500,6 +500,33 @@ class TopLevel { | ||
| 500 | 500 | * @throws Exception |
| 501 | 501 | */ |
| 502 | 502 | public static function from(stdClass $obj): TopLevel { |
| 503 | + if (!property_exists($obj, 'continue')) { | |
| 504 | + throw new Exception("Missing required property"); | |
| 505 | + } | |
| 506 | + if (!property_exists($obj, '')) { | |
| 507 | + throw new Exception("Missing required property"); | |
| 508 | + } | |
| 509 | + if (!property_exists($obj, 'null')) { | |
| 510 | + throw new Exception("Missing required property"); | |
| 511 | + } | |
| 512 | + if (!property_exists($obj, 'x\'')) { | |
| 513 | + throw new Exception("Missing required property"); | |
| 514 | + } | |
| 515 | + if (!property_exists($obj, '{}')) { | |
| 516 | + throw new Exception("Missing required property"); | |
| 517 | + } | |
| 518 | + if (!property_exists($obj, 'x"')) { | |
| 519 | + throw new Exception("Missing required property"); | |
| 520 | + } | |
| 521 | + if (!property_exists($obj, 'undefined')) { | |
| 522 | + throw new Exception("Missing required property"); | |
| 523 | + } | |
| 524 | + if (!property_exists($obj, 'x')) { | |
| 525 | + throw new Exception("Missing required property"); | |
| 526 | + } | |
| 527 | + if (!property_exists($obj, 'x y')) { | |
| 528 | + throw new Exception("Missing required property"); | |
| 529 | + } | |
| 503 | 530 | return new TopLevel( |
| 504 | 531 | TopLevel::fromContinue($obj->{'continue'}) |
| 505 | 532 | ,TopLevel::fromEmpty($obj->{''}) |
Test case
1 generated file · +9 −0test/inputs/json/priority/union-constructor-clash.json
Mphpdefault / TopLevel.php+9 −0
| @@ -171,6 +171,12 @@ class TopLevel { | ||
| 171 | 171 | * @throws Exception |
| 172 | 172 | */ |
| 173 | 173 | public static function from(stdClass $obj): TopLevel { |
| 174 | + if (!property_exists($obj, 'BoolInUnion')) { | |
| 175 | + throw new Exception("Missing required property"); | |
| 176 | + } | |
| 177 | + if (!property_exists($obj, 'union')) { | |
| 178 | + throw new Exception("Missing required property"); | |
| 179 | + } | |
| 174 | 180 | return new TopLevel( |
| 175 | 181 | TopLevel::fromBoolInUnion($obj->{'BoolInUnion'}) |
| 176 | 182 | ,TopLevel::fromUnion($obj->{'union'}) |
| @@ -271,6 +277,9 @@ class BoolInUnion { | ||
| 271 | 277 | * @throws Exception |
| 272 | 278 | */ |
| 273 | 279 | public static function from(stdClass $obj): BoolInUnion { |
| 280 | + if (!property_exists($obj, 'a')) { | |
| 281 | + throw new Exception("Missing required property"); | |
| 282 | + } | |
| 274 | 283 | return new BoolInUnion( |
| 275 | 284 | BoolInUnion::fromA($obj->{'a'}) |
| 276 | 285 | ); |
Test case
1 generated file · +12 −0test/inputs/json/priority/unions.json
Mphpdefault / TopLevel.php+12 −0
| @@ -303,6 +303,15 @@ class TopLevel { | ||
| 303 | 303 | * @throws Exception |
| 304 | 304 | */ |
| 305 | 305 | public static function from(stdClass $obj): TopLevel { |
| 306 | + if (!property_exists($obj, 'x')) { | |
| 307 | + throw new Exception("Missing required property"); | |
| 308 | + } | |
| 309 | + if (!property_exists($obj, 'y')) { | |
| 310 | + throw new Exception("Missing required property"); | |
| 311 | + } | |
| 312 | + if (!property_exists($obj, 'z')) { | |
| 313 | + throw new Exception("Missing required property"); | |
| 314 | + } | |
| 306 | 315 | return new TopLevel( |
| 307 | 316 | TopLevel::fromX($obj->{'x'}) |
| 308 | 317 | ,TopLevel::fromY($obj->{'y'}) |
| @@ -405,6 +414,9 @@ class Z { | ||
| 405 | 414 | * @throws Exception |
| 406 | 415 | */ |
| 407 | 416 | public static function from(stdClass $obj): Z { |
| 417 | + if (!property_exists($obj, 'a')) { | |
| 418 | + throw new Exception("Missing required property"); | |
| 419 | + } | |
| 408 | 420 | return new Z( |
| 409 | 421 | Z::fromA($obj->{'a'}) |
| 410 | 422 | ); |
Test case
1 generated file · +6 −0test/inputs/json/priority/url.json
Mphpdefault / TopLevel.php+6 −0
| @@ -136,6 +136,12 @@ class TopLevel { | ||
| 136 | 136 | * @throws Exception |
| 137 | 137 | */ |
| 138 | 138 | public static function from(stdClass $obj): TopLevel { |
| 139 | + if (!property_exists($obj, 'fromURL')) { | |
| 140 | + throw new Exception("Missing required property"); | |
| 141 | + } | |
| 142 | + if (!property_exists($obj, 'url')) { | |
| 143 | + throw new Exception("Missing required property"); | |
| 144 | + } | |
| 139 | 145 | return new TopLevel( |
| 140 | 146 | TopLevel::fromFromURL($obj->{'fromURL'}) |
| 141 | 147 | ,TopLevel::purpleFromURL($obj->{'url'}) |
Test case
1 generated file · +18 −0test/inputs/json/priority/uuids.json
Mphpdefault / TopLevel.php+18 −0
| @@ -364,6 +364,24 @@ class TopLevel { | ||
| 364 | 364 | * @throws Exception |
| 365 | 365 | */ |
| 366 | 366 | public static function from(stdClass $obj): TopLevel { |
| 367 | + if (!property_exists($obj, 'booleanValue')) { | |
| 368 | + throw new Exception("Missing required property"); | |
| 369 | + } | |
| 370 | + if (!property_exists($obj, 'doubleValue')) { | |
| 371 | + throw new Exception("Missing required property"); | |
| 372 | + } | |
| 373 | + if (!property_exists($obj, 'intValue')) { | |
| 374 | + throw new Exception("Missing required property"); | |
| 375 | + } | |
| 376 | + if (!property_exists($obj, 'stringValue')) { | |
| 377 | + throw new Exception("Missing required property"); | |
| 378 | + } | |
| 379 | + if (!property_exists($obj, 'uuidValue')) { | |
| 380 | + throw new Exception("Missing required property"); | |
| 381 | + } | |
| 382 | + if (!property_exists($obj, 'uuidValues')) { | |
| 383 | + throw new Exception("Missing required property"); | |
| 384 | + } | |
| 367 | 385 | return new TopLevel( |
| 368 | 386 | TopLevel::fromBooleanValue($obj->{'booleanValue'}) |
| 369 | 387 | ,TopLevel::fromDoubleValue($obj->{'doubleValue'}) |
Test case
1 generated file · +15 −0test/inputs/json/samples/bitcoin-block.json
Mphpdefault / TopLevel.php+15 −0
| @@ -306,6 +306,21 @@ class TopLevel { | ||
| 306 | 306 | * @throws Exception |
| 307 | 307 | */ |
| 308 | 308 | public static function from(stdClass $obj): TopLevel { |
| 309 | + if (!property_exists($obj, 'block_index')) { | |
| 310 | + throw new Exception("Missing required property"); | |
| 311 | + } | |
| 312 | + if (!property_exists($obj, 'hash')) { | |
| 313 | + throw new Exception("Missing required property"); | |
| 314 | + } | |
| 315 | + if (!property_exists($obj, 'height')) { | |
| 316 | + throw new Exception("Missing required property"); | |
| 317 | + } | |
| 318 | + if (!property_exists($obj, 'time')) { | |
| 319 | + throw new Exception("Missing required property"); | |
| 320 | + } | |
| 321 | + if (!property_exists($obj, 'txIndexes')) { | |
| 322 | + throw new Exception("Missing required property"); | |
| 323 | + } | |
| 309 | 324 | return new TopLevel( |
| 310 | 325 | TopLevel::fromBlockIndex($obj->{'block_index'}) |
| 311 | 326 | ,TopLevel::fromHash($obj->{'hash'}) |
Test case
1 generated file · +6 −0test/inputs/json/samples/getting-started.json
Mphpdefault / TopLevel.php+6 −0
| @@ -150,6 +150,12 @@ class TopLevel { | ||
| 150 | 150 | * @throws Exception |
| 151 | 151 | */ |
| 152 | 152 | public static function from(stdClass $obj): TopLevel { |
| 153 | + if (!property_exists($obj, 'greeting')) { | |
| 154 | + throw new Exception("Missing required property"); | |
| 155 | + } | |
| 156 | + if (!property_exists($obj, 'instructions')) { | |
| 157 | + throw new Exception("Missing required property"); | |
| 158 | + } | |
| 153 | 159 | return new TopLevel( |
| 154 | 160 | TopLevel::fromGreeting($obj->{'greeting'}) |
| 155 | 161 | ,TopLevel::fromInstructions($obj->{'instructions'}) |
Test case
1 generated file · +648 −0test/inputs/json/samples/github-events.json
Mphpdefault / TopLevel.php+648 −0
| @@ -469,6 +469,27 @@ class TopLevel { | ||
| 469 | 469 | * @throws Exception |
| 470 | 470 | */ |
| 471 | 471 | public static function from(stdClass $obj): TopLevel { |
| 472 | + if (!property_exists($obj, 'actor')) { | |
| 473 | + throw new Exception("Missing required property"); | |
| 474 | + } | |
| 475 | + if (!property_exists($obj, 'created_at')) { | |
| 476 | + throw new Exception("Missing required property"); | |
| 477 | + } | |
| 478 | + if (!property_exists($obj, 'id')) { | |
| 479 | + throw new Exception("Missing required property"); | |
| 480 | + } | |
| 481 | + if (!property_exists($obj, 'payload')) { | |
| 482 | + throw new Exception("Missing required property"); | |
| 483 | + } | |
| 484 | + if (!property_exists($obj, 'public')) { | |
| 485 | + throw new Exception("Missing required property"); | |
| 486 | + } | |
| 487 | + if (!property_exists($obj, 'repo')) { | |
| 488 | + throw new Exception("Missing required property"); | |
| 489 | + } | |
| 490 | + if (!property_exists($obj, 'type')) { | |
| 491 | + throw new Exception("Missing required property"); | |
| 492 | + } | |
| 472 | 493 | return new TopLevel( |
| 473 | 494 | TopLevel::fromActor($obj->{'actor'}) |
| 474 | 495 | ,TopLevel::fromCreatedAt($obj->{'created_at'}) |
| @@ -851,6 +872,21 @@ class Actor { | ||
| 851 | 872 | * @throws Exception |
| 852 | 873 | */ |
| 853 | 874 | public static function from(stdClass $obj): Actor { |
| 875 | + if (!property_exists($obj, 'avatar_url')) { | |
| 876 | + throw new Exception("Missing required property"); | |
| 877 | + } | |
| 878 | + if (!property_exists($obj, 'gravatar_id')) { | |
| 879 | + throw new Exception("Missing required property"); | |
| 880 | + } | |
| 881 | + if (!property_exists($obj, 'id')) { | |
| 882 | + throw new Exception("Missing required property"); | |
| 883 | + } | |
| 884 | + if (!property_exists($obj, 'login')) { | |
| 885 | + throw new Exception("Missing required property"); | |
| 886 | + } | |
| 887 | + if (!property_exists($obj, 'url')) { | |
| 888 | + throw new Exception("Missing required property"); | |
| 889 | + } | |
| 854 | 890 | return new Actor( |
| 855 | 891 | Actor::fromAvatarURL($obj->{'avatar_url'}) |
| 856 | 892 | ,Actor::fromDisplayLogin($obj->{'display_login'}) |
| @@ -2421,6 +2457,30 @@ class Comment { | ||
| 2421 | 2457 | * @throws Exception |
| 2422 | 2458 | */ |
| 2423 | 2459 | public static function from(stdClass $obj): Comment { |
| 2460 | + if (!property_exists($obj, 'body')) { | |
| 2461 | + throw new Exception("Missing required property"); | |
| 2462 | + } | |
| 2463 | + if (!property_exists($obj, 'created_at')) { | |
| 2464 | + throw new Exception("Missing required property"); | |
| 2465 | + } | |
| 2466 | + if (!property_exists($obj, 'html_url')) { | |
| 2467 | + throw new Exception("Missing required property"); | |
| 2468 | + } | |
| 2469 | + if (!property_exists($obj, 'id')) { | |
| 2470 | + throw new Exception("Missing required property"); | |
| 2471 | + } | |
| 2472 | + if (!property_exists($obj, 'issue_url')) { | |
| 2473 | + throw new Exception("Missing required property"); | |
| 2474 | + } | |
| 2475 | + if (!property_exists($obj, 'updated_at')) { | |
| 2476 | + throw new Exception("Missing required property"); | |
| 2477 | + } | |
| 2478 | + if (!property_exists($obj, 'url')) { | |
| 2479 | + throw new Exception("Missing required property"); | |
| 2480 | + } | |
| 2481 | + if (!property_exists($obj, 'user')) { | |
| 2482 | + throw new Exception("Missing required property"); | |
| 2483 | + } | |
| 2424 | 2484 | return new Comment( |
| 2425 | 2485 | Comment::fromBody($obj->{'body'}) |
| 2426 | 2486 | ,Comment::fromCreatedAt($obj->{'created_at'}) |
| @@ -3366,6 +3426,57 @@ class User { | ||
| 3366 | 3426 | * @throws Exception |
| 3367 | 3427 | */ |
| 3368 | 3428 | public static function from(stdClass $obj): User { |
| 3429 | + if (!property_exists($obj, 'avatar_url')) { | |
| 3430 | + throw new Exception("Missing required property"); | |
| 3431 | + } | |
| 3432 | + if (!property_exists($obj, 'events_url')) { | |
| 3433 | + throw new Exception("Missing required property"); | |
| 3434 | + } | |
| 3435 | + if (!property_exists($obj, 'followers_url')) { | |
| 3436 | + throw new Exception("Missing required property"); | |
| 3437 | + } | |
| 3438 | + if (!property_exists($obj, 'following_url')) { | |
| 3439 | + throw new Exception("Missing required property"); | |
| 3440 | + } | |
| 3441 | + if (!property_exists($obj, 'gists_url')) { | |
| 3442 | + throw new Exception("Missing required property"); | |
| 3443 | + } | |
| 3444 | + if (!property_exists($obj, 'gravatar_id')) { | |
| 3445 | + throw new Exception("Missing required property"); | |
| 3446 | + } | |
| 3447 | + if (!property_exists($obj, 'html_url')) { | |
| 3448 | + throw new Exception("Missing required property"); | |
| 3449 | + } | |
| 3450 | + if (!property_exists($obj, 'id')) { | |
| 3451 | + throw new Exception("Missing required property"); | |
| 3452 | + } | |
| 3453 | + if (!property_exists($obj, 'login')) { | |
| 3454 | + throw new Exception("Missing required property"); | |
| 3455 | + } | |
| 3456 | + if (!property_exists($obj, 'organizations_url')) { | |
| 3457 | + throw new Exception("Missing required property"); | |
| 3458 | + } | |
| 3459 | + if (!property_exists($obj, 'received_events_url')) { | |
| 3460 | + throw new Exception("Missing required property"); | |
| 3461 | + } | |
| 3462 | + if (!property_exists($obj, 'repos_url')) { | |
| 3463 | + throw new Exception("Missing required property"); | |
| 3464 | + } | |
| 3465 | + if (!property_exists($obj, 'site_admin')) { | |
| 3466 | + throw new Exception("Missing required property"); | |
| 3467 | + } | |
| 3468 | + if (!property_exists($obj, 'starred_url')) { | |
| 3469 | + throw new Exception("Missing required property"); | |
| 3470 | + } | |
| 3471 | + if (!property_exists($obj, 'subscriptions_url')) { | |
| 3472 | + throw new Exception("Missing required property"); | |
| 3473 | + } | |
| 3474 | + if (!property_exists($obj, 'type')) { | |
| 3475 | + throw new Exception("Missing required property"); | |
| 3476 | + } | |
| 3477 | + if (!property_exists($obj, 'url')) { | |
| 3478 | + throw new Exception("Missing required property"); | |
| 3479 | + } | |
| 3369 | 3480 | return new User( |
| 3370 | 3481 | User::fromAvatarURL($obj->{'avatar_url'}) |
| 3371 | 3482 | ,User::fromEventsURL($obj->{'events_url'}) |
| @@ -3754,6 +3865,21 @@ class Commit { | ||
| 3754 | 3865 | * @throws Exception |
| 3755 | 3866 | */ |
| 3756 | 3867 | public static function from(stdClass $obj): Commit { |
| 3868 | + if (!property_exists($obj, 'author')) { | |
| 3869 | + throw new Exception("Missing required property"); | |
| 3870 | + } | |
| 3871 | + if (!property_exists($obj, 'distinct')) { | |
| 3872 | + throw new Exception("Missing required property"); | |
| 3873 | + } | |
| 3874 | + if (!property_exists($obj, 'message')) { | |
| 3875 | + throw new Exception("Missing required property"); | |
| 3876 | + } | |
| 3877 | + if (!property_exists($obj, 'sha')) { | |
| 3878 | + throw new Exception("Missing required property"); | |
| 3879 | + } | |
| 3880 | + if (!property_exists($obj, 'url')) { | |
| 3881 | + throw new Exception("Missing required property"); | |
| 3882 | + } | |
| 3757 | 3883 | return new Commit( |
| 3758 | 3884 | Commit::fromAuthor($obj->{'author'}) |
| 3759 | 3885 | ,Commit::fromDistinct($obj->{'distinct'}) |
| @@ -3912,6 +4038,12 @@ class Author { | ||
| 3912 | 4038 | * @throws Exception |
| 3913 | 4039 | */ |
| 3914 | 4040 | public static function from(stdClass $obj): Author { |
| 4041 | + if (!property_exists($obj, 'email')) { | |
| 4042 | + throw new Exception("Missing required property"); | |
| 4043 | + } | |
| 4044 | + if (!property_exists($obj, 'name')) { | |
| 4045 | + throw new Exception("Missing required property"); | |
| 4046 | + } | |
| 3915 | 4047 | return new Author( |
| 3916 | 4048 | Author::fromEmail($obj->{'email'}) |
| 3917 | 4049 | ,Author::fromName($obj->{'name'}) |
| @@ -5184,6 +5316,69 @@ class Issue { | ||
| 5184 | 5316 | * @throws Exception |
| 5185 | 5317 | */ |
| 5186 | 5318 | public static function from(stdClass $obj): Issue { |
| 5319 | + if (!property_exists($obj, 'assignee')) { | |
| 5320 | + throw new Exception("Missing required property"); | |
| 5321 | + } | |
| 5322 | + if (!property_exists($obj, 'assignees')) { | |
| 5323 | + throw new Exception("Missing required property"); | |
| 5324 | + } | |
| 5325 | + if (!property_exists($obj, 'body')) { | |
| 5326 | + throw new Exception("Missing required property"); | |
| 5327 | + } | |
| 5328 | + if (!property_exists($obj, 'closed_at')) { | |
| 5329 | + throw new Exception("Missing required property"); | |
| 5330 | + } | |
| 5331 | + if (!property_exists($obj, 'comments')) { | |
| 5332 | + throw new Exception("Missing required property"); | |
| 5333 | + } | |
| 5334 | + if (!property_exists($obj, 'comments_url')) { | |
| 5335 | + throw new Exception("Missing required property"); | |
| 5336 | + } | |
| 5337 | + if (!property_exists($obj, 'created_at')) { | |
| 5338 | + throw new Exception("Missing required property"); | |
| 5339 | + } | |
| 5340 | + if (!property_exists($obj, 'events_url')) { | |
| 5341 | + throw new Exception("Missing required property"); | |
| 5342 | + } | |
| 5343 | + if (!property_exists($obj, 'html_url')) { | |
| 5344 | + throw new Exception("Missing required property"); | |
| 5345 | + } | |
| 5346 | + if (!property_exists($obj, 'id')) { | |
| 5347 | + throw new Exception("Missing required property"); | |
| 5348 | + } | |
| 5349 | + if (!property_exists($obj, 'labels')) { | |
| 5350 | + throw new Exception("Missing required property"); | |
| 5351 | + } | |
| 5352 | + if (!property_exists($obj, 'labels_url')) { | |
| 5353 | + throw new Exception("Missing required property"); | |
| 5354 | + } | |
| 5355 | + if (!property_exists($obj, 'locked')) { | |
| 5356 | + throw new Exception("Missing required property"); | |
| 5357 | + } | |
| 5358 | + if (!property_exists($obj, 'milestone')) { | |
| 5359 | + throw new Exception("Missing required property"); | |
| 5360 | + } | |
| 5361 | + if (!property_exists($obj, 'number')) { | |
| 5362 | + throw new Exception("Missing required property"); | |
| 5363 | + } | |
| 5364 | + if (!property_exists($obj, 'repository_url')) { | |
| 5365 | + throw new Exception("Missing required property"); | |
| 5366 | + } | |
| 5367 | + if (!property_exists($obj, 'state')) { | |
| 5368 | + throw new Exception("Missing required property"); | |
| 5369 | + } | |
| 5370 | + if (!property_exists($obj, 'title')) { | |
| 5371 | + throw new Exception("Missing required property"); | |
| 5372 | + } | |
| 5373 | + if (!property_exists($obj, 'updated_at')) { | |
| 5374 | + throw new Exception("Missing required property"); | |
| 5375 | + } | |
| 5376 | + if (!property_exists($obj, 'url')) { | |
| 5377 | + throw new Exception("Missing required property"); | |
| 5378 | + } | |
| 5379 | + if (!property_exists($obj, 'user')) { | |
| 5380 | + throw new Exception("Missing required property"); | |
| 5381 | + } | |
| 5187 | 5382 | return new Issue( |
| 5188 | 5383 | Issue::fromAssignee($obj->{'assignee'}) |
| 5189 | 5384 | ,Issue::fromAssignees($obj->{'assignees'}) |
| @@ -5532,6 +5727,21 @@ class Label { | ||
| 5532 | 5727 | * @throws Exception |
| 5533 | 5728 | */ |
| 5534 | 5729 | public static function from(stdClass $obj): Label { |
| 5730 | + if (!property_exists($obj, 'color')) { | |
| 5731 | + throw new Exception("Missing required property"); | |
| 5732 | + } | |
| 5733 | + if (!property_exists($obj, 'default')) { | |
| 5734 | + throw new Exception("Missing required property"); | |
| 5735 | + } | |
| 5736 | + if (!property_exists($obj, 'id')) { | |
| 5737 | + throw new Exception("Missing required property"); | |
| 5738 | + } | |
| 5739 | + if (!property_exists($obj, 'name')) { | |
| 5740 | + throw new Exception("Missing required property"); | |
| 5741 | + } | |
| 5742 | + if (!property_exists($obj, 'url')) { | |
| 5743 | + throw new Exception("Missing required property"); | |
| 5744 | + } | |
| 5535 | 5745 | return new Label( |
| 5536 | 5746 | Label::fromColor($obj->{'color'}) |
| 5537 | 5747 | ,Label::fromDefault($obj->{'default'}) |
| @@ -6401,6 +6611,51 @@ class Milestone { | ||
| 6401 | 6611 | * @throws Exception |
| 6402 | 6612 | */ |
| 6403 | 6613 | public static function from(stdClass $obj): Milestone { |
| 6614 | + if (!property_exists($obj, 'closed_at')) { | |
| 6615 | + throw new Exception("Missing required property"); | |
| 6616 | + } | |
| 6617 | + if (!property_exists($obj, 'closed_issues')) { | |
| 6618 | + throw new Exception("Missing required property"); | |
| 6619 | + } | |
| 6620 | + if (!property_exists($obj, 'created_at')) { | |
| 6621 | + throw new Exception("Missing required property"); | |
| 6622 | + } | |
| 6623 | + if (!property_exists($obj, 'creator')) { | |
| 6624 | + throw new Exception("Missing required property"); | |
| 6625 | + } | |
| 6626 | + if (!property_exists($obj, 'description')) { | |
| 6627 | + throw new Exception("Missing required property"); | |
| 6628 | + } | |
| 6629 | + if (!property_exists($obj, 'due_on')) { | |
| 6630 | + throw new Exception("Missing required property"); | |
| 6631 | + } | |
| 6632 | + if (!property_exists($obj, 'html_url')) { | |
| 6633 | + throw new Exception("Missing required property"); | |
| 6634 | + } | |
| 6635 | + if (!property_exists($obj, 'id')) { | |
| 6636 | + throw new Exception("Missing required property"); | |
| 6637 | + } | |
| 6638 | + if (!property_exists($obj, 'labels_url')) { | |
| 6639 | + throw new Exception("Missing required property"); | |
| 6640 | + } | |
| 6641 | + if (!property_exists($obj, 'number')) { | |
| 6642 | + throw new Exception("Missing required property"); | |
| 6643 | + } | |
| 6644 | + if (!property_exists($obj, 'open_issues')) { | |
| 6645 | + throw new Exception("Missing required property"); | |
| 6646 | + } | |
| 6647 | + if (!property_exists($obj, 'state')) { | |
| 6648 | + throw new Exception("Missing required property"); | |
| 6649 | + } | |
| 6650 | + if (!property_exists($obj, 'title')) { | |
| 6651 | + throw new Exception("Missing required property"); | |
| 6652 | + } | |
| 6653 | + if (!property_exists($obj, 'updated_at')) { | |
| 6654 | + throw new Exception("Missing required property"); | |
| 6655 | + } | |
| 6656 | + if (!property_exists($obj, 'url')) { | |
| 6657 | + throw new Exception("Missing required property"); | |
| 6658 | + } | |
| 6404 | 6659 | return new Milestone( |
| 6405 | 6660 | Milestone::fromClosedAt($obj->{'closed_at'}) |
| 6406 | 6661 | ,Milestone::fromClosedIssues($obj->{'closed_issues'}) |
| @@ -6683,6 +6938,18 @@ class IssuePullRequest { | ||
| 6683 | 6938 | * @throws Exception |
| 6684 | 6939 | */ |
| 6685 | 6940 | public static function from(stdClass $obj): IssuePullRequest { |
| 6941 | + if (!property_exists($obj, 'diff_url')) { | |
| 6942 | + throw new Exception("Missing required property"); | |
| 6943 | + } | |
| 6944 | + if (!property_exists($obj, 'html_url')) { | |
| 6945 | + throw new Exception("Missing required property"); | |
| 6946 | + } | |
| 6947 | + if (!property_exists($obj, 'patch_url')) { | |
| 6948 | + throw new Exception("Missing required property"); | |
| 6949 | + } | |
| 6950 | + if (!property_exists($obj, 'url')) { | |
| 6951 | + throw new Exception("Missing required property"); | |
| 6952 | + } | |
| 6686 | 6953 | return new IssuePullRequest( |
| 6687 | 6954 | IssuePullRequest::fromDiffURL($obj->{'diff_url'}) |
| 6688 | 6955 | ,IssuePullRequest::fromHTMLURL($obj->{'html_url'}) |
| @@ -8934,6 +9201,129 @@ class PayloadPullRequest { | ||
| 8934 | 9201 | * @throws Exception |
| 8935 | 9202 | */ |
| 8936 | 9203 | public static function from(stdClass $obj): PayloadPullRequest { |
| 9204 | + if (!property_exists($obj, 'additions')) { | |
| 9205 | + throw new Exception("Missing required property"); | |
| 9206 | + } | |
| 9207 | + if (!property_exists($obj, 'assignee')) { | |
| 9208 | + throw new Exception("Missing required property"); | |
| 9209 | + } | |
| 9210 | + if (!property_exists($obj, 'assignees')) { | |
| 9211 | + throw new Exception("Missing required property"); | |
| 9212 | + } | |
| 9213 | + if (!property_exists($obj, 'base')) { | |
| 9214 | + throw new Exception("Missing required property"); | |
| 9215 | + } | |
| 9216 | + if (!property_exists($obj, 'body')) { | |
| 9217 | + throw new Exception("Missing required property"); | |
| 9218 | + } | |
| 9219 | + if (!property_exists($obj, 'changed_files')) { | |
| 9220 | + throw new Exception("Missing required property"); | |
| 9221 | + } | |
| 9222 | + if (!property_exists($obj, 'closed_at')) { | |
| 9223 | + throw new Exception("Missing required property"); | |
| 9224 | + } | |
| 9225 | + if (!property_exists($obj, 'comments')) { | |
| 9226 | + throw new Exception("Missing required property"); | |
| 9227 | + } | |
| 9228 | + if (!property_exists($obj, 'comments_url')) { | |
| 9229 | + throw new Exception("Missing required property"); | |
| 9230 | + } | |
| 9231 | + if (!property_exists($obj, 'commits')) { | |
| 9232 | + throw new Exception("Missing required property"); | |
| 9233 | + } | |
| 9234 | + if (!property_exists($obj, 'commits_url')) { | |
| 9235 | + throw new Exception("Missing required property"); | |
| 9236 | + } | |
| 9237 | + if (!property_exists($obj, 'created_at')) { | |
| 9238 | + throw new Exception("Missing required property"); | |
| 9239 | + } | |
| 9240 | + if (!property_exists($obj, 'deletions')) { | |
| 9241 | + throw new Exception("Missing required property"); | |
| 9242 | + } | |
| 9243 | + if (!property_exists($obj, 'diff_url')) { | |
| 9244 | + throw new Exception("Missing required property"); | |
| 9245 | + } | |
| 9246 | + if (!property_exists($obj, 'head')) { | |
| 9247 | + throw new Exception("Missing required property"); | |
| 9248 | + } | |
| 9249 | + if (!property_exists($obj, 'html_url')) { | |
| 9250 | + throw new Exception("Missing required property"); | |
| 9251 | + } | |
| 9252 | + if (!property_exists($obj, 'id')) { | |
| 9253 | + throw new Exception("Missing required property"); | |
| 9254 | + } | |
| 9255 | + if (!property_exists($obj, 'issue_url')) { | |
| 9256 | + throw new Exception("Missing required property"); | |
| 9257 | + } | |
| 9258 | + if (!property_exists($obj, '_links')) { | |
| 9259 | + throw new Exception("Missing required property"); | |
| 9260 | + } | |
| 9261 | + if (!property_exists($obj, 'locked')) { | |
| 9262 | + throw new Exception("Missing required property"); | |
| 9263 | + } | |
| 9264 | + if (!property_exists($obj, 'maintainer_can_modify')) { | |
| 9265 | + throw new Exception("Missing required property"); | |
| 9266 | + } | |
| 9267 | + if (!property_exists($obj, 'merge_commit_sha')) { | |
| 9268 | + throw new Exception("Missing required property"); | |
| 9269 | + } | |
| 9270 | + if (!property_exists($obj, 'mergeable')) { | |
| 9271 | + throw new Exception("Missing required property"); | |
| 9272 | + } | |
| 9273 | + if (!property_exists($obj, 'mergeable_state')) { | |
| 9274 | + throw new Exception("Missing required property"); | |
| 9275 | + } | |
| 9276 | + if (!property_exists($obj, 'merged')) { | |
| 9277 | + throw new Exception("Missing required property"); | |
| 9278 | + } | |
| 9279 | + if (!property_exists($obj, 'merged_at')) { | |
| 9280 | + throw new Exception("Missing required property"); | |
| 9281 | + } | |
| 9282 | + if (!property_exists($obj, 'merged_by')) { | |
| 9283 | + throw new Exception("Missing required property"); | |
| 9284 | + } | |
| 9285 | + if (!property_exists($obj, 'milestone')) { | |
| 9286 | + throw new Exception("Missing required property"); | |
| 9287 | + } | |
| 9288 | + if (!property_exists($obj, 'number')) { | |
| 9289 | + throw new Exception("Missing required property"); | |
| 9290 | + } | |
| 9291 | + if (!property_exists($obj, 'patch_url')) { | |
| 9292 | + throw new Exception("Missing required property"); | |
| 9293 | + } | |
| 9294 | + if (!property_exists($obj, 'rebaseable')) { | |
| 9295 | + throw new Exception("Missing required property"); | |
| 9296 | + } | |
| 9297 | + if (!property_exists($obj, 'requested_reviewers')) { | |
| 9298 | + throw new Exception("Missing required property"); | |
| 9299 | + } | |
| 9300 | + if (!property_exists($obj, 'review_comment_url')) { | |
| 9301 | + throw new Exception("Missing required property"); | |
| 9302 | + } | |
| 9303 | + if (!property_exists($obj, 'review_comments')) { | |
| 9304 | + throw new Exception("Missing required property"); | |
| 9305 | + } | |
| 9306 | + if (!property_exists($obj, 'review_comments_url')) { | |
| 9307 | + throw new Exception("Missing required property"); | |
| 9308 | + } | |
| 9309 | + if (!property_exists($obj, 'state')) { | |
| 9310 | + throw new Exception("Missing required property"); | |
| 9311 | + } | |
| 9312 | + if (!property_exists($obj, 'statuses_url')) { | |
| 9313 | + throw new Exception("Missing required property"); | |
| 9314 | + } | |
| 9315 | + if (!property_exists($obj, 'title')) { | |
| 9316 | + throw new Exception("Missing required property"); | |
| 9317 | + } | |
| 9318 | + if (!property_exists($obj, 'updated_at')) { | |
| 9319 | + throw new Exception("Missing required property"); | |
| 9320 | + } | |
| 9321 | + if (!property_exists($obj, 'url')) { | |
| 9322 | + throw new Exception("Missing required property"); | |
| 9323 | + } | |
| 9324 | + if (!property_exists($obj, 'user')) { | |
| 9325 | + throw new Exception("Missing required property"); | |
| 9326 | + } | |
| 8937 | 9327 | return new PayloadPullRequest( |
| 8938 | 9328 | PayloadPullRequest::fromAdditions($obj->{'additions'}) |
| 8939 | 9329 | ,PayloadPullRequest::fromAssignee($obj->{'assignee'}) |
| @@ -9322,6 +9712,21 @@ class Base { | ||
| 9322 | 9712 | * @throws Exception |
| 9323 | 9713 | */ |
| 9324 | 9714 | public static function from(stdClass $obj): Base { |
| 9715 | + if (!property_exists($obj, 'label')) { | |
| 9716 | + throw new Exception("Missing required property"); | |
| 9717 | + } | |
| 9718 | + if (!property_exists($obj, 'ref')) { | |
| 9719 | + throw new Exception("Missing required property"); | |
| 9720 | + } | |
| 9721 | + if (!property_exists($obj, 'repo')) { | |
| 9722 | + throw new Exception("Missing required property"); | |
| 9723 | + } | |
| 9724 | + if (!property_exists($obj, 'sha')) { | |
| 9725 | + throw new Exception("Missing required property"); | |
| 9726 | + } | |
| 9727 | + if (!property_exists($obj, 'user')) { | |
| 9728 | + throw new Exception("Missing required property"); | |
| 9729 | + } | |
| 9325 | 9730 | return new Base( |
| 9326 | 9731 | Base::fromLabel($obj->{'label'}) |
| 9327 | 9732 | ,Base::fromRef($obj->{'ref'}) |
| @@ -12989,6 +13394,213 @@ class BaseRepo { | ||
| 12989 | 13394 | * @throws Exception |
| 12990 | 13395 | */ |
| 12991 | 13396 | public static function from(stdClass $obj): BaseRepo { |
| 13397 | + if (!property_exists($obj, 'archive_url')) { | |
| 13398 | + throw new Exception("Missing required property"); | |
| 13399 | + } | |
| 13400 | + if (!property_exists($obj, 'assignees_url')) { | |
| 13401 | + throw new Exception("Missing required property"); | |
| 13402 | + } | |
| 13403 | + if (!property_exists($obj, 'blobs_url')) { | |
| 13404 | + throw new Exception("Missing required property"); | |
| 13405 | + } | |
| 13406 | + if (!property_exists($obj, 'branches_url')) { | |
| 13407 | + throw new Exception("Missing required property"); | |
| 13408 | + } | |
| 13409 | + if (!property_exists($obj, 'clone_url')) { | |
| 13410 | + throw new Exception("Missing required property"); | |
| 13411 | + } | |
| 13412 | + if (!property_exists($obj, 'collaborators_url')) { | |
| 13413 | + throw new Exception("Missing required property"); | |
| 13414 | + } | |
| 13415 | + if (!property_exists($obj, 'comments_url')) { | |
| 13416 | + throw new Exception("Missing required property"); | |
| 13417 | + } | |
| 13418 | + if (!property_exists($obj, 'commits_url')) { | |
| 13419 | + throw new Exception("Missing required property"); | |
| 13420 | + } | |
| 13421 | + if (!property_exists($obj, 'compare_url')) { | |
| 13422 | + throw new Exception("Missing required property"); | |
| 13423 | + } | |
| 13424 | + if (!property_exists($obj, 'contents_url')) { | |
| 13425 | + throw new Exception("Missing required property"); | |
| 13426 | + } | |
| 13427 | + if (!property_exists($obj, 'contributors_url')) { | |
| 13428 | + throw new Exception("Missing required property"); | |
| 13429 | + } | |
| 13430 | + if (!property_exists($obj, 'created_at')) { | |
| 13431 | + throw new Exception("Missing required property"); | |
| 13432 | + } | |
| 13433 | + if (!property_exists($obj, 'default_branch')) { | |
| 13434 | + throw new Exception("Missing required property"); | |
| 13435 | + } | |
| 13436 | + if (!property_exists($obj, 'deployments_url')) { | |
| 13437 | + throw new Exception("Missing required property"); | |
| 13438 | + } | |
| 13439 | + if (!property_exists($obj, 'description')) { | |
| 13440 | + throw new Exception("Missing required property"); | |
| 13441 | + } | |
| 13442 | + if (!property_exists($obj, 'downloads_url')) { | |
| 13443 | + throw new Exception("Missing required property"); | |
| 13444 | + } | |
| 13445 | + if (!property_exists($obj, 'events_url')) { | |
| 13446 | + throw new Exception("Missing required property"); | |
| 13447 | + } | |
| 13448 | + if (!property_exists($obj, 'fork')) { | |
| 13449 | + throw new Exception("Missing required property"); | |
| 13450 | + } | |
| 13451 | + if (!property_exists($obj, 'forks')) { | |
| 13452 | + throw new Exception("Missing required property"); | |
| 13453 | + } | |
| 13454 | + if (!property_exists($obj, 'forks_count')) { | |
| 13455 | + throw new Exception("Missing required property"); | |
| 13456 | + } | |
| 13457 | + if (!property_exists($obj, 'forks_url')) { | |
| 13458 | + throw new Exception("Missing required property"); | |
| 13459 | + } | |
| 13460 | + if (!property_exists($obj, 'full_name')) { | |
| 13461 | + throw new Exception("Missing required property"); | |
| 13462 | + } | |
| 13463 | + if (!property_exists($obj, 'git_commits_url')) { | |
| 13464 | + throw new Exception("Missing required property"); | |
| 13465 | + } | |
| 13466 | + if (!property_exists($obj, 'git_refs_url')) { | |
| 13467 | + throw new Exception("Missing required property"); | |
| 13468 | + } | |
| 13469 | + if (!property_exists($obj, 'git_tags_url')) { | |
| 13470 | + throw new Exception("Missing required property"); | |
| 13471 | + } | |
| 13472 | + if (!property_exists($obj, 'git_url')) { | |
| 13473 | + throw new Exception("Missing required property"); | |
| 13474 | + } | |
| 13475 | + if (!property_exists($obj, 'has_downloads')) { | |
| 13476 | + throw new Exception("Missing required property"); | |
| 13477 | + } | |
| 13478 | + if (!property_exists($obj, 'has_issues')) { | |
| 13479 | + throw new Exception("Missing required property"); | |
| 13480 | + } | |
| 13481 | + if (!property_exists($obj, 'has_pages')) { | |
| 13482 | + throw new Exception("Missing required property"); | |
| 13483 | + } | |
| 13484 | + if (!property_exists($obj, 'has_projects')) { | |
| 13485 | + throw new Exception("Missing required property"); | |
| 13486 | + } | |
| 13487 | + if (!property_exists($obj, 'has_wiki')) { | |
| 13488 | + throw new Exception("Missing required property"); | |
| 13489 | + } | |
| 13490 | + if (!property_exists($obj, 'homepage')) { | |
| 13491 | + throw new Exception("Missing required property"); | |
| 13492 | + } | |
| 13493 | + if (!property_exists($obj, 'hooks_url')) { | |
| 13494 | + throw new Exception("Missing required property"); | |
| 13495 | + } | |
| 13496 | + if (!property_exists($obj, 'html_url')) { | |
| 13497 | + throw new Exception("Missing required property"); | |
| 13498 | + } | |
| 13499 | + if (!property_exists($obj, 'id')) { | |
| 13500 | + throw new Exception("Missing required property"); | |
| 13501 | + } | |
| 13502 | + if (!property_exists($obj, 'issue_comment_url')) { | |
| 13503 | + throw new Exception("Missing required property"); | |
| 13504 | + } | |
| 13505 | + if (!property_exists($obj, 'issue_events_url')) { | |
| 13506 | + throw new Exception("Missing required property"); | |
| 13507 | + } | |
| 13508 | + if (!property_exists($obj, 'issues_url')) { | |
| 13509 | + throw new Exception("Missing required property"); | |
| 13510 | + } | |
| 13511 | + if (!property_exists($obj, 'keys_url')) { | |
| 13512 | + throw new Exception("Missing required property"); | |
| 13513 | + } | |
| 13514 | + if (!property_exists($obj, 'labels_url')) { | |
| 13515 | + throw new Exception("Missing required property"); | |
| 13516 | + } | |
| 13517 | + if (!property_exists($obj, 'language')) { | |
| 13518 | + throw new Exception("Missing required property"); | |
| 13519 | + } | |
| 13520 | + if (!property_exists($obj, 'languages_url')) { | |
| 13521 | + throw new Exception("Missing required property"); | |
| 13522 | + } | |
| 13523 | + if (!property_exists($obj, 'merges_url')) { | |
| 13524 | + throw new Exception("Missing required property"); | |
| 13525 | + } | |
| 13526 | + if (!property_exists($obj, 'milestones_url')) { | |
| 13527 | + throw new Exception("Missing required property"); | |
| 13528 | + } | |
| 13529 | + if (!property_exists($obj, 'mirror_url')) { | |
| 13530 | + throw new Exception("Missing required property"); | |
| 13531 | + } | |
| 13532 | + if (!property_exists($obj, 'name')) { | |
| 13533 | + throw new Exception("Missing required property"); | |
| 13534 | + } | |
| 13535 | + if (!property_exists($obj, 'notifications_url')) { | |
| 13536 | + throw new Exception("Missing required property"); | |
| 13537 | + } | |
| 13538 | + if (!property_exists($obj, 'open_issues')) { | |
| 13539 | + throw new Exception("Missing required property"); | |
| 13540 | + } | |
| 13541 | + if (!property_exists($obj, 'open_issues_count')) { | |
| 13542 | + throw new Exception("Missing required property"); | |
| 13543 | + } | |
| 13544 | + if (!property_exists($obj, 'owner')) { | |
| 13545 | + throw new Exception("Missing required property"); | |
| 13546 | + } | |
| 13547 | + if (!property_exists($obj, 'private')) { | |
| 13548 | + throw new Exception("Missing required property"); | |
| 13549 | + } | |
| 13550 | + if (!property_exists($obj, 'pulls_url')) { | |
| 13551 | + throw new Exception("Missing required property"); | |
| 13552 | + } | |
| 13553 | + if (!property_exists($obj, 'pushed_at')) { | |
| 13554 | + throw new Exception("Missing required property"); | |
| 13555 | + } | |
| 13556 | + if (!property_exists($obj, 'releases_url')) { | |
| 13557 | + throw new Exception("Missing required property"); | |
| 13558 | + } | |
| 13559 | + if (!property_exists($obj, 'size')) { | |
| 13560 | + throw new Exception("Missing required property"); | |
| 13561 | + } | |
| 13562 | + if (!property_exists($obj, 'ssh_url')) { | |
| 13563 | + throw new Exception("Missing required property"); | |
| 13564 | + } | |
| 13565 | + if (!property_exists($obj, 'stargazers_count')) { | |
| 13566 | + throw new Exception("Missing required property"); | |
| 13567 | + } | |
| 13568 | + if (!property_exists($obj, 'stargazers_url')) { | |
| 13569 | + throw new Exception("Missing required property"); | |
| 13570 | + } | |
| 13571 | + if (!property_exists($obj, 'statuses_url')) { | |
| 13572 | + throw new Exception("Missing required property"); | |
| 13573 | + } | |
| 13574 | + if (!property_exists($obj, 'subscribers_url')) { | |
| 13575 | + throw new Exception("Missing required property"); | |
| 13576 | + } | |
| 13577 | + if (!property_exists($obj, 'subscription_url')) { | |
| 13578 | + throw new Exception("Missing required property"); | |
| 13579 | + } | |
| 13580 | + if (!property_exists($obj, 'svn_url')) { | |
| 13581 | + throw new Exception("Missing required property"); | |
| 13582 | + } | |
| 13583 | + if (!property_exists($obj, 'tags_url')) { | |
| 13584 | + throw new Exception("Missing required property"); | |
| 13585 | + } | |
| 13586 | + if (!property_exists($obj, 'teams_url')) { | |
| 13587 | + throw new Exception("Missing required property"); | |
| 13588 | + } | |
| 13589 | + if (!property_exists($obj, 'trees_url')) { | |
| 13590 | + throw new Exception("Missing required property"); | |
| 13591 | + } | |
| 13592 | + if (!property_exists($obj, 'updated_at')) { | |
| 13593 | + throw new Exception("Missing required property"); | |
| 13594 | + } | |
| 13595 | + if (!property_exists($obj, 'url')) { | |
| 13596 | + throw new Exception("Missing required property"); | |
| 13597 | + } | |
| 13598 | + if (!property_exists($obj, 'watchers')) { | |
| 13599 | + throw new Exception("Missing required property"); | |
| 13600 | + } | |
| 13601 | + if (!property_exists($obj, 'watchers_count')) { | |
| 13602 | + throw new Exception("Missing required property"); | |
| 13603 | + } | |
| 12992 | 13604 | return new BaseRepo( |
| 12993 | 13605 | BaseRepo::fromArchiveURL($obj->{'archive_url'}) |
| 12994 | 13606 | ,BaseRepo::fromAssigneesURL($obj->{'assignees_url'}) |
| @@ -13595,6 +14207,30 @@ class Links { | ||
| 13595 | 14207 | * @throws Exception |
| 13596 | 14208 | */ |
| 13597 | 14209 | public static function from(stdClass $obj): Links { |
| 14210 | + if (!property_exists($obj, 'comments')) { | |
| 14211 | + throw new Exception("Missing required property"); | |
| 14212 | + } | |
| 14213 | + if (!property_exists($obj, 'commits')) { | |
| 14214 | + throw new Exception("Missing required property"); | |
| 14215 | + } | |
| 14216 | + if (!property_exists($obj, 'html')) { | |
| 14217 | + throw new Exception("Missing required property"); | |
| 14218 | + } | |
| 14219 | + if (!property_exists($obj, 'issue')) { | |
| 14220 | + throw new Exception("Missing required property"); | |
| 14221 | + } | |
| 14222 | + if (!property_exists($obj, 'review_comment')) { | |
| 14223 | + throw new Exception("Missing required property"); | |
| 14224 | + } | |
| 14225 | + if (!property_exists($obj, 'review_comments')) { | |
| 14226 | + throw new Exception("Missing required property"); | |
| 14227 | + } | |
| 14228 | + if (!property_exists($obj, 'self')) { | |
| 14229 | + throw new Exception("Missing required property"); | |
| 14230 | + } | |
| 14231 | + if (!property_exists($obj, 'statuses')) { | |
| 14232 | + throw new Exception("Missing required property"); | |
| 14233 | + } | |
| 13598 | 14234 | return new Links( |
| 13599 | 14235 | Links::fromComments($obj->{'comments'}) |
| 13600 | 14236 | ,Links::fromCommits($obj->{'commits'}) |
| @@ -13707,6 +14343,9 @@ class Comments { | ||
| 13707 | 14343 | * @throws Exception |
| 13708 | 14344 | */ |
| 13709 | 14345 | public static function from(stdClass $obj): Comments { |
| 14346 | + if (!property_exists($obj, 'href')) { | |
| 14347 | + throw new Exception("Missing required property"); | |
| 14348 | + } | |
| 13710 | 14349 | return new Comments( |
| 13711 | 14350 | Comments::fromHref($obj->{'href'}) |
| 13712 | 14351 | ); |
| @@ -13909,6 +14548,15 @@ class TopLevelRepo { | ||
| 13909 | 14548 | * @throws Exception |
| 13910 | 14549 | */ |
| 13911 | 14550 | public static function from(stdClass $obj): TopLevelRepo { |
| 14551 | + if (!property_exists($obj, 'id')) { | |
| 14552 | + throw new Exception("Missing required property"); | |
| 14553 | + } | |
| 14554 | + if (!property_exists($obj, 'name')) { | |
| 14555 | + throw new Exception("Missing required property"); | |
| 14556 | + } | |
| 14557 | + if (!property_exists($obj, 'url')) { | |
| 14558 | + throw new Exception("Missing required property"); | |
| 14559 | + } | |
| 13912 | 14560 | return new TopLevelRepo( |
| 13913 | 14561 | TopLevelRepo::fromID($obj->{'id'}) |
| 13914 | 14562 | ,TopLevelRepo::fromName($obj->{'name'}) |
Test case
1 generated file · +57 −0test/inputs/json/samples/kitchen-sink.json
Mphpdefault / TopLevel.php+57 −0
| @@ -918,6 +918,48 @@ class TopLevel { | ||
| 918 | 918 | * @throws Exception |
| 919 | 919 | */ |
| 920 | 920 | public static function from(stdClass $obj): TopLevel { |
| 921 | + if (!property_exists($obj, 'booleanValue')) { | |
| 922 | + throw new Exception("Missing required property"); | |
| 923 | + } | |
| 924 | + if (!property_exists($obj, 'dateValue')) { | |
| 925 | + throw new Exception("Missing required property"); | |
| 926 | + } | |
| 927 | + if (!property_exists($obj, 'differentThings')) { | |
| 928 | + throw new Exception("Missing required property"); | |
| 929 | + } | |
| 930 | + if (!property_exists($obj, 'doubleValue')) { | |
| 931 | + throw new Exception("Missing required property"); | |
| 932 | + } | |
| 933 | + if (!property_exists($obj, 'intValue')) { | |
| 934 | + throw new Exception("Missing required property"); | |
| 935 | + } | |
| 936 | + if (!property_exists($obj, 'mapValue')) { | |
| 937 | + throw new Exception("Missing required property"); | |
| 938 | + } | |
| 939 | + if (!property_exists($obj, 'name with spaces')) { | |
| 940 | + throw new Exception("Missing required property"); | |
| 941 | + } | |
| 942 | + if (!property_exists($obj, 'nullValue')) { | |
| 943 | + throw new Exception("Missing required property"); | |
| 944 | + } | |
| 945 | + if (!property_exists($obj, 'nullableMapValue')) { | |
| 946 | + throw new Exception("Missing required property"); | |
| 947 | + } | |
| 948 | + if (!property_exists($obj, 'people')) { | |
| 949 | + throw new Exception("Missing required property"); | |
| 950 | + } | |
| 951 | + if (!property_exists($obj, 'person')) { | |
| 952 | + throw new Exception("Missing required property"); | |
| 953 | + } | |
| 954 | + if (!property_exists($obj, 'stringValue')) { | |
| 955 | + throw new Exception("Missing required property"); | |
| 956 | + } | |
| 957 | + if (!property_exists($obj, 'tuples')) { | |
| 958 | + throw new Exception("Missing required property"); | |
| 959 | + } | |
| 960 | + if (!property_exists($obj, 'uuidValue')) { | |
| 961 | + throw new Exception("Missing required property"); | |
| 962 | + } | |
| 921 | 963 | return new TopLevel( |
| 922 | 964 | TopLevel::fromBooleanValue($obj->{'booleanValue'}) |
| 923 | 965 | ,TopLevel::fromDateValue($obj->{'dateValue'}) |
| @@ -1042,6 +1084,9 @@ class DifferentThing { | ||
| 1042 | 1084 | * @throws Exception |
| 1043 | 1085 | */ |
| 1044 | 1086 | public static function from(stdClass $obj): DifferentThing { |
| 1087 | + if (!property_exists($obj, 'name')) { | |
| 1088 | + throw new Exception("Missing required property"); | |
| 1089 | + } | |
| 1045 | 1090 | return new DifferentThing( |
| 1046 | 1091 | DifferentThing::fromName($obj->{'name'}) |
| 1047 | 1092 | ); |
| @@ -1277,6 +1322,12 @@ class PersonElement { | ||
| 1277 | 1322 | * @throws Exception |
| 1278 | 1323 | */ |
| 1279 | 1324 | public static function from(stdClass $obj): PersonElement { |
| 1325 | + if (!property_exists($obj, 'intOrString')) { | |
| 1326 | + throw new Exception("Missing required property"); | |
| 1327 | + } | |
| 1328 | + if (!property_exists($obj, 'name')) { | |
| 1329 | + throw new Exception("Missing required property"); | |
| 1330 | + } | |
| 1280 | 1331 | return new PersonElement( |
| 1281 | 1332 | PersonElement::fromIntOrString($obj->{'intOrString'}) |
| 1282 | 1333 | ,PersonElement::fromName($obj->{'name'}) |
| @@ -1431,6 +1482,12 @@ class PurplePerson { | ||
| 1431 | 1482 | * @throws Exception |
| 1432 | 1483 | */ |
| 1433 | 1484 | public static function from(stdClass $obj): PurplePerson { |
| 1485 | + if (!property_exists($obj, 'intOrString')) { | |
| 1486 | + throw new Exception("Missing required property"); | |
| 1487 | + } | |
| 1488 | + if (!property_exists($obj, 'name')) { | |
| 1489 | + throw new Exception("Missing required property"); | |
| 1490 | + } | |
| 1434 | 1491 | return new PurplePerson( |
| 1435 | 1492 | PurplePerson::fromIntOrString($obj->{'intOrString'}) |
| 1436 | 1493 | ,PurplePerson::fromName($obj->{'name'}) |
Test case
1 generated file · +18 −0test/inputs/json/samples/null-safe.json
Mphpdefault / TopLevel.php+18 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'item')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromItem($obj->{'item'}) |
| 101 | 104 | ); |
| @@ -388,6 +391,12 @@ class Item { | ||
| 388 | 391 | * @throws Exception |
| 389 | 392 | */ |
| 390 | 393 | public static function from(stdClass $obj): Item { |
| 394 | + if (!property_exists($obj, 'name')) { | |
| 395 | + throw new Exception("Missing required property"); | |
| 396 | + } | |
| 397 | + if (!property_exists($obj, 'sex')) { | |
| 398 | + throw new Exception("Missing required property"); | |
| 399 | + } | |
| 391 | 400 | return new Item( |
| 392 | 401 | Item::fromAddress($obj->{'address'}) |
| 393 | 402 | ,Item::fromCreatedAt($obj->{'created_at'}) |
| @@ -596,6 +605,15 @@ class Address { | ||
| 596 | 605 | * @throws Exception |
| 597 | 606 | */ |
| 598 | 607 | public static function from(stdClass $obj): Address { |
| 608 | + if (!property_exists($obj, 'city')) { | |
| 609 | + throw new Exception("Missing required property"); | |
| 610 | + } | |
| 611 | + if (!property_exists($obj, 'country')) { | |
| 612 | + throw new Exception("Missing required property"); | |
| 613 | + } | |
| 614 | + if (!property_exists($obj, 'street')) { | |
| 615 | + throw new Exception("Missing required property"); | |
| 616 | + } | |
| 599 | 617 | return new Address( |
| 600 | 618 | Address::fromCity($obj->{'city'}) |
| 601 | 619 | ,Address::fromCountry($obj->{'country'}) |
Test case
1 generated file · +51 −0test/inputs/json/samples/pokedex.json
Mphpdefault / TopLevel.php+51 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'pokemon')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromPokemon($obj->{'pokemon'}) |
| 101 | 104 | ); |
| @@ -1129,6 +1132,48 @@ class Pokemon { | ||
| 1129 | 1132 | * @throws Exception |
| 1130 | 1133 | */ |
| 1131 | 1134 | public static function from(stdClass $obj): Pokemon { |
| 1135 | + if (!property_exists($obj, 'avg_spawns')) { | |
| 1136 | + throw new Exception("Missing required property"); | |
| 1137 | + } | |
| 1138 | + if (!property_exists($obj, 'candy')) { | |
| 1139 | + throw new Exception("Missing required property"); | |
| 1140 | + } | |
| 1141 | + if (!property_exists($obj, 'egg')) { | |
| 1142 | + throw new Exception("Missing required property"); | |
| 1143 | + } | |
| 1144 | + if (!property_exists($obj, 'height')) { | |
| 1145 | + throw new Exception("Missing required property"); | |
| 1146 | + } | |
| 1147 | + if (!property_exists($obj, 'id')) { | |
| 1148 | + throw new Exception("Missing required property"); | |
| 1149 | + } | |
| 1150 | + if (!property_exists($obj, 'img')) { | |
| 1151 | + throw new Exception("Missing required property"); | |
| 1152 | + } | |
| 1153 | + if (!property_exists($obj, 'multipliers')) { | |
| 1154 | + throw new Exception("Missing required property"); | |
| 1155 | + } | |
| 1156 | + if (!property_exists($obj, 'name')) { | |
| 1157 | + throw new Exception("Missing required property"); | |
| 1158 | + } | |
| 1159 | + if (!property_exists($obj, 'num')) { | |
| 1160 | + throw new Exception("Missing required property"); | |
| 1161 | + } | |
| 1162 | + if (!property_exists($obj, 'spawn_chance')) { | |
| 1163 | + throw new Exception("Missing required property"); | |
| 1164 | + } | |
| 1165 | + if (!property_exists($obj, 'spawn_time')) { | |
| 1166 | + throw new Exception("Missing required property"); | |
| 1167 | + } | |
| 1168 | + if (!property_exists($obj, 'type')) { | |
| 1169 | + throw new Exception("Missing required property"); | |
| 1170 | + } | |
| 1171 | + if (!property_exists($obj, 'weaknesses')) { | |
| 1172 | + throw new Exception("Missing required property"); | |
| 1173 | + } | |
| 1174 | + if (!property_exists($obj, 'weight')) { | |
| 1175 | + throw new Exception("Missing required property"); | |
| 1176 | + } | |
| 1132 | 1177 | return new Pokemon( |
| 1133 | 1178 | Pokemon::fromAvgSpawns($obj->{'avg_spawns'}) |
| 1134 | 1179 | ,Pokemon::fromCandy($obj->{'candy'}) |
| @@ -1372,6 +1417,12 @@ class Evolution { | ||
| 1372 | 1417 | * @throws Exception |
| 1373 | 1418 | */ |
| 1374 | 1419 | public static function from(stdClass $obj): Evolution { |
| 1420 | + if (!property_exists($obj, 'name')) { | |
| 1421 | + throw new Exception("Missing required property"); | |
| 1422 | + } | |
| 1423 | + if (!property_exists($obj, 'num')) { | |
| 1424 | + throw new Exception("Missing required property"); | |
| 1425 | + } | |
| 1375 | 1426 | return new Evolution( |
| 1376 | 1427 | Evolution::fromName($obj->{'name'}) |
| 1377 | 1428 | ,Evolution::fromNum($obj->{'num'}) |
Test case
1 generated file · +255 −0test/inputs/json/samples/reddit.json
Mphpdefault / TopLevel.php+255 −0
| @@ -137,6 +137,12 @@ class TopLevel { | ||
| 137 | 137 | * @throws Exception |
| 138 | 138 | */ |
| 139 | 139 | public static function from(stdClass $obj): TopLevel { |
| 140 | + if (!property_exists($obj, 'data')) { | |
| 141 | + throw new Exception("Missing required property"); | |
| 142 | + } | |
| 143 | + if (!property_exists($obj, 'kind')) { | |
| 144 | + throw new Exception("Missing required property"); | |
| 145 | + } | |
| 140 | 146 | return new TopLevel( |
| 141 | 147 | TopLevel::fromData($obj->{'data'}) |
| 142 | 148 | ,TopLevel::fromKind($obj->{'kind'}) |
| @@ -408,6 +414,18 @@ class TopLevelData { | ||
| 408 | 414 | * @throws Exception |
| 409 | 415 | */ |
| 410 | 416 | public static function from(stdClass $obj): TopLevelData { |
| 417 | + if (!property_exists($obj, 'after')) { | |
| 418 | + throw new Exception("Missing required property"); | |
| 419 | + } | |
| 420 | + if (!property_exists($obj, 'before')) { | |
| 421 | + throw new Exception("Missing required property"); | |
| 422 | + } | |
| 423 | + if (!property_exists($obj, 'children')) { | |
| 424 | + throw new Exception("Missing required property"); | |
| 425 | + } | |
| 426 | + if (!property_exists($obj, 'modhash')) { | |
| 427 | + throw new Exception("Missing required property"); | |
| 428 | + } | |
| 411 | 429 | return new TopLevelData( |
| 412 | 430 | TopLevelData::fromAfter($obj->{'after'}) |
| 413 | 431 | ,TopLevelData::fromBefore($obj->{'before'}) |
| @@ -566,6 +584,12 @@ class Child { | ||
| 566 | 584 | * @throws Exception |
| 567 | 585 | */ |
| 568 | 586 | public static function from(stdClass $obj): Child { |
| 587 | + if (!property_exists($obj, 'data')) { | |
| 588 | + throw new Exception("Missing required property"); | |
| 589 | + } | |
| 590 | + if (!property_exists($obj, 'kind')) { | |
| 591 | + throw new Exception("Missing required property"); | |
| 592 | + } | |
| 569 | 593 | return new Child( |
| 570 | 594 | Child::fromData($obj->{'data'}) |
| 571 | 595 | ,Child::fromKind($obj->{'kind'}) |
| @@ -4168,6 +4192,204 @@ class ChildData { | ||
| 4168 | 4192 | * @throws Exception |
| 4169 | 4193 | */ |
| 4170 | 4194 | public static function from(stdClass $obj): ChildData { |
| 4195 | + if (!property_exists($obj, 'approved_at_utc')) { | |
| 4196 | + throw new Exception("Missing required property"); | |
| 4197 | + } | |
| 4198 | + if (!property_exists($obj, 'approved_by')) { | |
| 4199 | + throw new Exception("Missing required property"); | |
| 4200 | + } | |
| 4201 | + if (!property_exists($obj, 'archived')) { | |
| 4202 | + throw new Exception("Missing required property"); | |
| 4203 | + } | |
| 4204 | + if (!property_exists($obj, 'author')) { | |
| 4205 | + throw new Exception("Missing required property"); | |
| 4206 | + } | |
| 4207 | + if (!property_exists($obj, 'author_flair_css_class')) { | |
| 4208 | + throw new Exception("Missing required property"); | |
| 4209 | + } | |
| 4210 | + if (!property_exists($obj, 'author_flair_text')) { | |
| 4211 | + throw new Exception("Missing required property"); | |
| 4212 | + } | |
| 4213 | + if (!property_exists($obj, 'banned_at_utc')) { | |
| 4214 | + throw new Exception("Missing required property"); | |
| 4215 | + } | |
| 4216 | + if (!property_exists($obj, 'banned_by')) { | |
| 4217 | + throw new Exception("Missing required property"); | |
| 4218 | + } | |
| 4219 | + if (!property_exists($obj, 'brand_safe')) { | |
| 4220 | + throw new Exception("Missing required property"); | |
| 4221 | + } | |
| 4222 | + if (!property_exists($obj, 'can_gild')) { | |
| 4223 | + throw new Exception("Missing required property"); | |
| 4224 | + } | |
| 4225 | + if (!property_exists($obj, 'can_mod_post')) { | |
| 4226 | + throw new Exception("Missing required property"); | |
| 4227 | + } | |
| 4228 | + if (!property_exists($obj, 'clicked')) { | |
| 4229 | + throw new Exception("Missing required property"); | |
| 4230 | + } | |
| 4231 | + if (!property_exists($obj, 'contest_mode')) { | |
| 4232 | + throw new Exception("Missing required property"); | |
| 4233 | + } | |
| 4234 | + if (!property_exists($obj, 'created')) { | |
| 4235 | + throw new Exception("Missing required property"); | |
| 4236 | + } | |
| 4237 | + if (!property_exists($obj, 'created_utc')) { | |
| 4238 | + throw new Exception("Missing required property"); | |
| 4239 | + } | |
| 4240 | + if (!property_exists($obj, 'distinguished')) { | |
| 4241 | + throw new Exception("Missing required property"); | |
| 4242 | + } | |
| 4243 | + if (!property_exists($obj, 'domain')) { | |
| 4244 | + throw new Exception("Missing required property"); | |
| 4245 | + } | |
| 4246 | + if (!property_exists($obj, 'downs')) { | |
| 4247 | + throw new Exception("Missing required property"); | |
| 4248 | + } | |
| 4249 | + if (!property_exists($obj, 'edited')) { | |
| 4250 | + throw new Exception("Missing required property"); | |
| 4251 | + } | |
| 4252 | + if (!property_exists($obj, 'gilded')) { | |
| 4253 | + throw new Exception("Missing required property"); | |
| 4254 | + } | |
| 4255 | + if (!property_exists($obj, 'hidden')) { | |
| 4256 | + throw new Exception("Missing required property"); | |
| 4257 | + } | |
| 4258 | + if (!property_exists($obj, 'hide_score')) { | |
| 4259 | + throw new Exception("Missing required property"); | |
| 4260 | + } | |
| 4261 | + if (!property_exists($obj, 'id')) { | |
| 4262 | + throw new Exception("Missing required property"); | |
| 4263 | + } | |
| 4264 | + if (!property_exists($obj, 'is_self')) { | |
| 4265 | + throw new Exception("Missing required property"); | |
| 4266 | + } | |
| 4267 | + if (!property_exists($obj, 'is_video')) { | |
| 4268 | + throw new Exception("Missing required property"); | |
| 4269 | + } | |
| 4270 | + if (!property_exists($obj, 'likes')) { | |
| 4271 | + throw new Exception("Missing required property"); | |
| 4272 | + } | |
| 4273 | + if (!property_exists($obj, 'link_flair_css_class')) { | |
| 4274 | + throw new Exception("Missing required property"); | |
| 4275 | + } | |
| 4276 | + if (!property_exists($obj, 'link_flair_text')) { | |
| 4277 | + throw new Exception("Missing required property"); | |
| 4278 | + } | |
| 4279 | + if (!property_exists($obj, 'locked')) { | |
| 4280 | + throw new Exception("Missing required property"); | |
| 4281 | + } | |
| 4282 | + if (!property_exists($obj, 'media')) { | |
| 4283 | + throw new Exception("Missing required property"); | |
| 4284 | + } | |
| 4285 | + if (!property_exists($obj, 'media_embed')) { | |
| 4286 | + throw new Exception("Missing required property"); | |
| 4287 | + } | |
| 4288 | + if (!property_exists($obj, 'mod_reports')) { | |
| 4289 | + throw new Exception("Missing required property"); | |
| 4290 | + } | |
| 4291 | + if (!property_exists($obj, 'name')) { | |
| 4292 | + throw new Exception("Missing required property"); | |
| 4293 | + } | |
| 4294 | + if (!property_exists($obj, 'num_comments')) { | |
| 4295 | + throw new Exception("Missing required property"); | |
| 4296 | + } | |
| 4297 | + if (!property_exists($obj, 'num_reports')) { | |
| 4298 | + throw new Exception("Missing required property"); | |
| 4299 | + } | |
| 4300 | + if (!property_exists($obj, 'over_18')) { | |
| 4301 | + throw new Exception("Missing required property"); | |
| 4302 | + } | |
| 4303 | + if (!property_exists($obj, 'parent_whitelist_status')) { | |
| 4304 | + throw new Exception("Missing required property"); | |
| 4305 | + } | |
| 4306 | + if (!property_exists($obj, 'permalink')) { | |
| 4307 | + throw new Exception("Missing required property"); | |
| 4308 | + } | |
| 4309 | + if (!property_exists($obj, 'post_hint')) { | |
| 4310 | + throw new Exception("Missing required property"); | |
| 4311 | + } | |
| 4312 | + if (!property_exists($obj, 'preview')) { | |
| 4313 | + throw new Exception("Missing required property"); | |
| 4314 | + } | |
| 4315 | + if (!property_exists($obj, 'quarantine')) { | |
| 4316 | + throw new Exception("Missing required property"); | |
| 4317 | + } | |
| 4318 | + if (!property_exists($obj, 'removal_reason')) { | |
| 4319 | + throw new Exception("Missing required property"); | |
| 4320 | + } | |
| 4321 | + if (!property_exists($obj, 'report_reasons')) { | |
| 4322 | + throw new Exception("Missing required property"); | |
| 4323 | + } | |
| 4324 | + if (!property_exists($obj, 'saved')) { | |
| 4325 | + throw new Exception("Missing required property"); | |
| 4326 | + } | |
| 4327 | + if (!property_exists($obj, 'score')) { | |
| 4328 | + throw new Exception("Missing required property"); | |
| 4329 | + } | |
| 4330 | + if (!property_exists($obj, 'secure_media')) { | |
| 4331 | + throw new Exception("Missing required property"); | |
| 4332 | + } | |
| 4333 | + if (!property_exists($obj, 'secure_media_embed')) { | |
| 4334 | + throw new Exception("Missing required property"); | |
| 4335 | + } | |
| 4336 | + if (!property_exists($obj, 'selftext')) { | |
| 4337 | + throw new Exception("Missing required property"); | |
| 4338 | + } | |
| 4339 | + if (!property_exists($obj, 'selftext_html')) { | |
| 4340 | + throw new Exception("Missing required property"); | |
| 4341 | + } | |
| 4342 | + if (!property_exists($obj, 'spoiler')) { | |
| 4343 | + throw new Exception("Missing required property"); | |
| 4344 | + } | |
| 4345 | + if (!property_exists($obj, 'stickied')) { | |
| 4346 | + throw new Exception("Missing required property"); | |
| 4347 | + } | |
| 4348 | + if (!property_exists($obj, 'subreddit')) { | |
| 4349 | + throw new Exception("Missing required property"); | |
| 4350 | + } | |
| 4351 | + if (!property_exists($obj, 'subreddit_id')) { | |
| 4352 | + throw new Exception("Missing required property"); | |
| 4353 | + } | |
| 4354 | + if (!property_exists($obj, 'subreddit_name_prefixed')) { | |
| 4355 | + throw new Exception("Missing required property"); | |
| 4356 | + } | |
| 4357 | + if (!property_exists($obj, 'subreddit_type')) { | |
| 4358 | + throw new Exception("Missing required property"); | |
| 4359 | + } | |
| 4360 | + if (!property_exists($obj, 'suggested_sort')) { | |
| 4361 | + throw new Exception("Missing required property"); | |
| 4362 | + } | |
| 4363 | + if (!property_exists($obj, 'thumbnail')) { | |
| 4364 | + throw new Exception("Missing required property"); | |
| 4365 | + } | |
| 4366 | + if (!property_exists($obj, 'thumbnail_height')) { | |
| 4367 | + throw new Exception("Missing required property"); | |
| 4368 | + } | |
| 4369 | + if (!property_exists($obj, 'thumbnail_width')) { | |
| 4370 | + throw new Exception("Missing required property"); | |
| 4371 | + } | |
| 4372 | + if (!property_exists($obj, 'title')) { | |
| 4373 | + throw new Exception("Missing required property"); | |
| 4374 | + } | |
| 4375 | + if (!property_exists($obj, 'ups')) { | |
| 4376 | + throw new Exception("Missing required property"); | |
| 4377 | + } | |
| 4378 | + if (!property_exists($obj, 'url')) { | |
| 4379 | + throw new Exception("Missing required property"); | |
| 4380 | + } | |
| 4381 | + if (!property_exists($obj, 'user_reports')) { | |
| 4382 | + throw new Exception("Missing required property"); | |
| 4383 | + } | |
| 4384 | + if (!property_exists($obj, 'view_count')) { | |
| 4385 | + throw new Exception("Missing required property"); | |
| 4386 | + } | |
| 4387 | + if (!property_exists($obj, 'visited')) { | |
| 4388 | + throw new Exception("Missing required property"); | |
| 4389 | + } | |
| 4390 | + if (!property_exists($obj, 'whitelist_status')) { | |
| 4391 | + throw new Exception("Missing required property"); | |
| 4392 | + } | |
| 4171 | 4393 | return new ChildData( |
| 4172 | 4394 | ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'}) |
| 4173 | 4395 | ,ChildData::fromApprovedBy($obj->{'approved_by'}) |
| @@ -4656,6 +4878,12 @@ class Preview { | ||
| 4656 | 4878 | * @throws Exception |
| 4657 | 4879 | */ |
| 4658 | 4880 | public static function from(stdClass $obj): Preview { |
| 4881 | + if (!property_exists($obj, 'enabled')) { | |
| 4882 | + throw new Exception("Missing required property"); | |
| 4883 | + } | |
| 4884 | + if (!property_exists($obj, 'images')) { | |
| 4885 | + throw new Exception("Missing required property"); | |
| 4886 | + } | |
| 4659 | 4887 | return new Preview( |
| 4660 | 4888 | Preview::fromEnabled($obj->{'enabled'}) |
| 4661 | 4889 | ,Preview::fromImages($obj->{'images'}) |
| @@ -4926,6 +5154,18 @@ class Image { | ||
| 4926 | 5154 | * @throws Exception |
| 4927 | 5155 | */ |
| 4928 | 5156 | public static function from(stdClass $obj): Image { |
| 5157 | + if (!property_exists($obj, 'id')) { | |
| 5158 | + throw new Exception("Missing required property"); | |
| 5159 | + } | |
| 5160 | + if (!property_exists($obj, 'resolutions')) { | |
| 5161 | + throw new Exception("Missing required property"); | |
| 5162 | + } | |
| 5163 | + if (!property_exists($obj, 'source')) { | |
| 5164 | + throw new Exception("Missing required property"); | |
| 5165 | + } | |
| 5166 | + if (!property_exists($obj, 'variants')) { | |
| 5167 | + throw new Exception("Missing required property"); | |
| 5168 | + } | |
| 4929 | 5169 | return new Image( |
| 4930 | 5170 | Image::fromID($obj->{'id'}) |
| 4931 | 5171 | ,Image::fromResolutions($obj->{'resolutions'}) |
| @@ -5134,6 +5374,15 @@ class Source { | ||
| 5134 | 5374 | * @throws Exception |
| 5135 | 5375 | */ |
| 5136 | 5376 | public static function from(stdClass $obj): Source { |
| 5377 | + if (!property_exists($obj, 'height')) { | |
| 5378 | + throw new Exception("Missing required property"); | |
| 5379 | + } | |
| 5380 | + if (!property_exists($obj, 'url')) { | |
| 5381 | + throw new Exception("Missing required property"); | |
| 5382 | + } | |
| 5383 | + if (!property_exists($obj, 'width')) { | |
| 5384 | + throw new Exception("Missing required property"); | |
| 5385 | + } | |
| 5137 | 5386 | return new Source( |
| 5138 | 5387 | Source::fromHeight($obj->{'height'}) |
| 5139 | 5388 | ,Source::fromURL($obj->{'url'}) |
| @@ -5475,6 +5724,12 @@ class GIF { | ||
| 5475 | 5724 | * @throws Exception |
| 5476 | 5725 | */ |
| 5477 | 5726 | public static function from(stdClass $obj): GIF { |
| 5727 | + if (!property_exists($obj, 'resolutions')) { | |
| 5728 | + throw new Exception("Missing required property"); | |
| 5729 | + } | |
| 5730 | + if (!property_exists($obj, 'source')) { | |
| 5731 | + throw new Exception("Missing required property"); | |
| 5732 | + } | |
| 5478 | 5733 | return new GIF( |
| 5479 | 5734 | GIF::fromResolutions($obj->{'resolutions'}) |
| 5480 | 5735 | ,GIF::fromSource($obj->{'source'}) |
Test case
1 generated file · +9 −0test/inputs/json/samples/simple-object.json
Mphpdefault / TopLevel.php+9 −0
| @@ -188,6 +188,15 @@ class TopLevel { | ||
| 188 | 188 | * @throws Exception |
| 189 | 189 | */ |
| 190 | 190 | public static function from(stdClass $obj): TopLevel { |
| 191 | + if (!property_exists($obj, 'date')) { | |
| 192 | + throw new Exception("Missing required property"); | |
| 193 | + } | |
| 194 | + if (!property_exists($obj, 'title')) { | |
| 195 | + throw new Exception("Missing required property"); | |
| 196 | + } | |
| 197 | + if (!property_exists($obj, 'validity')) { | |
| 198 | + throw new Exception("Missing required property"); | |
| 199 | + } | |
| 191 | 200 | return new TopLevel( |
| 192 | 201 | TopLevel::fromDate($obj->{'date'}) |
| 193 | 202 | ,TopLevel::fromTitle($obj->{'title'}) |
Test case
1 generated file · +150 −0test/inputs/json/samples/spotify-album.json
Mphpdefault / TopLevel.php+150 −0
| @@ -980,6 +980,57 @@ class TopLevel { | ||
| 980 | 980 | * @throws Exception |
| 981 | 981 | */ |
| 982 | 982 | public static function from(stdClass $obj): TopLevel { |
| 983 | + if (!property_exists($obj, 'album_type')) { | |
| 984 | + throw new Exception("Missing required property"); | |
| 985 | + } | |
| 986 | + if (!property_exists($obj, 'artists')) { | |
| 987 | + throw new Exception("Missing required property"); | |
| 988 | + } | |
| 989 | + if (!property_exists($obj, 'available_markets')) { | |
| 990 | + throw new Exception("Missing required property"); | |
| 991 | + } | |
| 992 | + if (!property_exists($obj, 'copyrights')) { | |
| 993 | + throw new Exception("Missing required property"); | |
| 994 | + } | |
| 995 | + if (!property_exists($obj, 'external_ids')) { | |
| 996 | + throw new Exception("Missing required property"); | |
| 997 | + } | |
| 998 | + if (!property_exists($obj, 'external_urls')) { | |
| 999 | + throw new Exception("Missing required property"); | |
| 1000 | + } | |
| 1001 | + if (!property_exists($obj, 'genres')) { | |
| 1002 | + throw new Exception("Missing required property"); | |
| 1003 | + } | |
| 1004 | + if (!property_exists($obj, 'href')) { | |
| 1005 | + throw new Exception("Missing required property"); | |
| 1006 | + } | |
| 1007 | + if (!property_exists($obj, 'id')) { | |
| 1008 | + throw new Exception("Missing required property"); | |
| 1009 | + } | |
| 1010 | + if (!property_exists($obj, 'images')) { | |
| 1011 | + throw new Exception("Missing required property"); | |
| 1012 | + } | |
| 1013 | + if (!property_exists($obj, 'name')) { | |
| 1014 | + throw new Exception("Missing required property"); | |
| 1015 | + } | |
| 1016 | + if (!property_exists($obj, 'popularity')) { | |
| 1017 | + throw new Exception("Missing required property"); | |
| 1018 | + } | |
| 1019 | + if (!property_exists($obj, 'release_date')) { | |
| 1020 | + throw new Exception("Missing required property"); | |
| 1021 | + } | |
| 1022 | + if (!property_exists($obj, 'release_date_precision')) { | |
| 1023 | + throw new Exception("Missing required property"); | |
| 1024 | + } | |
| 1025 | + if (!property_exists($obj, 'tracks')) { | |
| 1026 | + throw new Exception("Missing required property"); | |
| 1027 | + } | |
| 1028 | + if (!property_exists($obj, 'type')) { | |
| 1029 | + throw new Exception("Missing required property"); | |
| 1030 | + } | |
| 1031 | + if (!property_exists($obj, 'uri')) { | |
| 1032 | + throw new Exception("Missing required property"); | |
| 1033 | + } | |
| 983 | 1034 | return new TopLevel( |
| 984 | 1035 | TopLevel::fromAlbumType($obj->{'album_type'}) |
| 985 | 1036 | ,TopLevel::fromArtists($obj->{'artists'}) |
| @@ -1371,6 +1422,24 @@ class Artist { | ||
| 1371 | 1422 | * @throws Exception |
| 1372 | 1423 | */ |
| 1373 | 1424 | public static function from(stdClass $obj): Artist { |
| 1425 | + if (!property_exists($obj, 'external_urls')) { | |
| 1426 | + throw new Exception("Missing required property"); | |
| 1427 | + } | |
| 1428 | + if (!property_exists($obj, 'href')) { | |
| 1429 | + throw new Exception("Missing required property"); | |
| 1430 | + } | |
| 1431 | + if (!property_exists($obj, 'id')) { | |
| 1432 | + throw new Exception("Missing required property"); | |
| 1433 | + } | |
| 1434 | + if (!property_exists($obj, 'name')) { | |
| 1435 | + throw new Exception("Missing required property"); | |
| 1436 | + } | |
| 1437 | + if (!property_exists($obj, 'type')) { | |
| 1438 | + throw new Exception("Missing required property"); | |
| 1439 | + } | |
| 1440 | + if (!property_exists($obj, 'uri')) { | |
| 1441 | + throw new Exception("Missing required property"); | |
| 1442 | + } | |
| 1374 | 1443 | return new Artist( |
| 1375 | 1444 | Artist::fromExternalUrls($obj->{'external_urls'}) |
| 1376 | 1445 | ,Artist::fromHref($obj->{'href'}) |
| @@ -1479,6 +1548,9 @@ class ExternalUrls { | ||
| 1479 | 1548 | * @throws Exception |
| 1480 | 1549 | */ |
| 1481 | 1550 | public static function from(stdClass $obj): ExternalUrls { |
| 1551 | + if (!property_exists($obj, 'spotify')) { | |
| 1552 | + throw new Exception("Missing required property"); | |
| 1553 | + } | |
| 1482 | 1554 | return new ExternalUrls( |
| 1483 | 1555 | ExternalUrls::fromSpotify($obj->{'spotify'}) |
| 1484 | 1556 | ); |
| @@ -1629,6 +1701,12 @@ class Copyright { | ||
| 1629 | 1701 | * @throws Exception |
| 1630 | 1702 | */ |
| 1631 | 1703 | public static function from(stdClass $obj): Copyright { |
| 1704 | + if (!property_exists($obj, 'text')) { | |
| 1705 | + throw new Exception("Missing required property"); | |
| 1706 | + } | |
| 1707 | + if (!property_exists($obj, 'type')) { | |
| 1708 | + throw new Exception("Missing required property"); | |
| 1709 | + } | |
| 1632 | 1710 | return new Copyright( |
| 1633 | 1711 | Copyright::fromText($obj->{'text'}) |
| 1634 | 1712 | ,Copyright::fromType($obj->{'type'}) |
| @@ -1729,6 +1807,9 @@ class ExternalIDS { | ||
| 1729 | 1807 | * @throws Exception |
| 1730 | 1808 | */ |
| 1731 | 1809 | public static function from(stdClass $obj): ExternalIDS { |
| 1810 | + if (!property_exists($obj, 'upc')) { | |
| 1811 | + throw new Exception("Missing required property"); | |
| 1812 | + } | |
| 1732 | 1813 | return new ExternalIDS( |
| 1733 | 1814 | ExternalIDS::fromUpc($obj->{'upc'}) |
| 1734 | 1815 | ); |
| @@ -1931,6 +2012,15 @@ class Image { | ||
| 1931 | 2012 | * @throws Exception |
| 1932 | 2013 | */ |
| 1933 | 2014 | public static function from(stdClass $obj): Image { |
| 2015 | + if (!property_exists($obj, 'height')) { | |
| 2016 | + throw new Exception("Missing required property"); | |
| 2017 | + } | |
| 2018 | + if (!property_exists($obj, 'url')) { | |
| 2019 | + throw new Exception("Missing required property"); | |
| 2020 | + } | |
| 2021 | + if (!property_exists($obj, 'width')) { | |
| 2022 | + throw new Exception("Missing required property"); | |
| 2023 | + } | |
| 1934 | 2024 | return new Image( |
| 1935 | 2025 | Image::fromHeight($obj->{'height'}) |
| 1936 | 2026 | ,Image::fromURL($obj->{'url'}) |
| @@ -2363,6 +2453,27 @@ class Tracks { | ||
| 2363 | 2453 | * @throws Exception |
| 2364 | 2454 | */ |
| 2365 | 2455 | public static function from(stdClass $obj): Tracks { |
| 2456 | + if (!property_exists($obj, 'href')) { | |
| 2457 | + throw new Exception("Missing required property"); | |
| 2458 | + } | |
| 2459 | + if (!property_exists($obj, 'items')) { | |
| 2460 | + throw new Exception("Missing required property"); | |
| 2461 | + } | |
| 2462 | + if (!property_exists($obj, 'limit')) { | |
| 2463 | + throw new Exception("Missing required property"); | |
| 2464 | + } | |
| 2465 | + if (!property_exists($obj, 'next')) { | |
| 2466 | + throw new Exception("Missing required property"); | |
| 2467 | + } | |
| 2468 | + if (!property_exists($obj, 'offset')) { | |
| 2469 | + throw new Exception("Missing required property"); | |
| 2470 | + } | |
| 2471 | + if (!property_exists($obj, 'previous')) { | |
| 2472 | + throw new Exception("Missing required property"); | |
| 2473 | + } | |
| 2474 | + if (!property_exists($obj, 'total')) { | |
| 2475 | + throw new Exception("Missing required property"); | |
| 2476 | + } | |
| 2366 | 2477 | return new Tracks( |
| 2367 | 2478 | Tracks::fromHref($obj->{'href'}) |
| 2368 | 2479 | ,Tracks::fromItems($obj->{'items'}) |
| @@ -3124,6 +3235,45 @@ class Item { | ||
| 3124 | 3235 | * @throws Exception |
| 3125 | 3236 | */ |
| 3126 | 3237 | public static function from(stdClass $obj): Item { |
| 3238 | + if (!property_exists($obj, 'artists')) { | |
| 3239 | + throw new Exception("Missing required property"); | |
| 3240 | + } | |
| 3241 | + if (!property_exists($obj, 'available_markets')) { | |
| 3242 | + throw new Exception("Missing required property"); | |
| 3243 | + } | |
| 3244 | + if (!property_exists($obj, 'disc_number')) { | |
| 3245 | + throw new Exception("Missing required property"); | |
| 3246 | + } | |
| 3247 | + if (!property_exists($obj, 'duration_ms')) { | |
| 3248 | + throw new Exception("Missing required property"); | |
| 3249 | + } | |
| 3250 | + if (!property_exists($obj, 'explicit')) { | |
| 3251 | + throw new Exception("Missing required property"); | |
| 3252 | + } | |
| 3253 | + if (!property_exists($obj, 'external_urls')) { | |
| 3254 | + throw new Exception("Missing required property"); | |
| 3255 | + } | |
| 3256 | + if (!property_exists($obj, 'href')) { | |
| 3257 | + throw new Exception("Missing required property"); | |
| 3258 | + } | |
| 3259 | + if (!property_exists($obj, 'id')) { | |
| 3260 | + throw new Exception("Missing required property"); | |
| 3261 | + } | |
| 3262 | + if (!property_exists($obj, 'name')) { | |
| 3263 | + throw new Exception("Missing required property"); | |
| 3264 | + } | |
| 3265 | + if (!property_exists($obj, 'preview_url')) { | |
| 3266 | + throw new Exception("Missing required property"); | |
| 3267 | + } | |
| 3268 | + if (!property_exists($obj, 'track_number')) { | |
| 3269 | + throw new Exception("Missing required property"); | |
| 3270 | + } | |
| 3271 | + if (!property_exists($obj, 'type')) { | |
| 3272 | + throw new Exception("Missing required property"); | |
| 3273 | + } | |
| 3274 | + if (!property_exists($obj, 'uri')) { | |
| 3275 | + throw new Exception("Missing required property"); | |
| 3276 | + } | |
| 3127 | 3277 | return new Item( |
| 3128 | 3278 | Item::fromArtists($obj->{'artists'}) |
| 3129 | 3279 | ,Item::fromAvailableMarkets($obj->{'available_markets'}) |
Test case
1 generated file · +24 −0test/inputs/json/samples/us-avg-temperatures.json
Mphpdefault / TopLevel.php+24 −0
| @@ -152,6 +152,12 @@ class TopLevel { | ||
| 152 | 152 | * @throws Exception |
| 153 | 153 | */ |
| 154 | 154 | public static function from(stdClass $obj): TopLevel { |
| 155 | + if (!property_exists($obj, 'data')) { | |
| 156 | + throw new Exception("Missing required property"); | |
| 157 | + } | |
| 158 | + if (!property_exists($obj, 'description')) { | |
| 159 | + throw new Exception("Missing required property"); | |
| 160 | + } | |
| 155 | 161 | return new TopLevel( |
| 156 | 162 | TopLevel::fromData($obj->{'data'}) |
| 157 | 163 | ,TopLevel::fromDescription($obj->{'description'}) |
| @@ -304,6 +310,12 @@ class Datum { | ||
| 304 | 310 | * @throws Exception |
| 305 | 311 | */ |
| 306 | 312 | public static function from(stdClass $obj): Datum { |
| 313 | + if (!property_exists($obj, 'anomaly')) { | |
| 314 | + throw new Exception("Missing required property"); | |
| 315 | + } | |
| 316 | + if (!property_exists($obj, 'value')) { | |
| 317 | + throw new Exception("Missing required property"); | |
| 318 | + } | |
| 307 | 319 | return new Datum( |
| 308 | 320 | Datum::fromAnomaly($obj->{'anomaly'}) |
| 309 | 321 | ,Datum::fromValue($obj->{'value'}) |
| @@ -560,6 +572,18 @@ class Description { | ||
| 560 | 572 | * @throws Exception |
| 561 | 573 | */ |
| 562 | 574 | public static function from(stdClass $obj): Description { |
| 575 | + if (!property_exists($obj, 'base_period')) { | |
| 576 | + throw new Exception("Missing required property"); | |
| 577 | + } | |
| 578 | + if (!property_exists($obj, 'missing')) { | |
| 579 | + throw new Exception("Missing required property"); | |
| 580 | + } | |
| 581 | + if (!property_exists($obj, 'title')) { | |
| 582 | + throw new Exception("Missing required property"); | |
| 583 | + } | |
| 584 | + if (!property_exists($obj, 'units')) { | |
| 585 | + throw new Exception("Missing required property"); | |
| 586 | + } | |
| 563 | 587 | return new Description( |
| 564 | 588 | Description::fromBasePeriod($obj->{'base_period'}) |
| 565 | 589 | ,Description::fromMissing($obj->{'missing'}) |
Test case
1 generated file · +141 −0test/inputs/json/samples/us-senators.json
Mphpdefault / TopLevel.php+141 −0
| @@ -149,6 +149,12 @@ class TopLevel { | ||
| 149 | 149 | * @throws Exception |
| 150 | 150 | */ |
| 151 | 151 | public static function from(stdClass $obj): TopLevel { |
| 152 | + if (!property_exists($obj, 'meta')) { | |
| 153 | + throw new Exception("Missing required property"); | |
| 154 | + } | |
| 155 | + if (!property_exists($obj, 'objects')) { | |
| 156 | + throw new Exception("Missing required property"); | |
| 157 | + } | |
| 152 | 158 | return new TopLevel( |
| 153 | 159 | TopLevel::fromMeta($obj->{'meta'}) |
| 154 | 160 | ,TopLevel::fromObjects($obj->{'objects'}) |
| @@ -353,6 +359,15 @@ class Meta { | ||
| 353 | 359 | * @throws Exception |
| 354 | 360 | */ |
| 355 | 361 | public static function from(stdClass $obj): Meta { |
| 362 | + if (!property_exists($obj, 'limit')) { | |
| 363 | + throw new Exception("Missing required property"); | |
| 364 | + } | |
| 365 | + if (!property_exists($obj, 'offset')) { | |
| 366 | + throw new Exception("Missing required property"); | |
| 367 | + } | |
| 368 | + if (!property_exists($obj, 'total_count')) { | |
| 369 | + throw new Exception("Missing required property"); | |
| 370 | + } | |
| 356 | 371 | return new Meta( |
| 357 | 372 | Meta::fromLimit($obj->{'limit'}) |
| 358 | 373 | ,Meta::fromOffset($obj->{'offset'}) |
| @@ -1596,6 +1611,72 @@ class ObjectElement { | ||
| 1596 | 1611 | * @throws Exception |
| 1597 | 1612 | */ |
| 1598 | 1613 | public static function from(stdClass $obj): ObjectElement { |
| 1614 | + if (!property_exists($obj, 'caucus')) { | |
| 1615 | + throw new Exception("Missing required property"); | |
| 1616 | + } | |
| 1617 | + if (!property_exists($obj, 'congress_numbers')) { | |
| 1618 | + throw new Exception("Missing required property"); | |
| 1619 | + } | |
| 1620 | + if (!property_exists($obj, 'current')) { | |
| 1621 | + throw new Exception("Missing required property"); | |
| 1622 | + } | |
| 1623 | + if (!property_exists($obj, 'description')) { | |
| 1624 | + throw new Exception("Missing required property"); | |
| 1625 | + } | |
| 1626 | + if (!property_exists($obj, 'district')) { | |
| 1627 | + throw new Exception("Missing required property"); | |
| 1628 | + } | |
| 1629 | + if (!property_exists($obj, 'enddate')) { | |
| 1630 | + throw new Exception("Missing required property"); | |
| 1631 | + } | |
| 1632 | + if (!property_exists($obj, 'extra')) { | |
| 1633 | + throw new Exception("Missing required property"); | |
| 1634 | + } | |
| 1635 | + if (!property_exists($obj, 'leadership_title')) { | |
| 1636 | + throw new Exception("Missing required property"); | |
| 1637 | + } | |
| 1638 | + if (!property_exists($obj, 'party')) { | |
| 1639 | + throw new Exception("Missing required property"); | |
| 1640 | + } | |
| 1641 | + if (!property_exists($obj, 'person')) { | |
| 1642 | + throw new Exception("Missing required property"); | |
| 1643 | + } | |
| 1644 | + if (!property_exists($obj, 'phone')) { | |
| 1645 | + throw new Exception("Missing required property"); | |
| 1646 | + } | |
| 1647 | + if (!property_exists($obj, 'role_type')) { | |
| 1648 | + throw new Exception("Missing required property"); | |
| 1649 | + } | |
| 1650 | + if (!property_exists($obj, 'role_type_label')) { | |
| 1651 | + throw new Exception("Missing required property"); | |
| 1652 | + } | |
| 1653 | + if (!property_exists($obj, 'senator_class')) { | |
| 1654 | + throw new Exception("Missing required property"); | |
| 1655 | + } | |
| 1656 | + if (!property_exists($obj, 'senator_class_label')) { | |
| 1657 | + throw new Exception("Missing required property"); | |
| 1658 | + } | |
| 1659 | + if (!property_exists($obj, 'senator_rank')) { | |
| 1660 | + throw new Exception("Missing required property"); | |
| 1661 | + } | |
| 1662 | + if (!property_exists($obj, 'senator_rank_label')) { | |
| 1663 | + throw new Exception("Missing required property"); | |
| 1664 | + } | |
| 1665 | + if (!property_exists($obj, 'startdate')) { | |
| 1666 | + throw new Exception("Missing required property"); | |
| 1667 | + } | |
| 1668 | + if (!property_exists($obj, 'state')) { | |
| 1669 | + throw new Exception("Missing required property"); | |
| 1670 | + } | |
| 1671 | + if (!property_exists($obj, 'title')) { | |
| 1672 | + throw new Exception("Missing required property"); | |
| 1673 | + } | |
| 1674 | + if (!property_exists($obj, 'title_long')) { | |
| 1675 | + throw new Exception("Missing required property"); | |
| 1676 | + } | |
| 1677 | + if (!property_exists($obj, 'website')) { | |
| 1678 | + throw new Exception("Missing required property"); | |
| 1679 | + } | |
| 1599 | 1680 | return new ObjectElement( |
| 1600 | 1681 | ObjectElement::fromCaucus($obj->{'caucus'}) |
| 1601 | 1682 | ,ObjectElement::fromCongressNumbers($obj->{'congress_numbers'}) |
| @@ -2017,6 +2098,15 @@ class Extra { | ||
| 2017 | 2098 | * @throws Exception |
| 2018 | 2099 | */ |
| 2019 | 2100 | public static function from(stdClass $obj): Extra { |
| 2101 | + if (!property_exists($obj, 'address')) { | |
| 2102 | + throw new Exception("Missing required property"); | |
| 2103 | + } | |
| 2104 | + if (!property_exists($obj, 'contact_form')) { | |
| 2105 | + throw new Exception("Missing required property"); | |
| 2106 | + } | |
| 2107 | + if (!property_exists($obj, 'office')) { | |
| 2108 | + throw new Exception("Missing required property"); | |
| 2109 | + } | |
| 2020 | 2110 | return new Extra( |
| 2021 | 2111 | Extra::fromAddress($obj->{'address'}) |
| 2022 | 2112 | ,Extra::fromContactForm($obj->{'contact_form'}) |
| @@ -2978,6 +3068,57 @@ class Person { | ||
| 2978 | 3068 | * @throws Exception |
| 2979 | 3069 | */ |
| 2980 | 3070 | public static function from(stdClass $obj): Person { |
| 3071 | + if (!property_exists($obj, 'bioguideid')) { | |
| 3072 | + throw new Exception("Missing required property"); | |
| 3073 | + } | |
| 3074 | + if (!property_exists($obj, 'birthday')) { | |
| 3075 | + throw new Exception("Missing required property"); | |
| 3076 | + } | |
| 3077 | + if (!property_exists($obj, 'cspanid')) { | |
| 3078 | + throw new Exception("Missing required property"); | |
| 3079 | + } | |
| 3080 | + if (!property_exists($obj, 'firstname')) { | |
| 3081 | + throw new Exception("Missing required property"); | |
| 3082 | + } | |
| 3083 | + if (!property_exists($obj, 'gender')) { | |
| 3084 | + throw new Exception("Missing required property"); | |
| 3085 | + } | |
| 3086 | + if (!property_exists($obj, 'gender_label')) { | |
| 3087 | + throw new Exception("Missing required property"); | |
| 3088 | + } | |
| 3089 | + if (!property_exists($obj, 'lastname')) { | |
| 3090 | + throw new Exception("Missing required property"); | |
| 3091 | + } | |
| 3092 | + if (!property_exists($obj, 'link')) { | |
| 3093 | + throw new Exception("Missing required property"); | |
| 3094 | + } | |
| 3095 | + if (!property_exists($obj, 'middlename')) { | |
| 3096 | + throw new Exception("Missing required property"); | |
| 3097 | + } | |
| 3098 | + if (!property_exists($obj, 'name')) { | |
| 3099 | + throw new Exception("Missing required property"); | |
| 3100 | + } | |
| 3101 | + if (!property_exists($obj, 'namemod')) { | |
| 3102 | + throw new Exception("Missing required property"); | |
| 3103 | + } | |
| 3104 | + if (!property_exists($obj, 'nickname')) { | |
| 3105 | + throw new Exception("Missing required property"); | |
| 3106 | + } | |
| 3107 | + if (!property_exists($obj, 'osid')) { | |
| 3108 | + throw new Exception("Missing required property"); | |
| 3109 | + } | |
| 3110 | + if (!property_exists($obj, 'pvsid')) { | |
| 3111 | + throw new Exception("Missing required property"); | |
| 3112 | + } | |
| 3113 | + if (!property_exists($obj, 'sortname')) { | |
| 3114 | + throw new Exception("Missing required property"); | |
| 3115 | + } | |
| 3116 | + if (!property_exists($obj, 'twitterid')) { | |
| 3117 | + throw new Exception("Missing required property"); | |
| 3118 | + } | |
| 3119 | + if (!property_exists($obj, 'youtubeid')) { | |
| 3120 | + throw new Exception("Missing required property"); | |
| 3121 | + } | |
| 2981 | 3122 | return new Person( |
| 2982 | 3123 | Person::fromBioguideid($obj->{'bioguideid'}) |
| 2983 | 3124 | ,Person::fromBirthday($obj->{'birthday'}) |
Test case
1 generated file · +12 −0test/inputs/schema/accessors.schema
Mschema-phpdefault / TopLevel.php+12 −0
| @@ -264,6 +264,18 @@ class TopLevel { | ||
| 264 | 264 | * @throws Exception |
| 265 | 265 | */ |
| 266 | 266 | public static function from(stdClass $obj): TopLevel { |
| 267 | + if (!property_exists($obj, 'bar')) { | |
| 268 | + throw new Exception("Missing required property"); | |
| 269 | + } | |
| 270 | + if (!property_exists($obj, 'enum')) { | |
| 271 | + throw new Exception("Missing required property"); | |
| 272 | + } | |
| 273 | + if (!property_exists($obj, 'foo')) { | |
| 274 | + throw new Exception("Missing required property"); | |
| 275 | + } | |
| 276 | + if (!property_exists($obj, 'union')) { | |
| 277 | + throw new Exception("Missing required property"); | |
| 278 | + } | |
| 267 | 279 | return new TopLevel( |
| 268 | 280 | TopLevel::fromBarre($obj->{'bar'}) |
| 269 | 281 | ,TopLevel::fromEnumerification($obj->{'enum'}) |
Test case
1 generated file · +9 −0test/inputs/schema/all-of-additional-properties-false.schema
Mschema-phpdefault / TopLevel.php+9 −0
| @@ -252,6 +252,15 @@ class TopLevel { | ||
| 252 | 252 | * @throws Exception |
| 253 | 253 | */ |
| 254 | 254 | public static function from(stdClass $obj): TopLevel { |
| 255 | + if (!property_exists($obj, 'amount')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 258 | + if (!property_exists($obj, 'frequency')) { | |
| 259 | + throw new Exception("Missing required property"); | |
| 260 | + } | |
| 261 | + if (!property_exists($obj, 'type')) { | |
| 262 | + throw new Exception("Missing required property"); | |
| 263 | + } | |
| 255 | 264 | return new TopLevel( |
| 256 | 265 | TopLevel::fromAmount($obj->{'amount'}) |
| 257 | 266 | ,TopLevel::fromFrequency($obj->{'frequency'}) |
Test case
1 generated file · +6 −0test/inputs/schema/any.schema
Mschema-phpdefault / TopLevel.php+6 −0
| @@ -150,6 +150,12 @@ class TopLevel { | ||
| 150 | 150 | * @throws Exception |
| 151 | 151 | */ |
| 152 | 152 | public static function from(stdClass $obj): TopLevel { |
| 153 | + if (!property_exists($obj, 'foo')) { | |
| 154 | + throw new Exception("Missing required property"); | |
| 155 | + } | |
| 156 | + if (!property_exists($obj, 'values')) { | |
| 157 | + throw new Exception("Missing required property"); | |
| 158 | + } | |
| 153 | 159 | return new TopLevel( |
| 154 | 160 | TopLevel::fromFoo($obj->{'foo'}) |
| 155 | 161 | ,TopLevel::fromValues($obj->{'values'}) |
Test case
1 generated file · +12 −0test/inputs/schema/bool-string.schema
Mschema-phpdefault / TopLevel.php+12 −0
| @@ -520,6 +520,18 @@ class TopLevel { | ||
| 520 | 520 | * @throws Exception |
| 521 | 521 | */ |
| 522 | 522 | public static function from(stdClass $obj): TopLevel { |
| 523 | + if (!property_exists($obj, 'nullable')) { | |
| 524 | + throw new Exception("Missing required property"); | |
| 525 | + } | |
| 526 | + if (!property_exists($obj, 'one')) { | |
| 527 | + throw new Exception("Missing required property"); | |
| 528 | + } | |
| 529 | + if (!property_exists($obj, 'unionWithBool')) { | |
| 530 | + throw new Exception("Missing required property"); | |
| 531 | + } | |
| 532 | + if (!property_exists($obj, 'unionWithBoolAndEnum')) { | |
| 533 | + throw new Exception("Missing required property"); | |
| 534 | + } | |
| 523 | 535 | return new TopLevel( |
| 524 | 536 | TopLevel::fromArrNullable($obj->{'arrNullable'}) |
| 525 | 537 | ,TopLevel::fromArrOne($obj->{'arrOne'}) |
Test case
1 generated file · +6 −0test/inputs/schema/boolean-subschema.schema
Mschema-phpdefault / TopLevel.php+6 −0
| @@ -251,6 +251,12 @@ class TopLevel { | ||
| 251 | 251 | * @throws Exception |
| 252 | 252 | */ |
| 253 | 253 | public static function from(stdClass $obj): TopLevel { |
| 254 | + if (!property_exists($obj, 'empty')) { | |
| 255 | + throw new Exception("Missing required property"); | |
| 256 | + } | |
| 257 | + if (!property_exists($obj, 'foo')) { | |
| 258 | + throw new Exception("Missing required property"); | |
| 259 | + } | |
| 254 | 260 | return new TopLevel( |
| 255 | 261 | TopLevel::fromDisallowed($obj->{'disallowed'}) |
| 256 | 262 | ,TopLevel::fromEmpty($obj->{'empty'}) |
Test case
1 generated file · +3 −0test/inputs/schema/comment-injection-enum-nested-comment.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -110,6 +110,9 @@ class TopLevel { | ||
| 110 | 110 | * @throws Exception |
| 111 | 111 | */ |
| 112 | 112 | public static function from(stdClass $obj): TopLevel { |
| 113 | + if (!property_exists($obj, 'kind')) { | |
| 114 | + throw new Exception("Missing required property"); | |
| 115 | + } | |
| 113 | 116 | return new TopLevel( |
| 114 | 117 | TopLevel::fromKind($obj->{'kind'}) |
| 115 | 118 | ); |
Test case
1 generated file · +3 −0test/inputs/schema/comment-injection-enum.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -125,6 +125,9 @@ class TopLevel { | ||
| 125 | 125 | * @throws Exception |
| 126 | 126 | */ |
| 127 | 127 | public static function from(stdClass $obj): TopLevel { |
| 128 | + if (!property_exists($obj, 'kind')) { | |
| 129 | + throw new Exception("Missing required property"); | |
| 130 | + } | |
| 128 | 131 | return new TopLevel( |
| 129 | 132 | TopLevel::fromKind($obj->{'kind'}) |
| 130 | 133 | ); |
Test case
1 generated file · +3 −0test/inputs/schema/comment-injection-nested-comment.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -109,6 +109,9 @@ class TopLevel { | ||
| 109 | 109 | * @throws Exception |
| 110 | 110 | */ |
| 111 | 111 | public static function from(stdClass $obj): TopLevel { |
| 112 | + if (!property_exists($obj, 'value')) { | |
| 113 | + throw new Exception("Missing required property"); | |
| 114 | + } | |
| 112 | 115 | return new TopLevel( |
| 113 | 116 | TopLevel::fromValue($obj->{'value'}) |
| 114 | 117 | ); |
Test case
1 generated file · +3 −0test/inputs/schema/comment-injection.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -365,6 +365,9 @@ class TopLevel { | ||
| 365 | 365 | * @throws Exception |
| 366 | 366 | */ |
| 367 | 367 | public static function from(stdClass $obj): TopLevel { |
| 368 | + if (!property_exists($obj, 'value')) { | |
| 369 | + throw new Exception("Missing required property"); | |
| 370 | + } | |
| 368 | 371 | return new TopLevel( |
| 369 | 372 | TopLevel::fromTrailingBackslash($obj->{'trailingBackslash'}) |
| 370 | 373 | ,TopLevel::fromTrailingQuote($obj->{'trailingQuote'}) |
Test case
1 generated file · +15 −0test/inputs/schema/const-non-string.schema
Mschema-phpdefault / TopLevel.php+15 −0
| @@ -293,6 +293,21 @@ class TopLevel { | ||
| 293 | 293 | * @throws Exception |
| 294 | 294 | */ |
| 295 | 295 | public static function from(stdClass $obj): TopLevel { |
| 296 | + if (!property_exists($obj, 'amount')) { | |
| 297 | + throw new Exception("Missing required property"); | |
| 298 | + } | |
| 299 | + if (!property_exists($obj, 'enabled')) { | |
| 300 | + throw new Exception("Missing required property"); | |
| 301 | + } | |
| 302 | + if (!property_exists($obj, 'kind')) { | |
| 303 | + throw new Exception("Missing required property"); | |
| 304 | + } | |
| 305 | + if (!property_exists($obj, 'ratio')) { | |
| 306 | + throw new Exception("Missing required property"); | |
| 307 | + } | |
| 308 | + if (!property_exists($obj, 'version')) { | |
| 309 | + throw new Exception("Missing required property"); | |
| 310 | + } | |
| 296 | 311 | return new TopLevel( |
| 297 | 312 | TopLevel::fromAmount($obj->{'amount'}) |
| 298 | 313 | ,TopLevel::fromEnabled($obj->{'enabled'}) |
Test case
1 generated file · +3 −0test/inputs/schema/cut-enum.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -84,6 +84,9 @@ class TopLevel { | ||
| 84 | 84 | * @throws Exception |
| 85 | 85 | */ |
| 86 | 86 | public static function from(stdClass $obj): TopLevel { |
| 87 | + if (!property_exists($obj, 'foo')) { | |
| 88 | + throw new Exception("Missing required property"); | |
| 89 | + } | |
| 87 | 90 | return new TopLevel( |
| 88 | 91 | TopLevel::fromFoo($obj->{'foo'}) |
| 89 | 92 | ); |
Test case
1 generated file · +6 −0test/inputs/schema/date-time-or-string.schema
Mschema-phpdefault / TopLevel.php+6 −0
| @@ -161,6 +161,12 @@ class TopLevel { | ||
| 161 | 161 | * @throws Exception |
| 162 | 162 | */ |
| 163 | 163 | public static function from(stdClass $obj): TopLevel { |
| 164 | + if (!property_exists($obj, 'bar')) { | |
| 165 | + throw new Exception("Missing required property"); | |
| 166 | + } | |
| 167 | + if (!property_exists($obj, 'foo')) { | |
| 168 | + throw new Exception("Missing required property"); | |
| 169 | + } | |
| 164 | 170 | return new TopLevel( |
| 165 | 171 | TopLevel::fromBar($obj->{'bar'}) |
| 166 | 172 | ,TopLevel::fromFoo($obj->{'foo'}) |
Test case
1 generated file · +15 −0test/inputs/schema/date-time.schema
Mschema-phpdefault / TopLevel.php+15 −0
| @@ -357,6 +357,21 @@ class TopLevel { | ||
| 357 | 357 | * @throws Exception |
| 358 | 358 | */ |
| 359 | 359 | public static function from(stdClass $obj): TopLevel { |
| 360 | + if (!property_exists($obj, 'complex-union-array')) { | |
| 361 | + throw new Exception("Missing required property"); | |
| 362 | + } | |
| 363 | + if (!property_exists($obj, 'date')) { | |
| 364 | + throw new Exception("Missing required property"); | |
| 365 | + } | |
| 366 | + if (!property_exists($obj, 'date-time')) { | |
| 367 | + throw new Exception("Missing required property"); | |
| 368 | + } | |
| 369 | + if (!property_exists($obj, 'time')) { | |
| 370 | + throw new Exception("Missing required property"); | |
| 371 | + } | |
| 372 | + if (!property_exists($obj, 'union-array')) { | |
| 373 | + throw new Exception("Missing required property"); | |
| 374 | + } | |
| 360 | 375 | return new TopLevel( |
| 361 | 376 | TopLevel::fromComplexUnionArray($obj->{'complex-union-array'}) |
| 362 | 377 | ,TopLevel::fromDate($obj->{'date'}) |
Test case
1 generated file · +3 −0test/inputs/schema/default-value.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -84,6 +84,9 @@ class TopLevel { | ||
| 84 | 84 | * @throws Exception |
| 85 | 85 | */ |
| 86 | 86 | public static function from(stdClass $obj): TopLevel { |
| 87 | + if (!property_exists($obj, 'id')) { | |
| 88 | + throw new Exception("Missing required property"); | |
| 89 | + } | |
| 87 | 90 | return new TopLevel( |
| 88 | 91 | TopLevel::fromID($obj->{'id'}) |
| 89 | 92 | ); |
Test case
1 generated file · +12 −0test/inputs/schema/description.schema
Mschema-phpdefault / TopLevel.php+12 −0
| @@ -387,6 +387,15 @@ class TopLevel { | ||
| 387 | 387 | * @throws Exception |
| 388 | 388 | */ |
| 389 | 389 | public static function from(stdClass $obj): TopLevel { |
| 390 | + if (!property_exists($obj, 'enum')) { | |
| 391 | + throw new Exception("Missing required property"); | |
| 392 | + } | |
| 393 | + if (!property_exists($obj, 'object-or-string')) { | |
| 394 | + throw new Exception("Missing required property"); | |
| 395 | + } | |
| 396 | + if (!property_exists($obj, 'union')) { | |
| 397 | + throw new Exception("Missing required property"); | |
| 398 | + } | |
| 390 | 399 | return new TopLevel( |
| 391 | 400 | TopLevel::fromBar($obj->{'bar'}) |
| 392 | 401 | ,TopLevel::fromEnum($obj->{'enum'}) |
| @@ -555,6 +564,9 @@ class ObjectOrString { | ||
| 555 | 564 | * @throws Exception |
| 556 | 565 | */ |
| 557 | 566 | public static function from(stdClass $obj): ObjectOrString { |
| 567 | + if (!property_exists($obj, 'prop')) { | |
| 568 | + throw new Exception("Missing required property"); | |
| 569 | + } | |
| 558 | 570 | return new ObjectOrString( |
| 559 | 571 | ObjectOrString::fromProp($obj->{'prop'}) |
| 560 | 572 | ); |
Test case
1 generated file · +6 −0test/inputs/schema/direct-union.schema
Mschema-phpdefault / TopLevel.php+6 −0
| @@ -99,6 +99,9 @@ class TopLevel { | ||
| 99 | 99 | * @throws Exception |
| 100 | 100 | */ |
| 101 | 101 | public static function from(stdClass $obj): TopLevel { |
| 102 | + if (!property_exists($obj, 'stuff')) { | |
| 103 | + throw new Exception("Missing required property"); | |
| 104 | + } | |
| 102 | 105 | return new TopLevel( |
| 103 | 106 | TopLevel::fromStuff($obj->{'stuff'}) |
| 104 | 107 | ); |
| @@ -409,6 +412,9 @@ class Thing { | ||
| 409 | 412 | * @throws Exception |
| 410 | 413 | */ |
| 411 | 414 | public static function from(stdClass $obj): Thing { |
| 415 | + if (!property_exists($obj, 'required')) { | |
| 416 | + throw new Exception("Missing required property"); | |
| 417 | + } | |
| 412 | 418 | return new Thing( |
| 413 | 419 | Thing::fromOptional($obj->{'optional'}) |
| 414 | 420 | ,Thing::fromRequired($obj->{'required'}) |
Test case
1 generated file · +6 −0test/inputs/schema/enum-large.schema
Mschema-phpdefault / TopLevel.php+6 −0
| @@ -138,6 +138,12 @@ class TopLevel { | ||
| 138 | 138 | * @throws Exception |
| 139 | 139 | */ |
| 140 | 140 | public static function from(stdClass $obj): TopLevel { |
| 141 | + if (!property_exists($obj, 'callsign')) { | |
| 142 | + throw new Exception("Missing required property"); | |
| 143 | + } | |
| 144 | + if (!property_exists($obj, 'priority')) { | |
| 145 | + throw new Exception("Missing required property"); | |
| 146 | + } | |
| 141 | 147 | return new TopLevel( |
| 142 | 148 | TopLevel::fromCallsign($obj->{'callsign'}) |
| 143 | 149 | ,TopLevel::fromPriority($obj->{'priority'}) |
Test case
1 generated file · +3 −0test/inputs/schema/enum-with-null.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -95,6 +95,9 @@ class TopLevel { | ||
| 95 | 95 | * @throws Exception |
| 96 | 96 | */ |
| 97 | 97 | public static function from(stdClass $obj): TopLevel { |
| 98 | + if (!property_exists($obj, 'enum')) { | |
| 99 | + throw new Exception("Missing required property"); | |
| 100 | + } | |
| 98 | 101 | return new TopLevel( |
| 99 | 102 | TopLevel::fromEnum($obj->{'enum'}) |
| 100 | 103 | ); |
Test case
1 generated file · +3 −0test/inputs/schema/enum-with-values.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'weekdays')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromWeekdays($obj->{'weekdays'}) |
| 90 | 93 | ); |
Test case
1 generated file · +3 −0test/inputs/schema/enum.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -378,6 +378,9 @@ class TopLevel { | ||
| 378 | 378 | * @throws Exception |
| 379 | 379 | */ |
| 380 | 380 | public static function from(stdClass $obj): TopLevel { |
| 381 | + if (!property_exists($obj, 'gve')) { | |
| 382 | + throw new Exception("Missing required property"); | |
| 383 | + } | |
| 381 | 384 | return new TopLevel( |
| 382 | 385 | TopLevel::fromArr($obj->{'arr'}) |
| 383 | 386 | ,TopLevel::fromFor($obj->{'for'}) |
Test case
1 generated file · +3 −0test/inputs/schema/go-schema-pattern-properties.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -101,6 +101,9 @@ class TopLevel { | ||
| 101 | 101 | * @throws Exception |
| 102 | 102 | */ |
| 103 | 103 | public static function from(stdClass $obj): TopLevel { |
| 104 | + if (!property_exists($obj, 'map')) { | |
| 105 | + throw new Exception("Missing required property"); | |
| 106 | + } | |
| 104 | 107 | return new TopLevel( |
| 105 | 108 | TopLevel::fromMap($obj->{'map'}) |
| 106 | 109 | ); |
Test case
1 generated file · +3 −0test/inputs/schema/haskell-enum-forbidden.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'health')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromHealth($obj->{'health'}) |
| 90 | 93 | ); |
Test case
1 generated file · +3 −0test/inputs/schema/id-no-address.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -84,6 +84,9 @@ class TopLevel { | ||
| 84 | 84 | * @throws Exception |
| 85 | 85 | */ |
| 86 | 86 | public static function from(stdClass $obj): TopLevel { |
| 87 | + if (!property_exists($obj, 'item')) { | |
| 88 | + throw new Exception("Missing required property"); | |
| 89 | + } | |
| 87 | 90 | return new TopLevel( |
| 88 | 91 | TopLevel::fromItem($obj->{'item'}) |
| 89 | 92 | ); |
Test case
1 generated file · +3 −0test/inputs/schema/id-root.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -84,6 +84,9 @@ class TopLevel { | ||
| 84 | 84 | * @throws Exception |
| 85 | 85 | */ |
| 86 | 86 | public static function from(stdClass $obj): TopLevel { |
| 87 | + if (!property_exists($obj, 'bar')) { | |
| 88 | + throw new Exception("Missing required property"); | |
| 89 | + } | |
| 87 | 90 | return new TopLevel( |
| 88 | 91 | TopLevel::fromBar($obj->{'bar'}) |
| 89 | 92 | ); |
Test case
1 generated file · +9 −0test/inputs/schema/ie-suffix-singularization.schema
Mschema-phpdefault / TopLevel.php+9 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'cookies')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromCookies($obj->{'cookies'}) |
| 101 | 104 | ); |
| @@ -246,6 +249,12 @@ class Cookie { | ||
| 246 | 249 | * @throws Exception |
| 247 | 250 | */ |
| 248 | 251 | public static function from(stdClass $obj): Cookie { |
| 252 | + if (!property_exists($obj, 'name')) { | |
| 253 | + throw new Exception("Missing required property"); | |
| 254 | + } | |
| 255 | + if (!property_exists($obj, 'value')) { | |
| 256 | + throw new Exception("Missing required property"); | |
| 257 | + } | |
| 249 | 258 | return new Cookie( |
| 250 | 259 | Cookie::fromName($obj->{'name'}) |
| 251 | 260 | ,Cookie::fromValue($obj->{'value'}) |
Test case
1 generated file · +9 −0test/inputs/schema/implicit-all-of.schema
Mschema-phpdefault / TopLevel.php+9 −0
| @@ -188,6 +188,15 @@ class TopLevel { | ||
| 188 | 188 | * @throws Exception |
| 189 | 189 | */ |
| 190 | 190 | public static function from(stdClass $obj): TopLevel { |
| 191 | + if (!property_exists($obj, 'foo')) { | |
| 192 | + throw new Exception("Missing required property"); | |
| 193 | + } | |
| 194 | + if (!property_exists($obj, 'bar')) { | |
| 195 | + throw new Exception("Missing required property"); | |
| 196 | + } | |
| 197 | + if (!property_exists($obj, 'quux')) { | |
| 198 | + throw new Exception("Missing required property"); | |
| 199 | + } | |
| 191 | 200 | return new TopLevel( |
| 192 | 201 | TopLevel::fromFoo($obj->{'foo'}) |
| 193 | 202 | ,TopLevel::fromBar($obj->{'bar'}) |
Test case
1 generated file · +6 −0test/inputs/schema/implicit-class-array-union.schema
Mschema-phpdefault / TopLevel.php+6 −0
| @@ -154,6 +154,9 @@ class TopLevel { | ||
| 154 | 154 | * @throws Exception |
| 155 | 155 | */ |
| 156 | 156 | public static function from(stdClass $obj): TopLevel { |
| 157 | + if (!property_exists($obj, 'foo')) { | |
| 158 | + throw new Exception("Missing required property"); | |
| 159 | + } | |
| 157 | 160 | return new TopLevel( |
| 158 | 161 | TopLevel::fromFoo($obj->{'foo'}) |
| 159 | 162 | ); |
| @@ -252,6 +255,9 @@ class Foo { | ||
| 252 | 255 | * @throws Exception |
| 253 | 256 | */ |
| 254 | 257 | public static function from(stdClass $obj): Foo { |
| 258 | + if (!property_exists($obj, 'bar')) { | |
| 259 | + throw new Exception("Missing required property"); | |
| 260 | + } | |
| 255 | 261 | return new Foo( |
| 256 | 262 | Foo::fromBar($obj->{'bar'}) |
| 257 | 263 | ); |
Test case
1 generated file · +3 −0test/inputs/schema/implicit-one-of.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -208,6 +208,9 @@ class TopLevel { | ||
| 208 | 208 | * @throws Exception |
| 209 | 209 | */ |
| 210 | 210 | public static function from(stdClass $obj): TopLevel { |
| 211 | + if (!property_exists($obj, 'foo')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 211 | 214 | return new TopLevel( |
| 212 | 215 | TopLevel::fromFoo($obj->{'foo'}) |
| 213 | 216 | ,TopLevel::fromBar($obj->{'bar'}) |
Test case
1 generated file · +3 −0test/inputs/schema/integer-float-union.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -107,6 +107,9 @@ class TopLevel { | ||
| 107 | 107 | * @throws Exception |
| 108 | 108 | */ |
| 109 | 109 | public static function from(stdClass $obj): TopLevel { |
| 110 | + if (!property_exists($obj, 'number')) { | |
| 111 | + throw new Exception("Missing required property"); | |
| 112 | + } | |
| 110 | 113 | return new TopLevel( |
| 111 | 114 | TopLevel::fromNumber($obj->{'number'}) |
| 112 | 115 | ); |
Test case
1 generated file · +12 −0test/inputs/schema/integer-string.schema
Mschema-phpdefault / TopLevel.php+12 −0
| @@ -520,6 +520,18 @@ class TopLevel { | ||
| 520 | 520 | * @throws Exception |
| 521 | 521 | */ |
| 522 | 522 | public static function from(stdClass $obj): TopLevel { |
| 523 | + if (!property_exists($obj, 'nullable')) { | |
| 524 | + throw new Exception("Missing required property"); | |
| 525 | + } | |
| 526 | + if (!property_exists($obj, 'one')) { | |
| 527 | + throw new Exception("Missing required property"); | |
| 528 | + } | |
| 529 | + if (!property_exists($obj, 'unionWithInt')) { | |
| 530 | + throw new Exception("Missing required property"); | |
| 531 | + } | |
| 532 | + if (!property_exists($obj, 'unionWithIntAndEnum')) { | |
| 533 | + throw new Exception("Missing required property"); | |
| 534 | + } | |
| 523 | 535 | return new TopLevel( |
| 524 | 536 | TopLevel::fromArrNullable($obj->{'arrNullable'}) |
| 525 | 537 | ,TopLevel::fromArrOne($obj->{'arrOne'}) |
Test case
1 generated file · +27 −0test/inputs/schema/integer-type.schema
Mschema-phpdefault / TopLevel.php+27 −0
| @@ -514,6 +514,33 @@ class TopLevel { | ||
| 514 | 514 | * @throws Exception |
| 515 | 515 | */ |
| 516 | 516 | public static function from(stdClass $obj): TopLevel { |
| 517 | + if (!property_exists($obj, 'above_i32_max')) { | |
| 518 | + throw new Exception("Missing required property"); | |
| 519 | + } | |
| 520 | + if (!property_exists($obj, 'below_i32_min')) { | |
| 521 | + throw new Exception("Missing required property"); | |
| 522 | + } | |
| 523 | + if (!property_exists($obj, 'i32_range')) { | |
| 524 | + throw new Exception("Missing required property"); | |
| 525 | + } | |
| 526 | + if (!property_exists($obj, 'large_bounds')) { | |
| 527 | + throw new Exception("Missing required property"); | |
| 528 | + } | |
| 529 | + if (!property_exists($obj, 'only_maximum')) { | |
| 530 | + throw new Exception("Missing required property"); | |
| 531 | + } | |
| 532 | + if (!property_exists($obj, 'only_minimum')) { | |
| 533 | + throw new Exception("Missing required property"); | |
| 534 | + } | |
| 535 | + if (!property_exists($obj, 'small_negative')) { | |
| 536 | + throw new Exception("Missing required property"); | |
| 537 | + } | |
| 538 | + if (!property_exists($obj, 'small_positive')) { | |
| 539 | + throw new Exception("Missing required property"); | |
| 540 | + } | |
| 541 | + if (!property_exists($obj, 'unbounded')) { | |
| 542 | + throw new Exception("Missing required property"); | |
| 543 | + } | |
| 517 | 544 | return new TopLevel( |
| 518 | 545 | TopLevel::fromAboveI32Max($obj->{'above_i32_max'}) |
| 519 | 546 | ,TopLevel::fromBelowI32Min($obj->{'below_i32_min'}) |
Test case
1 generated file · +3 −0test/inputs/schema/intersection.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -255,6 +255,9 @@ class Intersection { | ||
| 255 | 255 | * @throws Exception |
| 256 | 256 | */ |
| 257 | 257 | public static function from(stdClass $obj): Intersection { |
| 258 | + if (!property_exists($obj, 'foo')) { | |
| 259 | + throw new Exception("Missing required property"); | |
| 260 | + } | |
| 258 | 261 | return new Intersection( |
| 259 | 262 | Intersection::fromFoo($obj->{'foo'}) |
| 260 | 263 | ,Intersection::fromBar($obj->{'bar'}) |
Test case
1 generated file · +12 −0test/inputs/schema/light.schema
Mschema-phpdefault / TopLevel.php+12 −0
| @@ -85,6 +85,9 @@ class TopLevel { | ||
| 85 | 85 | * @throws Exception |
| 86 | 86 | */ |
| 87 | 87 | public static function from(stdClass $obj): TopLevel { |
| 88 | + if (!property_exists($obj, 'LightParams')) { | |
| 89 | + throw new Exception("Missing required property"); | |
| 90 | + } | |
| 88 | 91 | return new TopLevel( |
| 89 | 92 | TopLevel::fromLightParams($obj->{'LightParams'}) |
| 90 | 93 | ); |
| @@ -287,6 +290,15 @@ class LightParams { | ||
| 287 | 290 | * @throws Exception |
| 288 | 291 | */ |
| 289 | 292 | public static function from(stdClass $obj): LightParams { |
| 293 | + if (!property_exists($obj, 'app_id')) { | |
| 294 | + throw new Exception("Missing required property"); | |
| 295 | + } | |
| 296 | + if (!property_exists($obj, 'outlet_id')) { | |
| 297 | + throw new Exception("Missing required property"); | |
| 298 | + } | |
| 299 | + if (!property_exists($obj, 'rgba')) { | |
| 300 | + throw new Exception("Missing required property"); | |
| 301 | + } | |
| 290 | 302 | return new LightParams( |
| 291 | 303 | LightParams::fromAppID($obj->{'app_id'}) |
| 292 | 304 | ,LightParams::fromOutletID($obj->{'outlet_id'}) |
Test case
1 generated file · +15 −0test/inputs/schema/min-max-items.schema
Mschema-phpdefault / TopLevel.php+15 −0
| @@ -387,6 +387,21 @@ class TopLevel { | ||
| 387 | 387 | * @throws Exception |
| 388 | 388 | */ |
| 389 | 389 | public static function from(stdClass $obj): TopLevel { |
| 390 | + if (!property_exists($obj, 'maxOnly')) { | |
| 391 | + throw new Exception("Missing required property"); | |
| 392 | + } | |
| 393 | + if (!property_exists($obj, 'minAndMax')) { | |
| 394 | + throw new Exception("Missing required property"); | |
| 395 | + } | |
| 396 | + if (!property_exists($obj, 'minOnly')) { | |
| 397 | + throw new Exception("Missing required property"); | |
| 398 | + } | |
| 399 | + if (!property_exists($obj, 'plain')) { | |
| 400 | + throw new Exception("Missing required property"); | |
| 401 | + } | |
| 402 | + if (!property_exists($obj, 'unionItems')) { | |
| 403 | + throw new Exception("Missing required property"); | |
| 404 | + } | |
| 390 | 405 | return new TopLevel( |
| 391 | 406 | TopLevel::fromMaxOnly($obj->{'maxOnly'}) |
| 392 | 407 | ,TopLevel::fromMinAndMax($obj->{'minAndMax'}) |
Test case
1 generated file · +24 −0test/inputs/schema/minmax-integer.schema
Mschema-phpdefault / TopLevel.php+24 −0
| @@ -458,6 +458,30 @@ class TopLevel { | ||
| 458 | 458 | * @throws Exception |
| 459 | 459 | */ |
| 460 | 460 | public static function from(stdClass $obj): TopLevel { |
| 461 | + if (!property_exists($obj, 'free')) { | |
| 462 | + throw new Exception("Missing required property"); | |
| 463 | + } | |
| 464 | + if (!property_exists($obj, 'intersection')) { | |
| 465 | + throw new Exception("Missing required property"); | |
| 466 | + } | |
| 467 | + if (!property_exists($obj, 'max')) { | |
| 468 | + throw new Exception("Missing required property"); | |
| 469 | + } | |
| 470 | + if (!property_exists($obj, 'min')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 473 | + if (!property_exists($obj, 'minmax')) { | |
| 474 | + throw new Exception("Missing required property"); | |
| 475 | + } | |
| 476 | + if (!property_exists($obj, 'minMaxIntersection')) { | |
| 477 | + throw new Exception("Missing required property"); | |
| 478 | + } | |
| 479 | + if (!property_exists($obj, 'minMaxUnion')) { | |
| 480 | + throw new Exception("Missing required property"); | |
| 481 | + } | |
| 482 | + if (!property_exists($obj, 'union')) { | |
| 483 | + throw new Exception("Missing required property"); | |
| 484 | + } | |
| 461 | 485 | return new TopLevel( |
| 462 | 486 | TopLevel::fromFree($obj->{'free'}) |
| 463 | 487 | ,TopLevel::fromIntersection($obj->{'intersection'}) |
Test case
1 generated file · +24 −0test/inputs/schema/minmax.schema
Mschema-phpdefault / TopLevel.php+24 −0
| @@ -458,6 +458,30 @@ class TopLevel { | ||
| 458 | 458 | * @throws Exception |
| 459 | 459 | */ |
| 460 | 460 | public static function from(stdClass $obj): TopLevel { |
| 461 | + if (!property_exists($obj, 'free')) { | |
| 462 | + throw new Exception("Missing required property"); | |
| 463 | + } | |
| 464 | + if (!property_exists($obj, 'intersection')) { | |
| 465 | + throw new Exception("Missing required property"); | |
| 466 | + } | |
| 467 | + if (!property_exists($obj, 'max')) { | |
| 468 | + throw new Exception("Missing required property"); | |
| 469 | + } | |
| 470 | + if (!property_exists($obj, 'min')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 473 | + if (!property_exists($obj, 'minmax')) { | |
| 474 | + throw new Exception("Missing required property"); | |
| 475 | + } | |
| 476 | + if (!property_exists($obj, 'minMaxIntersection')) { | |
| 477 | + throw new Exception("Missing required property"); | |
| 478 | + } | |
| 479 | + if (!property_exists($obj, 'minMaxUnion')) { | |
| 480 | + throw new Exception("Missing required property"); | |
| 481 | + } | |
| 482 | + if (!property_exists($obj, 'union')) { | |
| 483 | + throw new Exception("Missing required property"); | |
| 484 | + } | |
| 461 | 485 | return new TopLevel( |
| 462 | 486 | TopLevel::fromFree($obj->{'free'}) |
| 463 | 487 | ,TopLevel::fromIntersection($obj->{'intersection'}) |
Test case
1 generated file · +24 −0test/inputs/schema/minmaxlength.schema
Mschema-phpdefault / TopLevel.php+24 −0
| @@ -507,6 +507,30 @@ class TopLevel { | ||
| 507 | 507 | * @throws Exception |
| 508 | 508 | */ |
| 509 | 509 | public static function from(stdClass $obj): TopLevel { |
| 510 | + if (!property_exists($obj, 'intersection')) { | |
| 511 | + throw new Exception("Missing required property"); | |
| 512 | + } | |
| 513 | + if (!property_exists($obj, 'inUnion')) { | |
| 514 | + throw new Exception("Missing required property"); | |
| 515 | + } | |
| 516 | + if (!property_exists($obj, 'maxlength')) { | |
| 517 | + throw new Exception("Missing required property"); | |
| 518 | + } | |
| 519 | + if (!property_exists($obj, 'minlength')) { | |
| 520 | + throw new Exception("Missing required property"); | |
| 521 | + } | |
| 522 | + if (!property_exists($obj, 'minMaxIntersection')) { | |
| 523 | + throw new Exception("Missing required property"); | |
| 524 | + } | |
| 525 | + if (!property_exists($obj, 'minmaxlength')) { | |
| 526 | + throw new Exception("Missing required property"); | |
| 527 | + } | |
| 528 | + if (!property_exists($obj, 'minMaxUnion')) { | |
| 529 | + throw new Exception("Missing required property"); | |
| 530 | + } | |
| 531 | + if (!property_exists($obj, 'union')) { | |
| 532 | + throw new Exception("Missing required property"); | |
| 533 | + } | |
| 510 | 534 | return new TopLevel( |
| 511 | 535 | TopLevel::fromIntersection($obj->{'intersection'}) |
| 512 | 536 | ,TopLevel::fromInUnion($obj->{'inUnion'}) |
Test case
1 generated file · +3 −0test/inputs/schema/multi-type-enum.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -121,6 +121,9 @@ class TopLevel { | ||
| 121 | 121 | * @throws Exception |
| 122 | 122 | */ |
| 123 | 123 | public static function from(stdClass $obj): TopLevel { |
| 124 | + if (!property_exists($obj, 'foo')) { | |
| 125 | + throw new Exception("Missing required property"); | |
| 126 | + } | |
| 124 | 127 | return new TopLevel( |
| 125 | 128 | TopLevel::fromFoo($obj->{'foo'}) |
| 126 | 129 | ); |
Test case
1 generated file · +3 −0test/inputs/schema/mutually-recursive.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -112,6 +112,9 @@ class Bar { | ||
| 112 | 112 | * @throws Exception |
| 113 | 113 | */ |
| 114 | 114 | public static function from(stdClass $obj): Bar { |
| 115 | + if (!property_exists($obj, 'foo')) { | |
| 116 | + throw new Exception("Missing required property"); | |
| 117 | + } | |
| 115 | 118 | return new Bar( |
| 116 | 119 | Bar::fromFoo($obj->{'foo'}) |
| 117 | 120 | ); |
Test case
1 generated file · +3 −0test/inputs/schema/nested-intersection-union.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -96,6 +96,9 @@ class TopLevel { | ||
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
| 98 | 98 | public static function from(stdClass $obj): TopLevel { |
| 99 | + if (!property_exists($obj, 'input')) { | |
| 100 | + throw new Exception("Missing required property"); | |
| 101 | + } | |
| 99 | 102 | return new TopLevel( |
| 100 | 103 | TopLevel::fromInput($obj->{'input'}) |
| 101 | 104 | ); |
Test case
1 generated file · +9 −0test/inputs/schema/non-standard-ref.schema
Mschema-phpdefault / TopLevel.php+9 −0
| @@ -188,6 +188,15 @@ class TopLevel { | ||
| 188 | 188 | * @throws Exception |
| 189 | 189 | */ |
| 190 | 190 | public static function from(stdClass $obj): TopLevel { |
| 191 | + if (!property_exists($obj, 'bar')) { | |
| 192 | + throw new Exception("Missing required property"); | |
| 193 | + } | |
| 194 | + if (!property_exists($obj, 'foo')) { | |
| 195 | + throw new Exception("Missing required property"); | |
| 196 | + } | |
| 197 | + if (!property_exists($obj, 'quux')) { | |
| 198 | + throw new Exception("Missing required property"); | |
| 199 | + } | |
| 191 | 200 | return new TopLevel( |
| 192 | 201 | TopLevel::fromBar($obj->{'bar'}) |
| 193 | 202 | ,TopLevel::fromFoo($obj->{'foo'}) |
Test case
1 generated file · +3 −0test/inputs/schema/nullable-optional-one-of.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -147,6 +147,9 @@ class TopLevel { | ||
| 147 | 147 | * @throws Exception |
| 148 | 148 | */ |
| 149 | 149 | public static function from(stdClass $obj): TopLevel { |
| 150 | + if (!property_exists($obj, 'kind')) { | |
| 151 | + throw new Exception("Missing required property"); | |
| 152 | + } | |
| 150 | 153 | return new TopLevel( |
| 151 | 154 | TopLevel::fromB($obj->{'b'}) |
| 152 | 155 | ,TopLevel::fromKind($obj->{'kind'}) |
Test case
1 generated file · +3 −0test/inputs/schema/object-type-required.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -146,6 +146,9 @@ class TopLevel { | ||
| 146 | 146 | * @throws Exception |
| 147 | 147 | */ |
| 148 | 148 | public static function from(stdClass $obj): TopLevel { |
| 149 | + if (!property_exists($obj, 'foo')) { | |
| 150 | + throw new Exception("Missing required property"); | |
| 151 | + } | |
| 149 | 152 | return new TopLevel( |
| 150 | 153 | TopLevel::fromFoo($obj->{'foo'}) |
| 151 | 154 | ,TopLevel::fromBar($obj->{'bar'}) |
Test case
1 generated file · +3 −0test/inputs/schema/optional-any.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -136,6 +136,9 @@ class TopLevel { | ||
| 136 | 136 | * @throws Exception |
| 137 | 137 | */ |
| 138 | 138 | public static function from(stdClass $obj): TopLevel { |
| 139 | + if (!property_exists($obj, 'bar')) { | |
| 140 | + throw new Exception("Missing required property"); | |
| 141 | + } | |
| 139 | 142 | return new TopLevel( |
| 140 | 143 | TopLevel::fromBar($obj->{'bar'}) |
| 141 | 144 | ,TopLevel::fromFoo($obj->{'foo'}) |
Test case
1 generated file · +15 −0test/inputs/schema/optional-const-ref.schema
Mschema-phpdefault / TopLevel.php+15 −0
| @@ -478,6 +478,15 @@ class TopLevel { | ||
| 478 | 478 | * @throws Exception |
| 479 | 479 | */ |
| 480 | 480 | public static function from(stdClass $obj): TopLevel { |
| 481 | + if (!property_exists($obj, 'requiredCoordinates')) { | |
| 482 | + throw new Exception("Missing required property"); | |
| 483 | + } | |
| 484 | + if (!property_exists($obj, 'requiredCount')) { | |
| 485 | + throw new Exception("Missing required property"); | |
| 486 | + } | |
| 487 | + if (!property_exists($obj, 'requiredLabel')) { | |
| 488 | + throw new Exception("Missing required property"); | |
| 489 | + } | |
| 481 | 490 | return new TopLevel( |
| 482 | 491 | TopLevel::fromCoordinates($obj->{'coordinates'}) |
| 483 | 492 | ,TopLevel::fromCount($obj->{'count'}) |
| @@ -640,6 +649,12 @@ class Coordinate { | ||
| 640 | 649 | * @throws Exception |
| 641 | 650 | */ |
| 642 | 651 | public static function from(stdClass $obj): Coordinate { |
| 652 | + if (!property_exists($obj, 'latitude')) { | |
| 653 | + throw new Exception("Missing required property"); | |
| 654 | + } | |
| 655 | + if (!property_exists($obj, 'longitude')) { | |
| 656 | + throw new Exception("Missing required property"); | |
| 657 | + } | |
| 643 | 658 | return new Coordinate( |
| 644 | 659 | Coordinate::fromLatitude($obj->{'latitude'}) |
| 645 | 660 | ,Coordinate::fromLongitude($obj->{'longitude'}) |
Test case
1 generated file · +3 −0test/inputs/schema/optional-constraints.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -347,6 +347,9 @@ class TopLevel { | ||
| 347 | 347 | * @throws Exception |
| 348 | 348 | */ |
| 349 | 349 | public static function from(stdClass $obj): TopLevel { |
| 350 | + if (!property_exists($obj, 'reqZeroMin')) { | |
| 351 | + throw new Exception("Missing required property"); | |
| 352 | + } | |
| 350 | 353 | return new TopLevel( |
| 351 | 354 | TopLevel::fromOptDouble($obj->{'optDouble'}) |
| 352 | 355 | ,TopLevel::fromOptInt($obj->{'optInt'}) |
Test case
1 generated file · +9 −0test/inputs/schema/optional-date-time.schema
Mschema-phpdefault / TopLevel.php+9 −0
| @@ -388,6 +388,15 @@ class TopLevel { | ||
| 388 | 388 | * @throws Exception |
| 389 | 389 | */ |
| 390 | 390 | public static function from(stdClass $obj): TopLevel { |
| 391 | + if (!property_exists($obj, 'required-date')) { | |
| 392 | + throw new Exception("Missing required property"); | |
| 393 | + } | |
| 394 | + if (!property_exists($obj, 'required-date-time')) { | |
| 395 | + throw new Exception("Missing required property"); | |
| 396 | + } | |
| 397 | + if (!property_exists($obj, 'required-time')) { | |
| 398 | + throw new Exception("Missing required property"); | |
| 399 | + } | |
| 391 | 400 | return new TopLevel( |
| 392 | 401 | TopLevel::fromOptionalDate($obj->{'optional-date'}) |
| 393 | 402 | ,TopLevel::fromOptionalDateTime($obj->{'optional-date-time'}) |
Test case
1 generated file · +3 −0test/inputs/schema/optional-enum.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -147,6 +147,9 @@ class TopLevel { | ||
| 147 | 147 | * @throws Exception |
| 148 | 148 | */ |
| 149 | 149 | public static function from(stdClass $obj): TopLevel { |
| 150 | + if (!property_exists($obj, 'name')) { | |
| 151 | + throw new Exception("Missing required property"); | |
| 152 | + } | |
| 150 | 153 | return new TopLevel( |
| 151 | 154 | TopLevel::fromName($obj->{'name'}) |
| 152 | 155 | ,TopLevel::fromShortcut($obj->{'shortcut'}) |
Test case
1 generated file · +9 −0test/inputs/schema/pattern.schema
Mschema-phpdefault / TopLevel.php+9 −0
| @@ -197,6 +197,15 @@ class TopLevel { | ||
| 197 | 197 | * @throws Exception |
| 198 | 198 | */ |
| 199 | 199 | public static function from(stdClass $obj): TopLevel { |
| 200 | + if (!property_exists($obj, 'pattern1')) { | |
| 201 | + throw new Exception("Missing required property"); | |
| 202 | + } | |
| 203 | + if (!property_exists($obj, 'pattern2')) { | |
| 204 | + throw new Exception("Missing required property"); | |
| 205 | + } | |
| 206 | + if (!property_exists($obj, 'union')) { | |
| 207 | + throw new Exception("Missing required property"); | |
| 208 | + } | |
| 200 | 209 | return new TopLevel( |
| 201 | 210 | TopLevel::fromPattern1($obj->{'pattern1'}) |
| 202 | 211 | ,TopLevel::fromPattern2($obj->{'pattern2'}) |
Test case
1 generated file · +6 −0test/inputs/schema/prefix-items.schema
Mschema-phpdefault / TopLevel.php+6 −0
| @@ -204,6 +204,12 @@ class TopLevel { | ||
| 204 | 204 | * @throws Exception |
| 205 | 205 | */ |
| 206 | 206 | public static function from(stdClass $obj): TopLevel { |
| 207 | + if (!property_exists($obj, 'open')) { | |
| 208 | + throw new Exception("Missing required property"); | |
| 209 | + } | |
| 210 | + if (!property_exists($obj, 'tuple')) { | |
| 211 | + throw new Exception("Missing required property"); | |
| 212 | + } | |
| 207 | 213 | return new TopLevel( |
| 208 | 214 | TopLevel::fromOpen($obj->{'open'}) |
| 209 | 215 | ,TopLevel::fromTuple($obj->{'tuple'}) |
Test case
1 generated file · +3 −0test/inputs/schema/ref-id-files.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -84,6 +84,9 @@ class TopLevel { | ||
| 84 | 84 | * @throws Exception |
| 85 | 85 | */ |
| 86 | 86 | public static function from(stdClass $obj): TopLevel { |
| 87 | + if (!property_exists($obj, 'foo')) { | |
| 88 | + throw new Exception("Missing required property"); | |
| 89 | + } | |
| 87 | 90 | return new TopLevel( |
| 88 | 91 | TopLevel::fromFoo($obj->{'foo'}) |
| 89 | 92 | ); |
Test case
1 generated file · +3 −0test/inputs/schema/required-draft3.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -84,6 +84,9 @@ class TopLevel { | ||
| 84 | 84 | * @throws Exception |
| 85 | 85 | */ |
| 86 | 86 | public static function from(stdClass $obj): TopLevel { |
| 87 | + if (!property_exists($obj, 'longitude')) { | |
| 88 | + throw new Exception("Missing required property"); | |
| 89 | + } | |
| 87 | 90 | return new TopLevel( |
| 88 | 91 | TopLevel::fromLongitude($obj->{'longitude'}) |
| 89 | 92 | ); |
Test case
1 generated file · +6 −0test/inputs/schema/required-non-properties.schema
Mschema-phpdefault / TopLevel.php+6 −0
| @@ -136,6 +136,12 @@ class TopLevel { | ||
| 136 | 136 | * @throws Exception |
| 137 | 137 | */ |
| 138 | 138 | public static function from(stdClass $obj): TopLevel { |
| 139 | + if (!property_exists($obj, 'foo')) { | |
| 140 | + throw new Exception("Missing required property"); | |
| 141 | + } | |
| 142 | + if (!property_exists($obj, 'bar')) { | |
| 143 | + throw new Exception("Missing required property"); | |
| 144 | + } | |
| 139 | 145 | return new TopLevel( |
| 140 | 146 | TopLevel::fromFoo($obj->{'foo'}) |
| 141 | 147 | ,TopLevel::fromBar($obj->{'bar'}) |
Test case
1 generated file · +3 −0test/inputs/schema/required.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -84,6 +84,9 @@ class TopLevel { | ||
| 84 | 84 | * @throws Exception |
| 85 | 85 | */ |
| 86 | 86 | public static function from(stdClass $obj): TopLevel { |
| 87 | + if (!property_exists($obj, 'longitude')) { | |
| 88 | + throw new Exception("Missing required property"); | |
| 89 | + } | |
| 87 | 90 | return new TopLevel( |
| 88 | 91 | TopLevel::fromLongitude($obj->{'longitude'}) |
| 89 | 92 | ); |
Test case
1 generated file · +6 −0test/inputs/schema/rust-cycle-breaker-union.schema
Mschema-phpdefault / TopLevel.php+6 −0
| @@ -165,6 +165,9 @@ class TopLevel { | ||
| 165 | 165 | * @throws Exception |
| 166 | 166 | */ |
| 167 | 167 | public static function from(stdClass $obj): TopLevel { |
| 168 | + if (!property_exists($obj, 'value')) { | |
| 169 | + throw new Exception("Missing required property"); | |
| 170 | + } | |
| 168 | 171 | return new TopLevel( |
| 169 | 172 | TopLevel::fromNext($obj->{'next'}) |
| 170 | 173 | ,TopLevel::fromValue($obj->{'value'}) |
| @@ -346,6 +349,9 @@ class Node { | ||
| 346 | 349 | * @throws Exception |
| 347 | 350 | */ |
| 348 | 351 | public static function from(stdClass $obj): Node { |
| 352 | + if (!property_exists($obj, 'value')) { | |
| 353 | + throw new Exception("Missing required property"); | |
| 354 | + } | |
| 349 | 355 | return new Node( |
| 350 | 356 | Node::fromNext($obj->{'next'}) |
| 351 | 357 | ,Node::fromValue($obj->{'value'}) |
Test case
1 generated file · +6 −0test/inputs/schema/schema-constraints.schema
Mschema-phpdefault / TopLevel.php+6 −0
| @@ -144,6 +144,12 @@ class TopLevel { | ||
| 144 | 144 | * @throws Exception |
| 145 | 145 | */ |
| 146 | 146 | public static function from(stdClass $obj): TopLevel { |
| 147 | + if (!property_exists($obj, 'minMaxLength')) { | |
| 148 | + throw new Exception("Missing required property"); | |
| 149 | + } | |
| 150 | + if (!property_exists($obj, 'percent')) { | |
| 151 | + throw new Exception("Missing required property"); | |
| 152 | + } | |
| 147 | 153 | return new TopLevel( |
| 148 | 154 | TopLevel::fromMinMaxLength($obj->{'minMaxLength'}) |
| 149 | 155 | ,TopLevel::fromPercent($obj->{'percent'}) |
Test case
1 generated file · +3 −0test/inputs/schema/strict-optional.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -94,6 +94,9 @@ class TopLevel { | ||
| 94 | 94 | * @throws Exception |
| 95 | 95 | */ |
| 96 | 96 | public static function from(stdClass $obj): TopLevel { |
| 97 | + if (!property_exists($obj, 'foo')) { | |
| 98 | + throw new Exception("Missing required property"); | |
| 99 | + } | |
| 97 | 100 | return new TopLevel( |
| 98 | 101 | TopLevel::fromFoo($obj->{'foo'}) |
| 99 | 102 | ); |
Test case
1 generated file · +6 −0test/inputs/schema/top-level-array.schema
Mschema-phpdefault / TopLevel.php+6 −0
| @@ -136,6 +136,12 @@ class TopLevel { | ||
| 136 | 136 | * @throws Exception |
| 137 | 137 | */ |
| 138 | 138 | public static function from(stdClass $obj): TopLevel { |
| 139 | + if (!property_exists($obj, 'label')) { | |
| 140 | + throw new Exception("Missing required property"); | |
| 141 | + } | |
| 142 | + if (!property_exists($obj, 'score')) { | |
| 143 | + throw new Exception("Missing required property"); | |
| 144 | + } | |
| 139 | 145 | return new TopLevel( |
| 140 | 146 | TopLevel::fromLabel($obj->{'label'}) |
| 141 | 147 | ,TopLevel::fromScore($obj->{'score'}) |
Test case
1 generated file · +3 −0test/inputs/schema/tuple.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -118,6 +118,9 @@ class TopLevel { | ||
| 118 | 118 | * @throws Exception |
| 119 | 119 | */ |
| 120 | 120 | public static function from(stdClass $obj): TopLevel { |
| 121 | + if (!property_exists($obj, 'tuple')) { | |
| 122 | + throw new Exception("Missing required property"); | |
| 123 | + } | |
| 121 | 124 | return new TopLevel( |
| 122 | 125 | TopLevel::fromTuple($obj->{'tuple'}) |
| 123 | 126 | ); |
Test case
1 generated file · +6 −0test/inputs/schema/unevaluated-properties.schema
Mschema-phpdefault / TopLevel.php+6 −0
| @@ -609,6 +609,12 @@ class Item { | ||
| 609 | 609 | * @throws Exception |
| 610 | 610 | */ |
| 611 | 611 | public static function from(stdClass $obj): Item { |
| 612 | + if (!property_exists($obj, 'key')) { | |
| 613 | + throw new Exception("Missing required property"); | |
| 614 | + } | |
| 615 | + if (!property_exists($obj, 'value')) { | |
| 616 | + throw new Exception("Missing required property"); | |
| 617 | + } | |
| 612 | 618 | return new Item( |
| 613 | 619 | Item::fromKey($obj->{'key'}) |
| 614 | 620 | ,Item::fromValue($obj->{'value'}) |
Test case
1 generated file · +3 −0test/inputs/schema/union-int-double.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -115,6 +115,9 @@ class TopLevel { | ||
| 115 | 115 | * @throws Exception |
| 116 | 116 | */ |
| 117 | 117 | public static function from(stdClass $obj): TopLevel { |
| 118 | + if (!property_exists($obj, 'value')) { | |
| 119 | + throw new Exception("Missing required property"); | |
| 120 | + } | |
| 118 | 121 | return new TopLevel( |
| 119 | 122 | TopLevel::fromValue($obj->{'value'}) |
| 120 | 123 | ); |
Test case
1 generated file · +6 −0test/inputs/schema/union-list.schema
Mschema-phpdefault / TopLevel.php+6 −0
| @@ -105,6 +105,9 @@ class TopLevel { | ||
| 105 | 105 | * @throws Exception |
| 106 | 106 | */ |
| 107 | 107 | public static function from(stdClass $obj): TopLevel { |
| 108 | + if (!property_exists($obj, 'list')) { | |
| 109 | + throw new Exception("Missing required property"); | |
| 110 | + } | |
| 108 | 111 | return new TopLevel( |
| 109 | 112 | TopLevel::fromList($obj->{'list'}) |
| 110 | 113 | ); |
| @@ -224,6 +227,9 @@ class UnionList { | ||
| 224 | 227 | * @throws Exception |
| 225 | 228 | */ |
| 226 | 229 | public static function from(stdClass $obj): UnionList { |
| 230 | + if (!property_exists($obj, 'next')) { | |
| 231 | + throw new Exception("Missing required property"); | |
| 232 | + } | |
| 227 | 233 | return new UnionList( |
| 228 | 234 | UnionList::fromNext($obj->{'next'}) |
| 229 | 235 | ); |
Test case
1 generated file · +3 −0test/inputs/schema/union.schema
Mschema-phpdefault / TopLevel.php+3 −0
| @@ -208,6 +208,9 @@ class TopLevel { | ||
| 208 | 208 | * @throws Exception |
| 209 | 209 | */ |
| 210 | 210 | public static function from(stdClass $obj): TopLevel { |
| 211 | + if (!property_exists($obj, 'two')) { | |
| 212 | + throw new Exception("Missing required property"); | |
| 213 | + } | |
| 211 | 214 | return new TopLevel( |
| 212 | 215 | TopLevel::fromOne($obj->{'one'}) |
| 213 | 216 | ,TopLevel::fromTwo($obj->{'two'}) |
Test case
1 generated file · +9 −0test/inputs/schema/uuid.schema
Mschema-phpdefault / TopLevel.php+9 −0
| @@ -461,6 +461,15 @@ class TopLevel { | ||
| 461 | 461 | * @throws Exception |
| 462 | 462 | */ |
| 463 | 463 | public static function from(stdClass $obj): TopLevel { |
| 464 | + if (!property_exists($obj, 'nullable')) { | |
| 465 | + throw new Exception("Missing required property"); | |
| 466 | + } | |
| 467 | + if (!property_exists($obj, 'one')) { | |
| 468 | + throw new Exception("Missing required property"); | |
| 469 | + } | |
| 470 | + if (!property_exists($obj, 'unionWithEnum')) { | |
| 471 | + throw new Exception("Missing required property"); | |
| 472 | + } | |
| 464 | 473 | return new TopLevel( |
| 465 | 474 | TopLevel::fromArrNullable($obj->{'arrNullable'}) |
| 466 | 475 | ,TopLevel::fromArrOne($obj->{'arrOne'}) |
Test case
1 generated file · +60 −0test/inputs/schema/vega-lite.schema
Mschema-phpdefault / TopLevel.php+60 −0
| @@ -29035,6 +29035,9 @@ class VGBinding { | ||
| 29035 | 29035 | * @throws Exception |
| 29036 | 29036 | */ |
| 29037 | 29037 | public static function from(stdClass $obj): VGBinding { |
| 29038 | + if (!property_exists($obj, 'input')) { | |
| 29039 | + throw new Exception("Missing required property"); | |
| 29040 | + } | |
| 29038 | 29041 | return new VGBinding( |
| 29039 | 29042 | VGBinding::fromElement($obj->{'element'}) |
| 29040 | 29043 | ,VGBinding::fromInput($obj->{'input'}) |
| @@ -43789,6 +43792,9 @@ class ConditionalValueDef { | ||
| 43789 | 43792 | * @throws Exception |
| 43790 | 43793 | */ |
| 43791 | 43794 | public static function from(stdClass $obj): ConditionalValueDef { |
| 43795 | + if (!property_exists($obj, 'value')) { | |
| 43796 | + throw new Exception("Missing required property"); | |
| 43797 | + } | |
| 43792 | 43798 | return new ConditionalValueDef( |
| 43793 | 43799 | ConditionalValueDef::fromTest($obj->{'test'}) |
| 43794 | 43800 | ,ConditionalValueDef::fromValue($obj->{'value'}) |
| @@ -47410,6 +47416,9 @@ class RepeatRef { | ||
| 47410 | 47416 | * @throws Exception |
| 47411 | 47417 | */ |
| 47412 | 47418 | public static function from(stdClass $obj): RepeatRef { |
| 47419 | + if (!property_exists($obj, 'repeat')) { | |
| 47420 | + throw new Exception("Missing required property"); | |
| 47421 | + } | |
| 47413 | 47422 | return new RepeatRef( |
| 47414 | 47423 | RepeatRef::fromRepeat($obj->{'repeat'}) |
| 47415 | 47424 | ); |
| @@ -50814,6 +50823,9 @@ class SelectionDomain { | ||
| 50814 | 50823 | * @throws Exception |
| 50815 | 50824 | */ |
| 50816 | 50825 | public static function from(stdClass $obj): SelectionDomain { |
| 50826 | + if (!property_exists($obj, 'selection')) { | |
| 50827 | + throw new Exception("Missing required property"); | |
| 50828 | + } | |
| 50817 | 50829 | return new SelectionDomain( |
| 50818 | 50830 | SelectionDomain::fromField($obj->{'field'}) |
| 50819 | 50831 | ,SelectionDomain::fromSelection($obj->{'selection'}) |
| @@ -51024,6 +51036,9 @@ class InterpolateParams { | ||
| 51024 | 51036 | * @throws Exception |
| 51025 | 51037 | */ |
| 51026 | 51038 | public static function from(stdClass $obj): InterpolateParams { |
| 51039 | + if (!property_exists($obj, 'type')) { | |
| 51040 | + throw new Exception("Missing required property"); | |
| 51041 | + } | |
| 51027 | 51042 | return new InterpolateParams( |
| 51028 | 51043 | InterpolateParams::fromGamma($obj->{'gamma'}) |
| 51029 | 51044 | ,InterpolateParams::fromType($obj->{'type'}) |
| @@ -51229,6 +51244,12 @@ class Nice { | ||
| 51229 | 51244 | * @throws Exception |
| 51230 | 51245 | */ |
| 51231 | 51246 | public static function from(stdClass $obj): Nice { |
| 51247 | + if (!property_exists($obj, 'interval')) { | |
| 51248 | + throw new Exception("Missing required property"); | |
| 51249 | + } | |
| 51250 | + if (!property_exists($obj, 'step')) { | |
| 51251 | + throw new Exception("Missing required property"); | |
| 51252 | + } | |
| 51232 | 51253 | return new Nice( |
| 51233 | 51254 | Nice::fromInterval($obj->{'interval'}) |
| 51234 | 51255 | ,Nice::fromStep($obj->{'step'}) |
| @@ -51519,6 +51540,9 @@ class SchemeParams { | ||
| 51519 | 51540 | * @throws Exception |
| 51520 | 51541 | */ |
| 51521 | 51542 | public static function from(stdClass $obj): SchemeParams { |
| 51543 | + if (!property_exists($obj, 'name')) { | |
| 51544 | + throw new Exception("Missing required property"); | |
| 51545 | + } | |
| 51522 | 51546 | return new SchemeParams( |
| 51523 | 51547 | SchemeParams::fromExtent($obj->{'extent'}) |
| 51524 | 51548 | ,SchemeParams::fromName($obj->{'name'}) |
| @@ -51951,6 +51975,9 @@ class SortField { | ||
| 51951 | 51975 | * @throws Exception |
| 51952 | 51976 | */ |
| 51953 | 51977 | public static function from(stdClass $obj): SortField { |
| 51978 | + if (!property_exists($obj, 'op')) { | |
| 51979 | + throw new Exception("Missing required property"); | |
| 51980 | + } | |
| 51954 | 51981 | return new SortField( |
| 51955 | 51982 | SortField::fromField($obj->{'field'}) |
| 51956 | 51983 | ,SortField::fromOp($obj->{'op'}) |
| @@ -52780,6 +52807,9 @@ class FacetFieldDef { | ||
| 52780 | 52807 | * @throws Exception |
| 52781 | 52808 | */ |
| 52782 | 52809 | public static function from(stdClass $obj): FacetFieldDef { |
| 52810 | + if (!property_exists($obj, 'type')) { | |
| 52811 | + throw new Exception("Missing required property"); | |
| 52812 | + } | |
| 52783 | 52813 | return new FacetFieldDef( |
| 52784 | 52814 | FacetFieldDef::fromAggregate($obj->{'aggregate'}) |
| 52785 | 52815 | ,FacetFieldDef::fromBin($obj->{'bin'}) |
| @@ -53712,6 +53742,9 @@ class FieldDef { | ||
| 53712 | 53742 | * @throws Exception |
| 53713 | 53743 | */ |
| 53714 | 53744 | public static function from(stdClass $obj): FieldDef { |
| 53745 | + if (!property_exists($obj, 'type')) { | |
| 53746 | + throw new Exception("Missing required property"); | |
| 53747 | + } | |
| 53715 | 53748 | return new FieldDef( |
| 53716 | 53749 | FieldDef::fromAggregate($obj->{'aggregate'}) |
| 53717 | 53750 | ,FieldDef::fromBin($obj->{'bin'}) |
| @@ -55992,6 +56025,9 @@ class OrderFieldDef { | ||
| 55992 | 56025 | * @throws Exception |
| 55993 | 56026 | */ |
| 55994 | 56027 | public static function from(stdClass $obj): OrderFieldDef { |
| 56028 | + if (!property_exists($obj, 'type')) { | |
| 56029 | + throw new Exception("Missing required property"); | |
| 56030 | + } | |
| 55995 | 56031 | return new OrderFieldDef( |
| 55996 | 56032 | OrderFieldDef::fromAggregate($obj->{'aggregate'}) |
| 55997 | 56033 | ,OrderFieldDef::fromBin($obj->{'bin'}) |
| @@ -69109,6 +69145,9 @@ class MarkDef { | ||
| 69109 | 69145 | * @throws Exception |
| 69110 | 69146 | */ |
| 69111 | 69147 | public static function from(stdClass $obj): MarkDef { |
| 69148 | + if (!property_exists($obj, 'type')) { | |
| 69149 | + throw new Exception("Missing required property"); | |
| 69150 | + } | |
| 69112 | 69151 | return new MarkDef( |
| 69113 | 69152 | MarkDef::fromAlign($obj->{'align'}) |
| 69114 | 69153 | ,MarkDef::fromAngle($obj->{'angle'}) |
| @@ -72940,6 +72979,9 @@ class SelectionDef { | ||
| 72940 | 72979 | * @throws Exception |
| 72941 | 72980 | */ |
| 72942 | 72981 | public static function from(stdClass $obj): SelectionDef { |
| 72982 | + if (!property_exists($obj, 'type')) { | |
| 72983 | + throw new Exception("Missing required property"); | |
| 72984 | + } | |
| 72943 | 72985 | return new SelectionDef( |
| 72944 | 72986 | SelectionDef::fromBind($obj->{'bind'}) |
| 72945 | 72987 | ,SelectionDef::fromEmpty($obj->{'empty'}) |
| @@ -73510,6 +73552,9 @@ class TitleParams { | ||
| 73510 | 73552 | * @throws Exception |
| 73511 | 73553 | */ |
| 73512 | 73554 | public static function from(stdClass $obj): TitleParams { |
| 73555 | + if (!property_exists($obj, 'text')) { | |
| 73556 | + throw new Exception("Missing required property"); | |
| 73557 | + } | |
| 73513 | 73558 | return new TitleParams( |
| 73514 | 73559 | TitleParams::fromAnchor($obj->{'anchor'}) |
| 73515 | 73560 | ,TitleParams::fromOffset($obj->{'offset'}) |
| @@ -74832,6 +74877,15 @@ class AggregatedFieldDef { | ||
| 74832 | 74877 | * @throws Exception |
| 74833 | 74878 | */ |
| 74834 | 74879 | public static function from(stdClass $obj): AggregatedFieldDef { |
| 74880 | + if (!property_exists($obj, 'as')) { | |
| 74881 | + throw new Exception("Missing required property"); | |
| 74882 | + } | |
| 74883 | + if (!property_exists($obj, 'field')) { | |
| 74884 | + throw new Exception("Missing required property"); | |
| 74885 | + } | |
| 74886 | + if (!property_exists($obj, 'op')) { | |
| 74887 | + throw new Exception("Missing required property"); | |
| 74888 | + } | |
| 74835 | 74889 | return new AggregatedFieldDef( |
| 74836 | 74890 | AggregatedFieldDef::fromAs($obj->{'as'}) |
| 74837 | 74891 | ,AggregatedFieldDef::fromField($obj->{'field'}) |
| @@ -75098,6 +75152,12 @@ class LookupData { | ||
| 75098 | 75152 | * @throws Exception |
| 75099 | 75153 | */ |
| 75100 | 75154 | public static function from(stdClass $obj): LookupData { |
| 75155 | + if (!property_exists($obj, 'data')) { | |
| 75156 | + throw new Exception("Missing required property"); | |
| 75157 | + } | |
| 75158 | + if (!property_exists($obj, 'key')) { | |
| 75159 | + throw new Exception("Missing required property"); | |
| 75160 | + } | |
| 75101 | 75161 | return new LookupData( |
| 75102 | 75162 | LookupData::fromData($obj->{'data'}) |
| 75103 | 75163 | ,LookupData::fromFields($obj->{'fields'}) |
No generated files match these filters.