Generated-output differences

quicktype output changed between the PR base and tested PR merge revisions.
← Back to the pull request
280test cases
280files differ
280modified
0new
0deleted
24,085changed lines
+24,062 −23insertions / deletions
Base aa0c35898cd477b512c618fd15bd4c5f399b84d0 · PR merge db847a0828d9e21e1c4ce2beb53fd7b347530482 · Head 9d6f534599adf8ff0b8e450c5560c224be411b25 · raw patch
Test case

test/inputs/graphql/github1.graphql

1 generated file · +15 −0
Mgraphql-phpdefault / TopLevel.php+15 −0
@@ -169,6 +169,9 @@ class TopLevel {
169169 * @throws Exception
170170 */
171171 public static function from(stdClass $obj): TopLevel {
172+ if (!property_exists($obj, 'data')) {
173+ throw new Exception("Missing required property");
174+ }
172175 return new TopLevel(
173176 TopLevel::fromData($obj->{'data'})
174177 ,TopLevel::fromErrors($obj->{'errors'})
@@ -270,6 +273,9 @@ class Data {
270273 * @throws Exception
271274 */
272275 public static function from(stdClass $obj): Data {
276+ if (!property_exists($obj, 'viewer')) {
277+ throw new Exception("Missing required property");
278+ }
273279 return new Data(
274280 Data::fromViewer($obj->{'viewer'})
275281 );
@@ -430,6 +436,12 @@ class User {
430436 * @throws Exception
431437 */
432438 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+ }
433445 return new User(
434446 User::fromLogin($obj->{'login'})
435447 ,User::fromRealName($obj->{'realName'})
@@ -530,6 +542,9 @@ class Error {
530542 * @throws Exception
531543 */
532544 public static function from(stdClass $obj): Error {
545+ if (!property_exists($obj, 'message')) {
546+ throw new Exception("Missing required property");
547+ }
533548 return new Error(
534549 Error::fromMessage($obj->{'message'})
535550 );
Test case

test/inputs/graphql/github2.graphql

1 generated file · +24 −0
Mgraphql-phpdefault / TopLevel.php+24 −0
@@ -169,6 +169,9 @@ class TopLevel {
169169 * @throws Exception
170170 */
171171 public static function from(stdClass $obj): TopLevel {
172+ if (!property_exists($obj, 'data')) {
173+ throw new Exception("Missing required property");
174+ }
172175 return new TopLevel(
173176 TopLevel::fromData($obj->{'data'})
174177 ,TopLevel::fromErrors($obj->{'errors'})
@@ -270,6 +273,9 @@ class Data {
270273 * @throws Exception
271274 */
272275 public static function from(stdClass $obj): Data {
276+ if (!property_exists($obj, 'viewer')) {
277+ throw new Exception("Missing required property");
278+ }
273279 return new Data(
274280 Data::fromViewer($obj->{'viewer'})
275281 );
@@ -421,6 +427,12 @@ class User {
421427 * @throws Exception
422428 */
423429 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+ }
424436 return new User(
425437 User::fromLogin($obj->{'login'})
426438 ,User::fromRepositories($obj->{'repositories'})
@@ -605,6 +617,12 @@ class RepositoryConnection {
605617 * @throws Exception
606618 */
607619 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+ }
608626 return new RepositoryConnection(
609627 RepositoryConnection::fromTotalCount($obj->{'totalCount'})
610628 ,RepositoryConnection::fromNodes($obj->{'nodes'})
@@ -705,6 +723,9 @@ class Repository {
705723 * @throws Exception
706724 */
707725 public static function from(stdClass $obj): Repository {
726+ if (!property_exists($obj, 'name')) {
727+ throw new Exception("Missing required property");
728+ }
708729 return new Repository(
709730 Repository::fromName($obj->{'name'})
710731 );
@@ -803,6 +824,9 @@ class Error {
803824 * @throws Exception
804825 */
805826 public static function from(stdClass $obj): Error {
827+ if (!property_exists($obj, 'message')) {
828+ throw new Exception("Missing required property");
829+ }
806830 return new Error(
807831 Error::fromMessage($obj->{'message'})
808832 );
Test case

test/inputs/graphql/github3.graphql

1 generated file · +24 −0
Mgraphql-phpdefault / TopLevel.php+24 −0
@@ -169,6 +169,9 @@ class TopLevel {
169169 * @throws Exception
170170 */
171171 public static function from(stdClass $obj): TopLevel {
172+ if (!property_exists($obj, 'data')) {
173+ throw new Exception("Missing required property");
174+ }
172175 return new TopLevel(
173176 TopLevel::fromData($obj->{'data'})
174177 ,TopLevel::fromErrors($obj->{'errors'})
@@ -270,6 +273,9 @@ class Data {
270273 * @throws Exception
271274 */
272275 public static function from(stdClass $obj): Data {
276+ if (!property_exists($obj, 'viewer')) {
277+ throw new Exception("Missing required property");
278+ }
273279 return new Data(
274280 Data::fromViewer($obj->{'viewer'})
275281 );
@@ -431,6 +437,12 @@ class User {
431437 * @throws Exception
432438 */
433439 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+ }
434446 return new User(
435447 User::fromLogin($obj->{'login'})
436448 ,User::fromRepository($obj->{'repository'})
@@ -532,6 +544,9 @@ class Repository {
532544 * @throws Exception
533545 */
534546 public static function from(stdClass $obj): Repository {
547+ if (!property_exists($obj, 'pullRequests')) {
548+ throw new Exception("Missing required property");
549+ }
535550 return new Repository(
536551 Repository::fromPullRequests($obj->{'pullRequests'})
537552 );
@@ -662,6 +677,9 @@ class PullRequestConnection {
662677 * @throws Exception
663678 */
664679 public static function from(stdClass $obj): PullRequestConnection {
680+ if (!property_exists($obj, 'nodes')) {
681+ throw new Exception("Missing required property");
682+ }
665683 return new PullRequestConnection(
666684 PullRequestConnection::fromNodes($obj->{'nodes'})
667685 );
@@ -761,6 +779,9 @@ class PullRequest {
761779 * @throws Exception
762780 */
763781 public static function from(stdClass $obj): PullRequest {
782+ if (!property_exists($obj, 'state')) {
783+ throw new Exception("Missing required property");
784+ }
764785 return new PullRequest(
765786 PullRequest::fromState($obj->{'state'})
766787 );
@@ -912,6 +933,9 @@ class Error {
912933 * @throws Exception
913934 */
914935 public static function from(stdClass $obj): Error {
936+ if (!property_exists($obj, 'message')) {
937+ throw new Exception("Missing required property");
938+ }
915939 return new Error(
916940 Error::fromMessage($obj->{'message'})
917941 );
Test case

test/inputs/graphql/github4.graphql

1 generated file · +27 −0
Mgraphql-phpdefault / TopLevel.php+27 −0
@@ -169,6 +169,9 @@ class TopLevel {
169169 * @throws Exception
170170 */
171171 public static function from(stdClass $obj): TopLevel {
172+ if (!property_exists($obj, 'data')) {
173+ throw new Exception("Missing required property");
174+ }
172175 return new TopLevel(
173176 TopLevel::fromData($obj->{'data'})
174177 ,TopLevel::fromErrors($obj->{'errors'})
@@ -270,6 +273,9 @@ class Data {
270273 * @throws Exception
271274 */
272275 public static function from(stdClass $obj): Data {
276+ if (!property_exists($obj, 'viewer')) {
277+ throw new Exception("Missing required property");
278+ }
273279 return new Data(
274280 Data::fromViewer($obj->{'viewer'})
275281 );
@@ -493,6 +499,15 @@ class User {
493499 * @throws Exception
494500 */
495501 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+ }
496511 return new User(
497512 User::fromLogin($obj->{'login'})
498513 ,User::fromName($obj->{'name'})
@@ -596,6 +611,9 @@ class Repository {
596611 * @throws Exception
597612 */
598613 public static function from(stdClass $obj): Repository {
614+ if (!property_exists($obj, 'pullRequests')) {
615+ throw new Exception("Missing required property");
616+ }
599617 return new Repository(
600618 Repository::fromPullRequests($obj->{'pullRequests'})
601619 );
@@ -726,6 +744,9 @@ class PullRequestConnection {
726744 * @throws Exception
727745 */
728746 public static function from(stdClass $obj): PullRequestConnection {
747+ if (!property_exists($obj, 'nodes')) {
748+ throw new Exception("Missing required property");
749+ }
729750 return new PullRequestConnection(
730751 PullRequestConnection::fromNodes($obj->{'nodes'})
731752 );
@@ -825,6 +846,9 @@ class PullRequest {
825846 * @throws Exception
826847 */
827848 public static function from(stdClass $obj): PullRequest {
849+ if (!property_exists($obj, 'state')) {
850+ throw new Exception("Missing required property");
851+ }
828852 return new PullRequest(
829853 PullRequest::fromState($obj->{'state'})
830854 );
@@ -976,6 +1000,9 @@ class Error {
9761000 * @throws Exception
9771001 */
9781002 public static function from(stdClass $obj): Error {
1003+ if (!property_exists($obj, 'message')) {
1004+ throw new Exception("Missing required property");
1005+ }
9791006 return new Error(
9801007 Error::fromMessage($obj->{'message'})
9811008 );
Test case

test/inputs/graphql/github5.graphql

1 generated file · +12 −0
Mgraphql-phpdefault / TopLevel.php+12 −0
@@ -169,6 +169,9 @@ class TopLevel {
169169 * @throws Exception
170170 */
171171 public static function from(stdClass $obj): TopLevel {
172+ if (!property_exists($obj, 'data')) {
173+ throw new Exception("Missing required property");
174+ }
172175 return new TopLevel(
173176 TopLevel::fromData($obj->{'data'})
174177 ,TopLevel::fromErrors($obj->{'errors'})
@@ -270,6 +273,9 @@ class Data {
270273 * @throws Exception
271274 */
272275 public static function from(stdClass $obj): Data {
276+ if (!property_exists($obj, 'viewer')) {
277+ throw new Exception("Missing required property");
278+ }
273279 return new Data(
274280 Data::fromViewer($obj->{'viewer'})
275281 );
@@ -430,6 +436,9 @@ class User {
430436 * @throws Exception
431437 */
432438 public static function from(stdClass $obj): User {
439+ if (!property_exists($obj, 'login')) {
440+ throw new Exception("Missing required property");
441+ }
433442 return new User(
434443 User::fromLogin($obj->{'login'})
435444 ,User::fromName($obj->{'name'})
@@ -530,6 +539,9 @@ class Error {
530539 * @throws Exception
531540 */
532541 public static function from(stdClass $obj): Error {
542+ if (!property_exists($obj, 'message')) {
543+ throw new Exception("Missing required property");
544+ }
533545 return new Error(
534546 Error::fromMessage($obj->{'message'})
535547 );
Test case

test/inputs/graphql/github6.graphql

1 generated file · +12 −0
Mgraphql-phpdefault / TopLevel.php+12 −0
@@ -169,6 +169,9 @@ class TopLevel {
169169 * @throws Exception
170170 */
171171 public static function from(stdClass $obj): TopLevel {
172+ if (!property_exists($obj, 'data')) {
173+ throw new Exception("Missing required property");
174+ }
172175 return new TopLevel(
173176 TopLevel::fromData($obj->{'data'})
174177 ,TopLevel::fromErrors($obj->{'errors'})
@@ -280,6 +283,9 @@ class Data {
280283 * @throws Exception
281284 */
282285 public static function from(stdClass $obj): Data {
286+ if (!property_exists($obj, 'resource')) {
287+ throw new Exception("Missing required property");
288+ }
283289 return new Data(
284290 Data::fromResource($obj->{'resource'})
285291 );
@@ -440,6 +446,9 @@ class UniformResourceLocatable {
440446 * @throws Exception
441447 */
442448 public static function from(stdClass $obj): UniformResourceLocatable {
449+ if (!property_exists($obj, 'url')) {
450+ throw new Exception("Missing required property");
451+ }
443452 return new UniformResourceLocatable(
444453 UniformResourceLocatable::fromURL($obj->{'url'})
445454 ,UniformResourceLocatable::fromLogin($obj->{'login'})
@@ -540,6 +549,9 @@ class Error {
540549 * @throws Exception
541550 */
542551 public static function from(stdClass $obj): Error {
552+ if (!property_exists($obj, 'message')) {
553+ throw new Exception("Missing required property");
554+ }
543555 return new Error(
544556 Error::fromMessage($obj->{'message'})
545557 );
Test case

test/inputs/graphql/github7.graphql

1 generated file · +42 −0
Mgraphql-phpdefault / TopLevel.php+42 −0
@@ -169,6 +169,9 @@ class TopLevel {
169169 * @throws Exception
170170 */
171171 public static function from(stdClass $obj): TopLevel {
172+ if (!property_exists($obj, 'data')) {
173+ throw new Exception("Missing required property");
174+ }
172175 return new TopLevel(
173176 TopLevel::fromData($obj->{'data'})
174177 ,TopLevel::fromErrors($obj->{'errors'})
@@ -270,6 +273,9 @@ class Data {
270273 * @throws Exception
271274 */
272275 public static function from(stdClass $obj): Data {
276+ if (!property_exists($obj, 'viewer')) {
277+ throw new Exception("Missing required property");
278+ }
273279 return new Data(
274280 Data::fromViewer($obj->{'viewer'})
275281 );
@@ -474,6 +480,15 @@ class User {
474480 * @throws Exception
475481 */
476482 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+ }
477492 return new User(
478493 User::fromLogin($obj->{'login'})
479494 ,User::fromStarredRepositories($obj->{'starredRepositories'})
@@ -608,6 +623,9 @@ class RepositoryConnection {
608623 * @throws Exception
609624 */
610625 public static function from(stdClass $obj): RepositoryConnection {
626+ if (!property_exists($obj, 'edges')) {
627+ throw new Exception("Missing required property");
628+ }
611629 return new RepositoryConnection(
612630 RepositoryConnection::fromEdges($obj->{'edges'})
613631 );
@@ -717,6 +735,9 @@ class RepositoryEdge {
717735 * @throws Exception
718736 */
719737 public static function from(stdClass $obj): RepositoryEdge {
738+ if (!property_exists($obj, 'node')) {
739+ throw new Exception("Missing required property");
740+ }
720741 return new RepositoryEdge(
721742 RepositoryEdge::fromNode($obj->{'node'})
722743 );
@@ -1027,6 +1048,21 @@ class Repository {
10271048 * @throws Exception
10281049 */
10291050 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+ }
10301066 return new Repository(
10311067 Repository::fromName($obj->{'name'})
10321068 ,Repository::fromStargazers($obj->{'stargazers'})
@@ -1133,6 +1169,9 @@ class Connection {
11331169 * @throws Exception
11341170 */
11351171 public static function from(stdClass $obj): Connection {
1172+ if (!property_exists($obj, 'totalCount')) {
1173+ throw new Exception("Missing required property");
1174+ }
11361175 return new Connection(
11371176 Connection::fromTotalCount($obj->{'totalCount'})
11381177 );
@@ -1231,6 +1270,9 @@ class Error {
12311270 * @throws Exception
12321271 */
12331272 public static function from(stdClass $obj): Error {
1273+ if (!property_exists($obj, 'message')) {
1274+ throw new Exception("Missing required property");
1275+ }
12341276 return new Error(
12351277 Error::fromMessage($obj->{'message'})
12361278 );
Test case

test/inputs/graphql/github8.graphql

1 generated file · +18 −0
Mgraphql-phpdefault / TopLevel.php+18 −0
@@ -169,6 +169,9 @@ class TopLevel {
169169 * @throws Exception
170170 */
171171 public static function from(stdClass $obj): TopLevel {
172+ if (!property_exists($obj, 'data')) {
173+ throw new Exception("Missing required property");
174+ }
172175 return new TopLevel(
173176 TopLevel::fromData($obj->{'data'})
174177 ,TopLevel::fromErrors($obj->{'errors'})
@@ -280,6 +283,9 @@ class Data {
280283 * @throws Exception
281284 */
282285 public static function from(stdClass $obj): Data {
286+ if (!property_exists($obj, 'repository')) {
287+ throw new Exception("Missing required property");
288+ }
283289 return new Data(
284290 Data::fromRepository($obj->{'repository'})
285291 );
@@ -504,6 +510,15 @@ class Repository {
504510 * @throws Exception
505511 */
506512 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+ }
507522 return new Repository(
508523 Repository::fromNameWithOwner($obj->{'nameWithOwner'})
509524 ,Repository::fromN303($obj->{'n303'})
@@ -892,6 +907,9 @@ class Error {
892907 * @throws Exception
893908 */
894909 public static function from(stdClass $obj): Error {
910+ if (!property_exists($obj, 'message')) {
911+ throw new Exception("Missing required property");
912+ }
895913 return new Error(
896914 Error::fromMessage($obj->{'message'})
897915 );
Test case

test/inputs/graphql/github9.graphql

1 generated file · +27 −0
Mgraphql-phpdefault / TopLevel.php+27 −0
@@ -169,6 +169,9 @@ class TopLevel {
169169 * @throws Exception
170170 */
171171 public static function from(stdClass $obj): TopLevel {
172+ if (!property_exists($obj, 'data')) {
173+ throw new Exception("Missing required property");
174+ }
172175 return new TopLevel(
173176 TopLevel::fromData($obj->{'data'})
174177 ,TopLevel::fromErrors($obj->{'errors'})
@@ -280,6 +283,9 @@ class Data {
280283 * @throws Exception
281284 */
282285 public static function from(stdClass $obj): Data {
286+ if (!property_exists($obj, 'addReaction')) {
287+ throw new Exception("Missing required property");
288+ }
283289 return new Data(
284290 Data::fromAddReaction($obj->{'addReaction'})
285291 );
@@ -494,6 +500,15 @@ class AddReactionPayload {
494500 * @throws Exception
495501 */
496502 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+ }
497512 return new AddReactionPayload(
498513 AddReactionPayload::fromClientMutationID($obj->{'clientMutationId'})
499514 ,AddReactionPayload::fromReaction($obj->{'reaction'})
@@ -597,6 +612,9 @@ class Reaction {
597612 * @throws Exception
598613 */
599614 public static function from(stdClass $obj): Reaction {
615+ if (!property_exists($obj, 'content')) {
616+ throw new Exception("Missing required property");
617+ }
600618 return new Reaction(
601619 Reaction::fromContent($obj->{'content'})
602620 );
@@ -834,6 +852,12 @@ class Reactable {
834852 * @throws Exception
835853 */
836854 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+ }
837861 return new Reactable(
838862 Reactable::fromViewerCanReact($obj->{'viewerCanReact'})
839863 ,Reactable::fromReactionGroups($obj->{'reactionGroups'})
@@ -934,6 +958,9 @@ class Error {
934958 * @throws Exception
935959 */
936960 public static function from(stdClass $obj): Error {
961+ if (!property_exists($obj, 'message')) {
962+ throw new Exception("Missing required property");
963+ }
937964 return new Error(
938965 Error::fromMessage($obj->{'message'})
939966 );
Test case

test/inputs/json/misc/00ec5.json

1 generated file · +96 −0
Mphpdefault / TopLevel.php+96 −0
@@ -479,6 +479,30 @@ class TopLevel {
479479 * @throws Exception
480480 */
481481 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+ }
482506 return new TopLevel(
483507 TopLevel::fromBasePath($obj->{'basePath'})
484508 ,TopLevel::fromDefinitions($obj->{'definitions'})
@@ -592,6 +616,9 @@ class Definitions {
592616 * @throws Exception
593617 */
594618 public static function from(stdClass $obj): Definitions {
619+ if (!property_exists($obj, 'Provider')) {
620+ throw new Exception("Missing required property");
621+ }
595622 return new Definitions(
596623 Definitions::fromProvider($obj->{'Provider'})
597624 );
@@ -705,6 +732,9 @@ class Provider {
705732 * @throws Exception
706733 */
707734 public static function from(stdClass $obj): Provider {
735+ if (!property_exists($obj, 'properties')) {
736+ throw new Exception("Missing required property");
737+ }
708738 return new Provider(
709739 Provider::fromProperties($obj->{'properties'})
710740 );
@@ -856,6 +886,12 @@ class Property {
856886 * @throws Exception
857887 */
858888 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+ }
859895 return new Property(
860896 Property::fromDescription($obj->{'description'})
861897 ,Property::fromType($obj->{'type'})
@@ -1105,6 +1141,15 @@ class Info {
11051141 * @throws Exception
11061142 */
11071143 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+ }
11081153 return new Info(
11091154 Info::fromDescription($obj->{'description'})
11101155 ,Info::fromTitle($obj->{'title'})
@@ -1208,6 +1253,9 @@ class Paths {
12081253 * @throws Exception
12091254 */
12101255 public static function from(stdClass $obj): Paths {
1256+ if (!property_exists($obj, '/business_service_providers/search')) {
1257+ throw new Exception("Missing required property");
1258+ }
12111259 return new Paths(
12121260 Paths::fromBusinessServiceProvidersSearch($obj->{'/business_service_providers/search'})
12131261 );
@@ -1307,6 +1355,9 @@ class BusinessServiceProvidersSearch {
13071355 * @throws Exception
13081356 */
13091357 public static function from(stdClass $obj): BusinessServiceProvidersSearch {
1358+ if (!property_exists($obj, 'get')) {
1359+ throw new Exception("Missing required property");
1360+ }
13101361 return new BusinessServiceProvidersSearch(
13111362 BusinessServiceProvidersSearch::fromGet($obj->{'get'})
13121363 );
@@ -1640,6 +1691,21 @@ class Get {
16401691 * @throws Exception
16411692 */
16421693 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+ }
16431709 return new Get(
16441710 Get::fromDescription($obj->{'description'})
16451711 ,Get::fromParameters($obj->{'parameters'})
@@ -2008,6 +2074,24 @@ class Parameter {
20082074 * @throws Exception
20092075 */
20102076 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+ }
20112095 return new Parameter(
20122096 Parameter::fromDescription($obj->{'description'})
20132097 ,Parameter::fromFormat($obj->{'format'})
@@ -2117,6 +2201,9 @@ class Responses {
21172201 * @throws Exception
21182202 */
21192203 public static function from(stdClass $obj): Responses {
2204+ if (!property_exists($obj, '200')) {
2205+ throw new Exception("Missing required property");
2206+ }
21202207 return new Responses(
21212208 Responses::fromThe200($obj->{'200'})
21222209 );
@@ -2268,6 +2355,12 @@ class The200 {
22682355 * @throws Exception
22692356 */
22702357 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+ }
22712364 return new The200(
22722365 The200::fromDescription($obj->{'description'})
22732366 ,The200::fromSchema($obj->{'schema'})
@@ -2368,6 +2461,9 @@ class Schema {
23682461 * @throws Exception
23692462 */
23702463 public static function from(stdClass $obj): Schema {
2464+ if (!property_exists($obj, '$ref')) {
2465+ throw new Exception("Missing required property");
2466+ }
23712467 return new Schema(
23722468 Schema::fromRef($obj->{'$ref'})
23732469 );
Test case

test/inputs/json/misc/010b1.json

1 generated file · +18 −0
Mphpdefault / TopLevel.php+18 −0
@@ -345,6 +345,24 @@ class TopLevel {
345345 * @throws Exception
346346 */
347347 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+ }
348366 return new TopLevel(
349367 TopLevel::fromAge($obj->{'age'})
350368 ,TopLevel::fromCountry($obj->{'country'})
Test case

test/inputs/json/misc/016af.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'total_population')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromTotalPopulation($obj->{'total_population'})
101104 );
@@ -246,6 +249,12 @@ class TotalPopulation {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new TotalPopulation(
250259 TotalPopulation::fromDate($obj->{'date'})
251260 ,TotalPopulation::fromPopulation($obj->{'population'})
Test case

test/inputs/json/misc/033b1.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -205,6 +205,15 @@ class TopLevel {
205205 * @throws Exception
206206 */
207207 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+ }
208217 return new TopLevel(
209218 TopLevel::fromBase($obj->{'base'})
210219 ,TopLevel::fromDate($obj->{'date'})
Test case

test/inputs/json/misc/050b0.json

1 generated file · +51 −0
Mphpdefault / TopLevel.php+51 −0
@@ -518,6 +518,30 @@ class TopLevel {
518518 * @throws Exception
519519 */
520520 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+ }
521545 return new TopLevel(
522546 TopLevel::fromID($obj->{'id'})
523547 ,TopLevel::fromIdentifiers($obj->{'identifiers'})
@@ -683,6 +707,12 @@ class Identifier {
683707 * @throws Exception
684708 */
685709 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+ }
686716 return new Identifier(
687717 Identifier::fromIdentifier($obj->{'identifier'})
688718 ,Identifier::fromScheme($obj->{'scheme'})
@@ -946,6 +976,12 @@ class Link {
946976 * @throws Exception
947977 */
948978 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+ }
949985 return new Link(
950986 Link::fromNote($obj->{'note'})
951987 ,Link::fromURL($obj->{'url'})
@@ -1169,6 +1205,12 @@ class OtherName {
11691205 * @throws Exception
11701206 */
11711207 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+ }
11721214 return new OtherName(
11731215 OtherName::fromName($obj->{'name'})
11741216 ,OtherName::fromNote($obj->{'note'})
@@ -1375,6 +1417,15 @@ class Text {
13751417 * @throws Exception
13761418 */
13771419 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+ }
13781429 return new Text(
13791430 Text::fromMediaType($obj->{'media_type'})
13801431 ,Text::fromTitle($obj->{'title'})
Test case

test/inputs/json/misc/06bee.json

1 generated file · +45 −0
Mphpdefault / TopLevel.php+45 −0
@@ -510,6 +510,30 @@ class TopLevel {
510510 * @throws Exception
511511 */
512512 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+ }
513537 return new TopLevel(
514538 TopLevel::fromID($obj->{'id'})
515539 ,TopLevel::fromIdentifiers($obj->{'identifiers'})
@@ -675,6 +699,12 @@ class Identifier {
675699 * @throws Exception
676700 */
677701 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+ }
678708 return new Identifier(
679709 Identifier::fromIdentifier($obj->{'identifier'})
680710 ,Identifier::fromScheme($obj->{'scheme'})
@@ -934,6 +964,12 @@ class Link {
934964 * @throws Exception
935965 */
936966 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+ }
937973 return new Link(
938974 Link::fromNote($obj->{'note'})
939975 ,Link::fromURL($obj->{'url'})
@@ -1185,6 +1221,15 @@ class Text {
11851221 * @throws Exception
11861222 */
11871223 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+ }
11881233 return new Text(
11891234 Text::fromMediaType($obj->{'media_type'})
11901235 ,Text::fromTitle($obj->{'title'})
Test case

test/inputs/json/misc/07540.json

1 generated file · +3 −0
Mphpdefault / TopLevel.php+3 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'cookies')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromCookies($obj->{'cookies'})
9093 );
Test case

test/inputs/json/misc/0779f.json

1 generated file · +75 −0
Mphpdefault / TopLevel.php+75 −0
@@ -450,6 +450,30 @@ class TopLevel {
450450 * @throws Exception
451451 */
452452 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+ }
453477 return new TopLevel(
454478 TopLevel::fromCity($obj->{'city'})
455479 ,TopLevel::fromDelay($obj->{'delay'})
@@ -978,6 +1002,33 @@ class Status {
9781002 * @throws Exception
9791003 */
9801004 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+ }
9811032 return new Status(
9821033 Status::fromAvgDelay($obj->{'avgDelay'})
9831034 ,Status::fromClosureBegin($obj->{'closureBegin'})
@@ -1301,6 +1352,21 @@ class Weather {
13011352 * @throws Exception
13021353 */
13031354 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+ }
13041370 return new Weather(
13051371 Weather::fromMeta($obj->{'meta'})
13061372 ,Weather::fromTemp($obj->{'temp'})
@@ -1511,6 +1577,15 @@ class Meta {
15111577 * @throws Exception
15121578 */
15131579 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+ }
15141589 return new Meta(
15151590 Meta::fromCredit($obj->{'credit'})
15161591 ,Meta::fromUpdated($obj->{'updated'})
Test case

test/inputs/json/misc/07c75.json

1 generated file · +45 −0
Mphpdefault / TopLevel.php+45 −0
@@ -512,6 +512,30 @@ class TopLevel {
512512 * @throws Exception
513513 */
514514 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+ }
515539 return new TopLevel(
516540 TopLevel::fromID($obj->{'id'})
517541 ,TopLevel::fromIdentifiers($obj->{'identifiers'})
@@ -676,6 +700,12 @@ class Identifier {
676700 * @throws Exception
677701 */
678702 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+ }
679709 return new Identifier(
680710 Identifier::fromIdentifier($obj->{'identifier'})
681711 ,Identifier::fromScheme($obj->{'scheme'})
@@ -828,6 +858,12 @@ class Link {
828858 * @throws Exception
829859 */
830860 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+ }
831867 return new Link(
832868 Link::fromNote($obj->{'note'})
833869 ,Link::fromURL($obj->{'url'})
@@ -1032,6 +1068,15 @@ class Text {
10321068 * @throws Exception
10331069 */
10341070 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+ }
10351080 return new Text(
10361081 Text::fromMediaType($obj->{'media_type'})
10371082 ,Text::fromTitle($obj->{'title'})
Test case

test/inputs/json/misc/09f54.json

1 generated file · +24 −0
Mphpdefault / TopLevel.php+24 −0
@@ -152,6 +152,12 @@ class TopLevel {
152152 * @throws Exception
153153 */
154154 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+ }
155161 return new TopLevel(
156162 TopLevel::fromData($obj->{'data'})
157163 ,TopLevel::fromDescription($obj->{'description'})
@@ -304,6 +310,12 @@ class Datum {
304310 * @throws Exception
305311 */
306312 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+ }
307319 return new Datum(
308320 Datum::fromAnomaly($obj->{'anomaly'})
309321 ,Datum::fromValue($obj->{'value'})
@@ -560,6 +572,18 @@ class Description {
560572 * @throws Exception
561573 */
562574 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+ }
563587 return new Description(
564588 Description::fromBasePeriod($obj->{'base_period'})
565589 ,Description::fromMissing($obj->{'missing'})
Test case

test/inputs/json/misc/0a358.json

1 generated file · +39 −0
Mphpdefault / TopLevel.php+39 −0
@@ -409,6 +409,27 @@ class TopLevel {
409409 * @throws Exception
410410 */
411411 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+ }
412433 return new TopLevel(
413434 TopLevel::fromCount($obj->{'count'})
414435 ,TopLevel::fromFacets($obj->{'facets'})
@@ -838,6 +859,24 @@ class Result {
838859 * @throws Exception
839860 */
840861 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+ }
841880 return new Result(
842881 Result::fromCode($obj->{'code'})
843882 ,Result::fromCreatedAt($obj->{'created_at'})
Test case

test/inputs/json/misc/0a91a.json

1 generated file · +489 −0
Mphpdefault / TopLevel.php+489 −0
@@ -470,6 +470,27 @@ class TopLevel {
470470 * @throws Exception
471471 */
472472 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+ }
473494 return new TopLevel(
474495 TopLevel::fromActor($obj->{'actor'})
475496 ,TopLevel::fromCreatedAt($obj->{'created_at'})
@@ -852,6 +873,21 @@ class Actor {
852873 * @throws Exception
853874 */
854875 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+ }
855891 return new Actor(
856892 Actor::fromAvatarURL($obj->{'avatar_url'})
857893 ,Actor::fromDisplayLogin($obj->{'display_login'})
@@ -2122,6 +2158,21 @@ class Commit {
21222158 * @throws Exception
21232159 */
21242160 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+ }
21252176 return new Commit(
21262177 Commit::fromAuthor($obj->{'author'})
21272178 ,Commit::fromDistinct($obj->{'distinct'})
@@ -2280,6 +2331,12 @@ class Author {
22802331 * @throws Exception
22812332 */
22822333 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+ }
22832340 return new Author(
22842341 Author::fromEmail($obj->{'email'})
22852342 ,Author::fromName($obj->{'name'})
@@ -4527,6 +4584,129 @@ class PullRequest {
45274584 * @throws Exception
45284585 */
45294586 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+ }
45304710 return new PullRequest(
45314711 PullRequest::fromAdditions($obj->{'additions'})
45324712 ,PullRequest::fromAssignee($obj->{'assignee'})
@@ -4915,6 +5095,21 @@ class Base {
49155095 * @throws Exception
49165096 */
49175097 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+ }
49185113 return new Base(
49195114 Base::fromLabel($obj->{'label'})
49205115 ,Base::fromRef($obj->{'ref'})
@@ -8588,6 +8783,213 @@ class BaseRepo {
85888783 * @throws Exception
85898784 */
85908785 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+ }
85918993 return new BaseRepo(
85928994 BaseRepo::fromArchiveURL($obj->{'archive_url'})
85938995 ,BaseRepo::fromAssigneesURL($obj->{'assignees_url'})
@@ -9654,6 +10056,57 @@ class MergedBy {
965410056 * @throws Exception
965510057 */
965610058 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+ }
965710110 return new MergedBy(
965810111 MergedBy::fromAvatarURL($obj->{'avatar_url'})
965910112 ,MergedBy::fromEventsURL($obj->{'events_url'})
@@ -10156,6 +10609,30 @@ class Links {
1015610609 * @throws Exception
1015710610 */
1015810611 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+ }
1015910636 return new Links(
1016010637 Links::fromComments($obj->{'comments'})
1016110638 ,Links::fromCommits($obj->{'commits'})
@@ -10268,6 +10745,9 @@ class Comments {
1026810745 * @throws Exception
1026910746 */
1027010747 public static function from(stdClass $obj): Comments {
10748+ if (!property_exists($obj, 'href')) {
10749+ throw new Exception("Missing required property");
10750+ }
1027110751 return new Comments(
1027210752 Comments::fromHref($obj->{'href'})
1027310753 );
@@ -10470,6 +10950,15 @@ class TopLevelRepo {
1047010950 * @throws Exception
1047110951 */
1047210952 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+ }
1047310962 return new TopLevelRepo(
1047410963 TopLevelRepo::fromID($obj->{'id'})
1047510964 ,TopLevelRepo::fromName($obj->{'name'})
Test case

test/inputs/json/misc/0b91a.json

1 generated file · +78 −0
Mphpdefault / TopLevel.php+78 −0
@@ -149,6 +149,12 @@ class TopLevel {
149149 * @throws Exception
150150 */
151151 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+ }
152158 return new TopLevel(
153159 TopLevel::fromMetadata($obj->{'metadata'})
154160 ,TopLevel::fromResults($obj->{'results'})
@@ -355,6 +361,15 @@ class Metadata {
355361 * @throws Exception
356362 */
357363 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+ }
358373 return new Metadata(
359374 Metadata::fromExecutionTime($obj->{'executionTime'})
360375 ,Metadata::fromResponseInfo($obj->{'responseInfo'})
@@ -509,6 +524,12 @@ class ResponseInfo {
509524 * @throws Exception
510525 */
511526 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+ }
512533 return new ResponseInfo(
513534 ResponseInfo::fromDeveloperMessage($obj->{'developerMessage'})
514535 ,ResponseInfo::fromStatus($obj->{'status'})
@@ -713,6 +734,15 @@ class Resultset {
713734 * @throws Exception
714735 */
715736 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+ }
716746 return new Resultset(
717747 Resultset::fromCount($obj->{'count'})
718748 ,Resultset::fromPage($obj->{'page'})
@@ -1548,6 +1578,48 @@ class Result {
15481578 * @throws Exception
15491579 */
15501580 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+ }
15511623 return new Result(
15521624 Result::fromAttachment($obj->{'attachment'})
15531625 ,Result::fromBody($obj->{'body'})
@@ -1727,6 +1799,12 @@ class Component {
17271799 * @throws Exception
17281800 */
17291801 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+ }
17301808 return new Component(
17311809 Component::fromName($obj->{'name'})
17321810 ,Component::fromUUID($obj->{'uuid'})
Test case

test/inputs/json/misc/0cffa.json

1 generated file · +207 −0
Mphpdefault / TopLevel.php+207 −0
@@ -202,6 +202,15 @@ class TopLevel {
202202 * @throws Exception
203203 */
204204 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+ }
205214 return new TopLevel(
206215 TopLevel::fromData($obj->{'data'})
207216 ,TopLevel::fromMeta($obj->{'meta'})
@@ -1203,6 +1212,57 @@ class Datum {
12031212 * @throws Exception
12041213 */
12051214 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+ }
12061266 return new Datum(
12071267 Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'})
12081268 ,Datum::fromBitlyURL($obj->{'bitly_url'})
@@ -2512,6 +2572,72 @@ class Images {
25122572 * @throws Exception
25132573 */
25142574 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+ }
25152641 return new Images(
25162642 Images::fromDownsized($obj->{'downsized'})
25172643 ,Images::fromDownsizedLarge($obj->{'downsized_large'})
@@ -2820,6 +2946,15 @@ class Downsized {
28202946 * @throws Exception
28212947 */
28222948 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+ }
28232958 return new Downsized(
28242959 Downsized::fromHeight($obj->{'height'})
28252960 ,Downsized::fromSize($obj->{'size'})
@@ -3080,6 +3215,18 @@ class DownsizedSmall {
30803215 * @throws Exception
30813216 */
30823217 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+ }
30833230 return new DownsizedSmall(
30843231 DownsizedSmall::fromHeight($obj->{'height'})
30853232 ,DownsizedSmall::fromMp4($obj->{'mp4'})
@@ -3692,6 +3839,24 @@ class FixedHeight {
36923839 * @throws Exception
36933840 */
36943841 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+ }
36953860 return new FixedHeight(
36963861 FixedHeight::fromFrames($obj->{'frames'})
36973862 ,FixedHeight::fromHash($obj->{'hash'})
@@ -3860,6 +4025,12 @@ class Looping {
38604025 * @throws Exception
38614026 */
38624027 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+ }
38634034 return new Looping(
38644035 Looping::fromMp4($obj->{'mp4'})
38654036 ,Looping::fromMp4Size($obj->{'mp4_size'})
@@ -4315,6 +4486,24 @@ class User {
43154486 * @throws Exception
43164487 */
43174488 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+ }
43184507 return new User(
43194508 User::fromAvatarURL($obj->{'avatar_url'})
43204509 ,User::fromBannerURL($obj->{'banner_url'})
@@ -4584,6 +4773,15 @@ class Meta {
45844773 * @throws Exception
45854774 */
45864775 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+ }
45874785 return new Meta(
45884786 Meta::fromMsg($obj->{'msg'})
45894787 ,Meta::fromResponseID($obj->{'response_id'})
@@ -4790,6 +4988,15 @@ class Pagination {
47904988 * @throws Exception
47914989 */
47924990 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+ }
47935000 return new Pagination(
47945001 Pagination::fromCount($obj->{'count'})
47955002 ,Pagination::fromOffset($obj->{'offset'})
Test case

test/inputs/json/misc/0e0c2.json

1 generated file · +135 −0
Mphpdefault / TopLevel.php+135 −0
@@ -255,6 +255,18 @@ class TopLevel {
255255 * @throws Exception
256256 */
257257 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+ }
258270 return new TopLevel(
259271 TopLevel::fromCount($obj->{'count'})
260272 ,TopLevel::fromNext($obj->{'next'})
@@ -1159,6 +1171,51 @@ class Result {
11591171 * @throws Exception
11601172 */
11611173 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+ }
11621219 return new Result(
11631220 Result::fromActiveScreens($obj->{'active_screens'})
11641221 ,Result::fromCollections($obj->{'collections'})
@@ -1455,6 +1512,18 @@ class Collection {
14551512 * @throws Exception
14561513 */
14571514 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+ }
14581527 return new Collection(
14591528 Collection::fromID($obj->{'id'})
14601529 ,Collection::fromMovies($obj->{'movies'})
@@ -1872,6 +1941,27 @@ class Detail {
18721941 * @throws Exception
18731942 */
18741943 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+ }
18751965 return new Detail(
18761966 Detail::fromCast($obj->{'cast'})
18771967 ,Detail::fromDirector($obj->{'director'})
@@ -2135,6 +2225,15 @@ class FavMovie {
21352225 * @throws Exception
21362226 */
21372227 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+ }
21382237 return new FavMovie(
21392238 FavMovie::fromFollow($obj->{'follow'})
21402239 ,FavMovie::fromStar($obj->{'star'})
@@ -2446,6 +2545,21 @@ class Image {
24462545 * @throws Exception
24472546 */
24482547 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+ }
24492563 return new Image(
24502564 Image::fromFavs($obj->{'favs'})
24512565 ,Image::fromID($obj->{'id'})
@@ -2807,6 +2921,18 @@ class Video {
28072921 * @throws Exception
28082922 */
28092923 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+ }
28102936 return new Video(
28112937 Video::fromKind($obj->{'kind'})
28122938 ,Video::fromLanguage($obj->{'language'})
@@ -3015,6 +3141,15 @@ class VoteScore {
30153141 * @throws Exception
30163142 */
30173143 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+ }
30183153 return new VoteScore(
30193154 VoteScore::fromAvg($obj->{'avg'})
30203155 ,VoteScore::fromScore($obj->{'score'})
Test case

test/inputs/json/misc/0fecf.json

1 generated file · +3 −0
Mphpdefault / TopLevel.php+3 −0
@@ -98,6 +98,9 @@ class TopLevel {
9898 * @throws Exception
9999 */
100100 public static function from(stdClass $obj): TopLevel {
101+ if (!property_exists($obj, 'countries')) {
102+ throw new Exception("Missing required property");
103+ }
101104 return new TopLevel(
102105 TopLevel::fromCountries($obj->{'countries'})
103106 );
Test case

test/inputs/json/misc/10be4.json

1 generated file · +51 −0
Mphpdefault / TopLevel.php+51 −0
@@ -518,6 +518,30 @@ class TopLevel {
518518 * @throws Exception
519519 */
520520 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+ }
521545 return new TopLevel(
522546 TopLevel::fromID($obj->{'id'})
523547 ,TopLevel::fromIdentifiers($obj->{'identifiers'})
@@ -683,6 +707,12 @@ class Identifier {
683707 * @throws Exception
684708 */
685709 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+ }
686716 return new Identifier(
687717 Identifier::fromIdentifier($obj->{'identifier'})
688718 ,Identifier::fromScheme($obj->{'scheme'})
@@ -978,6 +1008,12 @@ class Link {
9781008 * @throws Exception
9791009 */
9801010 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+ }
9811017 return new Link(
9821018 Link::fromNote($obj->{'note'})
9831019 ,Link::fromURL($obj->{'url'})
@@ -1205,6 +1241,12 @@ class OtherName {
12051241 * @throws Exception
12061242 */
12071243 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+ }
12081250 return new OtherName(
12091251 OtherName::fromName($obj->{'name'})
12101252 ,OtherName::fromNote($obj->{'note'})
@@ -1411,6 +1453,15 @@ class Text {
14111453 * @throws Exception
14121454 */
14131455 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+ }
14141465 return new Text(
14151466 Text::fromMediaType($obj->{'media_type'})
14161467 ,Text::fromTitle($obj->{'title'})
Test case

test/inputs/json/misc/112b5.json

1 generated file · +24 −0
Mphpdefault / TopLevel.php+24 −0
@@ -242,6 +242,18 @@ class TopLevel {
242242 * @throws Exception
243243 */
244244 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+ }
245257 return new TopLevel(
246258 TopLevel::fromArgs($obj->{'args'})
247259 ,TopLevel::fromHeaders($obj->{'headers'})
@@ -547,6 +559,18 @@ class Headers {
547559 * @throws Exception
548560 */
549561 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+ }
550574 return new Headers(
551575 Headers::fromAcceptEncoding($obj->{'Accept-Encoding'})
552576 ,Headers::fromConnection($obj->{'Connection'})
Test case

test/inputs/json/misc/127a1.json

1 generated file · +204 −0
Mphpdefault / TopLevel.php+204 −0
@@ -202,6 +202,15 @@ class TopLevel {
202202 * @throws Exception
203203 */
204204 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+ }
205214 return new TopLevel(
206215 TopLevel::fromData($obj->{'data'})
207216 ,TopLevel::fromMeta($obj->{'meta'})
@@ -1203,6 +1212,57 @@ class Datum {
12031212 * @throws Exception
12041213 */
12051214 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+ }
12061266 return new Datum(
12071267 Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'})
12081268 ,Datum::fromBitlyURL($obj->{'bitly_url'})
@@ -2512,6 +2572,72 @@ class Images {
25122572 * @throws Exception
25132573 */
25142574 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+ }
25152641 return new Images(
25162642 Images::fromDownsized($obj->{'downsized'})
25172643 ,Images::fromDownsizedLarge($obj->{'downsized_large'})
@@ -2820,6 +2946,15 @@ class Downsized {
28202946 * @throws Exception
28212947 */
28222948 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+ }
28232958 return new Downsized(
28242959 Downsized::fromHeight($obj->{'height'})
28252960 ,Downsized::fromSize($obj->{'size'})
@@ -3080,6 +3215,18 @@ class DownsizedSmall {
30803215 * @throws Exception
30813216 */
30823217 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+ }
30833230 return new DownsizedSmall(
30843231 DownsizedSmall::fromHeight($obj->{'height'})
30853232 ,DownsizedSmall::fromMp4($obj->{'mp4'})
@@ -3692,6 +3839,24 @@ class FixedHeight {
36923839 * @throws Exception
36933840 */
36943841 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+ }
36953860 return new FixedHeight(
36963861 FixedHeight::fromFrames($obj->{'frames'})
36973862 ,FixedHeight::fromHash($obj->{'hash'})
@@ -3860,6 +4025,12 @@ class Looping {
38604025 * @throws Exception
38614026 */
38624027 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+ }
38634034 return new Looping(
38644035 Looping::fromMp4($obj->{'mp4'})
38654036 ,Looping::fromMp4Size($obj->{'mp4_size'})
@@ -4321,6 +4492,21 @@ class User {
43214492 * @throws Exception
43224493 */
43234494 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+ }
43244510 return new User(
43254511 User::fromAvatarURL($obj->{'avatar_url'})
43264512 ,User::fromBannerURL($obj->{'banner_url'})
@@ -4590,6 +4776,15 @@ class Meta {
45904776 * @throws Exception
45914777 */
45924778 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+ }
45934788 return new Meta(
45944789 Meta::fromMsg($obj->{'msg'})
45954790 ,Meta::fromResponseID($obj->{'response_id'})
@@ -4796,6 +4991,15 @@ class Pagination {
47964991 * @throws Exception
47974992 */
47984993 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+ }
47995003 return new Pagination(
48005004 Pagination::fromCount($obj->{'count'})
48015005 ,Pagination::fromOffset($obj->{'offset'})
Test case

test/inputs/json/misc/13d8d.json

1 generated file · +48 −0
Mphpdefault / TopLevel.php+48 −0
@@ -502,6 +502,33 @@ class TopLevel {
502502 * @throws Exception
503503 */
504504 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+ }
505532 return new TopLevel(
506533 TopLevel::fromCategory($obj->{'category'})
507534 ,TopLevel::fromContext($obj->{'context'})
@@ -721,6 +748,15 @@ class Location {
721748 * @throws Exception
722749 */
723750 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+ }
724760 return new Location(
725761 Location::fromLatitude($obj->{'latitude'})
726762 ,Location::fromLongitude($obj->{'longitude'})
@@ -875,6 +911,12 @@ class Street {
875911 * @throws Exception
876912 */
877913 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+ }
878920 return new Street(
879921 Street::fromID($obj->{'id'})
880922 ,Street::fromName($obj->{'name'})
@@ -1027,6 +1069,12 @@ class OutcomeStatus {
10271069 * @throws Exception
10281070 */
10291071 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+ }
10301078 return new OutcomeStatus(
10311079 OutcomeStatus::fromCategory($obj->{'category'})
10321080 ,OutcomeStatus::fromDate($obj->{'date'})
Test case

test/inputs/json/misc/14d38.json

1 generated file · +15 −0
Mphpdefault / TopLevel.php+15 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'headers')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromHeaders($obj->{'headers'})
9093 );
@@ -339,6 +342,18 @@ class Headers {
339342 * @throws Exception
340343 */
341344 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+ }
342357 return new Headers(
343358 Headers::fromAcceptEncoding($obj->{'Accept-Encoding'})
344359 ,Headers::fromConnection($obj->{'Connection'})
Test case

test/inputs/json/misc/167d6.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -205,6 +205,15 @@ class TopLevel {
205205 * @throws Exception
206206 */
207207 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+ }
208217 return new TopLevel(
209218 TopLevel::fromBase($obj->{'base'})
210219 ,TopLevel::fromDate($obj->{'date'})
Test case

test/inputs/json/misc/16bc5.json

1 generated file · +180 −0
Mphpdefault / TopLevel.php+180 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'query')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromQuery($obj->{'query'})
9093 );
@@ -347,6 +350,18 @@ class Query {
347350 * @throws Exception
348351 */
349352 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+ }
350365 return new Query(
351366 Query::fromCount($obj->{'count'})
352367 ,Query::fromCreated($obj->{'created'})
@@ -452,6 +467,9 @@ class Results {
452467 * @throws Exception
453468 */
454469 public static function from(stdClass $obj): Results {
470+ if (!property_exists($obj, 'channel')) {
471+ throw new Exception("Missing required property");
472+ }
455473 return new Results(
456474 Results::fromChannel($obj->{'channel'})
457475 );
@@ -1181,6 +1199,45 @@ class Channel {
11811199 * @throws Exception
11821200 */
11831201 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+ }
11841241 return new Channel(
11851242 Channel::fromAstronomy($obj->{'astronomy'})
11861243 ,Channel::fromAtmosphere($obj->{'atmosphere'})
@@ -1355,6 +1412,12 @@ class Astronomy {
13551412 * @throws Exception
13561413 */
13571414 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+ }
13581421 return new Astronomy(
13591422 Astronomy::fromSunrise($obj->{'sunrise'})
13601423 ,Astronomy::fromSunset($obj->{'sunset'})
@@ -1611,6 +1674,18 @@ class Atmosphere {
16111674 * @throws Exception
16121675 */
16131676 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+ }
16141689 return new Atmosphere(
16151690 Atmosphere::fromHumidity($obj->{'humidity'})
16161691 ,Atmosphere::fromPressure($obj->{'pressure'})
@@ -1923,6 +1998,21 @@ class Image {
19231998 * @throws Exception
19241999 */
19252000 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+ }
19262016 return new Image(
19272017 Image::fromHeight($obj->{'height'})
19282018 ,Image::fromLink($obj->{'link'})
@@ -2459,6 +2549,33 @@ class Item {
24592549 * @throws Exception
24602550 */
24612551 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+ }
24622579 return new Item(
24632580 Item::fromCondition($obj->{'condition'})
24642581 ,Item::fromDescription($obj->{'description'})
@@ -2729,6 +2846,18 @@ class Condition {
27292846 * @throws Exception
27302847 */
27312848 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+ }
27322861 return new Condition(
27332862 Condition::fromCode($obj->{'code'})
27342863 ,Condition::fromDate($obj->{'date'})
@@ -3093,6 +3222,24 @@ class Forecast {
30933222 * @throws Exception
30943223 */
30953224 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+ }
30963243 return new Forecast(
30973244 Forecast::fromCode($obj->{'code'})
30983245 ,Forecast::fromDate($obj->{'date'})
@@ -3201,6 +3348,9 @@ class GUID {
32013348 * @throws Exception
32023349 */
32033350 public static function from(stdClass $obj): GUID {
3351+ if (!property_exists($obj, 'isPermaLink')) {
3352+ throw new Exception("Missing required property");
3353+ }
32043354 return new GUID(
32053355 GUID::fromIsPermaLink($obj->{'isPermaLink'})
32063356 );
@@ -3403,6 +3553,15 @@ class Location {
34033553 * @throws Exception
34043554 */
34053555 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+ }
34063565 return new Location(
34073566 Location::fromCity($obj->{'city'})
34083567 ,Location::fromCountry($obj->{'country'})
@@ -3661,6 +3820,18 @@ class Units {
36613820 * @throws Exception
36623821 */
36633822 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+ }
36643835 return new Units(
36653836 Units::fromDistance($obj->{'distance'})
36663837 ,Units::fromPressure($obj->{'pressure'})
@@ -3869,6 +4040,15 @@ class Wind {
38694040 * @throws Exception
38704041 */
38714042 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+ }
38724052 return new Wind(
38734053 Wind::fromChill($obj->{'chill'})
38744054 ,Wind::fromDirection($obj->{'direction'})
Test case

test/inputs/json/misc/176f1.json

1 generated file · +36 −0
Mphpdefault / TopLevel.php+36 −0
@@ -252,6 +252,18 @@ class TopLevel {
252252 * @throws Exception
253253 */
254254 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+ }
255267 return new TopLevel(
256268 TopLevel::fromMessage($obj->{'message'})
257269 ,TopLevel::fromResponseTime($obj->{'responseTime'})
@@ -368,6 +380,9 @@ class Results {
368380 * @throws Exception
369381 */
370382 public static function from(stdClass $obj): Results {
383+ if (!property_exists($obj, 'series')) {
384+ throw new Exception("Missing required property");
385+ }
371386 return new Results(
372387 Results::fromSeries($obj->{'series'})
373388 );
@@ -530,6 +545,12 @@ class Series {
530545 * @throws Exception
531546 */
532547 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+ }
533554 return new Series(
534555 Series::fromData($obj->{'data'})
535556 ,Series::fromSeriesID($obj->{'seriesID'})
@@ -850,6 +871,21 @@ class Datum {
850871 * @throws Exception
851872 */
852873 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+ }
853889 return new Datum(
854890 Datum::fromFootnotes($obj->{'footnotes'})
855891 ,Datum::fromPeriod($obj->{'period'})
Test case

test/inputs/json/misc/1a7f5.json

1 generated file · +18 −0
Mphpdefault / TopLevel.php+18 −0
@@ -345,6 +345,24 @@ class TopLevel {
345345 * @throws Exception
346346 */
347347 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+ }
348366 return new TopLevel(
349367 TopLevel::fromAge($obj->{'age'})
350368 ,TopLevel::fromCountry($obj->{'country'})
Test case

test/inputs/json/misc/1b28c.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'total_population')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromTotalPopulation($obj->{'total_population'})
101104 );
@@ -246,6 +249,12 @@ class TotalPopulation {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new TotalPopulation(
250259 TotalPopulation::fromDate($obj->{'date'})
251260 ,TotalPopulation::fromPopulation($obj->{'population'})
Test case

test/inputs/json/misc/1b409.json

1 generated file · +138 −0
Mphpdefault / TopLevel.php+138 −0
@@ -149,6 +149,12 @@ class TopLevel {
149149 * @throws Exception
150150 */
151151 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+ }
152158 return new TopLevel(
153159 TopLevel::fromMeta($obj->{'meta'})
154160 ,TopLevel::fromObjects($obj->{'objects'})
@@ -353,6 +359,15 @@ class Meta {
353359 * @throws Exception
354360 */
355361 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+ }
356371 return new Meta(
357372 Meta::fromLimit($obj->{'limit'})
358373 ,Meta::fromOffset($obj->{'offset'})
@@ -1535,6 +1550,69 @@ class ObjectElement {
15351550 * @throws Exception
15361551 */
15371552 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+ }
15381616 return new ObjectElement(
15391617 ObjectElement::fromCaucus($obj->{'caucus'})
15401618 ,ObjectElement::fromCongressNumbers($obj->{'congress_numbers'})
@@ -1911,6 +1989,12 @@ class Extra {
19111989 * @throws Exception
19121990 */
19131991 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+ }
19141998 return new Extra(
19151999 Extra::fromAddress($obj->{'address'})
19162000 ,Extra::fromContactForm($obj->{'contact_form'})
@@ -2983,6 +3067,60 @@ class Person {
29833067 * @throws Exception
29843068 */
29853069 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+ }
29863124 return new Person(
29873125 Person::fromBioguideid($obj->{'bioguideid'})
29883126 ,Person::fromBirthday($obj->{'birthday'})
Test case

test/inputs/json/misc/2465e.json

1 generated file · +114 −0
Mphpdefault / TopLevel.php+114 −0
@@ -479,6 +479,30 @@ class TopLevel {
479479 * @throws Exception
480480 */
481481 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+ }
482506 return new TopLevel(
483507 TopLevel::fromBasePath($obj->{'basePath'})
484508 ,TopLevel::fromDefinitions($obj->{'definitions'})
@@ -592,6 +616,9 @@ class Definitions {
592616 * @throws Exception
593617 */
594618 public static function from(stdClass $obj): Definitions {
619+ if (!property_exists($obj, 'Taxonomy')) {
620+ throw new Exception("Missing required property");
621+ }
595622 return new Definitions(
596623 Definitions::fromTaxonomy($obj->{'Taxonomy'})
597624 );
@@ -691,6 +718,9 @@ class Taxonomy {
691718 * @throws Exception
692719 */
693720 public static function from(stdClass $obj): Taxonomy {
721+ if (!property_exists($obj, 'properties')) {
722+ throw new Exception("Missing required property");
723+ }
694724 return new Taxonomy(
695725 Taxonomy::fromProperties($obj->{'properties'})
696726 );
@@ -1055,6 +1085,24 @@ class Properties {
10551085 * @throws Exception
10561086 */
10571087 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+ }
10581106 return new Properties(
10591107 Properties::fromAnnotations($obj->{'annotations'})
10601108 ,Properties::fromDatatypeProperties($obj->{'datatype_properties'})
@@ -1215,6 +1263,12 @@ class Annotations {
12151263 * @throws Exception
12161264 */
12171265 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+ }
12181272 return new Annotations(
12191273 Annotations::fromDescription($obj->{'description'})
12201274 ,Annotations::fromType($obj->{'type'})
@@ -1419,6 +1473,15 @@ class Info {
14191473 * @throws Exception
14201474 */
14211475 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+ }
14221485 return new Info(
14231486 Info::fromDescription($obj->{'description'})
14241487 ,Info::fromTitle($obj->{'title'})
@@ -1522,6 +1585,9 @@ class Paths {
15221585 * @throws Exception
15231586 */
15241587 public static function from(stdClass $obj): Paths {
1588+ if (!property_exists($obj, '/ita_taxonomies/search')) {
1589+ throw new Exception("Missing required property");
1590+ }
15251591 return new Paths(
15261592 Paths::fromItaTaxonomiesSearch($obj->{'/ita_taxonomies/search'})
15271593 );
@@ -1621,6 +1687,9 @@ class ItaTaxonomiesSearch {
16211687 * @throws Exception
16221688 */
16231689 public static function from(stdClass $obj): ItaTaxonomiesSearch {
1690+ if (!property_exists($obj, 'get')) {
1691+ throw new Exception("Missing required property");
1692+ }
16241693 return new ItaTaxonomiesSearch(
16251694 ItaTaxonomiesSearch::fromGet($obj->{'get'})
16261695 );
@@ -1954,6 +2023,21 @@ class Get {
19542023 * @throws Exception
19552024 */
19562025 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+ }
19572041 return new Get(
19582042 Get::fromDescription($obj->{'description'})
19592043 ,Get::fromParameters($obj->{'parameters'})
@@ -2320,6 +2404,24 @@ class Parameter {
23202404 * @throws Exception
23212405 */
23222406 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+ }
23232425 return new Parameter(
23242426 Parameter::fromDescription($obj->{'description'})
23252427 ,Parameter::fromFormat($obj->{'format'})
@@ -2429,6 +2531,9 @@ class Responses {
24292531 * @throws Exception
24302532 */
24312533 public static function from(stdClass $obj): Responses {
2534+ if (!property_exists($obj, '200')) {
2535+ throw new Exception("Missing required property");
2536+ }
24322537 return new Responses(
24332538 Responses::fromThe200($obj->{'200'})
24342539 );
@@ -2580,6 +2685,12 @@ class The200 {
25802685 * @throws Exception
25812686 */
25822687 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+ }
25832694 return new The200(
25842695 The200::fromDescription($obj->{'description'})
25852696 ,The200::fromSchema($obj->{'schema'})
@@ -2680,6 +2791,9 @@ class Schema {
26802791 * @throws Exception
26812792 */
26822793 public static function from(stdClass $obj): Schema {
2794+ if (!property_exists($obj, '$ref')) {
2795+ throw new Exception("Missing required property");
2796+ }
26832797 return new Schema(
26842798 Schema::fromRef($obj->{'$ref'})
26852799 );
Test case

test/inputs/json/misc/24f52.json

1 generated file · +75 −0
Mphpdefault / TopLevel.php+75 −0
@@ -450,6 +450,30 @@ class TopLevel {
450450 * @throws Exception
451451 */
452452 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+ }
453477 return new TopLevel(
454478 TopLevel::fromCity($obj->{'city'})
455479 ,TopLevel::fromDelay($obj->{'delay'})
@@ -978,6 +1002,33 @@ class Status {
9781002 * @throws Exception
9791003 */
9801004 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+ }
9811032 return new Status(
9821033 Status::fromAvgDelay($obj->{'avgDelay'})
9831034 ,Status::fromClosureBegin($obj->{'closureBegin'})
@@ -1301,6 +1352,21 @@ class Weather {
13011352 * @throws Exception
13021353 */
13031354 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+ }
13041370 return new Weather(
13051371 Weather::fromMeta($obj->{'meta'})
13061372 ,Weather::fromTemp($obj->{'temp'})
@@ -1511,6 +1577,15 @@ class Meta {
15111577 * @throws Exception
15121578 */
15131579 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+ }
15141589 return new Meta(
15151590 Meta::fromCredit($obj->{'credit'})
15161591 ,Meta::fromUpdated($obj->{'updated'})
Test case

test/inputs/json/misc/262f0.json

1 generated file · +180 −0
Mphpdefault / TopLevel.php+180 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'query')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromQuery($obj->{'query'})
9093 );
@@ -347,6 +350,18 @@ class Query {
347350 * @throws Exception
348351 */
349352 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+ }
350365 return new Query(
351366 Query::fromCount($obj->{'count'})
352367 ,Query::fromCreated($obj->{'created'})
@@ -452,6 +467,9 @@ class Results {
452467 * @throws Exception
453468 */
454469 public static function from(stdClass $obj): Results {
470+ if (!property_exists($obj, 'channel')) {
471+ throw new Exception("Missing required property");
472+ }
455473 return new Results(
456474 Results::fromChannel($obj->{'channel'})
457475 );
@@ -1181,6 +1199,45 @@ class Channel {
11811199 * @throws Exception
11821200 */
11831201 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+ }
11841241 return new Channel(
11851242 Channel::fromAstronomy($obj->{'astronomy'})
11861243 ,Channel::fromAtmosphere($obj->{'atmosphere'})
@@ -1355,6 +1412,12 @@ class Astronomy {
13551412 * @throws Exception
13561413 */
13571414 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+ }
13581421 return new Astronomy(
13591422 Astronomy::fromSunrise($obj->{'sunrise'})
13601423 ,Astronomy::fromSunset($obj->{'sunset'})
@@ -1611,6 +1674,18 @@ class Atmosphere {
16111674 * @throws Exception
16121675 */
16131676 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+ }
16141689 return new Atmosphere(
16151690 Atmosphere::fromHumidity($obj->{'humidity'})
16161691 ,Atmosphere::fromPressure($obj->{'pressure'})
@@ -1923,6 +1998,21 @@ class Image {
19231998 * @throws Exception
19241999 */
19252000 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+ }
19262016 return new Image(
19272017 Image::fromHeight($obj->{'height'})
19282018 ,Image::fromLink($obj->{'link'})
@@ -2459,6 +2549,33 @@ class Item {
24592549 * @throws Exception
24602550 */
24612551 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+ }
24622579 return new Item(
24632580 Item::fromCondition($obj->{'condition'})
24642581 ,Item::fromDescription($obj->{'description'})
@@ -2730,6 +2847,18 @@ class Condition {
27302847 * @throws Exception
27312848 */
27322849 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+ }
27332862 return new Condition(
27342863 Condition::fromCode($obj->{'code'})
27352864 ,Condition::fromDate($obj->{'date'})
@@ -3148,6 +3277,24 @@ class Forecast {
31483277 * @throws Exception
31493278 */
31503279 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+ }
31513298 return new Forecast(
31523299 Forecast::fromCode($obj->{'code'})
31533300 ,Forecast::fromDate($obj->{'date'})
@@ -3256,6 +3403,9 @@ class GUID {
32563403 * @throws Exception
32573404 */
32583405 public static function from(stdClass $obj): GUID {
3406+ if (!property_exists($obj, 'isPermaLink')) {
3407+ throw new Exception("Missing required property");
3408+ }
32593409 return new GUID(
32603410 GUID::fromIsPermaLink($obj->{'isPermaLink'})
32613411 );
@@ -3458,6 +3608,15 @@ class Location {
34583608 * @throws Exception
34593609 */
34603610 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+ }
34613620 return new Location(
34623621 Location::fromCity($obj->{'city'})
34633622 ,Location::fromCountry($obj->{'country'})
@@ -3716,6 +3875,18 @@ class Units {
37163875 * @throws Exception
37173876 */
37183877 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+ }
37193890 return new Units(
37203891 Units::fromDistance($obj->{'distance'})
37213892 ,Units::fromPressure($obj->{'pressure'})
@@ -3924,6 +4095,15 @@ class Wind {
39244095 * @throws Exception
39254096 */
39264097 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+ }
39274107 return new Wind(
39284108 Wind::fromChill($obj->{'chill'})
39294109 ,Wind::fromDirection($obj->{'direction'})
Test case

test/inputs/json/misc/26b49.json

1 generated file · +204 −0
Mphpdefault / TopLevel.php+204 −0
@@ -202,6 +202,15 @@ class TopLevel {
202202 * @throws Exception
203203 */
204204 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+ }
205214 return new TopLevel(
206215 TopLevel::fromData($obj->{'data'})
207216 ,TopLevel::fromMeta($obj->{'meta'})
@@ -1202,6 +1211,57 @@ class Datum {
12021211 * @throws Exception
12031212 */
12041213 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+ }
12051265 return new Datum(
12061266 Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'})
12071267 ,Datum::fromBitlyURL($obj->{'bitly_url'})
@@ -2574,6 +2634,72 @@ class Images {
25742634 * @throws Exception
25752635 */
25762636 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+ }
25772703 return new Images(
25782704 Images::fromDownsized($obj->{'downsized'})
25792705 ,Images::fromDownsizedLarge($obj->{'downsized_large'})
@@ -2884,6 +3010,15 @@ class Downsized {
28843010 * @throws Exception
28853011 */
28863012 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+ }
28873022 return new Downsized(
28883023 Downsized::fromHeight($obj->{'height'})
28893024 ,Downsized::fromSize($obj->{'size'})
@@ -3144,6 +3279,18 @@ class DownsizedSmall {
31443279 * @throws Exception
31453280 */
31463281 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+ }
31473294 return new DownsizedSmall(
31483295 DownsizedSmall::fromHeight($obj->{'height'})
31493296 ,DownsizedSmall::fromMp4($obj->{'mp4'})
@@ -3756,6 +3903,24 @@ class FixedHeight {
37563903 * @throws Exception
37573904 */
37583905 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+ }
37593924 return new FixedHeight(
37603925 FixedHeight::fromFrames($obj->{'frames'})
37613926 ,FixedHeight::fromHash($obj->{'hash'})
@@ -3924,6 +4089,12 @@ class Looping {
39244089 * @throws Exception
39254090 */
39264091 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+ }
39274098 return new Looping(
39284099 Looping::fromMp4($obj->{'mp4'})
39294100 ,Looping::fromMp4Size($obj->{'mp4_size'})
@@ -4396,6 +4567,21 @@ class User {
43964567 * @throws Exception
43974568 */
43984569 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+ }
43994585 return new User(
44004586 User::fromAvatarURL($obj->{'avatar_url'})
44014587 ,User::fromBannerURL($obj->{'banner_url'})
@@ -4608,6 +4794,15 @@ class Meta {
46084794 * @throws Exception
46094795 */
46104796 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+ }
46114806 return new Meta(
46124807 Meta::fromMsg($obj->{'msg'})
46134808 ,Meta::fromResponseID($obj->{'response_id'})
@@ -4814,6 +5009,15 @@ class Pagination {
48145009 * @throws Exception
48155010 */
48165011 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+ }
48175021 return new Pagination(
48185022 Pagination::fromCount($obj->{'count'})
48195023 ,Pagination::fromOffset($obj->{'offset'})
Test case

test/inputs/json/misc/26c9c.json

1 generated file · +321 −0
Mphpdefault / TopLevel.php+321 −0
@@ -190,6 +190,12 @@ class TopLevel {
190190 * @throws Exception
191191 */
192192 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+ }
193199 return new TopLevel(
194200 TopLevel::fromData($obj->{'data'})
195201 ,TopLevel::fromMeta($obj->{'meta'})
@@ -291,6 +297,9 @@ class Meta {
291297 * @throws Exception
292298 */
293299 public static function from(stdClass $obj): Meta {
300+ if (!property_exists($obj, 'view')) {
301+ throw new Exception("Missing required property");
302+ }
294303 return new Meta(
295304 Meta::fromView($obj->{'view'})
296305 );
@@ -2383,6 +2392,120 @@ class View {
23832392 * @throws Exception
23842393 */
23852394 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+ }
23862509 return new View(
23872510 View::fromAttribution($obj->{'attribution'})
23882511 ,View::fromAttributionLink($obj->{'attributionLink'})
@@ -3131,6 +3254,27 @@ class Column {
31313254 * @throws Exception
31323255 */
31333256 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+ }
31343278 return new Column(
31353279 Column::fromCachedContents($obj->{'cachedContents'})
31363280 ,Column::fromDataTypeName($obj->{'dataTypeName'})
@@ -3593,6 +3737,21 @@ class CachedContents {
35933737 * @throws Exception
35943738 */
35953739 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+ }
35963755 return new CachedContents(
35973756 CachedContents::fromAverage($obj->{'average'})
35983757 ,CachedContents::fromLargest($obj->{'largest'})
@@ -3755,6 +3914,12 @@ class Top {
37553914 * @throws Exception
37563915 */
37573916 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+ }
37583923 return new Top(
37593924 Top::fromCount($obj->{'count'})
37603925 ,Top::fromItem($obj->{'item'})
@@ -4273,6 +4438,15 @@ class Grant {
42734438 * @throws Exception
42744439 */
42754440 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+ }
42764450 return new Grant(
42774451 Grant::fromFlags($obj->{'flags'})
42784452 ,Grant::fromInherited($obj->{'inherited'})
@@ -4664,6 +4838,24 @@ class Metadata {
46644838 * @throws Exception
46654839 */
46664840 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+ }
46674859 return new Metadata(
46684860 Metadata::fromAttachments($obj->{'attachments'})
46694861 ,Metadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'})
@@ -4928,6 +5120,18 @@ class Attachment {
49285120 * @throws Exception
49295121 */
49305122 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+ }
49315135 return new Attachment(
49325136 Attachment::fromAssetID($obj->{'assetId'})
49335137 ,Attachment::fromBlobID($obj->{'blobId'})
@@ -5245,6 +5449,21 @@ class CustomFields {
52455449 * @throws Exception
52465450 */
52475451 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+ }
52485467 return new CustomFields(
52495468 CustomFields::fromAdditionalResources($obj->{'Additional Resources'})
52505469 ,CustomFields::fromCommonCore($obj->{'Common Core'})
@@ -5403,6 +5622,12 @@ class AdditionalResources {
54035622 * @throws Exception
54045623 */
54055624 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+ }
54065631 return new AdditionalResources(
54075632 AdditionalResources::fromAdditionalResourcesSeeAlso($obj->{'See Also '})
54085633 ,AdditionalResources::fromSeeAlso($obj->{'See Also'})
@@ -5607,6 +5832,15 @@ class CommonCore {
56075832 * @throws Exception
56085833 */
56095834 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+ }
56105844 return new CommonCore(
56115845 CommonCore::fromContactEmail($obj->{'Contact Email'})
56125846 ,CommonCore::fromContactName($obj->{'Contact Name'})
@@ -5709,6 +5943,9 @@ class DatasetInformation {
57095943 * @throws Exception
57105944 */
57115945 public static function from(stdClass $obj): DatasetInformation {
5946+ if (!property_exists($obj, 'Agency')) {
5947+ throw new Exception("Missing required property");
5948+ }
57125949 return new DatasetInformation(
57135950 DatasetInformation::fromAgency($obj->{'Agency'})
57145951 );
@@ -6223,6 +6460,33 @@ class DatasetSummary {
62236460 * @throws Exception
62246461 */
62256462 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+ }
62266490 return new DatasetSummary(
62276491 DatasetSummary::fromContactInformation($obj->{'Contact Information'})
62286492 ,DatasetSummary::fromCoverage($obj->{'Coverage'})
@@ -6337,6 +6601,9 @@ class Notes {
63376601 * @throws Exception
63386602 */
63396603 public static function from(stdClass $obj): Notes {
6604+ if (!property_exists($obj, 'Notes')) {
6605+ throw new Exception("Missing required property");
6606+ }
63406607 return new Notes(
63416608 Notes::fromNotes($obj->{'Notes'})
63426609 );
@@ -6447,6 +6714,9 @@ class JSONQuery {
64476714 * @throws Exception
64486715 */
64496716 public static function from(stdClass $obj): JSONQuery {
6717+ if (!property_exists($obj, 'order')) {
6718+ throw new Exception("Missing required property");
6719+ }
64506720 return new JSONQuery(
64516721 JSONQuery::fromOrder($obj->{'order'})
64526722 );
@@ -6597,6 +6867,12 @@ class Order {
65976867 * @throws Exception
65986868 */
65996869 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+ }
66006876 return new Order(
66016877 Order::fromAscending($obj->{'ascending'})
66026878 ,Order::fromColumnFieldName($obj->{'columnFieldName'})
@@ -6698,6 +6974,9 @@ class RenderTypeConfig {
66986974 * @throws Exception
66996975 */
67006976 public static function from(stdClass $obj): RenderTypeConfig {
6977+ if (!property_exists($obj, 'visible')) {
6978+ throw new Exception("Missing required property");
6979+ }
67016980 return new RenderTypeConfig(
67026981 RenderTypeConfig::fromVisible($obj->{'visible'})
67036982 );
@@ -6796,6 +7075,9 @@ class Visible {
67967075 * @throws Exception
67977076 */
67987077 public static function from(stdClass $obj): Visible {
7078+ if (!property_exists($obj, 'table')) {
7079+ throw new Exception("Missing required property");
7080+ }
67997081 return new Visible(
68007082 Visible::fromTable($obj->{'table'})
68017083 );
@@ -7272,6 +7554,30 @@ class Owner {
72727554 * @throws Exception
72737555 */
72747556 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+ }
72757581 return new Owner(
72767582 Owner::fromDisplayName($obj->{'displayName'})
72777583 ,Owner::fromID($obj->{'id'})
@@ -7396,6 +7702,9 @@ class Query {
73967702 * @throws Exception
73977703 */
73987704 public static function from(stdClass $obj): Query {
7705+ if (!property_exists($obj, 'orderBys')) {
7706+ throw new Exception("Missing required property");
7707+ }
73997708 return new Query(
74007709 Query::fromOrderBys($obj->{'orderBys'})
74017710 );
@@ -7547,6 +7856,12 @@ class OrderBy {
75477856 * @throws Exception
75487857 */
75497858 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+ }
75507865 return new OrderBy(
75517866 OrderBy::fromAscending($obj->{'ascending'})
75527867 ,OrderBy::fromExpression($obj->{'expression'})
@@ -7699,6 +8014,12 @@ class Expression {
76998014 * @throws Exception
77008015 */
77018016 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+ }
77028023 return new Expression(
77038024 Expression::fromColumnID($obj->{'columnId'})
77048025 ,Expression::fromType($obj->{'type'})
Test case

test/inputs/json/misc/27332.json

1 generated file · +279 −0
Mphpdefault / TopLevel.php+279 −0
@@ -137,6 +137,12 @@ class TopLevel {
137137 * @throws Exception
138138 */
139139 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+ }
140146 return new TopLevel(
141147 TopLevel::fromData($obj->{'data'})
142148 ,TopLevel::fromKind($obj->{'kind'})
@@ -408,6 +414,18 @@ class TopLevelData {
408414 * @throws Exception
409415 */
410416 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+ }
411429 return new TopLevelData(
412430 TopLevelData::fromAfter($obj->{'after'})
413431 ,TopLevelData::fromBefore($obj->{'before'})
@@ -566,6 +584,12 @@ class Child {
566584 * @throws Exception
567585 */
568586 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+ }
569593 return new Child(
570594 Child::fromData($obj->{'data'})
571595 ,Child::fromKind($obj->{'kind'})
@@ -4125,6 +4149,192 @@ class ChildData {
41254149 * @throws Exception
41264150 */
41274151 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+ }
41284338 return new ChildData(
41294339 ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'})
41304340 ,ChildData::fromApprovedBy($obj->{'approved_by'})
@@ -4460,6 +4670,12 @@ class Media {
44604670 * @throws Exception
44614671 */
44624672 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+ }
44634679 return new Media(
44644680 Media::fromOembed($obj->{'oembed'})
44654681 ,Media::fromType($obj->{'type'})
@@ -5132,6 +5348,42 @@ class Oembed {
51325348 * @throws Exception
51335349 */
51345350 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+ }
51355387 return new Oembed(
51365388 Oembed::fromDescription($obj->{'description'})
51375389 ,Oembed::fromHeight($obj->{'height'})
@@ -5665,6 +5917,12 @@ class Preview {
56655917 * @throws Exception
56665918 */
56675919 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+ }
56685926 return new Preview(
56695927 Preview::fromEnabled($obj->{'enabled'})
56705928 ,Preview::fromImages($obj->{'images'})
@@ -5935,6 +6193,18 @@ class Image {
59356193 * @throws Exception
59366194 */
59376195 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+ }
59386208 return new Image(
59396209 Image::fromID($obj->{'id'})
59406210 ,Image::fromResolutions($obj->{'resolutions'})
@@ -6143,6 +6413,15 @@ class Source {
61436413 * @throws Exception
61446414 */
61456415 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+ }
61466425 return new Source(
61476426 Source::fromHeight($obj->{'height'})
61486427 ,Source::fromURL($obj->{'url'})
Test case

test/inputs/json/misc/29f47.json

1 generated file · +243 −0
Mphpdefault / TopLevel.php+243 −0
@@ -137,6 +137,12 @@ class TopLevel {
137137 * @throws Exception
138138 */
139139 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+ }
140146 return new TopLevel(
141147 TopLevel::fromData($obj->{'data'})
142148 ,TopLevel::fromKind($obj->{'kind'})
@@ -408,6 +414,18 @@ class TopLevelData {
408414 * @throws Exception
409415 */
410416 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+ }
411429 return new TopLevelData(
412430 TopLevelData::fromAfter($obj->{'after'})
413431 ,TopLevelData::fromBefore($obj->{'before'})
@@ -566,6 +584,12 @@ class Child {
566584 * @throws Exception
567585 */
568586 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+ }
569593 return new Child(
570594 Child::fromData($obj->{'data'})
571595 ,Child::fromKind($obj->{'kind'})
@@ -4102,6 +4126,192 @@ class ChildData {
41024126 * @throws Exception
41034127 */
41044128 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+ }
41054315 return new ChildData(
41064316 ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'})
41074317 ,ChildData::fromApprovedBy($obj->{'approved_by'})
@@ -4578,6 +4788,12 @@ class Preview {
45784788 * @throws Exception
45794789 */
45804790 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+ }
45814797 return new Preview(
45824798 Preview::fromEnabled($obj->{'enabled'})
45834799 ,Preview::fromImages($obj->{'images'})
@@ -4848,6 +5064,18 @@ class Image {
48485064 * @throws Exception
48495065 */
48505066 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+ }
48515079 return new Image(
48525080 Image::fromID($obj->{'id'})
48535081 ,Image::fromResolutions($obj->{'resolutions'})
@@ -5056,6 +5284,15 @@ class Source {
50565284 * @throws Exception
50575285 */
50585286 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+ }
50595296 return new Source(
50605297 Source::fromHeight($obj->{'height'})
50615298 ,Source::fromURL($obj->{'url'})
@@ -5397,6 +5634,12 @@ class GIF {
53975634 * @throws Exception
53985635 */
53995636 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+ }
54005643 return new GIF(
54015644 GIF::fromResolutions($obj->{'resolutions'})
54025645 ,GIF::fromSource($obj->{'source'})
Test case

test/inputs/json/misc/2d4e2.json

1 generated file · +147 −0
Mphpdefault / TopLevel.php+147 −0
@@ -149,6 +149,12 @@ class TopLevel {
149149 * @throws Exception
150150 */
151151 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+ }
152158 return new TopLevel(
153159 TopLevel::fromMeta($obj->{'meta'})
154160 ,TopLevel::fromObjects($obj->{'objects'})
@@ -353,6 +359,15 @@ class Meta {
353359 * @throws Exception
354360 */
355361 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+ }
356371 return new Meta(
357372 Meta::fromLimit($obj->{'limit'})
358373 ,Meta::fromOffset($obj->{'offset'})
@@ -1648,6 +1663,75 @@ class ObjectElement {
16481663 * @throws Exception
16491664 */
16501665 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+ }
16511735 return new ObjectElement(
16521736 ObjectElement::fromCaucus($obj->{'caucus'})
16531737 ,ObjectElement::fromCongressNumbers($obj->{'congress_numbers'})
@@ -2071,6 +2155,15 @@ class Extra {
20712155 * @throws Exception
20722156 */
20732157 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+ }
20742167 return new Extra(
20752168 Extra::fromAddress($obj->{'address'})
20762169 ,Extra::fromContactForm($obj->{'contact_form'})
@@ -3084,6 +3177,60 @@ class Person {
30843177 * @throws Exception
30853178 */
30863179 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+ }
30873234 return new Person(
30883235 Person::fromBioguideid($obj->{'bioguideid'})
30893236 ,Person::fromBirthday($obj->{'birthday'})
Test case

test/inputs/json/misc/31189.json

1 generated file · +30 −0
Mphpdefault / TopLevel.php+30 −0
@@ -203,6 +203,15 @@ class TopLevel {
203203 * @throws Exception
204204 */
205205 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+ }
206215 return new TopLevel(
207216 TopLevel::fromDetails($obj->{'details'})
208217 ,TopLevel::fromRates($obj->{'rates'})
@@ -473,6 +482,18 @@ class Rate {
473482 * @throws Exception
474483 */
475484 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+ }
476497 return new Rate(
477498 Rate::fromCode($obj->{'code'})
478499 ,Rate::fromCountryCode($obj->{'country_code'})
@@ -630,6 +651,12 @@ class Period {
630651 * @throws Exception
631652 */
632653 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+ }
633660 return new Period(
634661 Period::fromEffectiveFrom($obj->{'effective_from'})
635662 ,Period::fromRates($obj->{'rates'})
@@ -1040,6 +1067,9 @@ class Rates {
10401067 * @throws Exception
10411068 */
10421069 public static function from(stdClass $obj): Rates {
1070+ if (!property_exists($obj, 'standard')) {
1071+ throw new Exception("Missing required property");
1072+ }
10431073 return new Rates(
10441074 Rates::fromParking($obj->{'parking'})
10451075 ,Rates::fromReduced($obj->{'reduced'})
Test case

test/inputs/json/misc/32431.json

1 generated file · +126 −0
Mphpdefault / TopLevel.php+126 −0
@@ -267,6 +267,18 @@ class TopLevel {
267267 * @throws Exception
268268 */
269269 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+ }
270282 return new TopLevel(
271283 TopLevel::fromBbox($obj->{'bbox'})
272284 ,TopLevel::fromFeatures($obj->{'features'})
@@ -530,6 +542,18 @@ class Feature {
530542 * @throws Exception
531543 */
532544 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+ }
533557 return new Feature(
534558 Feature::fromGeometry($obj->{'geometry'})
535559 ,Feature::fromID($obj->{'id'})
@@ -701,6 +725,12 @@ class Geometry {
701725 * @throws Exception
702726 */
703727 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+ }
704734 return new Geometry(
705735 Geometry::fromCoordinates($obj->{'coordinates'})
706736 ,Geometry::fromType($obj->{'type'})
@@ -2191,6 +2221,84 @@ class Properties {
21912221 * @throws Exception
21922222 */
21932223 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+ }
21942302 return new Properties(
21952303 Properties::fromAlert($obj->{'alert'})
21962304 ,Properties::fromCdi($obj->{'cdi'})
@@ -2791,6 +2899,24 @@ class Metadata {
27912899 * @throws Exception
27922900 */
27932901 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+ }
27942920 return new Metadata(
27952921 Metadata::fromAPI($obj->{'api'})
27962922 ,Metadata::fromCount($obj->{'count'})
Test case

test/inputs/json/misc/32d5c.json

1 generated file · +24 −0
Mphpdefault / TopLevel.php+24 −0
@@ -465,6 +465,30 @@ class TopLevel {
465465 * @throws Exception
466466 */
467467 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+ }
468492 return new TopLevel(
469493 TopLevel::fromBirthDate($obj->{'BirthDate'})
470494 ,TopLevel::fromBirthDateIsProtected($obj->{'BirthDateIsProtected'})
Test case

test/inputs/json/misc/337ed.json

1 generated file · +141 −0
Mphpdefault / TopLevel.php+141 −0
@@ -409,6 +409,27 @@ class TopLevel {
409409 * @throws Exception
410410 */
411411 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+ }
412433 return new TopLevel(
413434 TopLevel::fromCount($obj->{'count'})
414435 ,TopLevel::fromFacets($obj->{'facets'})
@@ -2397,6 +2418,102 @@ class Result {
23972418 * @throws Exception
23982419 */
23992420 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+ }
24002517 return new Result(
24012518 Result::fromCostAbsolute($obj->{'cost_absolute'})
24022519 ,Result::fromCostMax($obj->{'cost_max'})
@@ -2937,6 +3054,30 @@ class CustomIncome {
29373054 * @throws Exception
29383055 */
29393056 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+ }
29403081 return new CustomIncome(
29413082 CustomIncome::fromAmount($obj->{'amount'})
29423083 ,CustomIncome::fromCreatedAt($obj->{'created_at'})
Test case

test/inputs/json/misc/33d2e.json

1 generated file · +21 −0
Mphpdefault / TopLevel.php+21 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'laureates')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromLaureates($obj->{'laureates'})
101104 );
@@ -911,6 +914,21 @@ class Laureate {
911914 * @throws Exception
912915 */
913916 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+ }
914932 return new Laureate(
915933 Laureate::fromBorn($obj->{'born'})
916934 ,Laureate::fromBornCity($obj->{'bornCity'})
@@ -1435,6 +1453,9 @@ class Prize {
14351453 * @throws Exception
14361454 */
14371455 public static function from(stdClass $obj): Prize {
1456+ if (!property_exists($obj, 'affiliations')) {
1457+ throw new Exception("Missing required property");
1458+ }
14381459 return new Prize(
14391460 Prize::fromAffiliations($obj->{'affiliations'})
14401461 ,Prize::fromCategory($obj->{'category'})
Test case

test/inputs/json/misc/34702.json

1 generated file · +87 −0
Mphpdefault / TopLevel.php+87 −0
@@ -253,6 +253,18 @@ class TopLevel {
253253 * @throws Exception
254254 */
255255 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+ }
256268 return new TopLevel(
257269 TopLevel::fromCRS($obj->{'crs'})
258270 ,TopLevel::fromFeatures($obj->{'features'})
@@ -410,6 +422,12 @@ class CRS {
410422 * @throws Exception
411423 */
412424 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+ }
413431 return new CRS(
414432 CRS::fromProperties($obj->{'properties'})
415433 ,CRS::fromType($obj->{'type'})
@@ -510,6 +528,9 @@ class CRSProperties {
510528 * @throws Exception
511529 */
512530 public static function from(stdClass $obj): CRSProperties {
531+ if (!property_exists($obj, 'name')) {
532+ throw new Exception("Missing required property");
533+ }
513534 return new CRSProperties(
514535 CRSProperties::fromName($obj->{'name'})
515536 );
@@ -820,6 +841,21 @@ class Feature {
820841 * @throws Exception
821842 */
822843 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+ }
823859 return new Feature(
824860 Feature::fromGeometry($obj->{'geometry'})
825861 ,Feature::fromGeometryName($obj->{'geometry_name'})
@@ -993,6 +1029,12 @@ class Geometry {
9931029 * @throws Exception
9941030 */
9951031 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+ }
9961038 return new Geometry(
9971039 Geometry::fromCoordinates($obj->{'coordinates'})
9981040 ,Geometry::fromType($obj->{'type'})
@@ -1944,6 +1986,51 @@ class FeatureProperties {
19441986 * @throws Exception
19451987 */
19461988 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+ }
19472034 return new FeatureProperties(
19482035 FeatureProperties::fromDivision($obj->{'division'})
19492036 ,FeatureProperties::fromFax($obj->{'fax'})
Test case

test/inputs/json/misc/3536b.json

1 generated file · +45 −0
Mphpdefault / TopLevel.php+45 −0
@@ -507,6 +507,30 @@ class TopLevel {
507507 * @throws Exception
508508 */
509509 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+ }
510534 return new TopLevel(
511535 TopLevel::fromID($obj->{'id'})
512536 ,TopLevel::fromIdentifiers($obj->{'identifiers'})
@@ -672,6 +696,12 @@ class Identifier {
672696 * @throws Exception
673697 */
674698 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+ }
675705 return new Identifier(
676706 Identifier::fromIdentifier($obj->{'identifier'})
677707 ,Identifier::fromScheme($obj->{'scheme'})
@@ -930,6 +960,12 @@ class Link {
930960 * @throws Exception
931961 */
932962 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+ }
933969 return new Link(
934970 Link::fromNote($obj->{'note'})
935971 ,Link::fromURL($obj->{'url'})
@@ -1134,6 +1170,15 @@ class Text {
11341170 * @throws Exception
11351171 */
11361172 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+ }
11371182 return new Text(
11381183 Text::fromMediaType($obj->{'media_type'})
11391184 ,Text::fromTitle($obj->{'title'})
Test case

test/inputs/json/misc/3659d.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'total_population')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromTotalPopulation($obj->{'total_population'})
101104 );
@@ -246,6 +249,12 @@ class TotalPopulation {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new TotalPopulation(
250259 TotalPopulation::fromDate($obj->{'date'})
251260 ,TotalPopulation::fromPopulation($obj->{'population'})
Test case

test/inputs/json/misc/36d5d.json

1 generated file · +75 −0
Mphpdefault / TopLevel.php+75 −0
@@ -450,6 +450,30 @@ class TopLevel {
450450 * @throws Exception
451451 */
452452 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+ }
453477 return new TopLevel(
454478 TopLevel::fromCity($obj->{'city'})
455479 ,TopLevel::fromDelay($obj->{'delay'})
@@ -978,6 +1002,33 @@ class Status {
9781002 * @throws Exception
9791003 */
9801004 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+ }
9811032 return new Status(
9821033 Status::fromAvgDelay($obj->{'avgDelay'})
9831034 ,Status::fromClosureBegin($obj->{'closureBegin'})
@@ -1301,6 +1352,21 @@ class Weather {
13011352 * @throws Exception
13021353 */
13031354 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+ }
13041370 return new Weather(
13051371 Weather::fromMeta($obj->{'meta'})
13061372 ,Weather::fromTemp($obj->{'temp'})
@@ -1511,6 +1577,15 @@ class Meta {
15111577 * @throws Exception
15121578 */
15131579 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+ }
15141589 return new Meta(
15151590 Meta::fromCredit($obj->{'credit'})
15161591 ,Meta::fromUpdated($obj->{'updated'})
Test case

test/inputs/json/misc/3a6b3.json

1 generated file · +75 −0
Mphpdefault / TopLevel.php+75 −0
@@ -450,6 +450,30 @@ class TopLevel {
450450 * @throws Exception
451451 */
452452 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+ }
453477 return new TopLevel(
454478 TopLevel::fromCity($obj->{'city'})
455479 ,TopLevel::fromDelay($obj->{'delay'})
@@ -978,6 +1002,33 @@ class Status {
9781002 * @throws Exception
9791003 */
9801004 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+ }
9811032 return new Status(
9821033 Status::fromAvgDelay($obj->{'avgDelay'})
9831034 ,Status::fromClosureBegin($obj->{'closureBegin'})
@@ -1301,6 +1352,21 @@ class Weather {
13011352 * @throws Exception
13021353 */
13031354 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+ }
13041370 return new Weather(
13051371 Weather::fromMeta($obj->{'meta'})
13061372 ,Weather::fromTemp($obj->{'temp'})
@@ -1511,6 +1577,15 @@ class Meta {
15111577 * @throws Exception
15121578 */
15131579 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+ }
15141589 return new Meta(
15151590 Meta::fromCredit($obj->{'credit'})
15161591 ,Meta::fromUpdated($obj->{'updated'})
Test case

test/inputs/json/misc/3e9a3.json

1 generated file · +36 −0
Mphpdefault / TopLevel.php+36 −0
@@ -252,6 +252,18 @@ class TopLevel {
252252 * @throws Exception
253253 */
254254 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+ }
255267 return new TopLevel(
256268 TopLevel::fromMessage($obj->{'message'})
257269 ,TopLevel::fromResponseTime($obj->{'responseTime'})
@@ -368,6 +380,9 @@ class Results {
368380 * @throws Exception
369381 */
370382 public static function from(stdClass $obj): Results {
383+ if (!property_exists($obj, 'series')) {
384+ throw new Exception("Missing required property");
385+ }
371386 return new Results(
372387 Results::fromSeries($obj->{'series'})
373388 );
@@ -530,6 +545,12 @@ class Series {
530545 * @throws Exception
531546 */
532547 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+ }
533554 return new Series(
534555 Series::fromData($obj->{'data'})
535556 ,Series::fromSeriesID($obj->{'seriesID'})
@@ -850,6 +871,21 @@ class Datum {
850871 * @throws Exception
851872 */
852873 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+ }
853889 return new Datum(
854890 Datum::fromFootnotes($obj->{'footnotes'})
855891 ,Datum::fromPeriod($obj->{'period'})
Test case

test/inputs/json/misc/3f1ce.json

1 generated file · +180 −0
Mphpdefault / TopLevel.php+180 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'query')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromQuery($obj->{'query'})
9093 );
@@ -347,6 +350,18 @@ class Query {
347350 * @throws Exception
348351 */
349352 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+ }
350365 return new Query(
351366 Query::fromCount($obj->{'count'})
352367 ,Query::fromCreated($obj->{'created'})
@@ -452,6 +467,9 @@ class Results {
452467 * @throws Exception
453468 */
454469 public static function from(stdClass $obj): Results {
470+ if (!property_exists($obj, 'channel')) {
471+ throw new Exception("Missing required property");
472+ }
455473 return new Results(
456474 Results::fromChannel($obj->{'channel'})
457475 );
@@ -1181,6 +1199,45 @@ class Channel {
11811199 * @throws Exception
11821200 */
11831201 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+ }
11841241 return new Channel(
11851242 Channel::fromAstronomy($obj->{'astronomy'})
11861243 ,Channel::fromAtmosphere($obj->{'atmosphere'})
@@ -1355,6 +1412,12 @@ class Astronomy {
13551412 * @throws Exception
13561413 */
13571414 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+ }
13581421 return new Astronomy(
13591422 Astronomy::fromSunrise($obj->{'sunrise'})
13601423 ,Astronomy::fromSunset($obj->{'sunset'})
@@ -1611,6 +1674,18 @@ class Atmosphere {
16111674 * @throws Exception
16121675 */
16131676 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+ }
16141689 return new Atmosphere(
16151690 Atmosphere::fromHumidity($obj->{'humidity'})
16161691 ,Atmosphere::fromPressure($obj->{'pressure'})
@@ -1923,6 +1998,21 @@ class Image {
19231998 * @throws Exception
19241999 */
19252000 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+ }
19262016 return new Image(
19272017 Image::fromHeight($obj->{'height'})
19282018 ,Image::fromLink($obj->{'link'})
@@ -2459,6 +2549,33 @@ class Item {
24592549 * @throws Exception
24602550 */
24612551 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+ }
24622579 return new Item(
24632580 Item::fromCondition($obj->{'condition'})
24642581 ,Item::fromDescription($obj->{'description'})
@@ -2729,6 +2846,18 @@ class Condition {
27292846 * @throws Exception
27302847 */
27312848 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+ }
27322861 return new Condition(
27332862 Condition::fromCode($obj->{'code'})
27342863 ,Condition::fromDate($obj->{'date'})
@@ -3094,6 +3223,24 @@ class Forecast {
30943223 * @throws Exception
30953224 */
30963225 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+ }
30973244 return new Forecast(
30983245 Forecast::fromCode($obj->{'code'})
30993246 ,Forecast::fromDate($obj->{'date'})
@@ -3247,6 +3394,9 @@ class GUID {
32473394 * @throws Exception
32483395 */
32493396 public static function from(stdClass $obj): GUID {
3397+ if (!property_exists($obj, 'isPermaLink')) {
3398+ throw new Exception("Missing required property");
3399+ }
32503400 return new GUID(
32513401 GUID::fromIsPermaLink($obj->{'isPermaLink'})
32523402 );
@@ -3449,6 +3599,15 @@ class Location {
34493599 * @throws Exception
34503600 */
34513601 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+ }
34523611 return new Location(
34533612 Location::fromCity($obj->{'city'})
34543613 ,Location::fromCountry($obj->{'country'})
@@ -3707,6 +3866,18 @@ class Units {
37073866 * @throws Exception
37083867 */
37093868 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+ }
37103881 return new Units(
37113882 Units::fromDistance($obj->{'distance'})
37123883 ,Units::fromPressure($obj->{'pressure'})
@@ -3915,6 +4086,15 @@ class Wind {
39154086 * @throws Exception
39164087 */
39174088 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+ }
39184098 return new Wind(
39194099 Wind::fromChill($obj->{'chill'})
39204100 ,Wind::fromDirection($obj->{'direction'})
Test case

test/inputs/json/misc/421d4.json

1 generated file · +204 −0
Mphpdefault / TopLevel.php+204 −0
@@ -190,6 +190,12 @@ class TopLevel {
190190 * @throws Exception
191191 */
192192 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+ }
193199 return new TopLevel(
194200 TopLevel::fromData($obj->{'data'})
195201 ,TopLevel::fromMeta($obj->{'meta'})
@@ -291,6 +297,9 @@ class Meta {
291297 * @throws Exception
292298 */
293299 public static function from(stdClass $obj): Meta {
300+ if (!property_exists($obj, 'view')) {
301+ throw new Exception("Missing required property");
302+ }
294303 return new Meta(
295304 Meta::fromView($obj->{'view'})
296305 );
@@ -2488,6 +2497,126 @@ class View {
24882497 * @throws Exception
24892498 */
24902499 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+ }
24912620 return new View(
24922621 View::fromAttribution($obj->{'attribution'})
24932622 ,View::fromAverageRating($obj->{'averageRating'})
@@ -3240,6 +3369,27 @@ class Column {
32403369 * @throws Exception
32413370 */
32423371 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+ }
32433393 return new Column(
32443394 Column::fromCachedContents($obj->{'cachedContents'})
32453395 ,Column::fromDataTypeName($obj->{'dataTypeName'})
@@ -3732,6 +3882,12 @@ class CachedContents {
37323882 * @throws Exception
37333883 */
37343884 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+ }
37353891 return new CachedContents(
37363892 CachedContents::fromAverage($obj->{'average'})
37373893 ,CachedContents::fromLargest($obj->{'largest'})
@@ -3894,6 +4050,12 @@ class Top {
38944050 * @throws Exception
38954051 */
38964052 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+ }
38974059 return new Top(
38984060 Top::fromCount($obj->{'count'})
38994061 ,Top::fromItem($obj->{'item'})
@@ -4157,6 +4319,15 @@ class Grant {
41574319 * @throws Exception
41584320 */
41594321 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+ }
41604331 return new Grant(
41614332 Grant::fromFlags($obj->{'flags'})
41624333 ,Grant::fromInherited($obj->{'inherited'})
@@ -4259,6 +4430,9 @@ class License {
42594430 * @throws Exception
42604431 */
42614432 public static function from(stdClass $obj): License {
4433+ if (!property_exists($obj, 'name')) {
4434+ throw new Exception("Missing required property");
4435+ }
42624436 return new License(
42634437 License::fromName($obj->{'name'})
42644438 );
@@ -4580,6 +4754,21 @@ class Metadata {
45804754 * @throws Exception
45814755 */
45824756 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+ }
45834772 return new Metadata(
45844773 Metadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'})
45854774 ,Metadata::fromRDFClass($obj->{'rdfClass'})
@@ -4687,6 +4876,9 @@ class RenderTypeConfig {
46874876 * @throws Exception
46884877 */
46894878 public static function from(stdClass $obj): RenderTypeConfig {
4879+ if (!property_exists($obj, 'visible')) {
4880+ throw new Exception("Missing required property");
4881+ }
46904882 return new RenderTypeConfig(
46914883 RenderTypeConfig::fromVisible($obj->{'visible'})
46924884 );
@@ -4785,6 +4977,9 @@ class Visible {
47854977 * @throws Exception
47864978 */
47874979 public static function from(stdClass $obj): Visible {
4980+ if (!property_exists($obj, 'table')) {
4981+ throw new Exception("Missing required property");
4982+ }
47884983 return new Visible(
47894984 Visible::fromTable($obj->{'table'})
47904985 );
@@ -4987,6 +5182,15 @@ class Owner {
49875182 * @throws Exception
49885183 */
49895184 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+ }
49905194 return new Owner(
49915195 Owner::fromDisplayName($obj->{'displayName'})
49925196 ,Owner::fromID($obj->{'id'})
Test case

test/inputs/json/misc/437e7.json

1 generated file · +207 −0
Mphpdefault / TopLevel.php+207 −0
@@ -202,6 +202,15 @@ class TopLevel {
202202 * @throws Exception
203203 */
204204 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+ }
205214 return new TopLevel(
206215 TopLevel::fromData($obj->{'data'})
207216 ,TopLevel::fromMeta($obj->{'meta'})
@@ -1202,6 +1211,57 @@ class Datum {
12021211 * @throws Exception
12031212 */
12041213 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+ }
12051265 return new Datum(
12061266 Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'})
12071267 ,Datum::fromBitlyURL($obj->{'bitly_url'})
@@ -2448,6 +2508,72 @@ class Images {
24482508 * @throws Exception
24492509 */
24502510 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+ }
24512577 return new Images(
24522578 Images::fromDownsized($obj->{'downsized'})
24532579 ,Images::fromDownsizedLarge($obj->{'downsized_large'})
@@ -2754,6 +2880,15 @@ class Downsized {
27542880 * @throws Exception
27552881 */
27562882 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+ }
27572892 return new Downsized(
27582893 Downsized::fromHeight($obj->{'height'})
27592894 ,Downsized::fromSize($obj->{'size'})
@@ -3014,6 +3149,18 @@ class DownsizedSmall {
30143149 * @throws Exception
30153150 */
30163151 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+ }
30173164 return new DownsizedSmall(
30183165 DownsizedSmall::fromHeight($obj->{'height'})
30193166 ,DownsizedSmall::fromMp4($obj->{'mp4'})
@@ -3564,6 +3711,24 @@ class FixedHeight {
35643711 * @throws Exception
35653712 */
35663713 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+ }
35673732 return new FixedHeight(
35683733 FixedHeight::fromFrames($obj->{'frames'})
35693734 ,FixedHeight::fromHeight($obj->{'height'})
@@ -3730,6 +3895,12 @@ class Looping {
37303895 * @throws Exception
37313896 */
37323897 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+ }
37333904 return new Looping(
37343905 Looping::fromMp4($obj->{'mp4'})
37353906 ,Looping::fromMp4Size($obj->{'mp4_size'})
@@ -4192,6 +4363,24 @@ class User {
41924363 * @throws Exception
41934364 */
41944365 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+ }
41954384 return new User(
41964385 User::fromAvatarURL($obj->{'avatar_url'})
41974386 ,User::fromBannerURL($obj->{'banner_url'})
@@ -4404,6 +4593,15 @@ class Meta {
44044593 * @throws Exception
44054594 */
44064595 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+ }
44074605 return new Meta(
44084606 Meta::fromMsg($obj->{'msg'})
44094607 ,Meta::fromResponseID($obj->{'response_id'})
@@ -4610,6 +4808,15 @@ class Pagination {
46104808 * @throws Exception
46114809 */
46124810 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+ }
46134820 return new Pagination(
46144821 Pagination::fromCount($obj->{'count'})
46154822 ,Pagination::fromOffset($obj->{'offset'})
Test case

test/inputs/json/misc/43970.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -188,6 +188,15 @@ class TopLevel {
188188 * @throws Exception
189189 */
190190 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+ }
191200 return new TopLevel(
192201 TopLevel::fromID($obj->{'ID'})
193202 ,TopLevel::fromName($obj->{'Name'})
Test case

test/inputs/json/misc/43eaf.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -205,6 +205,15 @@ class TopLevel {
205205 * @throws Exception
206206 */
207207 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+ }
208217 return new TopLevel(
209218 TopLevel::fromBase($obj->{'base'})
210219 ,TopLevel::fromDate($obj->{'date'})
Test case

test/inputs/json/misc/458db.json

1 generated file · +75 −0
Mphpdefault / TopLevel.php+75 −0
@@ -149,6 +149,12 @@ class TopLevel {
149149 * @throws Exception
150150 */
151151 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+ }
152158 return new TopLevel(
153159 TopLevel::fromMetadata($obj->{'metadata'})
154160 ,TopLevel::fromResults($obj->{'results'})
@@ -355,6 +361,15 @@ class Metadata {
355361 * @throws Exception
356362 */
357363 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+ }
358373 return new Metadata(
359374 Metadata::fromExecutionTime($obj->{'executionTime'})
360375 ,Metadata::fromResponseInfo($obj->{'responseInfo'})
@@ -509,6 +524,12 @@ class ResponseInfo {
509524 * @throws Exception
510525 */
511526 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+ }
512533 return new ResponseInfo(
513534 ResponseInfo::fromDeveloperMessage($obj->{'developerMessage'})
514535 ,ResponseInfo::fromStatus($obj->{'status'})
@@ -713,6 +734,15 @@ class Resultset {
713734 * @throws Exception
714735 */
715736 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+ }
716746 return new Resultset(
717747 Resultset::fromCount($obj->{'count'})
718748 ,Resultset::fromPage($obj->{'page'})
@@ -1501,6 +1531,45 @@ class Result {
15011531 * @throws Exception
15021532 */
15031533 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+ }
15041573 return new Result(
15051574 Result::fromAttachments($obj->{'attachments'})
15061575 ,Result::fromBody($obj->{'body'})
@@ -1679,6 +1748,12 @@ class Component {
16791748 * @throws Exception
16801749 */
16811750 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+ }
16821757 return new Component(
16831758 Component::fromName($obj->{'name'})
16841759 ,Component::fromUUID($obj->{'uuid'})
Test case

test/inputs/json/misc/4961a.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'total_population')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromTotalPopulation($obj->{'total_population'})
101104 );
@@ -246,6 +249,12 @@ class TotalPopulation {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new TotalPopulation(
250259 TotalPopulation::fromDate($obj->{'date'})
251260 ,TotalPopulation::fromPopulation($obj->{'population'})
Test case

test/inputs/json/misc/4a0d7.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'total_population')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromTotalPopulation($obj->{'total_population'})
101104 );
@@ -246,6 +249,12 @@ class TotalPopulation {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new TotalPopulation(
250259 TotalPopulation::fromDate($obj->{'date'})
251260 ,TotalPopulation::fromPopulation($obj->{'population'})
Test case

test/inputs/json/misc/4a455.json

1 generated file · +60 −0
Mphpdefault / TopLevel.php+60 −0
@@ -253,6 +253,18 @@ class TopLevel {
253253 * @throws Exception
254254 */
255255 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+ }
256268 return new TopLevel(
257269 TopLevel::fromCRS($obj->{'crs'})
258270 ,TopLevel::fromFeatures($obj->{'features'})
@@ -410,6 +422,12 @@ class CRS {
410422 * @throws Exception
411423 */
412424 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+ }
413431 return new CRS(
414432 CRS::fromProperties($obj->{'properties'})
415433 ,CRS::fromType($obj->{'type'})
@@ -510,6 +528,9 @@ class CRSProperties {
510528 * @throws Exception
511529 */
512530 public static function from(stdClass $obj): CRSProperties {
531+ if (!property_exists($obj, 'name')) {
532+ throw new Exception("Missing required property");
533+ }
513534 return new CRSProperties(
514535 CRSProperties::fromName($obj->{'name'})
515536 );
@@ -820,6 +841,21 @@ class Feature {
820841 * @throws Exception
821842 */
822843 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+ }
823859 return new Feature(
824860 Feature::fromGeometry($obj->{'geometry'})
825861 ,Feature::fromGeometryName($obj->{'geometry_name'})
@@ -1004,6 +1040,12 @@ class Geometry {
10041040 * @throws Exception
10051041 */
10061042 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+ }
10071049 return new Geometry(
10081050 Geometry::fromCoordinates($obj->{'coordinates'})
10091051 ,Geometry::fromType($obj->{'type'})
@@ -1454,6 +1496,24 @@ class FeatureProperties {
14541496 * @throws Exception
14551497 */
14561498 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+ }
14571517 return new FeatureProperties(
14581518 FeatureProperties::fromFacebookaccount($obj->{'facebookaccount'})
14591519 ,FeatureProperties::fromFrequencyfinderurl($obj->{'frequencyfinderurl'})
Test case

test/inputs/json/misc/4c547.json

1 generated file · +180 −0
Mphpdefault / TopLevel.php+180 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'query')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromQuery($obj->{'query'})
9093 );
@@ -347,6 +350,18 @@ class Query {
347350 * @throws Exception
348351 */
349352 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+ }
350365 return new Query(
351366 Query::fromCount($obj->{'count'})
352367 ,Query::fromCreated($obj->{'created'})
@@ -452,6 +467,9 @@ class Results {
452467 * @throws Exception
453468 */
454469 public static function from(stdClass $obj): Results {
470+ if (!property_exists($obj, 'channel')) {
471+ throw new Exception("Missing required property");
472+ }
455473 return new Results(
456474 Results::fromChannel($obj->{'channel'})
457475 );
@@ -1181,6 +1199,45 @@ class Channel {
11811199 * @throws Exception
11821200 */
11831201 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+ }
11841241 return new Channel(
11851242 Channel::fromAstronomy($obj->{'astronomy'})
11861243 ,Channel::fromAtmosphere($obj->{'atmosphere'})
@@ -1355,6 +1412,12 @@ class Astronomy {
13551412 * @throws Exception
13561413 */
13571414 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+ }
13581421 return new Astronomy(
13591422 Astronomy::fromSunrise($obj->{'sunrise'})
13601423 ,Astronomy::fromSunset($obj->{'sunset'})
@@ -1611,6 +1674,18 @@ class Atmosphere {
16111674 * @throws Exception
16121675 */
16131676 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+ }
16141689 return new Atmosphere(
16151690 Atmosphere::fromHumidity($obj->{'humidity'})
16161691 ,Atmosphere::fromPressure($obj->{'pressure'})
@@ -1923,6 +1998,21 @@ class Image {
19231998 * @throws Exception
19241999 */
19252000 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+ }
19262016 return new Image(
19272017 Image::fromHeight($obj->{'height'})
19282018 ,Image::fromLink($obj->{'link'})
@@ -2459,6 +2549,33 @@ class Item {
24592549 * @throws Exception
24602550 */
24612551 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+ }
24622579 return new Item(
24632580 Item::fromCondition($obj->{'condition'})
24642581 ,Item::fromDescription($obj->{'description'})
@@ -2729,6 +2846,18 @@ class Condition {
27292846 * @throws Exception
27302847 */
27312848 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+ }
27322861 return new Condition(
27332862 Condition::fromCode($obj->{'code'})
27342863 ,Condition::fromDate($obj->{'date'})
@@ -3093,6 +3222,24 @@ class Forecast {
30933222 * @throws Exception
30943223 */
30953224 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+ }
30963243 return new Forecast(
30973244 Forecast::fromCode($obj->{'code'})
30983245 ,Forecast::fromDate($obj->{'date'})
@@ -3201,6 +3348,9 @@ class GUID {
32013348 * @throws Exception
32023349 */
32033350 public static function from(stdClass $obj): GUID {
3351+ if (!property_exists($obj, 'isPermaLink')) {
3352+ throw new Exception("Missing required property");
3353+ }
32043354 return new GUID(
32053355 GUID::fromIsPermaLink($obj->{'isPermaLink'})
32063356 );
@@ -3403,6 +3553,15 @@ class Location {
34033553 * @throws Exception
34043554 */
34053555 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+ }
34063565 return new Location(
34073566 Location::fromCity($obj->{'city'})
34083567 ,Location::fromCountry($obj->{'country'})
@@ -3661,6 +3820,18 @@ class Units {
36613820 * @throws Exception
36623821 */
36633822 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+ }
36643835 return new Units(
36653836 Units::fromDistance($obj->{'distance'})
36663837 ,Units::fromPressure($obj->{'pressure'})
@@ -3869,6 +4040,15 @@ class Wind {
38694040 * @throws Exception
38704041 */
38714042 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+ }
38724052 return new Wind(
38734053 Wind::fromChill($obj->{'chill'})
38744054 ,Wind::fromDirection($obj->{'direction'})
Test case

test/inputs/json/misc/4d6fb.json

1 generated file · +282 −0
Mphpdefault / TopLevel.php+282 −0
@@ -137,6 +137,12 @@ class TopLevel {
137137 * @throws Exception
138138 */
139139 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+ }
140146 return new TopLevel(
141147 TopLevel::fromData($obj->{'data'})
142148 ,TopLevel::fromKind($obj->{'kind'})
@@ -408,6 +414,18 @@ class TopLevelData {
408414 * @throws Exception
409415 */
410416 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+ }
411429 return new TopLevelData(
412430 TopLevelData::fromAfter($obj->{'after'})
413431 ,TopLevelData::fromBefore($obj->{'before'})
@@ -566,6 +584,12 @@ class Child {
566584 * @throws Exception
567585 */
568586 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+ }
569593 return new Child(
570594 Child::fromData($obj->{'data'})
571595 ,Child::fromKind($obj->{'kind'})
@@ -4082,6 +4106,192 @@ class ChildData {
40824106 * @throws Exception
40834107 */
40844108 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+ }
40854295 return new ChildData(
40864296 ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'})
40874297 ,ChildData::fromApprovedBy($obj->{'approved_by'})
@@ -4359,6 +4569,12 @@ class Media {
43594569 * @throws Exception
43604570 */
43614571 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+ }
43624578 return new Media(
43634579 Media::fromOembed($obj->{'oembed'})
43644580 ,Media::fromType($obj->{'type'})
@@ -5083,6 +5299,45 @@ class Oembed {
50835299 * @throws Exception
50845300 */
50855301 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+ }
50865341 return new Oembed(
50875342 Oembed::fromAuthorName($obj->{'author_name'})
50885343 ,Oembed::fromAuthorURL($obj->{'author_url'})
@@ -5618,6 +5873,12 @@ class Preview {
56185873 * @throws Exception
56195874 */
56205875 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+ }
56215882 return new Preview(
56225883 Preview::fromEnabled($obj->{'enabled'})
56235884 ,Preview::fromImages($obj->{'images'})
@@ -5888,6 +6149,18 @@ class Image {
58886149 * @throws Exception
58896150 */
58906151 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+ }
58916164 return new Image(
58926165 Image::fromID($obj->{'id'})
58936166 ,Image::fromResolutions($obj->{'resolutions'})
@@ -6096,6 +6369,15 @@ class Source {
60966369 * @throws Exception
60976370 */
60986371 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+ }
60996381 return new Source(
61006382 Source::fromHeight($obj->{'height'})
61016383 ,Source::fromURL($obj->{'url'})
Test case

test/inputs/json/misc/4e336.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'total_population')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromTotalPopulation($obj->{'total_population'})
101104 );
@@ -246,6 +249,12 @@ class TotalPopulation {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new TotalPopulation(
250259 TotalPopulation::fromDate($obj->{'date'})
251260 ,TotalPopulation::fromPopulation($obj->{'population'})
Test case

test/inputs/json/misc/54147.json

1 generated file · +33 −0
Mphpdefault / TopLevel.php+33 −0
@@ -400,6 +400,27 @@ class TopLevel {
400400 * @throws Exception
401401 */
402402 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+ }
403424 return new TopLevel(
404425 TopLevel::fromArgs($obj->{'args'})
405426 ,TopLevel::fromData($obj->{'data'})
@@ -711,6 +732,18 @@ class Headers {
711732 * @throws Exception
712733 */
713734 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+ }
714747 return new Headers(
715748 Headers::fromAcceptEncoding($obj->{'Accept-Encoding'})
716749 ,Headers::fromConnection($obj->{'Connection'})
Test case

test/inputs/json/misc/54d32.json

1 generated file · +39 −0
Mphpdefault / TopLevel.php+39 −0
@@ -409,6 +409,27 @@ class TopLevel {
409409 * @throws Exception
410410 */
411411 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+ }
412433 return new TopLevel(
413434 TopLevel::fromCount($obj->{'count'})
414435 ,TopLevel::fromFacets($obj->{'facets'})
@@ -839,6 +860,24 @@ class Result {
839860 * @throws Exception
840861 */
841862 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+ }
842881 return new Result(
843882 Result::fromCreatedAt($obj->{'created_at'})
844883 ,Result::fromID($obj->{'id'})
Test case

test/inputs/json/misc/570ec.json

1 generated file · +51 −0
Mphpdefault / TopLevel.php+51 −0
@@ -513,6 +513,30 @@ class TopLevel {
513513 * @throws Exception
514514 */
515515 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+ }
516540 return new TopLevel(
517541 TopLevel::fromID($obj->{'id'})
518542 ,TopLevel::fromIdentifiers($obj->{'identifiers'})
@@ -678,6 +702,12 @@ class Identifier {
678702 * @throws Exception
679703 */
680704 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+ }
681711 return new Identifier(
682712 Identifier::fromIdentifier($obj->{'identifier'})
683713 ,Identifier::fromScheme($obj->{'scheme'})
@@ -883,6 +913,12 @@ class Link {
883913 * @throws Exception
884914 */
885915 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+ }
886922 return new Link(
887923 Link::fromNote($obj->{'note'})
888924 ,Link::fromURL($obj->{'url'})
@@ -1045,6 +1081,12 @@ class OtherName {
10451081 * @throws Exception
10461082 */
10471083 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+ }
10481090 return new OtherName(
10491091 OtherName::fromName($obj->{'name'})
10501092 ,OtherName::fromNote($obj->{'note'})
@@ -1249,6 +1291,15 @@ class Text {
12491291 * @throws Exception
12501292 */
12511293 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+ }
12521303 return new Text(
12531304 Text::fromMediaType($obj->{'media_type'})
12541305 ,Text::fromTitle($obj->{'title'})
Test case

test/inputs/json/misc/5dd0d.json

1 generated file · +75 −0
Mphpdefault / TopLevel.php+75 −0
@@ -450,6 +450,30 @@ class TopLevel {
450450 * @throws Exception
451451 */
452452 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+ }
453477 return new TopLevel(
454478 TopLevel::fromCity($obj->{'city'})
455479 ,TopLevel::fromDelay($obj->{'delay'})
@@ -978,6 +1002,33 @@ class Status {
9781002 * @throws Exception
9791003 */
9801004 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+ }
9811032 return new Status(
9821033 Status::fromAvgDelay($obj->{'avgDelay'})
9831034 ,Status::fromClosureBegin($obj->{'closureBegin'})
@@ -1301,6 +1352,21 @@ class Weather {
13011352 * @throws Exception
13021353 */
13031354 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+ }
13041370 return new Weather(
13051371 Weather::fromMeta($obj->{'meta'})
13061372 ,Weather::fromTemp($obj->{'temp'})
@@ -1511,6 +1577,15 @@ class Meta {
15111577 * @throws Exception
15121578 */
15131579 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+ }
15141589 return new Meta(
15151590 Meta::fromCredit($obj->{'credit'})
15161591 ,Meta::fromUpdated($obj->{'updated'})
Test case

test/inputs/json/misc/5eae5.json

1 generated file · +12 −0
Mphpdefault / TopLevel.php+12 −0
@@ -247,6 +247,18 @@ class TopLevel {
247247 * @throws Exception
248248 */
249249 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+ }
250262 return new TopLevel(
251263 TopLevel::fromDate($obj->{'Date'})
252264 ,TopLevel::fromID($obj->{'ID'})
Test case

test/inputs/json/misc/5eb20.json

1 generated file · +75 −0
Mphpdefault / TopLevel.php+75 −0
@@ -450,6 +450,30 @@ class TopLevel {
450450 * @throws Exception
451451 */
452452 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+ }
453477 return new TopLevel(
454478 TopLevel::fromCity($obj->{'city'})
455479 ,TopLevel::fromDelay($obj->{'delay'})
@@ -978,6 +1002,33 @@ class Status {
9781002 * @throws Exception
9791003 */
9801004 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+ }
9811032 return new Status(
9821033 Status::fromAvgDelay($obj->{'avgDelay'})
9831034 ,Status::fromClosureBegin($obj->{'closureBegin'})
@@ -1301,6 +1352,21 @@ class Weather {
13011352 * @throws Exception
13021353 */
13031354 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+ }
13041370 return new Weather(
13051371 Weather::fromMeta($obj->{'meta'})
13061372 ,Weather::fromTemp($obj->{'temp'})
@@ -1511,6 +1577,15 @@ class Meta {
15111577 * @throws Exception
15121578 */
15131579 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+ }
15141589 return new Meta(
15151590 Meta::fromCredit($obj->{'credit'})
15161591 ,Meta::fromUpdated($obj->{'updated'})
Test case

test/inputs/json/misc/5f3a1.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -205,6 +205,15 @@ class TopLevel {
205205 * @throws Exception
206206 */
207207 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+ }
208217 return new TopLevel(
209218 TopLevel::fromBase($obj->{'base'})
210219 ,TopLevel::fromDate($obj->{'date'})
Test case

test/inputs/json/misc/5f7fe.json

1 generated file · +321 −0
Mphpdefault / TopLevel.php+321 −0
@@ -190,6 +190,12 @@ class TopLevel {
190190 * @throws Exception
191191 */
192192 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+ }
193199 return new TopLevel(
194200 TopLevel::fromData($obj->{'data'})
195201 ,TopLevel::fromMeta($obj->{'meta'})
@@ -291,6 +297,9 @@ class Meta {
291297 * @throws Exception
292298 */
293299 public static function from(stdClass $obj): Meta {
300+ if (!property_exists($obj, 'view')) {
301+ throw new Exception("Missing required property");
302+ }
294303 return new Meta(
295304 Meta::fromView($obj->{'view'})
296305 );
@@ -2383,6 +2392,120 @@ class View {
23832392 * @throws Exception
23842393 */
23852394 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+ }
23862509 return new View(
23872510 View::fromAttribution($obj->{'attribution'})
23882511 ,View::fromAttributionLink($obj->{'attributionLink'})
@@ -3133,6 +3256,27 @@ class Column {
31333256 * @throws Exception
31343257 */
31353258 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+ }
31363280 return new Column(
31373281 Column::fromCachedContents($obj->{'cachedContents'})
31383282 ,Column::fromDataTypeName($obj->{'dataTypeName'})
@@ -3471,6 +3615,21 @@ class CachedContents {
34713615 * @throws Exception
34723616 */
34733617 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+ }
34743633 return new CachedContents(
34753634 CachedContents::fromLargest($obj->{'largest'})
34763635 ,CachedContents::fromNonNull($obj->{'non_null'})
@@ -3629,6 +3788,12 @@ class Top {
36293788 * @throws Exception
36303789 */
36313790 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+ }
36323797 return new Top(
36333798 Top::fromCount($obj->{'count'})
36343799 ,Top::fromItem($obj->{'item'})
@@ -4072,6 +4237,15 @@ class Grant {
40724237 * @throws Exception
40734238 */
40744239 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+ }
40754249 return new Grant(
40764250 Grant::fromFlags($obj->{'flags'})
40774251 ,Grant::fromInherited($obj->{'inherited'})
@@ -4463,6 +4637,24 @@ class Metadata {
44634637 * @throws Exception
44644638 */
44654639 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+ }
44664658 return new Metadata(
44674659 Metadata::fromAttachments($obj->{'attachments'})
44684660 ,Metadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'})
@@ -4727,6 +4919,18 @@ class Attachment {
47274919 * @throws Exception
47284920 */
47294921 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+ }
47304934 return new Attachment(
47314935 Attachment::fromAssetID($obj->{'assetId'})
47324936 ,Attachment::fromBlobID($obj->{'blobId'})
@@ -5044,6 +5248,21 @@ class CustomFields {
50445248 * @throws Exception
50455249 */
50465250 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+ }
50475266 return new CustomFields(
50485267 CustomFields::fromAdditionalResources($obj->{'Additional Resources'})
50495268 ,CustomFields::fromCommonCore($obj->{'Common Core'})
@@ -5202,6 +5421,12 @@ class AdditionalResources {
52025421 * @throws Exception
52035422 */
52045423 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+ }
52055430 return new AdditionalResources(
52065431 AdditionalResources::fromAdditionalResourcesSeeAlso($obj->{'See Also '})
52075432 ,AdditionalResources::fromSeeAlso($obj->{'See Also'})
@@ -5406,6 +5631,15 @@ class CommonCore {
54065631 * @throws Exception
54075632 */
54085633 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+ }
54095643 return new CommonCore(
54105644 CommonCore::fromContactEmail($obj->{'Contact Email'})
54115645 ,CommonCore::fromContactName($obj->{'Contact Name'})
@@ -5508,6 +5742,9 @@ class DatasetInformation {
55085742 * @throws Exception
55095743 */
55105744 public static function from(stdClass $obj): DatasetInformation {
5745+ if (!property_exists($obj, 'Agency')) {
5746+ throw new Exception("Missing required property");
5747+ }
55115748 return new DatasetInformation(
55125749 DatasetInformation::fromAgency($obj->{'Agency'})
55135750 );
@@ -6022,6 +6259,33 @@ class DatasetSummary {
60226259 * @throws Exception
60236260 */
60246261 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+ }
60256289 return new DatasetSummary(
60266290 DatasetSummary::fromContactInformation($obj->{'Contact Information'})
60276291 ,DatasetSummary::fromCoverage($obj->{'Coverage'})
@@ -6136,6 +6400,9 @@ class Notes {
61366400 * @throws Exception
61376401 */
61386402 public static function from(stdClass $obj): Notes {
6403+ if (!property_exists($obj, 'Notes')) {
6404+ throw new Exception("Missing required property");
6405+ }
61396406 return new Notes(
61406407 Notes::fromNotes($obj->{'Notes'})
61416408 );
@@ -6246,6 +6513,9 @@ class JSONQuery {
62466513 * @throws Exception
62476514 */
62486515 public static function from(stdClass $obj): JSONQuery {
6516+ if (!property_exists($obj, 'order')) {
6517+ throw new Exception("Missing required property");
6518+ }
62496519 return new JSONQuery(
62506520 JSONQuery::fromOrder($obj->{'order'})
62516521 );
@@ -6396,6 +6666,12 @@ class Order {
63966666 * @throws Exception
63976667 */
63986668 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+ }
63996675 return new Order(
64006676 Order::fromAscending($obj->{'ascending'})
64016677 ,Order::fromColumnFieldName($obj->{'columnFieldName'})
@@ -6497,6 +6773,9 @@ class RenderTypeConfig {
64976773 * @throws Exception
64986774 */
64996775 public static function from(stdClass $obj): RenderTypeConfig {
6776+ if (!property_exists($obj, 'visible')) {
6777+ throw new Exception("Missing required property");
6778+ }
65006779 return new RenderTypeConfig(
65016780 RenderTypeConfig::fromVisible($obj->{'visible'})
65026781 );
@@ -6595,6 +6874,9 @@ class Visible {
65956874 * @throws Exception
65966875 */
65976876 public static function from(stdClass $obj): Visible {
6877+ if (!property_exists($obj, 'table')) {
6878+ throw new Exception("Missing required property");
6879+ }
65986880 return new Visible(
65996881 Visible::fromTable($obj->{'table'})
66006882 );
@@ -7071,6 +7353,30 @@ class Owner {
70717353 * @throws Exception
70727354 */
70737355 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+ }
70747380 return new Owner(
70757381 Owner::fromDisplayName($obj->{'displayName'})
70767382 ,Owner::fromID($obj->{'id'})
@@ -7195,6 +7501,9 @@ class Query {
71957501 * @throws Exception
71967502 */
71977503 public static function from(stdClass $obj): Query {
7504+ if (!property_exists($obj, 'orderBys')) {
7505+ throw new Exception("Missing required property");
7506+ }
71987507 return new Query(
71997508 Query::fromOrderBys($obj->{'orderBys'})
72007509 );
@@ -7346,6 +7655,12 @@ class OrderBy {
73467655 * @throws Exception
73477656 */
73487657 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+ }
73497664 return new OrderBy(
73507665 OrderBy::fromAscending($obj->{'ascending'})
73517666 ,OrderBy::fromExpression($obj->{'expression'})
@@ -7498,6 +7813,12 @@ class Expression {
74987813 * @throws Exception
74997814 */
75007815 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+ }
75017822 return new Expression(
75027823 Expression::fromColumnID($obj->{'columnId'})
75037824 ,Expression::fromType($obj->{'type'})
Test case

test/inputs/json/misc/617e8.json

1 generated file · +315 −0
Mphpdefault / TopLevel.php+315 −0
@@ -190,6 +190,12 @@ class TopLevel {
190190 * @throws Exception
191191 */
192192 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+ }
193199 return new TopLevel(
194200 TopLevel::fromData($obj->{'data'})
195201 ,TopLevel::fromMeta($obj->{'meta'})
@@ -291,6 +297,9 @@ class Meta {
291297 * @throws Exception
292298 */
293299 public static function from(stdClass $obj): Meta {
300+ if (!property_exists($obj, 'view')) {
301+ throw new Exception("Missing required property");
302+ }
294303 return new Meta(
295304 Meta::fromView($obj->{'view'})
296305 );
@@ -2383,6 +2392,120 @@ class View {
23832392 * @throws Exception
23842393 */
23852394 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+ }
23862509 return new View(
23872510 View::fromAttribution($obj->{'attribution'})
23882511 ,View::fromAttributionLink($obj->{'attributionLink'})
@@ -3195,6 +3318,27 @@ class Column {
31953318 * @throws Exception
31963319 */
31973320 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+ }
31983342 return new Column(
31993343 Column::fromCachedContents($obj->{'cachedContents'})
32003344 ,Column::fromDataTypeName($obj->{'dataTypeName'})
@@ -3535,6 +3679,21 @@ class CachedContents {
35353679 * @throws Exception
35363680 */
35373681 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+ }
35383697 return new CachedContents(
35393698 CachedContents::fromLargest($obj->{'largest'})
35403699 ,CachedContents::fromNonNull($obj->{'non_null'})
@@ -3693,6 +3852,12 @@ class Top {
36933852 * @throws Exception
36943853 */
36953854 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+ }
36963861 return new Top(
36973862 Top::fromCount($obj->{'count'})
36983863 ,Top::fromItem($obj->{'item'})
@@ -4136,6 +4301,15 @@ class Grant {
41364301 * @throws Exception
41374302 */
41384303 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+ }
41394313 return new Grant(
41404314 Grant::fromFlags($obj->{'flags'})
41414315 ,Grant::fromInherited($obj->{'inherited'})
@@ -4527,6 +4701,24 @@ class Metadata {
45274701 * @throws Exception
45284702 */
45294703 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+ }
45304722 return new Metadata(
45314723 Metadata::fromAttachments($obj->{'attachments'})
45324724 ,Metadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'})
@@ -4791,6 +4983,18 @@ class Attachment {
47914983 * @throws Exception
47924984 */
47934985 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+ }
47944998 return new Attachment(
47954999 Attachment::fromAssetID($obj->{'assetId'})
47965000 ,Attachment::fromBlobID($obj->{'blobId'})
@@ -5108,6 +5312,21 @@ class CustomFields {
51085312 * @throws Exception
51095313 */
51105314 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+ }
51115330 return new CustomFields(
51125331 CustomFields::fromAdditionalResources($obj->{'Additional Resources'})
51135332 ,CustomFields::fromCommonCore($obj->{'Common Core'})
@@ -5214,6 +5433,9 @@ class AdditionalResources {
52145433 * @throws Exception
52155434 */
52165435 public static function from(stdClass $obj): AdditionalResources {
5436+ if (!property_exists($obj, 'See Also')) {
5437+ throw new Exception("Missing required property");
5438+ }
52175439 return new AdditionalResources(
52185440 AdditionalResources::fromSeeAlso($obj->{'See Also'})
52195441 );
@@ -5416,6 +5638,15 @@ class CommonCore {
54165638 * @throws Exception
54175639 */
54185640 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+ }
54195650 return new CommonCore(
54205651 CommonCore::fromContactEmail($obj->{'Contact Email'})
54215652 ,CommonCore::fromContactName($obj->{'Contact Name'})
@@ -5518,6 +5749,9 @@ class DatasetInformation {
55185749 * @throws Exception
55195750 */
55205751 public static function from(stdClass $obj): DatasetInformation {
5752+ if (!property_exists($obj, 'Agency')) {
5753+ throw new Exception("Missing required property");
5754+ }
55215755 return new DatasetInformation(
55225756 DatasetInformation::fromAgency($obj->{'Agency'})
55235757 );
@@ -5980,6 +6214,30 @@ class DatasetSummary {
59806214 * @throws Exception
59816215 */
59826216 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+ }
59836241 return new DatasetSummary(
59846242 DatasetSummary::fromContactInformation($obj->{'Contact Information'})
59856243 ,DatasetSummary::fromCoverage($obj->{'Coverage'})
@@ -6092,6 +6350,9 @@ class Notes {
60926350 * @throws Exception
60936351 */
60946352 public static function from(stdClass $obj): Notes {
6353+ if (!property_exists($obj, 'Notes')) {
6354+ throw new Exception("Missing required property");
6355+ }
60956356 return new Notes(
60966357 Notes::fromNotes($obj->{'Notes'})
60976358 );
@@ -6202,6 +6463,9 @@ class JSONQuery {
62026463 * @throws Exception
62036464 */
62046465 public static function from(stdClass $obj): JSONQuery {
6466+ if (!property_exists($obj, 'order')) {
6467+ throw new Exception("Missing required property");
6468+ }
62056469 return new JSONQuery(
62066470 JSONQuery::fromOrder($obj->{'order'})
62076471 );
@@ -6352,6 +6616,12 @@ class Order {
63526616 * @throws Exception
63536617 */
63546618 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+ }
63556625 return new Order(
63566626 Order::fromAscending($obj->{'ascending'})
63576627 ,Order::fromColumnFieldName($obj->{'columnFieldName'})
@@ -6453,6 +6723,9 @@ class RenderTypeConfig {
64536723 * @throws Exception
64546724 */
64556725 public static function from(stdClass $obj): RenderTypeConfig {
6726+ if (!property_exists($obj, 'visible')) {
6727+ throw new Exception("Missing required property");
6728+ }
64566729 return new RenderTypeConfig(
64576730 RenderTypeConfig::fromVisible($obj->{'visible'})
64586731 );
@@ -6551,6 +6824,9 @@ class Visible {
65516824 * @throws Exception
65526825 */
65536826 public static function from(stdClass $obj): Visible {
6827+ if (!property_exists($obj, 'table')) {
6828+ throw new Exception("Missing required property");
6829+ }
65546830 return new Visible(
65556831 Visible::fromTable($obj->{'table'})
65566832 );
@@ -7027,6 +7303,30 @@ class Owner {
70277303 * @throws Exception
70287304 */
70297305 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+ }
70307330 return new Owner(
70317331 Owner::fromDisplayName($obj->{'displayName'})
70327332 ,Owner::fromID($obj->{'id'})
@@ -7151,6 +7451,9 @@ class Query {
71517451 * @throws Exception
71527452 */
71537453 public static function from(stdClass $obj): Query {
7454+ if (!property_exists($obj, 'orderBys')) {
7455+ throw new Exception("Missing required property");
7456+ }
71547457 return new Query(
71557458 Query::fromOrderBys($obj->{'orderBys'})
71567459 );
@@ -7302,6 +7605,12 @@ class OrderBy {
73027605 * @throws Exception
73037606 */
73047607 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+ }
73057614 return new OrderBy(
73067615 OrderBy::fromAscending($obj->{'ascending'})
73077616 ,OrderBy::fromExpression($obj->{'expression'})
@@ -7454,6 +7763,12 @@ class Expression {
74547763 * @throws Exception
74557764 */
74567765 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+ }
74577772 return new Expression(
74587773 Expression::fromColumnID($obj->{'columnId'})
74597774 ,Expression::fromType($obj->{'type'})
Test case

test/inputs/json/misc/61b66.json

1 generated file · +75 −0
Mphpdefault / TopLevel.php+75 −0
@@ -450,6 +450,30 @@ class TopLevel {
450450 * @throws Exception
451451 */
452452 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+ }
453477 return new TopLevel(
454478 TopLevel::fromCity($obj->{'city'})
455479 ,TopLevel::fromDelay($obj->{'delay'})
@@ -978,6 +1002,33 @@ class Status {
9781002 * @throws Exception
9791003 */
9801004 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+ }
9811032 return new Status(
9821033 Status::fromAvgDelay($obj->{'avgDelay'})
9831034 ,Status::fromClosureBegin($obj->{'closureBegin'})
@@ -1301,6 +1352,21 @@ class Weather {
13011352 * @throws Exception
13021353 */
13031354 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+ }
13041370 return new Weather(
13051371 Weather::fromMeta($obj->{'meta'})
13061372 ,Weather::fromTemp($obj->{'temp'})
@@ -1511,6 +1577,15 @@ class Meta {
15111577 * @throws Exception
15121578 */
15131579 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+ }
15141589 return new Meta(
15151590 Meta::fromCredit($obj->{'credit'})
15161591 ,Meta::fromUpdated($obj->{'updated'})
Test case

test/inputs/json/misc/6260a.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -205,6 +205,15 @@ class TopLevel {
205205 * @throws Exception
206206 */
207207 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+ }
208217 return new TopLevel(
209218 TopLevel::fromBase($obj->{'base'})
210219 ,TopLevel::fromDate($obj->{'date'})
Test case

test/inputs/json/misc/65dec.json

1 generated file · +87 −0
Mphpdefault / TopLevel.php+87 −0
@@ -630,6 +630,39 @@ class TopLevel {
630630 * @throws Exception
631631 */
632632 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+ }
633666 return new TopLevel(
634667 TopLevel::fromBooster($obj->{'booster'})
635668 ,TopLevel::fromBorder($obj->{'border'})
@@ -2411,6 +2444,48 @@ class Card {
24112444 * @throws Exception
24122445 */
24132446 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+ }
24142489 return new Card(
24152490 Card::fromArtist($obj->{'artist'})
24162491 ,Card::fromCmc($obj->{'cmc'})
@@ -2783,6 +2858,12 @@ class LegalityElement {
27832858 * @throws Exception
27842859 */
27852860 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+ }
27862867 return new LegalityElement(
27872868 LegalityElement::fromFormat($obj->{'format'})
27882869 ,LegalityElement::fromLegality($obj->{'legality'})
@@ -3045,6 +3126,12 @@ class Ruling {
30453126 * @throws Exception
30463127 */
30473128 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+ }
30483135 return new Ruling(
30493136 Ruling::fromDate($obj->{'date'})
30503137 ,Ruling::fromText($obj->{'text'})
Test case

test/inputs/json/misc/66121.json

1 generated file · +45 −0
Mphpdefault / TopLevel.php+45 −0
@@ -517,6 +517,30 @@ class TopLevel {
517517 * @throws Exception
518518 */
519519 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+ }
520544 return new TopLevel(
521545 TopLevel::fromID($obj->{'id'})
522546 ,TopLevel::fromIdentifiers($obj->{'identifiers'})
@@ -682,6 +706,12 @@ class Identifier {
682706 * @throws Exception
683707 */
684708 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+ }
685715 return new Identifier(
686716 Identifier::fromIdentifier($obj->{'identifier'})
687717 ,Identifier::fromScheme($obj->{'scheme'})
@@ -941,6 +971,12 @@ class Link {
941971 * @throws Exception
942972 */
943973 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+ }
944980 return new Link(
945981 Link::fromNote($obj->{'note'})
946982 ,Link::fromURL($obj->{'url'})
@@ -1192,6 +1228,15 @@ class Text {
11921228 * @throws Exception
11931229 */
11941230 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+ }
11951240 return new Text(
11961241 Text::fromMediaType($obj->{'media_type'})
11971242 ,Text::fromTitle($obj->{'title'})
Test case

test/inputs/json/misc/6617c.json

1 generated file · +15 −0
Mphpdefault / TopLevel.php+15 −0
@@ -189,6 +189,15 @@ class TopLevel {
189189 * @throws Exception
190190 */
191191 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+ }
192201 return new TopLevel(
193202 TopLevel::fromIssPosition($obj->{'iss_position'})
194203 ,TopLevel::fromMessage($obj->{'message'})
@@ -343,6 +352,12 @@ class IssPosition {
343352 * @throws Exception
344353 */
345354 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+ }
346361 return new IssPosition(
347362 IssPosition::fromLatitude($obj->{'latitude'})
348363 ,IssPosition::fromLongitude($obj->{'longitude'})
Test case

test/inputs/json/misc/67c03.json

1 generated file · +15 −0
Mphpdefault / TopLevel.php+15 −0
@@ -200,6 +200,15 @@ class TopLevel {
200200 * @throws Exception
201201 */
202202 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+ }
203212 return new TopLevel(
204213 TopLevel::fromMessage($obj->{'message'})
205214 ,TopLevel::fromNumber($obj->{'number'})
@@ -354,6 +363,12 @@ class Person {
354363 * @throws Exception
355364 */
356365 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+ }
357372 return new Person(
358373 Person::fromCraft($obj->{'craft'})
359374 ,Person::fromName($obj->{'name'})
Test case

test/inputs/json/misc/68c30.json

1 generated file · +69 −0
Mphpdefault / TopLevel.php+69 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'txs')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromTxs($obj->{'txs'})
101104 );
@@ -790,6 +793,42 @@ class Tx {
790793 * @throws Exception
791794 */
792795 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+ }
793832 return new Tx(
794833 Tx::fromDoubleSpend($obj->{'double_spend'})
795834 ,Tx::fromHash($obj->{'hash'})
@@ -1015,6 +1054,15 @@ class Input {
10151054 * @throws Exception
10161055 */
10171056 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+ }
10181066 return new Input(
10191067 Input::fromPrevOut($obj->{'prev_out'})
10201068 ,Input::fromScript($obj->{'script'})
@@ -1429,6 +1477,27 @@ class Out {
14291477 * @throws Exception
14301478 */
14311479 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+ }
14321501 return new Out(
14331502 Out::fromAddr($obj->{'addr'})
14341503 ,Out::fromN($obj->{'n'})
Test case

test/inputs/json/misc/6c155.json

1 generated file · +108 −0
Mphpdefault / TopLevel.php+108 −0
@@ -149,6 +149,12 @@ class TopLevel {
149149 * @throws Exception
150150 */
151151 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+ }
152158 return new TopLevel(
153159 TopLevel::fromMetadata($obj->{'metadata'})
154160 ,TopLevel::fromResults($obj->{'results'})
@@ -355,6 +361,15 @@ class Metadata {
355361 * @throws Exception
356362 */
357363 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+ }
358373 return new Metadata(
359374 Metadata::fromExecutionTime($obj->{'executionTime'})
360375 ,Metadata::fromResponseInfo($obj->{'responseInfo'})
@@ -509,6 +524,12 @@ class ResponseInfo {
509524 * @throws Exception
510525 */
511526 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+ }
512533 return new ResponseInfo(
513534 ResponseInfo::fromDeveloperMessage($obj->{'developerMessage'})
514535 ,ResponseInfo::fromStatus($obj->{'status'})
@@ -713,6 +734,15 @@ class Resultset {
713734 * @throws Exception
714735 */
715736 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+ }
716746 return new Resultset(
717747 Resultset::fromCount($obj->{'count'})
718748 ,Resultset::fromPage($obj->{'page'})
@@ -1546,6 +1576,48 @@ class Result {
15461576 * @throws Exception
15471577 */
15481578 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+ }
15491621 return new Result(
15501622 Result::fromAttachment($obj->{'attachment'})
15511623 ,Result::fromBody($obj->{'body'})
@@ -1725,6 +1797,12 @@ class Component {
17251797 * @throws Exception
17261798 */
17271799 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+ }
17281806 return new Component(
17291807 Component::fromName($obj->{'name'})
17301808 ,Component::fromUUID($obj->{'uuid'})
@@ -2296,6 +2374,36 @@ class Location {
22962374 * @throws Exception
22972375 */
22982376 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+ }
22992407 return new Location(
23002408 Location::fromAdministrativeArea($obj->{'administrative_area'})
23012409 ,Location::fromCountry($obj->{'country'})
Test case

test/inputs/json/misc/6de06.json

1 generated file · +285 −0
Mphpdefault / TopLevel.php+285 −0
@@ -137,6 +137,12 @@ class TopLevel {
137137 * @throws Exception
138138 */
139139 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+ }
140146 return new TopLevel(
141147 TopLevel::fromData($obj->{'data'})
142148 ,TopLevel::fromKind($obj->{'kind'})
@@ -408,6 +414,18 @@ class TopLevelData {
408414 * @throws Exception
409415 */
410416 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+ }
411429 return new TopLevelData(
412430 TopLevelData::fromAfter($obj->{'after'})
413431 ,TopLevelData::fromBefore($obj->{'before'})
@@ -566,6 +584,12 @@ class Child {
566584 * @throws Exception
567585 */
568586 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+ }
569593 return new Child(
570594 Child::fromData($obj->{'data'})
571595 ,Child::fromKind($obj->{'kind'})
@@ -4121,6 +4145,192 @@ class ChildData {
41214145 * @throws Exception
41224146 */
41234147 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+ }
41244334 return new ChildData(
41254335 ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'})
41264336 ,ChildData::fromApprovedBy($obj->{'approved_by'})
@@ -4398,6 +4608,12 @@ class Media {
43984608 * @throws Exception
43994609 */
44004610 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+ }
44014617 return new Media(
44024618 Media::fromOembed($obj->{'oembed'})
44034619 ,Media::fromType($obj->{'type'})
@@ -5070,6 +5286,42 @@ class Oembed {
50705286 * @throws Exception
50715287 */
50725288 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+ }
50735325 return new Oembed(
50745326 Oembed::fromDescription($obj->{'description'})
50755327 ,Oembed::fromHeight($obj->{'height'})
@@ -5607,6 +5859,12 @@ class Preview {
56075859 * @throws Exception
56085860 */
56095861 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+ }
56105868 return new Preview(
56115869 Preview::fromEnabled($obj->{'enabled'})
56125870 ,Preview::fromImages($obj->{'images'})
@@ -5877,6 +6135,18 @@ class Image {
58776135 * @throws Exception
58786136 */
58796137 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+ }
58806150 return new Image(
58816151 Image::fromID($obj->{'id'})
58826152 ,Image::fromResolutions($obj->{'resolutions'})
@@ -6085,6 +6355,15 @@ class Source {
60856355 * @throws Exception
60866356 */
60876357 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+ }
60886367 return new Source(
60896368 Source::fromHeight($obj->{'height'})
60906369 ,Source::fromURL($obj->{'url'})
@@ -6556,6 +6835,12 @@ class GIF {
65566835 * @throws Exception
65576836 */
65586837 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+ }
65596844 return new GIF(
65606845 GIF::fromResolutions($obj->{'resolutions'})
65616846 ,GIF::fromSource($obj->{'source'})
Test case

test/inputs/json/misc/6dec6.json

1 generated file · +180 −0
Mphpdefault / TopLevel.php+180 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'query')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromQuery($obj->{'query'})
9093 );
@@ -347,6 +350,18 @@ class Query {
347350 * @throws Exception
348351 */
349352 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+ }
350365 return new Query(
351366 Query::fromCount($obj->{'count'})
352367 ,Query::fromCreated($obj->{'created'})
@@ -452,6 +467,9 @@ class Results {
452467 * @throws Exception
453468 */
454469 public static function from(stdClass $obj): Results {
470+ if (!property_exists($obj, 'channel')) {
471+ throw new Exception("Missing required property");
472+ }
455473 return new Results(
456474 Results::fromChannel($obj->{'channel'})
457475 );
@@ -1181,6 +1199,45 @@ class Channel {
11811199 * @throws Exception
11821200 */
11831201 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+ }
11841241 return new Channel(
11851242 Channel::fromAstronomy($obj->{'astronomy'})
11861243 ,Channel::fromAtmosphere($obj->{'atmosphere'})
@@ -1355,6 +1412,12 @@ class Astronomy {
13551412 * @throws Exception
13561413 */
13571414 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+ }
13581421 return new Astronomy(
13591422 Astronomy::fromSunrise($obj->{'sunrise'})
13601423 ,Astronomy::fromSunset($obj->{'sunset'})
@@ -1611,6 +1674,18 @@ class Atmosphere {
16111674 * @throws Exception
16121675 */
16131676 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+ }
16141689 return new Atmosphere(
16151690 Atmosphere::fromHumidity($obj->{'humidity'})
16161691 ,Atmosphere::fromPressure($obj->{'pressure'})
@@ -1923,6 +1998,21 @@ class Image {
19231998 * @throws Exception
19241999 */
19252000 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+ }
19262016 return new Image(
19272017 Image::fromHeight($obj->{'height'})
19282018 ,Image::fromLink($obj->{'link'})
@@ -2459,6 +2549,33 @@ class Item {
24592549 * @throws Exception
24602550 */
24612551 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+ }
24622579 return new Item(
24632580 Item::fromCondition($obj->{'condition'})
24642581 ,Item::fromDescription($obj->{'description'})
@@ -2729,6 +2846,18 @@ class Condition {
27292846 * @throws Exception
27302847 */
27312848 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+ }
27322861 return new Condition(
27332862 Condition::fromCode($obj->{'code'})
27342863 ,Condition::fromDate($obj->{'date'})
@@ -3094,6 +3223,24 @@ class Forecast {
30943223 * @throws Exception
30953224 */
30963225 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+ }
30973244 return new Forecast(
30983245 Forecast::fromCode($obj->{'code'})
30993246 ,Forecast::fromDate($obj->{'date'})
@@ -3255,6 +3402,9 @@ class GUID {
32553402 * @throws Exception
32563403 */
32573404 public static function from(stdClass $obj): GUID {
3405+ if (!property_exists($obj, 'isPermaLink')) {
3406+ throw new Exception("Missing required property");
3407+ }
32583408 return new GUID(
32593409 GUID::fromIsPermaLink($obj->{'isPermaLink'})
32603410 );
@@ -3457,6 +3607,15 @@ class Location {
34573607 * @throws Exception
34583608 */
34593609 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+ }
34603619 return new Location(
34613620 Location::fromCity($obj->{'city'})
34623621 ,Location::fromCountry($obj->{'country'})
@@ -3715,6 +3874,18 @@ class Units {
37153874 * @throws Exception
37163875 */
37173876 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+ }
37183889 return new Units(
37193890 Units::fromDistance($obj->{'distance'})
37203891 ,Units::fromPressure($obj->{'pressure'})
@@ -3923,6 +4094,15 @@ class Wind {
39234094 * @throws Exception
39244095 */
39254096 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+ }
39264106 return new Wind(
39274107 Wind::fromChill($obj->{'chill'})
39284108 ,Wind::fromDirection($obj->{'direction'})
Test case

test/inputs/json/misc/6eb00.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -188,6 +188,15 @@ class TopLevel {
188188 * @throws Exception
189189 */
190190 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+ }
191200 return new TopLevel(
192201 TopLevel::fromDirectorateID($obj->{'DirectorateID'})
193202 ,TopLevel::fromID($obj->{'Id'})
Test case

test/inputs/json/misc/70c77.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -205,6 +205,15 @@ class TopLevel {
205205 * @throws Exception
206206 */
207207 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+ }
208217 return new TopLevel(
209218 TopLevel::fromBase($obj->{'base'})
210219 ,TopLevel::fromDate($obj->{'date'})
Test case

test/inputs/json/misc/734ad.json

1 generated file · +171 −0
Mphpdefault / TopLevel.php+171 −0
@@ -409,6 +409,27 @@ class TopLevel {
409409 * @throws Exception
410410 */
411411 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+ }
412433 return new TopLevel(
413434 TopLevel::fromCount($obj->{'count'})
414435 ,TopLevel::fromFacets($obj->{'facets'})
@@ -3780,6 +3801,156 @@ class Result {
37803801 * @throws Exception
37813802 */
37823803 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+ }
37833954 return new Result(
37843955 Result::fromAcronym($obj->{'acronym'})
37853956 ,Result::fromActivityConsultCommittees($obj->{'activity_consult_committees'})
Test case

test/inputs/json/misc/75912.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -205,6 +205,15 @@ class TopLevel {
205205 * @throws Exception
206206 */
207207 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+ }
208217 return new TopLevel(
209218 TopLevel::fromBase($obj->{'base'})
210219 ,TopLevel::fromDate($obj->{'date'})
Test case

test/inputs/json/misc/7681c.json

1 generated file · +204 −0
Mphpdefault / TopLevel.php+204 −0
@@ -202,6 +202,15 @@ class TopLevel {
202202 * @throws Exception
203203 */
204204 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+ }
205214 return new TopLevel(
206215 TopLevel::fromData($obj->{'data'})
207216 ,TopLevel::fromMeta($obj->{'meta'})
@@ -1203,6 +1212,57 @@ class Datum {
12031212 * @throws Exception
12041213 */
12051214 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+ }
12061266 return new Datum(
12071267 Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'})
12081268 ,Datum::fromBitlyURL($obj->{'bitly_url'})
@@ -2512,6 +2572,72 @@ class Images {
25122572 * @throws Exception
25132573 */
25142574 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+ }
25152641 return new Images(
25162642 Images::fromDownsized($obj->{'downsized'})
25172643 ,Images::fromDownsizedLarge($obj->{'downsized_large'})
@@ -2820,6 +2946,15 @@ class Downsized {
28202946 * @throws Exception
28212947 */
28222948 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+ }
28232958 return new Downsized(
28242959 Downsized::fromHeight($obj->{'height'})
28252960 ,Downsized::fromSize($obj->{'size'})
@@ -3080,6 +3215,18 @@ class DownsizedSmall {
30803215 * @throws Exception
30813216 */
30823217 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+ }
30833230 return new DownsizedSmall(
30843231 DownsizedSmall::fromHeight($obj->{'height'})
30853232 ,DownsizedSmall::fromMp4($obj->{'mp4'})
@@ -3692,6 +3839,24 @@ class FixedHeight {
36923839 * @throws Exception
36933840 */
36943841 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+ }
36953860 return new FixedHeight(
36963861 FixedHeight::fromFrames($obj->{'frames'})
36973862 ,FixedHeight::fromHash($obj->{'hash'})
@@ -3860,6 +4025,12 @@ class Looping {
38604025 * @throws Exception
38614026 */
38624027 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+ }
38634034 return new Looping(
38644035 Looping::fromMp4($obj->{'mp4'})
38654036 ,Looping::fromMp4Size($obj->{'mp4_size'})
@@ -4328,6 +4499,21 @@ class User {
43284499 * @throws Exception
43294500 */
43304501 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+ }
43314517 return new User(
43324518 User::fromAvatarURL($obj->{'avatar_url'})
43334519 ,User::fromBannerURL($obj->{'banner_url'})
@@ -4597,6 +4783,15 @@ class Meta {
45974783 * @throws Exception
45984784 */
45994785 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+ }
46004795 return new Meta(
46014796 Meta::fromMsg($obj->{'msg'})
46024797 ,Meta::fromResponseID($obj->{'response_id'})
@@ -4803,6 +4998,15 @@ class Pagination {
48034998 * @throws Exception
48044999 */
48055000 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+ }
48065010 return new Pagination(
48075011 Pagination::fromCount($obj->{'count'})
48085012 ,Pagination::fromOffset($obj->{'offset'})
Test case

test/inputs/json/misc/76ae1.json

1 generated file · +312 −0
Mphpdefault / TopLevel.php+312 −0
@@ -479,6 +479,30 @@ class TopLevel {
479479 * @throws Exception
480480 */
481481 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+ }
482506 return new TopLevel(
483507 TopLevel::fromBasePath($obj->{'basePath'})
484508 ,TopLevel::fromDefinitions($obj->{'definitions'})
@@ -1228,6 +1252,45 @@ class Definitions {
12281252 * @throws Exception
12291253 */
12301254 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+ }
12311294 return new Definitions(
12321295 Definitions::fromArticle($obj->{'Article'})
12331296 ,Definitions::fromCenter($obj->{'Center'})
@@ -1365,6 +1428,9 @@ class Article {
13651428 * @throws Exception
13661429 */
13671430 public static function from(stdClass $obj): Article {
1431+ if (!property_exists($obj, 'properties')) {
1432+ throw new Exception("Missing required property");
1433+ }
13681434 return new Article(
13691435 Article::fromProperties($obj->{'properties'})
13701436 );
@@ -1516,6 +1582,12 @@ class Property {
15161582 * @throws Exception
15171583 */
15181584 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+ }
15191591 return new Property(
15201592 Property::fromDescription($obj->{'description'})
15211593 ,Property::fromType($obj->{'type'})
@@ -1662,6 +1734,9 @@ class DeMinimis {
16621734 * @throws Exception
16631735 */
16641736 public static function from(stdClass $obj): DeMinimis {
1737+ if (!property_exists($obj, 'properties')) {
1738+ throw new Exception("Missing required property");
1739+ }
16651740 return new DeMinimis(
16661741 DeMinimis::fromProperties($obj->{'properties'})
16671742 );
@@ -2079,6 +2154,27 @@ class DeMinimisProperties {
20792154 * @throws Exception
20802155 */
20812156 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+ }
20822178 return new DeMinimisProperties(
20832179 DeMinimisProperties::fromCountries($obj->{'countries'})
20842180 ,DeMinimisProperties::fromCountry($obj->{'country'})
@@ -2190,6 +2286,9 @@ class FAQ {
21902286 * @throws Exception
21912287 */
21922288 public static function from(stdClass $obj): FAQ {
2289+ if (!property_exists($obj, 'properties')) {
2290+ throw new Exception("Missing required property");
2291+ }
21932292 return new FAQ(
21942293 FAQ::fromProperties($obj->{'properties'})
21952294 );
@@ -2819,6 +2918,39 @@ class FAQProperties {
28192918 * @throws Exception
28202919 */
28212920 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+ }
28222954 return new FAQProperties(
28232955 FAQProperties::fromAnswer($obj->{'answer'})
28242956 ,FAQProperties::fromCountries($obj->{'countries'})
@@ -2938,6 +3070,9 @@ class Report {
29383070 * @throws Exception
29393071 */
29403072 public static function from(stdClass $obj): Report {
3073+ if (!property_exists($obj, 'properties')) {
3074+ throw new Exception("Missing required property");
3075+ }
29413076 return new Report(
29423077 Report::fromProperties($obj->{'properties'})
29433078 );
@@ -3461,6 +3596,33 @@ class ReportProperties {
34613596 * @throws Exception
34623597 */
34633598 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+ }
34643626 return new ReportProperties(
34653627 ReportProperties::fromCountries($obj->{'countries'})
34663628 ,ReportProperties::fromDescription($obj->{'description'})
@@ -3576,6 +3738,9 @@ class Taxonomy {
35763738 * @throws Exception
35773739 */
35783740 public static function from(stdClass $obj): Taxonomy {
3741+ if (!property_exists($obj, 'properties')) {
3742+ throw new Exception("Missing required property");
3743+ }
35793744 return new Taxonomy(
35803745 Taxonomy::fromProperties($obj->{'properties'})
35813746 );
@@ -3940,6 +4105,24 @@ class TaxonomyProperties {
39404105 * @throws Exception
39414106 */
39424107 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+ }
39434126 return new TaxonomyProperties(
39444127 TaxonomyProperties::fromAnnotations($obj->{'annotations'})
39454128 ,TaxonomyProperties::fromDatatypeProperties($obj->{'datatype_properties'})
@@ -4152,6 +4335,15 @@ class Info {
41524335 * @throws Exception
41534336 */
41544337 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+ }
41554347 return new Info(
41564348 Info::fromDescription($obj->{'description'})
41574349 ,Info::fromTitle($obj->{'title'})
@@ -4891,6 +5083,45 @@ class Paths {
48915083 * @throws Exception
48925084 */
48935085 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+ }
48945125 return new Paths(
48955126 Paths::fromBusinessServiceProvidersSearch($obj->{'/business_service_providers/search'})
48965127 ,Paths::fromConsolidatedScreeningListSearch($obj->{'/consolidated_screening_list/search'})
@@ -5014,6 +5245,9 @@ class BusinessServiceProvidersSearchClass {
50145245 * @throws Exception
50155246 */
50165247 public static function from(stdClass $obj): BusinessServiceProvidersSearchClass {
5248+ if (!property_exists($obj, 'get')) {
5249+ throw new Exception("Missing required property");
5250+ }
50175251 return new BusinessServiceProvidersSearchClass(
50185252 BusinessServiceProvidersSearchClass::fromGet($obj->{'get'})
50195253 );
@@ -5347,6 +5581,21 @@ class BusinessServiceProvidersSearchGet {
53475581 * @throws Exception
53485582 */
53495583 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+ }
53505599 return new BusinessServiceProvidersSearchGet(
53515600 BusinessServiceProvidersSearchGet::fromDescription($obj->{'description'})
53525601 ,BusinessServiceProvidersSearchGet::fromParameters($obj->{'parameters'})
@@ -5716,6 +5965,24 @@ class Parameter {
57165965 * @throws Exception
57175966 */
57185967 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+ }
57195986 return new Parameter(
57205987 Parameter::fromDescription($obj->{'description'})
57215988 ,Parameter::fromFormat($obj->{'format'})
@@ -5870,6 +6137,9 @@ class PurpleResponses {
58706137 * @throws Exception
58716138 */
58726139 public static function from(stdClass $obj): PurpleResponses {
6140+ if (!property_exists($obj, '200')) {
6141+ throw new Exception("Missing required property");
6142+ }
58736143 return new PurpleResponses(
58746144 PurpleResponses::fromThe200($obj->{'200'})
58756145 );
@@ -6021,6 +6291,12 @@ class Purple200 {
60216291 * @throws Exception
60226292 */
60236293 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+ }
60246300 return new Purple200(
60256301 Purple200::fromDescription($obj->{'description'})
60266302 ,Purple200::fromSchema($obj->{'schema'})
@@ -6121,6 +6397,9 @@ class ItemsClass {
61216397 * @throws Exception
61226398 */
61236399 public static function from(stdClass $obj): ItemsClass {
6400+ if (!property_exists($obj, '$ref')) {
6401+ throw new Exception("Missing required property");
6402+ }
61246403 return new ItemsClass(
61256404 ItemsClass::fromRef($obj->{'$ref'})
61266405 );
@@ -6220,6 +6499,9 @@ class ConsolidatedScreeningListSearchClass {
62206499 * @throws Exception
62216500 */
62226501 public static function from(stdClass $obj): ConsolidatedScreeningListSearchClass {
6502+ if (!property_exists($obj, 'get')) {
6503+ throw new Exception("Missing required property");
6504+ }
62236505 return new ConsolidatedScreeningListSearchClass(
62246506 ConsolidatedScreeningListSearchClass::fromGet($obj->{'get'})
62256507 );
@@ -6553,6 +6835,21 @@ class ConsolidatedScreeningListSearchGet {
65536835 * @throws Exception
65546836 */
65556837 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+ }
65566853 return new ConsolidatedScreeningListSearchGet(
65576854 ConsolidatedScreeningListSearchGet::fromDescription($obj->{'description'})
65586855 ,ConsolidatedScreeningListSearchGet::fromParameters($obj->{'parameters'})
@@ -6660,6 +6957,9 @@ class FluffyResponses {
66606957 * @throws Exception
66616958 */
66626959 public static function from(stdClass $obj): FluffyResponses {
6960+ if (!property_exists($obj, '200')) {
6961+ throw new Exception("Missing required property");
6962+ }
66636963 return new FluffyResponses(
66646964 FluffyResponses::fromThe200($obj->{'200'})
66656965 );
@@ -6811,6 +7111,12 @@ class Fluffy200 {
68117111 * @throws Exception
68127112 */
68137113 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+ }
68147120 return new Fluffy200(
68157121 Fluffy200::fromDescription($obj->{'description'})
68167122 ,Fluffy200::fromSchema($obj->{'schema'})
@@ -6965,6 +7271,12 @@ class PurpleSchema {
69657271 * @throws Exception
69667272 */
69677273 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+ }
69687280 return new PurpleSchema(
69697281 PurpleSchema::fromItems($obj->{'items'})
69707282 ,PurpleSchema::fromType($obj->{'type'})
Test case

test/inputs/json/misc/77392.json

1 generated file · +21 −0
Mphpdefault / TopLevel.php+21 −0
@@ -591,6 +591,27 @@ class TopLevel {
591591 * @throws Exception
592592 */
593593 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+ }
594615 return new TopLevel(
595616 TopLevel::fromDesignation($obj->{'designation'})
596617 ,TopLevel::fromDiscoveryDate($obj->{'discovery_date'})
Test case

test/inputs/json/misc/7d397.json

1 generated file · +102 −0
Mphpdefault / TopLevel.php+102 −0
@@ -479,6 +479,30 @@ class TopLevel {
479479 * @throws Exception
480480 */
481481 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+ }
482506 return new TopLevel(
483507 TopLevel::fromBasePath($obj->{'basePath'})
484508 ,TopLevel::fromDefinitions($obj->{'definitions'})
@@ -592,6 +616,9 @@ class Definitions {
592616 * @throws Exception
593617 */
594618 public static function from(stdClass $obj): Definitions {
619+ if (!property_exists($obj, 'List')) {
620+ throw new Exception("Missing required property");
621+ }
595622 return new Definitions(
596623 Definitions::fromList($obj->{'List'})
597624 );
@@ -705,6 +732,9 @@ class ListClass {
705732 * @throws Exception
706733 */
707734 public static function from(stdClass $obj): ListClass {
735+ if (!property_exists($obj, 'properties')) {
736+ throw new Exception("Missing required property");
737+ }
708738 return new ListClass(
709739 ListClass::fromProperties($obj->{'properties'})
710740 );
@@ -856,6 +886,12 @@ class Property {
856886 * @throws Exception
857887 */
858888 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+ }
859895 return new Property(
860896 Property::fromDescription($obj->{'description'})
861897 ,Property::fromType($obj->{'type'})
@@ -1105,6 +1141,15 @@ class Info {
11051141 * @throws Exception
11061142 */
11071143 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+ }
11081153 return new Info(
11091154 Info::fromDescription($obj->{'description'})
11101155 ,Info::fromTitle($obj->{'title'})
@@ -1208,6 +1253,9 @@ class Paths {
12081253 * @throws Exception
12091254 */
12101255 public static function from(stdClass $obj): Paths {
1256+ if (!property_exists($obj, '/consolidated_screening_list/search')) {
1257+ throw new Exception("Missing required property");
1258+ }
12111259 return new Paths(
12121260 Paths::fromConsolidatedScreeningListSearch($obj->{'/consolidated_screening_list/search'})
12131261 );
@@ -1307,6 +1355,9 @@ class ConsolidatedScreeningListSearch {
13071355 * @throws Exception
13081356 */
13091357 public static function from(stdClass $obj): ConsolidatedScreeningListSearch {
1358+ if (!property_exists($obj, 'get')) {
1359+ throw new Exception("Missing required property");
1360+ }
13101361 return new ConsolidatedScreeningListSearch(
13111362 ConsolidatedScreeningListSearch::fromGet($obj->{'get'})
13121363 );
@@ -1640,6 +1691,21 @@ class Get {
16401691 * @throws Exception
16411692 */
16421693 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+ }
16431709 return new Get(
16441710 Get::fromDescription($obj->{'description'})
16451711 ,Get::fromParameters($obj->{'parameters'})
@@ -2009,6 +2075,24 @@ class Parameter {
20092075 * @throws Exception
20102076 */
20112077 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+ }
20122096 return new Parameter(
20132097 Parameter::fromDescription($obj->{'description'})
20142098 ,Parameter::fromFormat($obj->{'format'})
@@ -2163,6 +2247,9 @@ class Responses {
21632247 * @throws Exception
21642248 */
21652249 public static function from(stdClass $obj): Responses {
2250+ if (!property_exists($obj, '200')) {
2251+ throw new Exception("Missing required property");
2252+ }
21662253 return new Responses(
21672254 Responses::fromThe200($obj->{'200'})
21682255 );
@@ -2314,6 +2401,12 @@ class The200 {
23142401 * @throws Exception
23152402 */
23162403 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+ }
23172410 return new The200(
23182411 The200::fromDescription($obj->{'description'})
23192412 ,The200::fromSchema($obj->{'schema'})
@@ -2467,6 +2560,12 @@ class Schema {
24672560 * @throws Exception
24682561 */
24692562 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+ }
24702569 return new Schema(
24712570 Schema::fromItems($obj->{'items'})
24722571 ,Schema::fromType($obj->{'type'})
@@ -2567,6 +2666,9 @@ class Items {
25672666 * @throws Exception
25682667 */
25692668 public static function from(stdClass $obj): Items {
2669+ if (!property_exists($obj, '$ref')) {
2670+ throw new Exception("Missing required property");
2671+ }
25702672 return new Items(
25712673 Items::fromRef($obj->{'$ref'})
25722674 );
Test case

test/inputs/json/misc/7d722.json

1 generated file · +75 −0
Mphpdefault / TopLevel.php+75 −0
@@ -450,6 +450,30 @@ class TopLevel {
450450 * @throws Exception
451451 */
452452 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+ }
453477 return new TopLevel(
454478 TopLevel::fromCity($obj->{'city'})
455479 ,TopLevel::fromDelay($obj->{'delay'})
@@ -978,6 +1002,33 @@ class Status {
9781002 * @throws Exception
9791003 */
9801004 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+ }
9811032 return new Status(
9821033 Status::fromAvgDelay($obj->{'avgDelay'})
9831034 ,Status::fromClosureBegin($obj->{'closureBegin'})
@@ -1301,6 +1352,21 @@ class Weather {
13011352 * @throws Exception
13021353 */
13031354 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+ }
13041370 return new Weather(
13051371 Weather::fromMeta($obj->{'meta'})
13061372 ,Weather::fromTemp($obj->{'temp'})
@@ -1511,6 +1577,15 @@ class Meta {
15111577 * @throws Exception
15121578 */
15131579 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+ }
15141589 return new Meta(
15151590 Meta::fromCredit($obj->{'credit'})
15161591 ,Meta::fromUpdated($obj->{'updated'})
Test case

test/inputs/json/misc/7df41.json

1 generated file · +24 −0
Mphpdefault / TopLevel.php+24 −0
@@ -297,6 +297,21 @@ class TopLevel {
297297 * @throws Exception
298298 */
299299 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+ }
300315 return new TopLevel(
301316 TopLevel::fromPC($obj->{'pc'})
302317 ,TopLevel::fromPs3($obj->{'ps3'})
@@ -507,6 +522,15 @@ class PC {
507522 * @throws Exception
508523 */
509524 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+ }
510534 return new PC(
511535 PC::fromCount($obj->{'count'})
512536 ,PC::fromLabel($obj->{'label'})
Test case

test/inputs/json/misc/7dfa6.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'total_population')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromTotalPopulation($obj->{'total_population'})
101104 );
@@ -246,6 +249,12 @@ class TotalPopulation {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new TotalPopulation(
250259 TotalPopulation::fromDate($obj->{'date'})
251260 ,TotalPopulation::fromPopulation($obj->{'population'})
Test case

test/inputs/json/misc/7eb30.json

1 generated file · +66 −0
Mphpdefault / TopLevel.php+66 −0
@@ -255,6 +255,18 @@ class TopLevel {
255255 * @throws Exception
256256 */
257257 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+ }
258270 return new TopLevel(
259271 TopLevel::fromCount($obj->{'count'})
260272 ,TopLevel::fromNext($obj->{'next'})
@@ -1038,6 +1050,48 @@ class Result {
10381050 * @throws Exception
10391051 */
10401052 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+ }
10411095 return new Result(
10421096 Result::fromCode($obj->{'code'})
10431097 ,Result::fromEnglish($obj->{'english'})
@@ -1321,6 +1375,18 @@ class Group {
13211375 * @throws Exception
13221376 */
13231377 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+ }
13241390 return new Group(
13251391 Group::fromCode($obj->{'code'})
13261392 ,Group::fromEnglish($obj->{'english'})
Test case

test/inputs/json/misc/7f568.json

1 generated file · +63 −0
Mphpdefault / TopLevel.php+63 −0
@@ -906,6 +906,54 @@ class TopLevel {
906906 * @throws Exception
907907 */
908908 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+ }
909957 return new TopLevel(
910958 TopLevel::fromComments($obj->{'comments'})
911959 ,TopLevel::fromCommentsURL($obj->{'comments_url'})
@@ -1254,6 +1302,21 @@ class File {
12541302 * @throws Exception
12551303 */
12561304 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+ }
12571320 return new File(
12581321 File::fromFilename($obj->{'filename'})
12591322 ,File::fromLanguage($obj->{'language'})
Test case

test/inputs/json/misc/80aff.json

1 generated file · +42 −0
Mphpdefault / TopLevel.php+42 −0
@@ -409,6 +409,27 @@ class TopLevel {
409409 * @throws Exception
410410 */
411411 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+ }
412433 return new TopLevel(
413434 TopLevel::fromCount($obj->{'count'})
414435 ,TopLevel::fromFacets($obj->{'facets'})
@@ -900,6 +921,27 @@ class Result {
900921 * @throws Exception
901922 */
902923 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+ }
903945 return new Result(
904946 Result::fromCreatedAt($obj->{'created_at'})
905947 ,Result::fromID($obj->{'id'})
Test case

test/inputs/json/misc/82509.json

1 generated file · +3 −0
Mphpdefault / TopLevel.php+3 −0
@@ -84,6 +84,9 @@ class TopLevel {
8484 * @throws Exception
8585 */
8686 public static function from(stdClass $obj): TopLevel {
87+ if (!property_exists($obj, 'origin')) {
88+ throw new Exception("Missing required property");
89+ }
8790 return new TopLevel(
8891 TopLevel::fromOrigin($obj->{'origin'})
8992 );
Test case

test/inputs/json/misc/8592b.json

1 generated file · +237 −0
Mphpdefault / TopLevel.php+237 −0
@@ -137,6 +137,12 @@ class TopLevel {
137137 * @throws Exception
138138 */
139139 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+ }
140146 return new TopLevel(
141147 TopLevel::fromData($obj->{'data'})
142148 ,TopLevel::fromKind($obj->{'kind'})
@@ -408,6 +414,18 @@ class TopLevelData {
408414 * @throws Exception
409415 */
410416 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+ }
411429 return new TopLevelData(
412430 TopLevelData::fromAfter($obj->{'after'})
413431 ,TopLevelData::fromBefore($obj->{'before'})
@@ -566,6 +584,12 @@ class Child {
566584 * @throws Exception
567585 */
568586 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+ }
569593 return new Child(
570594 Child::fromData($obj->{'data'})
571595 ,Child::fromKind($obj->{'kind'})
@@ -4079,6 +4103,192 @@ class ChildData {
40794103 * @throws Exception
40804104 */
40814105 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+ }
40824292 return new ChildData(
40834293 ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'})
40844294 ,ChildData::fromApprovedBy($obj->{'approved_by'})
@@ -4457,6 +4667,12 @@ class Preview {
44574667 * @throws Exception
44584668 */
44594669 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+ }
44604676 return new Preview(
44614677 Preview::fromEnabled($obj->{'enabled'})
44624678 ,Preview::fromImages($obj->{'images'})
@@ -4727,6 +4943,18 @@ class Image {
47274943 * @throws Exception
47284944 */
47294945 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+ }
47304958 return new Image(
47314959 Image::fromID($obj->{'id'})
47324960 ,Image::fromResolutions($obj->{'resolutions'})
@@ -4935,6 +5163,15 @@ class Source {
49355163 * @throws Exception
49365164 */
49375165 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+ }
49385175 return new Source(
49395176 Source::fromHeight($obj->{'height'})
49405177 ,Source::fromURL($obj->{'url'})
Test case

test/inputs/json/misc/88130.json

1 generated file · +180 −0
Mphpdefault / TopLevel.php+180 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'query')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromQuery($obj->{'query'})
9093 );
@@ -347,6 +350,18 @@ class Query {
347350 * @throws Exception
348351 */
349352 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+ }
350365 return new Query(
351366 Query::fromCount($obj->{'count'})
352367 ,Query::fromCreated($obj->{'created'})
@@ -452,6 +467,9 @@ class Results {
452467 * @throws Exception
453468 */
454469 public static function from(stdClass $obj): Results {
470+ if (!property_exists($obj, 'channel')) {
471+ throw new Exception("Missing required property");
472+ }
455473 return new Results(
456474 Results::fromChannel($obj->{'channel'})
457475 );
@@ -1181,6 +1199,45 @@ class Channel {
11811199 * @throws Exception
11821200 */
11831201 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+ }
11841241 return new Channel(
11851242 Channel::fromAstronomy($obj->{'astronomy'})
11861243 ,Channel::fromAtmosphere($obj->{'atmosphere'})
@@ -1355,6 +1412,12 @@ class Astronomy {
13551412 * @throws Exception
13561413 */
13571414 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+ }
13581421 return new Astronomy(
13591422 Astronomy::fromSunrise($obj->{'sunrise'})
13601423 ,Astronomy::fromSunset($obj->{'sunset'})
@@ -1611,6 +1674,18 @@ class Atmosphere {
16111674 * @throws Exception
16121675 */
16131676 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+ }
16141689 return new Atmosphere(
16151690 Atmosphere::fromHumidity($obj->{'humidity'})
16161691 ,Atmosphere::fromPressure($obj->{'pressure'})
@@ -1923,6 +1998,21 @@ class Image {
19231998 * @throws Exception
19241999 */
19252000 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+ }
19262016 return new Image(
19272017 Image::fromHeight($obj->{'height'})
19282018 ,Image::fromLink($obj->{'link'})
@@ -2459,6 +2549,33 @@ class Item {
24592549 * @throws Exception
24602550 */
24612551 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+ }
24622579 return new Item(
24632580 Item::fromCondition($obj->{'condition'})
24642581 ,Item::fromDescription($obj->{'description'})
@@ -2729,6 +2846,18 @@ class Condition {
27292846 * @throws Exception
27302847 */
27312848 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+ }
27322861 return new Condition(
27332862 Condition::fromCode($obj->{'code'})
27342863 ,Condition::fromDate($obj->{'date'})
@@ -3093,6 +3222,24 @@ class Forecast {
30933222 * @throws Exception
30943223 */
30953224 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+ }
30963243 return new Forecast(
30973244 Forecast::fromCode($obj->{'code'})
30983245 ,Forecast::fromDate($obj->{'date'})
@@ -3201,6 +3348,9 @@ class GUID {
32013348 * @throws Exception
32023349 */
32033350 public static function from(stdClass $obj): GUID {
3351+ if (!property_exists($obj, 'isPermaLink')) {
3352+ throw new Exception("Missing required property");
3353+ }
32043354 return new GUID(
32053355 GUID::fromIsPermaLink($obj->{'isPermaLink'})
32063356 );
@@ -3403,6 +3553,15 @@ class Location {
34033553 * @throws Exception
34043554 */
34053555 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+ }
34063565 return new Location(
34073566 Location::fromCity($obj->{'city'})
34083567 ,Location::fromCountry($obj->{'country'})
@@ -3661,6 +3820,18 @@ class Units {
36613820 * @throws Exception
36623821 */
36633822 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+ }
36643835 return new Units(
36653836 Units::fromDistance($obj->{'distance'})
36663837 ,Units::fromPressure($obj->{'pressure'})
@@ -3869,6 +4040,15 @@ class Wind {
38694040 * @throws Exception
38704041 */
38714042 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+ }
38724052 return new Wind(
38734053 Wind::fromChill($obj->{'chill'})
38744054 ,Wind::fromDirection($obj->{'direction'})
Test case

test/inputs/json/misc/8a62c.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'total_population')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromTotalPopulation($obj->{'total_population'})
101104 );
@@ -246,6 +249,12 @@ class TotalPopulation {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new TotalPopulation(
250259 TotalPopulation::fromDate($obj->{'date'})
251260 ,TotalPopulation::fromPopulation($obj->{'population'})
Test case

test/inputs/json/misc/908db.json

1 generated file · +12 −0
Mphpdefault / TopLevel.php+12 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'states')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromStates($obj->{'states'})
101104 );
@@ -195,6 +198,9 @@ class StateElement {
195198 * @throws Exception
196199 */
197200 public static function from(stdClass $obj): StateElement {
201+ if (!property_exists($obj, 'state')) {
202+ throw new Exception("Missing required property");
203+ }
198204 return new StateElement(
199205 StateElement::fromState($obj->{'state'})
200206 );
@@ -345,6 +351,12 @@ class StateState {
345351 * @throws Exception
346352 */
347353 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+ }
348360 return new StateState(
349361 StateState::fromStateID($obj->{'state_id'})
350362 ,StateState::fromStateName($obj->{'state_name'})
Test case

test/inputs/json/misc/9617f.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -205,6 +205,15 @@ class TopLevel {
205205 * @throws Exception
206206 */
207207 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+ }
208217 return new TopLevel(
209218 TopLevel::fromBase($obj->{'base'})
210219 ,TopLevel::fromDate($obj->{'date'})
Test case

test/inputs/json/misc/96f7c.json

1 generated file · +18 −0
Mphpdefault / TopLevel.php+18 −0
@@ -400,6 +400,24 @@ class TopLevel {
400400 * @throws Exception
401401 */
402402 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+ }
403421 return new TopLevel(
404422 TopLevel::fromGit($obj->{'git'})
405423 ,TopLevel::fromGithubServicesSHA($obj->{'github_services_sha'})
Test case

test/inputs/json/misc/9847b.json

1 generated file · +6 −0
Mphpdefault / TopLevel.php+6 −0
@@ -136,6 +136,12 @@ class TopLevel {
136136 * @throws Exception
137137 */
138138 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+ }
139145 return new TopLevel(
140146 TopLevel::fromID($obj->{'id'})
141147 ,TopLevel::fromName($obj->{'name'})
Test case

test/inputs/json/misc/9929c.json

1 generated file · +180 −0
Mphpdefault / TopLevel.php+180 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'query')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromQuery($obj->{'query'})
9093 );
@@ -347,6 +350,18 @@ class Query {
347350 * @throws Exception
348351 */
349352 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+ }
350365 return new Query(
351366 Query::fromCount($obj->{'count'})
352367 ,Query::fromCreated($obj->{'created'})
@@ -452,6 +467,9 @@ class Results {
452467 * @throws Exception
453468 */
454469 public static function from(stdClass $obj): Results {
470+ if (!property_exists($obj, 'channel')) {
471+ throw new Exception("Missing required property");
472+ }
455473 return new Results(
456474 Results::fromChannel($obj->{'channel'})
457475 );
@@ -1181,6 +1199,45 @@ class Channel {
11811199 * @throws Exception
11821200 */
11831201 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+ }
11841241 return new Channel(
11851242 Channel::fromAstronomy($obj->{'astronomy'})
11861243 ,Channel::fromAtmosphere($obj->{'atmosphere'})
@@ -1355,6 +1412,12 @@ class Astronomy {
13551412 * @throws Exception
13561413 */
13571414 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+ }
13581421 return new Astronomy(
13591422 Astronomy::fromSunrise($obj->{'sunrise'})
13601423 ,Astronomy::fromSunset($obj->{'sunset'})
@@ -1611,6 +1674,18 @@ class Atmosphere {
16111674 * @throws Exception
16121675 */
16131676 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+ }
16141689 return new Atmosphere(
16151690 Atmosphere::fromHumidity($obj->{'humidity'})
16161691 ,Atmosphere::fromPressure($obj->{'pressure'})
@@ -1923,6 +1998,21 @@ class Image {
19231998 * @throws Exception
19241999 */
19252000 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+ }
19262016 return new Image(
19272017 Image::fromHeight($obj->{'height'})
19282018 ,Image::fromLink($obj->{'link'})
@@ -2459,6 +2549,33 @@ class Item {
24592549 * @throws Exception
24602550 */
24612551 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+ }
24622579 return new Item(
24632580 Item::fromCondition($obj->{'condition'})
24642581 ,Item::fromDescription($obj->{'description'})
@@ -2729,6 +2846,18 @@ class Condition {
27292846 * @throws Exception
27302847 */
27312848 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+ }
27322861 return new Condition(
27332862 Condition::fromCode($obj->{'code'})
27342863 ,Condition::fromDate($obj->{'date'})
@@ -3093,6 +3222,24 @@ class Forecast {
30933222 * @throws Exception
30943223 */
30953224 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+ }
30963243 return new Forecast(
30973244 Forecast::fromCode($obj->{'code'})
30983245 ,Forecast::fromDate($obj->{'date'})
@@ -3201,6 +3348,9 @@ class GUID {
32013348 * @throws Exception
32023349 */
32033350 public static function from(stdClass $obj): GUID {
3351+ if (!property_exists($obj, 'isPermaLink')) {
3352+ throw new Exception("Missing required property");
3353+ }
32043354 return new GUID(
32053355 GUID::fromIsPermaLink($obj->{'isPermaLink'})
32063356 );
@@ -3403,6 +3553,15 @@ class Location {
34033553 * @throws Exception
34043554 */
34053555 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+ }
34063565 return new Location(
34073566 Location::fromCity($obj->{'city'})
34083567 ,Location::fromCountry($obj->{'country'})
@@ -3661,6 +3820,18 @@ class Units {
36613820 * @throws Exception
36623821 */
36633822 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+ }
36643835 return new Units(
36653836 Units::fromDistance($obj->{'distance'})
36663837 ,Units::fromPressure($obj->{'pressure'})
@@ -3869,6 +4040,15 @@ class Wind {
38694040 * @throws Exception
38704041 */
38714042 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+ }
38724052 return new Wind(
38734053 Wind::fromChill($obj->{'chill'})
38744054 ,Wind::fromDirection($obj->{'direction'})
Test case

test/inputs/json/misc/996bd.json

1 generated file · +45 −0
Mphpdefault / TopLevel.php+45 −0
@@ -517,6 +517,30 @@ class TopLevel {
517517 * @throws Exception
518518 */
519519 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+ }
520544 return new TopLevel(
521545 TopLevel::fromID($obj->{'id'})
522546 ,TopLevel::fromIdentifiers($obj->{'identifiers'})
@@ -682,6 +706,12 @@ class Identifier {
682706 * @throws Exception
683707 */
684708 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+ }
685715 return new Identifier(
686716 Identifier::fromIdentifier($obj->{'identifier'})
687717 ,Identifier::fromScheme($obj->{'scheme'})
@@ -944,6 +974,12 @@ class Link {
944974 * @throws Exception
945975 */
946976 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+ }
947983 return new Link(
948984 Link::fromNote($obj->{'note'})
949985 ,Link::fromURL($obj->{'url'})
@@ -1150,6 +1186,15 @@ class Text {
11501186 * @throws Exception
11511187 */
11521188 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+ }
11531198 return new Text(
11541199 Text::fromMediaType($obj->{'media_type'})
11551200 ,Text::fromTitle($obj->{'title'})
Test case

test/inputs/json/misc/9a503.json

1 generated file · +45 −0
Mphpdefault / TopLevel.php+45 −0
@@ -510,6 +510,30 @@ class TopLevel {
510510 * @throws Exception
511511 */
512512 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+ }
513537 return new TopLevel(
514538 TopLevel::fromID($obj->{'id'})
515539 ,TopLevel::fromIdentifiers($obj->{'identifiers'})
@@ -674,6 +698,12 @@ class Identifier {
674698 * @throws Exception
675699 */
676700 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+ }
677707 return new Identifier(
678708 Identifier::fromIdentifier($obj->{'identifier'})
679709 ,Identifier::fromScheme($obj->{'scheme'})
@@ -879,6 +909,12 @@ class Link {
879909 * @throws Exception
880910 */
881911 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+ }
882918 return new Link(
883919 Link::fromNote($obj->{'note'})
884920 ,Link::fromURL($obj->{'url'})
@@ -1083,6 +1119,15 @@ class Text {
10831119 * @throws Exception
10841120 */
10851121 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+ }
10861131 return new Text(
10871132 Text::fromMediaType($obj->{'media_type'})
10881133 ,Text::fromTitle($obj->{'title'})
Test case

test/inputs/json/misc/9ac3b.json

1 generated file · +54 −0
Mphpdefault / TopLevel.php+54 −0
@@ -409,6 +409,27 @@ class TopLevel {
409409 * @throws Exception
410410 */
411411 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+ }
412433 return new TopLevel(
413434 TopLevel::fromCount($obj->{'count'})
414435 ,TopLevel::fromFacets($obj->{'facets'})
@@ -1120,6 +1141,39 @@ class Result {
11201141 * @throws Exception
11211142 */
11221143 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+ }
11231177 return new Result(
11241178 Result::fromCreatedAt($obj->{'created_at'})
11251179 ,Result::fromEntity($obj->{'entity'})
Test case

test/inputs/json/misc/9eed5.json

1 generated file · +45 −0
Mphpdefault / TopLevel.php+45 −0
@@ -510,6 +510,30 @@ class TopLevel {
510510 * @throws Exception
511511 */
512512 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+ }
513537 return new TopLevel(
514538 TopLevel::fromID($obj->{'id'})
515539 ,TopLevel::fromIdentifiers($obj->{'identifiers'})
@@ -674,6 +698,12 @@ class Identifier {
674698 * @throws Exception
675699 */
676700 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+ }
677707 return new Identifier(
678708 Identifier::fromIdentifier($obj->{'identifier'})
679709 ,Identifier::fromScheme($obj->{'scheme'})
@@ -875,6 +905,12 @@ class Link {
875905 * @throws Exception
876906 */
877907 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+ }
878914 return new Link(
879915 Link::fromNote($obj->{'note'})
880916 ,Link::fromURL($obj->{'url'})
@@ -1079,6 +1115,15 @@ class Text {
10791115 * @throws Exception
10801116 */
10811117 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+ }
10821127 return new Text(
10831128 Text::fromMediaType($obj->{'media_type'})
10841129 ,Text::fromTitle($obj->{'title'})
Test case

test/inputs/json/misc/a0496.json

1 generated file · +51 −0
Mphpdefault / TopLevel.php+51 −0
@@ -991,6 +991,57 @@ class TopLevel {
991991 * @throws Exception
992992 */
993993 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+ }
9941045 return new TopLevel(
9951046 TopLevel::fromCode($obj->{'code'})
9961047 ,TopLevel::fromColumnNames($obj->{'column_names'})
Test case

test/inputs/json/misc/a1eca.json

1 generated file · +180 −0
Mphpdefault / TopLevel.php+180 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'query')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromQuery($obj->{'query'})
9093 );
@@ -347,6 +350,18 @@ class Query {
347350 * @throws Exception
348351 */
349352 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+ }
350365 return new Query(
351366 Query::fromCount($obj->{'count'})
352367 ,Query::fromCreated($obj->{'created'})
@@ -452,6 +467,9 @@ class Results {
452467 * @throws Exception
453468 */
454469 public static function from(stdClass $obj): Results {
470+ if (!property_exists($obj, 'channel')) {
471+ throw new Exception("Missing required property");
472+ }
455473 return new Results(
456474 Results::fromChannel($obj->{'channel'})
457475 );
@@ -1181,6 +1199,45 @@ class Channel {
11811199 * @throws Exception
11821200 */
11831201 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+ }
11841241 return new Channel(
11851242 Channel::fromAstronomy($obj->{'astronomy'})
11861243 ,Channel::fromAtmosphere($obj->{'atmosphere'})
@@ -1355,6 +1412,12 @@ class Astronomy {
13551412 * @throws Exception
13561413 */
13571414 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+ }
13581421 return new Astronomy(
13591422 Astronomy::fromSunrise($obj->{'sunrise'})
13601423 ,Astronomy::fromSunset($obj->{'sunset'})
@@ -1611,6 +1674,18 @@ class Atmosphere {
16111674 * @throws Exception
16121675 */
16131676 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+ }
16141689 return new Atmosphere(
16151690 Atmosphere::fromHumidity($obj->{'humidity'})
16161691 ,Atmosphere::fromPressure($obj->{'pressure'})
@@ -1923,6 +1998,21 @@ class Image {
19231998 * @throws Exception
19241999 */
19252000 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+ }
19262016 return new Image(
19272017 Image::fromHeight($obj->{'height'})
19282018 ,Image::fromLink($obj->{'link'})
@@ -2459,6 +2549,33 @@ class Item {
24592549 * @throws Exception
24602550 */
24612551 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+ }
24622579 return new Item(
24632580 Item::fromCondition($obj->{'condition'})
24642581 ,Item::fromDescription($obj->{'description'})
@@ -2729,6 +2846,18 @@ class Condition {
27292846 * @throws Exception
27302847 */
27312848 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+ }
27322861 return new Condition(
27332862 Condition::fromCode($obj->{'code'})
27342863 ,Condition::fromDate($obj->{'date'})
@@ -3093,6 +3222,24 @@ class Forecast {
30933222 * @throws Exception
30943223 */
30953224 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+ }
30963243 return new Forecast(
30973244 Forecast::fromCode($obj->{'code'})
30983245 ,Forecast::fromDate($obj->{'date'})
@@ -3201,6 +3348,9 @@ class GUID {
32013348 * @throws Exception
32023349 */
32033350 public static function from(stdClass $obj): GUID {
3351+ if (!property_exists($obj, 'isPermaLink')) {
3352+ throw new Exception("Missing required property");
3353+ }
32043354 return new GUID(
32053355 GUID::fromIsPermaLink($obj->{'isPermaLink'})
32063356 );
@@ -3403,6 +3553,15 @@ class Location {
34033553 * @throws Exception
34043554 */
34053555 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+ }
34063565 return new Location(
34073566 Location::fromCity($obj->{'city'})
34083567 ,Location::fromCountry($obj->{'country'})
@@ -3661,6 +3820,18 @@ class Units {
36613820 * @throws Exception
36623821 */
36633822 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+ }
36643835 return new Units(
36653836 Units::fromDistance($obj->{'distance'})
36663837 ,Units::fromPressure($obj->{'pressure'})
@@ -3869,6 +4040,15 @@ class Wind {
38694040 * @throws Exception
38704041 */
38714042 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+ }
38724052 return new Wind(
38734053 Wind::fromChill($obj->{'chill'})
38744054 ,Wind::fromDirection($obj->{'direction'})
Test case

test/inputs/json/misc/a3d8c.json

1 generated file · +204 −0
Mphpdefault / TopLevel.php+204 −0
@@ -190,6 +190,12 @@ class TopLevel {
190190 * @throws Exception
191191 */
192192 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+ }
193199 return new TopLevel(
194200 TopLevel::fromData($obj->{'data'})
195201 ,TopLevel::fromMeta($obj->{'meta'})
@@ -291,6 +297,9 @@ class Meta {
291297 * @throws Exception
292298 */
293299 public static function from(stdClass $obj): Meta {
300+ if (!property_exists($obj, 'view')) {
301+ throw new Exception("Missing required property");
302+ }
294303 return new Meta(
295304 Meta::fromView($obj->{'view'})
296305 );
@@ -2318,6 +2327,117 @@ class View {
23182327 * @throws Exception
23192328 */
23202329 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+ }
23212441 return new View(
23222442 View::fromAverageRating($obj->{'averageRating'})
23232443 ,View::fromCategory($obj->{'category'})
@@ -3066,6 +3186,27 @@ class Column {
30663186 * @throws Exception
30673187 */
30683188 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+ }
30693210 return new Column(
30703211 Column::fromCachedContents($obj->{'cachedContents'})
30713212 ,Column::fromDataTypeName($obj->{'dataTypeName'})
@@ -3528,6 +3669,21 @@ class CachedContents {
35283669 * @throws Exception
35293670 */
35303671 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+ }
35313687 return new CachedContents(
35323688 CachedContents::fromAverage($obj->{'average'})
35333689 ,CachedContents::fromLargest($obj->{'largest'})
@@ -3690,6 +3846,12 @@ class Top {
36903846 * @throws Exception
36913847 */
36923848 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+ }
36933855 return new Top(
36943856 Top::fromCount($obj->{'count'})
36953857 ,Top::fromItem($obj->{'item'})
@@ -4006,6 +4168,15 @@ class Grant {
40064168 * @throws Exception
40074169 */
40084170 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+ }
40094180 return new Grant(
40104181 Grant::fromFlags($obj->{'flags'})
40114182 ,Grant::fromInherited($obj->{'inherited'})
@@ -4108,6 +4279,9 @@ class License {
41084279 * @throws Exception
41094280 */
41104281 public static function from(stdClass $obj): License {
4282+ if (!property_exists($obj, 'name')) {
4283+ throw new Exception("Missing required property");
4284+ }
41114285 return new License(
41124286 License::fromName($obj->{'name'})
41134287 );
@@ -4429,6 +4603,21 @@ class Metadata {
44294603 * @throws Exception
44304604 */
44314605 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+ }
44324621 return new Metadata(
44334622 Metadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'})
44344623 ,Metadata::fromRDFClass($obj->{'rdfClass'})
@@ -4536,6 +4725,9 @@ class RenderTypeConfig {
45364725 * @throws Exception
45374726 */
45384727 public static function from(stdClass $obj): RenderTypeConfig {
4728+ if (!property_exists($obj, 'visible')) {
4729+ throw new Exception("Missing required property");
4730+ }
45394731 return new RenderTypeConfig(
45404732 RenderTypeConfig::fromVisible($obj->{'visible'})
45414733 );
@@ -4634,6 +4826,9 @@ class Visible {
46344826 * @throws Exception
46354827 */
46364828 public static function from(stdClass $obj): Visible {
4829+ if (!property_exists($obj, 'table')) {
4830+ throw new Exception("Missing required property");
4831+ }
46374832 return new Visible(
46384833 Visible::fromTable($obj->{'table'})
46394834 );
@@ -4836,6 +5031,15 @@ class Owner {
48365031 * @throws Exception
48375032 */
48385033 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+ }
48395043 return new Owner(
48405044 Owner::fromDisplayName($obj->{'displayName'})
48415045 ,Owner::fromID($obj->{'id'})
Test case

test/inputs/json/misc/a45b0.json

1 generated file · +18 −0
Mphpdefault / TopLevel.php+18 −0
@@ -345,6 +345,24 @@ class TopLevel {
345345 * @throws Exception
346346 */
347347 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+ }
348366 return new TopLevel(
349367 TopLevel::fromAge($obj->{'age'})
350368 ,TopLevel::fromCountry($obj->{'country'})
Test case

test/inputs/json/misc/a71df.json

1 generated file · +75 −0
Mphpdefault / TopLevel.php+75 −0
@@ -450,6 +450,30 @@ class TopLevel {
450450 * @throws Exception
451451 */
452452 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+ }
453477 return new TopLevel(
454478 TopLevel::fromCity($obj->{'city'})
455479 ,TopLevel::fromDelay($obj->{'delay'})
@@ -978,6 +1002,33 @@ class Status {
9781002 * @throws Exception
9791003 */
9801004 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+ }
9811032 return new Status(
9821033 Status::fromAvgDelay($obj->{'avgDelay'})
9831034 ,Status::fromClosureBegin($obj->{'closureBegin'})
@@ -1301,6 +1352,21 @@ class Weather {
13011352 * @throws Exception
13021353 */
13031354 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+ }
13041370 return new Weather(
13051371 Weather::fromMeta($obj->{'meta'})
13061372 ,Weather::fromTemp($obj->{'temp'})
@@ -1511,6 +1577,15 @@ class Meta {
15111577 * @throws Exception
15121578 */
15131579 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+ }
15141589 return new Meta(
15151590 Meta::fromCredit($obj->{'credit'})
15161591 ,Meta::fromUpdated($obj->{'updated'})
Test case

test/inputs/json/misc/a9691.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -205,6 +205,15 @@ class TopLevel {
205205 * @throws Exception
206206 */
207207 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+ }
208217 return new TopLevel(
209218 TopLevel::fromBase($obj->{'base'})
210219 ,TopLevel::fromDate($obj->{'date'})
Test case

test/inputs/json/misc/ab0d1.json

1 generated file · +18 −0
Mphpdefault / TopLevel.php+18 −0
@@ -345,6 +345,24 @@ class TopLevel {
345345 * @throws Exception
346346 */
347347 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+ }
348366 return new TopLevel(
349367 TopLevel::fromAge($obj->{'age'})
350368 ,TopLevel::fromCountry($obj->{'country'})
Test case

test/inputs/json/misc/abb4b.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'total_population')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromTotalPopulation($obj->{'total_population'})
101104 );
@@ -246,6 +249,12 @@ class TotalPopulation {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new TotalPopulation(
250259 TotalPopulation::fromDate($obj->{'date'})
251260 ,TotalPopulation::fromPopulation($obj->{'population'})
Test case

test/inputs/json/misc/ac944.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -205,6 +205,15 @@ class TopLevel {
205205 * @throws Exception
206206 */
207207 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+ }
208217 return new TopLevel(
209218 TopLevel::fromBase($obj->{'base'})
210219 ,TopLevel::fromDate($obj->{'date'})
Test case

test/inputs/json/misc/ad8be.json

1 generated file · +51 −0
Mphpdefault / TopLevel.php+51 −0
@@ -518,6 +518,30 @@ class TopLevel {
518518 * @throws Exception
519519 */
520520 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+ }
521545 return new TopLevel(
522546 TopLevel::fromID($obj->{'id'})
523547 ,TopLevel::fromIdentifiers($obj->{'identifiers'})
@@ -683,6 +707,12 @@ class Identifier {
683707 * @throws Exception
684708 */
685709 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+ }
686716 return new Identifier(
687717 Identifier::fromIdentifier($obj->{'identifier'})
688718 ,Identifier::fromScheme($obj->{'scheme'})
@@ -978,6 +1008,12 @@ class Link {
9781008 * @throws Exception
9791009 */
9801010 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+ }
9811017 return new Link(
9821018 Link::fromNote($obj->{'note'})
9831019 ,Link::fromURL($obj->{'url'})
@@ -1205,6 +1241,12 @@ class OtherName {
12051241 * @throws Exception
12061242 */
12071243 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+ }
12081250 return new OtherName(
12091251 OtherName::fromName($obj->{'name'})
12101252 ,OtherName::fromNote($obj->{'note'})
@@ -1411,6 +1453,15 @@ class Text {
14111453 * @throws Exception
14121454 */
14131455 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+ }
14141465 return new Text(
14151466 Text::fromMediaType($obj->{'media_type'})
14161467 ,Text::fromTitle($obj->{'title'})
Test case

test/inputs/json/misc/ae7f0.json

1 generated file · +204 −0
Mphpdefault / TopLevel.php+204 −0
@@ -137,6 +137,12 @@ class TopLevel {
137137 * @throws Exception
138138 */
139139 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+ }
140146 return new TopLevel(
141147 TopLevel::fromData($obj->{'data'})
142148 ,TopLevel::fromKind($obj->{'kind'})
@@ -408,6 +414,18 @@ class TopLevelData {
408414 * @throws Exception
409415 */
410416 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+ }
411429 return new TopLevelData(
412430 TopLevelData::fromAfter($obj->{'after'})
413431 ,TopLevelData::fromBefore($obj->{'before'})
@@ -566,6 +584,12 @@ class Child {
566584 * @throws Exception
567585 */
568586 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+ }
569593 return new Child(
570594 Child::fromData($obj->{'data'})
571595 ,Child::fromKind($obj->{'kind'})
@@ -3831,6 +3855,186 @@ class ChildData {
38313855 * @throws Exception
38323856 */
38333857 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+ }
38344038 return new ChildData(
38354039 ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'})
38364040 ,ChildData::fromApprovedBy($obj->{'approved_by'})
Test case

test/inputs/json/misc/ae9ca.json

1 generated file · +54 −0
Mphpdefault / TopLevel.php+54 −0
@@ -200,6 +200,15 @@ class TopLevel {
200200 * @throws Exception
201201 */
202202 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+ }
203212 return new TopLevel(
204213 TopLevel::fromFeatures($obj->{'features'})
205214 ,TopLevel::fromName($obj->{'name'})
@@ -409,6 +418,15 @@ class Feature {
409418 * @throws Exception
410419 */
411420 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+ }
412430 return new Feature(
413431 Feature::fromGeometry($obj->{'geometry'})
414432 ,Feature::fromProperties($obj->{'properties'})
@@ -578,6 +596,12 @@ class Geometry {
578596 * @throws Exception
579597 */
580598 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+ }
581605 return new Geometry(
582606 Geometry::fromCoordinates($obj->{'coordinates'})
583607 ,Geometry::fromType($obj->{'type'})
@@ -1194,6 +1218,36 @@ class Properties {
11941218 * @throws Exception
11951219 */
11961220 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+ }
11971251 return new Properties(
11981252 Properties::fromArea($obj->{'Area'})
11991253 ,Properties::fromCentralAssetID($obj->{'Central Asset ID'})
Test case

test/inputs/json/misc/af2d1.json

1 generated file · +156 −0
Mphpdefault / TopLevel.php+156 −0
@@ -253,6 +253,18 @@ class TopLevel {
253253 * @throws Exception
254254 */
255255 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+ }
256268 return new TopLevel(
257269 TopLevel::fromCRS($obj->{'crs'})
258270 ,TopLevel::fromFeatures($obj->{'features'})
@@ -410,6 +422,12 @@ class CRS {
410422 * @throws Exception
411423 */
412424 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+ }
413431 return new CRS(
414432 CRS::fromProperties($obj->{'properties'})
415433 ,CRS::fromType($obj->{'type'})
@@ -510,6 +528,9 @@ class CRSProperties {
510528 * @throws Exception
511529 */
512530 public static function from(stdClass $obj): CRSProperties {
531+ if (!property_exists($obj, 'name')) {
532+ throw new Exception("Missing required property");
533+ }
513534 return new CRSProperties(
514535 CRSProperties::fromName($obj->{'name'})
515536 );
@@ -820,6 +841,21 @@ class Feature {
820841 * @throws Exception
821842 */
822843 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+ }
823859 return new Feature(
824860 Feature::fromGeometry($obj->{'geometry'})
825861 ,Feature::fromGeometryName($obj->{'geometry_name'})
@@ -1026,6 +1062,12 @@ class Geometry {
10261062 * @throws Exception
10271063 */
10281064 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+ }
10291071 return new Geometry(
10301072 Geometry::fromCoordinates($obj->{'coordinates'})
10311073 ,Geometry::fromType($obj->{'type'})
@@ -3302,6 +3344,120 @@ class FeatureProperties {
33023344 * @throws Exception
33033345 */
33043346 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+ }
33053461 return new FeatureProperties(
33063462 FeatureProperties::fromAddImprov($obj->{'add_improv'})
33073463 ,FeatureProperties::fromArea($obj->{'area_'})
Test case

test/inputs/json/misc/b4865.json

1 generated file · +21 −0
Mphpdefault / TopLevel.php+21 −0
@@ -736,6 +736,21 @@ class TopLevel {
736736 * @throws Exception
737737 */
738738 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+ }
739754 return new TopLevel(
740755 TopLevel::fromComputedRegionCbhkFwbd($obj->{':@computed_region_cbhk_fwbd'})
741756 ,TopLevel::fromComputedRegionNnqa25F4($obj->{':@computed_region_nnqa_25f4'})
@@ -972,6 +987,12 @@ class Geolocation {
972987 * @throws Exception
973988 */
974989 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+ }
975996 return new Geolocation(
976997 Geolocation::fromCoordinates($obj->{'coordinates'})
977998 ,Geolocation::fromType($obj->{'type'})
Test case

test/inputs/json/misc/b6f2c.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'total_population')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromTotalPopulation($obj->{'total_population'})
101104 );
@@ -246,6 +249,12 @@ class TotalPopulation {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new TotalPopulation(
250259 TotalPopulation::fromDate($obj->{'date'})
251260 ,TotalPopulation::fromPopulation($obj->{'population'})
Test case

test/inputs/json/misc/b6fe5.json

1 generated file · +12 −0
Mphpdefault / TopLevel.php+12 −0
@@ -240,6 +240,18 @@ class TopLevel {
240240 * @throws Exception
241241 */
242242 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+ }
243255 return new TopLevel(
244256 TopLevel::fromGroup($obj->{'group'})
245257 ,TopLevel::fromMovie($obj->{'movie'})
Test case

test/inputs/json/misc/b9f64.json

1 generated file · +3 −0
Mphpdefault / TopLevel.php+3 −0
@@ -84,6 +84,9 @@ class TopLevel {
8484 * @throws Exception
8585 */
8686 public static function from(stdClass $obj): TopLevel {
87+ if (!property_exists($obj, 'user-agent')) {
88+ throw new Exception("Missing required property");
89+ }
8790 return new TopLevel(
8891 TopLevel::fromUserAgent($obj->{'user-agent'})
8992 );
Test case

test/inputs/json/misc/bb1ec.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'total_population')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromTotalPopulation($obj->{'total_population'})
101104 );
@@ -246,6 +249,12 @@ class TotalPopulation {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new TotalPopulation(
250259 TotalPopulation::fromDate($obj->{'date'})
251260 ,TotalPopulation::fromPopulation($obj->{'population'})
Test case

test/inputs/json/misc/be234.json

1 generated file · +291 −0
Mphpdefault / TopLevel.php+291 −0
@@ -137,6 +137,12 @@ class TopLevel {
137137 * @throws Exception
138138 */
139139 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+ }
140146 return new TopLevel(
141147 TopLevel::fromData($obj->{'data'})
142148 ,TopLevel::fromKind($obj->{'kind'})
@@ -408,6 +414,18 @@ class TopLevelData {
408414 * @throws Exception
409415 */
410416 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+ }
411429 return new TopLevelData(
412430 TopLevelData::fromAfter($obj->{'after'})
413431 ,TopLevelData::fromBefore($obj->{'before'})
@@ -566,6 +584,12 @@ class Child {
566584 * @throws Exception
567585 */
568586 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+ }
569593 return new Child(
570594 Child::fromData($obj->{'data'})
571595 ,Child::fromKind($obj->{'kind'})
@@ -4057,6 +4081,198 @@ class ChildData {
40574081 * @throws Exception
40584082 */
40594083 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+ }
40604276 return new ChildData(
40614277 ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'})
40624278 ,ChildData::fromApprovedBy($obj->{'approved_by'})
@@ -4396,6 +4612,12 @@ class Media {
43964612 * @throws Exception
43974613 */
43984614 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+ }
43994621 return new Media(
44004622 Media::fromOembed($obj->{'oembed'})
44014623 ,Media::fromType($obj->{'type'})
@@ -5068,6 +5290,42 @@ class Oembed {
50685290 * @throws Exception
50695291 */
50705292 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+ }
50715329 return new Oembed(
50725330 Oembed::fromDescription($obj->{'description'})
50735331 ,Oembed::fromHeight($obj->{'height'})
@@ -5605,6 +5863,12 @@ class Preview {
56055863 * @throws Exception
56065864 */
56075865 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+ }
56085872 return new Preview(
56095873 Preview::fromEnabled($obj->{'enabled'})
56105874 ,Preview::fromImages($obj->{'images'})
@@ -5875,6 +6139,18 @@ class Image {
58756139 * @throws Exception
58766140 */
58776141 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+ }
58786154 return new Image(
58796155 Image::fromID($obj->{'id'})
58806156 ,Image::fromResolutions($obj->{'resolutions'})
@@ -6083,6 +6359,15 @@ class Source {
60836359 * @throws Exception
60846360 */
60856361 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+ }
60866371 return new Source(
60876372 Source::fromHeight($obj->{'height'})
60886373 ,Source::fromURL($obj->{'url'})
@@ -6424,6 +6709,12 @@ class GIF {
64246709 * @throws Exception
64256710 */
64266711 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+ }
64276718 return new GIF(
64286719 GIF::fromResolutions($obj->{'resolutions'})
64296720 ,GIF::fromSource($obj->{'source'})
Test case

test/inputs/json/misc/c0356.json

1 generated file · +21 −0
Mphpdefault / TopLevel.php+21 −0
@@ -152,6 +152,12 @@ class TopLevel {
152152 * @throws Exception
153153 */
154154 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+ }
155161 return new TopLevel(
156162 TopLevel::fromData($obj->{'data'})
157163 ,TopLevel::fromDescription($obj->{'description'})
@@ -304,6 +310,12 @@ class Datum {
304310 * @throws Exception
305311 */
306312 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+ }
307319 return new Datum(
308320 Datum::fromAnomaly($obj->{'anomaly'})
309321 ,Datum::fromValue($obj->{'value'})
@@ -508,6 +520,15 @@ class Description {
508520 * @throws Exception
509521 */
510522 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+ }
511532 return new Description(
512533 Description::fromBasePeriod($obj->{'base_period'})
513534 ,Description::fromMissing($obj->{'missing'})
Test case

test/inputs/json/misc/c0a3a.json

1 generated file · +75 −0
Mphpdefault / TopLevel.php+75 −0
@@ -450,6 +450,30 @@ class TopLevel {
450450 * @throws Exception
451451 */
452452 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+ }
453477 return new TopLevel(
454478 TopLevel::fromCity($obj->{'city'})
455479 ,TopLevel::fromDelay($obj->{'delay'})
@@ -978,6 +1002,33 @@ class Status {
9781002 * @throws Exception
9791003 */
9801004 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+ }
9811032 return new Status(
9821033 Status::fromAvgDelay($obj->{'avgDelay'})
9831034 ,Status::fromClosureBegin($obj->{'closureBegin'})
@@ -1301,6 +1352,21 @@ class Weather {
13011352 * @throws Exception
13021353 */
13031354 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+ }
13041370 return new Weather(
13051371 Weather::fromMeta($obj->{'meta'})
13061372 ,Weather::fromTemp($obj->{'temp'})
@@ -1511,6 +1577,15 @@ class Meta {
15111577 * @throws Exception
15121578 */
15131579 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+ }
15141589 return new Meta(
15151590 Meta::fromCredit($obj->{'credit'})
15161591 ,Meta::fromUpdated($obj->{'updated'})
Test case

test/inputs/json/misc/c3303.json

1 generated file · +204 −0
Mphpdefault / TopLevel.php+204 −0
@@ -202,6 +202,15 @@ class TopLevel {
202202 * @throws Exception
203203 */
204204 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+ }
205214 return new TopLevel(
206215 TopLevel::fromData($obj->{'data'})
207216 ,TopLevel::fromMeta($obj->{'meta'})
@@ -1203,6 +1212,57 @@ class Datum {
12031212 * @throws Exception
12041213 */
12051214 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+ }
12061266 return new Datum(
12071267 Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'})
12081268 ,Datum::fromBitlyURL($obj->{'bitly_url'})
@@ -2512,6 +2572,72 @@ class Images {
25122572 * @throws Exception
25132573 */
25142574 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+ }
25152641 return new Images(
25162642 Images::fromDownsized($obj->{'downsized'})
25172643 ,Images::fromDownsizedLarge($obj->{'downsized_large'})
@@ -2820,6 +2946,15 @@ class Downsized {
28202946 * @throws Exception
28212947 */
28222948 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+ }
28232958 return new Downsized(
28242959 Downsized::fromHeight($obj->{'height'})
28252960 ,Downsized::fromSize($obj->{'size'})
@@ -3080,6 +3215,18 @@ class DownsizedSmall {
30803215 * @throws Exception
30813216 */
30823217 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+ }
30833230 return new DownsizedSmall(
30843231 DownsizedSmall::fromHeight($obj->{'height'})
30853232 ,DownsizedSmall::fromMp4($obj->{'mp4'})
@@ -3692,6 +3839,24 @@ class FixedHeight {
36923839 * @throws Exception
36933840 */
36943841 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+ }
36953860 return new FixedHeight(
36963861 FixedHeight::fromFrames($obj->{'frames'})
36973862 ,FixedHeight::fromHash($obj->{'hash'})
@@ -3860,6 +4025,12 @@ class Looping {
38604025 * @throws Exception
38614026 */
38624027 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+ }
38634034 return new Looping(
38644035 Looping::fromMp4($obj->{'mp4'})
38654036 ,Looping::fromMp4Size($obj->{'mp4_size'})
@@ -4267,6 +4438,21 @@ class User {
42674438 * @throws Exception
42684439 */
42694440 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+ }
42704456 return new User(
42714457 User::fromAvatarURL($obj->{'avatar_url'})
42724458 ,User::fromBannerURL($obj->{'banner_url'})
@@ -4526,6 +4712,15 @@ class Meta {
45264712 * @throws Exception
45274713 */
45284714 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+ }
45294724 return new Meta(
45304725 Meta::fromMsg($obj->{'msg'})
45314726 ,Meta::fromResponseID($obj->{'response_id'})
@@ -4732,6 +4927,15 @@ class Pagination {
47324927 * @throws Exception
47334928 */
47344929 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+ }
47354939 return new Pagination(
47364940 Pagination::fromCount($obj->{'count'})
47374941 ,Pagination::fromOffset($obj->{'offset'})
Test case

test/inputs/json/misc/c6cfd.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'countries')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromCountries($obj->{'countries'})
101104 );
@@ -246,6 +249,12 @@ class Country {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new Country(
250259 Country::fromCode($obj->{'code'})
251260 ,Country::fromName($obj->{'name'})
Test case

test/inputs/json/misc/cb0cc.json

1 generated file · +24 −0
Mphpdefault / TopLevel.php+24 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'prizes')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromPrizes($obj->{'prizes'})
101104 );
@@ -373,6 +376,15 @@ class Prize {
373376 * @throws Exception
374377 */
375378 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+ }
376388 return new Prize(
377389 Prize::fromCategory($obj->{'category'})
378390 ,Prize::fromLaureates($obj->{'laureates'})
@@ -760,6 +772,18 @@ class Laureate {
760772 * @throws Exception
761773 */
762774 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+ }
763787 return new Laureate(
764788 Laureate::fromFirstname($obj->{'firstname'})
765789 ,Laureate::fromID($obj->{'id'})
Test case

test/inputs/json/misc/cb81e.json

1 generated file · +18 −0
Mphpdefault / TopLevel.php+18 −0
@@ -154,6 +154,12 @@ class TopLevel {
154154 * @throws Exception
155155 */
156156 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+ }
157163 return new TopLevel(
158164 TopLevel::fromData($obj->{'data'})
159165 ,TopLevel::fromDescription($obj->{'description'})
@@ -410,6 +416,18 @@ class Description {
410416 * @throws Exception
411417 */
412418 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+ }
413431 return new Description(
414432 Description::fromBasePeriod($obj->{'base_period'})
415433 ,Description::fromMissing($obj->{'missing'})
Test case

test/inputs/json/misc/ccd18.json

1 generated file · +75 −0
Mphpdefault / TopLevel.php+75 −0
@@ -450,6 +450,30 @@ class TopLevel {
450450 * @throws Exception
451451 */
452452 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+ }
453477 return new TopLevel(
454478 TopLevel::fromCity($obj->{'city'})
455479 ,TopLevel::fromDelay($obj->{'delay'})
@@ -978,6 +1002,33 @@ class Status {
9781002 * @throws Exception
9791003 */
9801004 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+ }
9811032 return new Status(
9821033 Status::fromAvgDelay($obj->{'avgDelay'})
9831034 ,Status::fromClosureBegin($obj->{'closureBegin'})
@@ -1301,6 +1352,21 @@ class Weather {
13011352 * @throws Exception
13021353 */
13031354 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+ }
13041370 return new Weather(
13051371 Weather::fromMeta($obj->{'meta'})
13061372 ,Weather::fromTemp($obj->{'temp'})
@@ -1511,6 +1577,15 @@ class Meta {
15111577 * @throws Exception
15121578 */
15131579 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+ }
15141589 return new Meta(
15151590 Meta::fromCredit($obj->{'credit'})
15161591 ,Meta::fromUpdated($obj->{'updated'})
Test case

test/inputs/json/misc/cd238.json

1 generated file · +75 −0
Mphpdefault / TopLevel.php+75 −0
@@ -450,6 +450,30 @@ class TopLevel {
450450 * @throws Exception
451451 */
452452 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+ }
453477 return new TopLevel(
454478 TopLevel::fromCity($obj->{'city'})
455479 ,TopLevel::fromDelay($obj->{'delay'})
@@ -978,6 +1002,33 @@ class Status {
9781002 * @throws Exception
9791003 */
9801004 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+ }
9811032 return new Status(
9821033 Status::fromAvgDelay($obj->{'avgDelay'})
9831034 ,Status::fromClosureBegin($obj->{'closureBegin'})
@@ -1301,6 +1352,21 @@ class Weather {
13011352 * @throws Exception
13021353 */
13031354 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+ }
13041370 return new Weather(
13051371 Weather::fromMeta($obj->{'meta'})
13061372 ,Weather::fromTemp($obj->{'temp'})
@@ -1511,6 +1577,15 @@ class Meta {
15111577 * @throws Exception
15121578 */
15131579 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+ }
15141589 return new Meta(
15151590 Meta::fromCredit($obj->{'credit'})
15161591 ,Meta::fromUpdated($obj->{'updated'})
Test case

test/inputs/json/misc/cd463.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -205,6 +205,15 @@ class TopLevel {
205205 * @throws Exception
206206 */
207207 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+ }
208217 return new TopLevel(
209218 TopLevel::fromBase($obj->{'base'})
210219 ,TopLevel::fromDate($obj->{'date'})
Test case

test/inputs/json/misc/cf0d8.json

1 generated file · +180 −0
Mphpdefault / TopLevel.php+180 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'query')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromQuery($obj->{'query'})
9093 );
@@ -347,6 +350,18 @@ class Query {
347350 * @throws Exception
348351 */
349352 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+ }
350365 return new Query(
351366 Query::fromCount($obj->{'count'})
352367 ,Query::fromCreated($obj->{'created'})
@@ -452,6 +467,9 @@ class Results {
452467 * @throws Exception
453468 */
454469 public static function from(stdClass $obj): Results {
470+ if (!property_exists($obj, 'channel')) {
471+ throw new Exception("Missing required property");
472+ }
455473 return new Results(
456474 Results::fromChannel($obj->{'channel'})
457475 );
@@ -1181,6 +1199,45 @@ class Channel {
11811199 * @throws Exception
11821200 */
11831201 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+ }
11841241 return new Channel(
11851242 Channel::fromAstronomy($obj->{'astronomy'})
11861243 ,Channel::fromAtmosphere($obj->{'atmosphere'})
@@ -1355,6 +1412,12 @@ class Astronomy {
13551412 * @throws Exception
13561413 */
13571414 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+ }
13581421 return new Astronomy(
13591422 Astronomy::fromSunrise($obj->{'sunrise'})
13601423 ,Astronomy::fromSunset($obj->{'sunset'})
@@ -1611,6 +1674,18 @@ class Atmosphere {
16111674 * @throws Exception
16121675 */
16131676 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+ }
16141689 return new Atmosphere(
16151690 Atmosphere::fromHumidity($obj->{'humidity'})
16161691 ,Atmosphere::fromPressure($obj->{'pressure'})
@@ -1923,6 +1998,21 @@ class Image {
19231998 * @throws Exception
19241999 */
19252000 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+ }
19262016 return new Image(
19272017 Image::fromHeight($obj->{'height'})
19282018 ,Image::fromLink($obj->{'link'})
@@ -2459,6 +2549,33 @@ class Item {
24592549 * @throws Exception
24602550 */
24612551 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+ }
24622579 return new Item(
24632580 Item::fromCondition($obj->{'condition'})
24642581 ,Item::fromDescription($obj->{'description'})
@@ -2729,6 +2846,18 @@ class Condition {
27292846 * @throws Exception
27302847 */
27312848 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+ }
27322861 return new Condition(
27332862 Condition::fromCode($obj->{'code'})
27342863 ,Condition::fromDate($obj->{'date'})
@@ -3093,6 +3222,24 @@ class Forecast {
30933222 * @throws Exception
30943223 */
30953224 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+ }
30963243 return new Forecast(
30973244 Forecast::fromCode($obj->{'code'})
30983245 ,Forecast::fromDate($obj->{'date'})
@@ -3201,6 +3348,9 @@ class GUID {
32013348 * @throws Exception
32023349 */
32033350 public static function from(stdClass $obj): GUID {
3351+ if (!property_exists($obj, 'isPermaLink')) {
3352+ throw new Exception("Missing required property");
3353+ }
32043354 return new GUID(
32053355 GUID::fromIsPermaLink($obj->{'isPermaLink'})
32063356 );
@@ -3403,6 +3553,15 @@ class Location {
34033553 * @throws Exception
34043554 */
34053555 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+ }
34063565 return new Location(
34073566 Location::fromCity($obj->{'city'})
34083567 ,Location::fromCountry($obj->{'country'})
@@ -3661,6 +3820,18 @@ class Units {
36613820 * @throws Exception
36623821 */
36633822 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+ }
36643835 return new Units(
36653836 Units::fromDistance($obj->{'distance'})
36663837 ,Units::fromPressure($obj->{'pressure'})
@@ -3869,6 +4040,15 @@ class Wind {
38694040 * @throws Exception
38704041 */
38714042 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+ }
38724052 return new Wind(
38734053 Wind::fromChill($obj->{'chill'})
38744054 ,Wind::fromDirection($obj->{'direction'})
Test case

test/inputs/json/misc/cfbce.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -205,6 +205,15 @@ class TopLevel {
205205 * @throws Exception
206206 */
207207 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+ }
208217 return new TopLevel(
209218 TopLevel::fromBase($obj->{'base'})
210219 ,TopLevel::fromDate($obj->{'date'})
Test case

test/inputs/json/misc/d0908.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'total_population')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromTotalPopulation($obj->{'total_population'})
101104 );
@@ -246,6 +249,12 @@ class TotalPopulation {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new TotalPopulation(
250259 TotalPopulation::fromDate($obj->{'date'})
251260 ,TotalPopulation::fromPopulation($obj->{'population'})
Test case

test/inputs/json/misc/d23d5.json

1 generated file · +39 −0
Mphpdefault / TopLevel.php+39 −0
@@ -409,6 +409,27 @@ class TopLevel {
409409 * @throws Exception
410410 */
411411 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+ }
412433 return new TopLevel(
413434 TopLevel::fromCount($obj->{'count'})
414435 ,TopLevel::fromFacets($obj->{'facets'})
@@ -848,6 +869,24 @@ class Result {
848869 * @throws Exception
849870 */
850871 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+ }
851890 return new Result(
852891 Result::fromAcronym($obj->{'acronym'})
853892 ,Result::fromCreatedAt($obj->{'created_at'})
Test case

test/inputs/json/misc/dbfb3.json

1 generated file · +180 −0
Mphpdefault / TopLevel.php+180 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'query')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromQuery($obj->{'query'})
9093 );
@@ -347,6 +350,18 @@ class Query {
347350 * @throws Exception
348351 */
349352 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+ }
350365 return new Query(
351366 Query::fromCount($obj->{'count'})
352367 ,Query::fromCreated($obj->{'created'})
@@ -452,6 +467,9 @@ class Results {
452467 * @throws Exception
453468 */
454469 public static function from(stdClass $obj): Results {
470+ if (!property_exists($obj, 'channel')) {
471+ throw new Exception("Missing required property");
472+ }
455473 return new Results(
456474 Results::fromChannel($obj->{'channel'})
457475 );
@@ -1181,6 +1199,45 @@ class Channel {
11811199 * @throws Exception
11821200 */
11831201 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+ }
11841241 return new Channel(
11851242 Channel::fromAstronomy($obj->{'astronomy'})
11861243 ,Channel::fromAtmosphere($obj->{'atmosphere'})
@@ -1355,6 +1412,12 @@ class Astronomy {
13551412 * @throws Exception
13561413 */
13571414 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+ }
13581421 return new Astronomy(
13591422 Astronomy::fromSunrise($obj->{'sunrise'})
13601423 ,Astronomy::fromSunset($obj->{'sunset'})
@@ -1611,6 +1674,18 @@ class Atmosphere {
16111674 * @throws Exception
16121675 */
16131676 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+ }
16141689 return new Atmosphere(
16151690 Atmosphere::fromHumidity($obj->{'humidity'})
16161691 ,Atmosphere::fromPressure($obj->{'pressure'})
@@ -1923,6 +1998,21 @@ class Image {
19231998 * @throws Exception
19241999 */
19252000 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+ }
19262016 return new Image(
19272017 Image::fromHeight($obj->{'height'})
19282018 ,Image::fromLink($obj->{'link'})
@@ -2459,6 +2549,33 @@ class Item {
24592549 * @throws Exception
24602550 */
24612551 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+ }
24622579 return new Item(
24632580 Item::fromCondition($obj->{'condition'})
24642581 ,Item::fromDescription($obj->{'description'})
@@ -2730,6 +2847,18 @@ class Condition {
27302847 * @throws Exception
27312848 */
27322849 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+ }
27332862 return new Condition(
27342863 Condition::fromCode($obj->{'code'})
27352864 ,Condition::fromDate($obj->{'date'})
@@ -3144,6 +3273,24 @@ class Forecast {
31443273 * @throws Exception
31453274 */
31463275 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+ }
31473294 return new Forecast(
31483295 Forecast::fromCode($obj->{'code'})
31493296 ,Forecast::fromDate($obj->{'date'})
@@ -3252,6 +3399,9 @@ class GUID {
32523399 * @throws Exception
32533400 */
32543401 public static function from(stdClass $obj): GUID {
3402+ if (!property_exists($obj, 'isPermaLink')) {
3403+ throw new Exception("Missing required property");
3404+ }
32553405 return new GUID(
32563406 GUID::fromIsPermaLink($obj->{'isPermaLink'})
32573407 );
@@ -3454,6 +3604,15 @@ class Location {
34543604 * @throws Exception
34553605 */
34563606 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+ }
34573616 return new Location(
34583617 Location::fromCity($obj->{'city'})
34593618 ,Location::fromCountry($obj->{'country'})
@@ -3712,6 +3871,18 @@ class Units {
37123871 * @throws Exception
37133872 */
37143873 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+ }
37153886 return new Units(
37163887 Units::fromDistance($obj->{'distance'})
37173888 ,Units::fromPressure($obj->{'pressure'})
@@ -3920,6 +4091,15 @@ class Wind {
39204091 * @throws Exception
39214092 */
39224093 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+ }
39234103 return new Wind(
39244104 Wind::fromChill($obj->{'chill'})
39254105 ,Wind::fromDirection($obj->{'direction'})
Test case

test/inputs/json/misc/dc44f.json

1 generated file · +84 −0
Mphpdefault / TopLevel.php+84 −0
@@ -628,6 +628,39 @@ class TopLevel {
628628 * @throws Exception
629629 */
630630 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+ }
631664 return new TopLevel(
632665 TopLevel::fromBooster($obj->{'booster'})
633666 ,TopLevel::fromBorder($obj->{'border'})
@@ -2407,6 +2440,45 @@ class Card {
24072440 * @throws Exception
24082441 */
24092442 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+ }
24102482 return new Card(
24112483 Card::fromArtist($obj->{'artist'})
24122484 ,Card::fromCmc($obj->{'cmc'})
@@ -2778,6 +2850,12 @@ class LegalityElement {
27782850 * @throws Exception
27792851 */
27802852 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+ }
27812859 return new LegalityElement(
27822860 LegalityElement::fromFormat($obj->{'format'})
27832861 ,LegalityElement::fromLegality($obj->{'legality'})
@@ -3201,6 +3279,12 @@ class Ruling {
32013279 * @throws Exception
32023280 */
32033281 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+ }
32043288 return new Ruling(
32053289 Ruling::fromDate($obj->{'date'})
32063290 ,Ruling::fromText($obj->{'text'})
Test case

test/inputs/json/misc/dd1ce.json

1 generated file · +84 −0
Mphpdefault / TopLevel.php+84 −0
@@ -628,6 +628,39 @@ class TopLevel {
628628 * @throws Exception
629629 */
630630 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+ }
631664 return new TopLevel(
632665 TopLevel::fromBooster($obj->{'booster'})
633666 ,TopLevel::fromBorder($obj->{'border'})
@@ -2407,6 +2440,45 @@ class Card {
24072440 * @throws Exception
24082441 */
24092442 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+ }
24102482 return new Card(
24112483 Card::fromArtist($obj->{'artist'})
24122484 ,Card::fromCmc($obj->{'cmc'})
@@ -2778,6 +2850,12 @@ class LegalityElement {
27782850 * @throws Exception
27792851 */
27802852 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+ }
27812859 return new LegalityElement(
27822860 LegalityElement::fromFormat($obj->{'format'})
27832861 ,LegalityElement::fromLegality($obj->{'legality'})
@@ -3201,6 +3279,12 @@ class Ruling {
32013279 * @throws Exception
32023280 */
32033281 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+ }
32043288 return new Ruling(
32053289 Ruling::fromDate($obj->{'date'})
32063290 ,Ruling::fromText($obj->{'text'})
Test case

test/inputs/json/misc/dec3a.json

1 generated file · +132 −0
Mphpdefault / TopLevel.php+132 −0
@@ -149,6 +149,12 @@ class TopLevel {
149149 * @throws Exception
150150 */
151151 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+ }
152158 return new TopLevel(
153159 TopLevel::fromMetadata($obj->{'metadata'})
154160 ,TopLevel::fromResults($obj->{'results'})
@@ -355,6 +361,15 @@ class Metadata {
355361 * @throws Exception
356362 */
357363 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+ }
358373 return new Metadata(
359374 Metadata::fromExecutionTime($obj->{'executionTime'})
360375 ,Metadata::fromResponseInfo($obj->{'responseInfo'})
@@ -509,6 +524,12 @@ class ResponseInfo {
509524 * @throws Exception
510525 */
511526 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+ }
512533 return new ResponseInfo(
513534 ResponseInfo::fromDeveloperMessage($obj->{'developerMessage'})
514535 ,ResponseInfo::fromStatus($obj->{'status'})
@@ -713,6 +734,15 @@ class Resultset {
713734 * @throws Exception
714735 */
715736 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+ }
716746 return new Resultset(
717747 Resultset::fromCount($obj->{'count'})
718748 ,Resultset::fromPage($obj->{'page'})
@@ -1927,6 +1957,72 @@ class Result {
19271957 * @throws Exception
19281958 */
19291959 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+ }
19302026 return new Result(
19312027 Result::fromAboutOffice($obj->{'about_office'})
19322028 ,Result::fromApplicationProcess($obj->{'application_process'})
@@ -2122,6 +2218,12 @@ class HiringOrg {
21222218 * @throws Exception
21232219 */
21242220 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+ }
21252227 return new HiringOrg(
21262228 HiringOrg::fromName($obj->{'name'})
21272229 ,HiringOrg::fromUUID($obj->{'uuid'})
@@ -2693,6 +2795,36 @@ class Location {
26932795 * @throws Exception
26942796 */
26952797 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+ }
26962828 return new Location(
26972829 Location::fromAdministrativeArea($obj->{'administrative_area'})
26982830 ,Location::fromCountry($obj->{'country'})
Test case

test/inputs/json/misc/df957.json

1 generated file · +180 −0
Mphpdefault / TopLevel.php+180 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'query')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromQuery($obj->{'query'})
9093 );
@@ -347,6 +350,18 @@ class Query {
347350 * @throws Exception
348351 */
349352 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+ }
350365 return new Query(
351366 Query::fromCount($obj->{'count'})
352367 ,Query::fromCreated($obj->{'created'})
@@ -452,6 +467,9 @@ class Results {
452467 * @throws Exception
453468 */
454469 public static function from(stdClass $obj): Results {
470+ if (!property_exists($obj, 'channel')) {
471+ throw new Exception("Missing required property");
472+ }
455473 return new Results(
456474 Results::fromChannel($obj->{'channel'})
457475 );
@@ -1181,6 +1199,45 @@ class Channel {
11811199 * @throws Exception
11821200 */
11831201 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+ }
11841241 return new Channel(
11851242 Channel::fromAstronomy($obj->{'astronomy'})
11861243 ,Channel::fromAtmosphere($obj->{'atmosphere'})
@@ -1355,6 +1412,12 @@ class Astronomy {
13551412 * @throws Exception
13561413 */
13571414 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+ }
13581421 return new Astronomy(
13591422 Astronomy::fromSunrise($obj->{'sunrise'})
13601423 ,Astronomy::fromSunset($obj->{'sunset'})
@@ -1611,6 +1674,18 @@ class Atmosphere {
16111674 * @throws Exception
16121675 */
16131676 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+ }
16141689 return new Atmosphere(
16151690 Atmosphere::fromHumidity($obj->{'humidity'})
16161691 ,Atmosphere::fromPressure($obj->{'pressure'})
@@ -1923,6 +1998,21 @@ class Image {
19231998 * @throws Exception
19241999 */
19252000 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+ }
19262016 return new Image(
19272017 Image::fromHeight($obj->{'height'})
19282018 ,Image::fromLink($obj->{'link'})
@@ -2459,6 +2549,33 @@ class Item {
24592549 * @throws Exception
24602550 */
24612551 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+ }
24622579 return new Item(
24632580 Item::fromCondition($obj->{'condition'})
24642581 ,Item::fromDescription($obj->{'description'})
@@ -2729,6 +2846,18 @@ class Condition {
27292846 * @throws Exception
27302847 */
27312848 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+ }
27322861 return new Condition(
27332862 Condition::fromCode($obj->{'code'})
27342863 ,Condition::fromDate($obj->{'date'})
@@ -3093,6 +3222,24 @@ class Forecast {
30933222 * @throws Exception
30943223 */
30953224 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+ }
30963243 return new Forecast(
30973244 Forecast::fromCode($obj->{'code'})
30983245 ,Forecast::fromDate($obj->{'date'})
@@ -3201,6 +3348,9 @@ class GUID {
32013348 * @throws Exception
32023349 */
32033350 public static function from(stdClass $obj): GUID {
3351+ if (!property_exists($obj, 'isPermaLink')) {
3352+ throw new Exception("Missing required property");
3353+ }
32043354 return new GUID(
32053355 GUID::fromIsPermaLink($obj->{'isPermaLink'})
32063356 );
@@ -3403,6 +3553,15 @@ class Location {
34033553 * @throws Exception
34043554 */
34053555 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+ }
34063565 return new Location(
34073566 Location::fromCity($obj->{'city'})
34083567 ,Location::fromCountry($obj->{'country'})
@@ -3661,6 +3820,18 @@ class Units {
36613820 * @throws Exception
36623821 */
36633822 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+ }
36643835 return new Units(
36653836 Units::fromDistance($obj->{'distance'})
36663837 ,Units::fromPressure($obj->{'pressure'})
@@ -3869,6 +4040,15 @@ class Wind {
38694040 * @throws Exception
38704041 */
38714042 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+ }
38724052 return new Wind(
38734053 Wind::fromChill($obj->{'chill'})
38744054 ,Wind::fromDirection($obj->{'direction'})
Test case

test/inputs/json/misc/e0ac7.json

1 generated file · +207 −0
Mphpdefault / TopLevel.php+207 −0
@@ -202,6 +202,15 @@ class TopLevel {
202202 * @throws Exception
203203 */
204204 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+ }
205214 return new TopLevel(
206215 TopLevel::fromData($obj->{'data'})
207216 ,TopLevel::fromMeta($obj->{'meta'})
@@ -1202,6 +1211,57 @@ class Datum {
12021211 * @throws Exception
12031212 */
12041213 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+ }
12051265 return new Datum(
12061266 Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'})
12071267 ,Datum::fromBitlyURL($obj->{'bitly_url'})
@@ -2511,6 +2571,72 @@ class Images {
25112571 * @throws Exception
25122572 */
25132573 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+ }
25142640 return new Images(
25152641 Images::fromDownsized($obj->{'downsized'})
25162642 ,Images::fromDownsizedLarge($obj->{'downsized_large'})
@@ -2819,6 +2945,15 @@ class Downsized {
28192945 * @throws Exception
28202946 */
28212947 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+ }
28222957 return new Downsized(
28232958 Downsized::fromHeight($obj->{'height'})
28242959 ,Downsized::fromSize($obj->{'size'})
@@ -3079,6 +3214,18 @@ class DownsizedSmall {
30793214 * @throws Exception
30803215 */
30813216 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+ }
30823229 return new DownsizedSmall(
30833230 DownsizedSmall::fromHeight($obj->{'height'})
30843231 ,DownsizedSmall::fromMp4($obj->{'mp4'})
@@ -3691,6 +3838,24 @@ class FixedHeight {
36913838 * @throws Exception
36923839 */
36933840 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+ }
36943859 return new FixedHeight(
36953860 FixedHeight::fromFrames($obj->{'frames'})
36963861 ,FixedHeight::fromHash($obj->{'hash'})
@@ -3859,6 +4024,12 @@ class Looping {
38594024 * @throws Exception
38604025 */
38614026 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+ }
38624033 return new Looping(
38634034 Looping::fromMp4($obj->{'mp4'})
38644035 ,Looping::fromMp4Size($obj->{'mp4_size'})
@@ -4317,6 +4488,24 @@ class User {
43174488 * @throws Exception
43184489 */
43194490 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+ }
43204509 return new User(
43214510 User::fromAvatarURL($obj->{'avatar_url'})
43224511 ,User::fromBannerURL($obj->{'banner_url'})
@@ -4529,6 +4718,15 @@ class Meta {
45294718 * @throws Exception
45304719 */
45314720 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+ }
45324730 return new Meta(
45334731 Meta::fromMsg($obj->{'msg'})
45344732 ,Meta::fromResponseID($obj->{'response_id'})
@@ -4735,6 +4933,15 @@ class Pagination {
47354933 * @throws Exception
47364934 */
47374935 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+ }
47384945 return new Pagination(
47394946 Pagination::fromCount($obj->{'count'})
47404947 ,Pagination::fromOffset($obj->{'offset'})
Test case

test/inputs/json/misc/e2915.json

1 generated file · +180 −0
Mphpdefault / TopLevel.php+180 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'query')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromQuery($obj->{'query'})
9093 );
@@ -347,6 +350,18 @@ class Query {
347350 * @throws Exception
348351 */
349352 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+ }
350365 return new Query(
351366 Query::fromCount($obj->{'count'})
352367 ,Query::fromCreated($obj->{'created'})
@@ -452,6 +467,9 @@ class Results {
452467 * @throws Exception
453468 */
454469 public static function from(stdClass $obj): Results {
470+ if (!property_exists($obj, 'channel')) {
471+ throw new Exception("Missing required property");
472+ }
455473 return new Results(
456474 Results::fromChannel($obj->{'channel'})
457475 );
@@ -1181,6 +1199,45 @@ class Channel {
11811199 * @throws Exception
11821200 */
11831201 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+ }
11841241 return new Channel(
11851242 Channel::fromAstronomy($obj->{'astronomy'})
11861243 ,Channel::fromAtmosphere($obj->{'atmosphere'})
@@ -1355,6 +1412,12 @@ class Astronomy {
13551412 * @throws Exception
13561413 */
13571414 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+ }
13581421 return new Astronomy(
13591422 Astronomy::fromSunrise($obj->{'sunrise'})
13601423 ,Astronomy::fromSunset($obj->{'sunset'})
@@ -1611,6 +1674,18 @@ class Atmosphere {
16111674 * @throws Exception
16121675 */
16131676 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+ }
16141689 return new Atmosphere(
16151690 Atmosphere::fromHumidity($obj->{'humidity'})
16161691 ,Atmosphere::fromPressure($obj->{'pressure'})
@@ -1923,6 +1998,21 @@ class Image {
19231998 * @throws Exception
19241999 */
19252000 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+ }
19262016 return new Image(
19272017 Image::fromHeight($obj->{'height'})
19282018 ,Image::fromLink($obj->{'link'})
@@ -2459,6 +2549,33 @@ class Item {
24592549 * @throws Exception
24602550 */
24612551 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+ }
24622579 return new Item(
24632580 Item::fromCondition($obj->{'condition'})
24642581 ,Item::fromDescription($obj->{'description'})
@@ -2729,6 +2846,18 @@ class Condition {
27292846 * @throws Exception
27302847 */
27312848 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+ }
27322861 return new Condition(
27332862 Condition::fromCode($obj->{'code'})
27342863 ,Condition::fromDate($obj->{'date'})
@@ -3094,6 +3223,24 @@ class Forecast {
30943223 * @throws Exception
30953224 */
30963225 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+ }
30973244 return new Forecast(
30983245 Forecast::fromCode($obj->{'code'})
30993246 ,Forecast::fromDate($obj->{'date'})
@@ -3247,6 +3394,9 @@ class GUID {
32473394 * @throws Exception
32483395 */
32493396 public static function from(stdClass $obj): GUID {
3397+ if (!property_exists($obj, 'isPermaLink')) {
3398+ throw new Exception("Missing required property");
3399+ }
32503400 return new GUID(
32513401 GUID::fromIsPermaLink($obj->{'isPermaLink'})
32523402 );
@@ -3449,6 +3599,15 @@ class Location {
34493599 * @throws Exception
34503600 */
34513601 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+ }
34523611 return new Location(
34533612 Location::fromCity($obj->{'city'})
34543613 ,Location::fromCountry($obj->{'country'})
@@ -3707,6 +3866,18 @@ class Units {
37073866 * @throws Exception
37083867 */
37093868 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+ }
37103881 return new Units(
37113882 Units::fromDistance($obj->{'distance'})
37123883 ,Units::fromPressure($obj->{'pressure'})
@@ -3915,6 +4086,15 @@ class Wind {
39154086 * @throws Exception
39164087 */
39174088 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+ }
39184098 return new Wind(
39194099 Wind::fromChill($obj->{'chill'})
39204100 ,Wind::fromDirection($obj->{'direction'})
Test case

test/inputs/json/misc/e2a58.json

1 generated file · +6 −0
Mphpdefault / TopLevel.php+6 −0
@@ -150,6 +150,12 @@ class TopLevel {
150150 * @throws Exception
151151 */
152152 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+ }
153159 return new TopLevel(
154160 TopLevel::fromDate($obj->{'date'})
155161 ,TopLevel::fromStopAndSearch($obj->{'stop-and-search'})
Test case

test/inputs/json/misc/e324e.json

1 generated file · +102 −0
Mphpdefault / TopLevel.php+102 −0
@@ -479,6 +479,30 @@ class TopLevel {
479479 * @throws Exception
480480 */
481481 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+ }
482506 return new TopLevel(
483507 TopLevel::fromBasePath($obj->{'basePath'})
484508 ,TopLevel::fromDefinitions($obj->{'definitions'})
@@ -592,6 +616,9 @@ class Definitions {
592616 * @throws Exception
593617 */
594618 public static function from(stdClass $obj): Definitions {
619+ if (!property_exists($obj, 'Rate')) {
620+ throw new Exception("Missing required property");
621+ }
595622 return new Definitions(
596623 Definitions::fromRate($obj->{'Rate'})
597624 );
@@ -705,6 +732,9 @@ class Rate {
705732 * @throws Exception
706733 */
707734 public static function from(stdClass $obj): Rate {
735+ if (!property_exists($obj, 'properties')) {
736+ throw new Exception("Missing required property");
737+ }
708738 return new Rate(
709739 Rate::fromProperties($obj->{'properties'})
710740 );
@@ -856,6 +886,12 @@ class Property {
856886 * @throws Exception
857887 */
858888 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+ }
859895 return new Property(
860896 Property::fromDescription($obj->{'description'})
861897 ,Property::fromType($obj->{'type'})
@@ -1105,6 +1141,15 @@ class Info {
11051141 * @throws Exception
11061142 */
11071143 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+ }
11081153 return new Info(
11091154 Info::fromDescription($obj->{'description'})
11101155 ,Info::fromTitle($obj->{'title'})
@@ -1208,6 +1253,9 @@ class Paths {
12081253 * @throws Exception
12091254 */
12101255 public static function from(stdClass $obj): Paths {
1256+ if (!property_exists($obj, '/tariff_rates/search')) {
1257+ throw new Exception("Missing required property");
1258+ }
12111259 return new Paths(
12121260 Paths::fromTariffRatesSearch($obj->{'/tariff_rates/search'})
12131261 );
@@ -1307,6 +1355,9 @@ class TariffRatesSearch {
13071355 * @throws Exception
13081356 */
13091357 public static function from(stdClass $obj): TariffRatesSearch {
1358+ if (!property_exists($obj, 'get')) {
1359+ throw new Exception("Missing required property");
1360+ }
13101361 return new TariffRatesSearch(
13111362 TariffRatesSearch::fromGet($obj->{'get'})
13121363 );
@@ -1640,6 +1691,21 @@ class Get {
16401691 * @throws Exception
16411692 */
16421693 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+ }
16431709 return new Get(
16441710 Get::fromDescription($obj->{'description'})
16451711 ,Get::fromParameters($obj->{'parameters'})
@@ -2008,6 +2074,24 @@ class Parameter {
20082074 * @throws Exception
20092075 */
20102076 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+ }
20112095 return new Parameter(
20122096 Parameter::fromDescription($obj->{'description'})
20132097 ,Parameter::fromFormat($obj->{'format'})
@@ -2117,6 +2201,9 @@ class Responses {
21172201 * @throws Exception
21182202 */
21192203 public static function from(stdClass $obj): Responses {
2204+ if (!property_exists($obj, '200')) {
2205+ throw new Exception("Missing required property");
2206+ }
21202207 return new Responses(
21212208 Responses::fromThe200($obj->{'200'})
21222209 );
@@ -2268,6 +2355,12 @@ class The200 {
22682355 * @throws Exception
22692356 */
22702357 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+ }
22712364 return new The200(
22722365 The200::fromDescription($obj->{'description'})
22732366 ,The200::fromSchema($obj->{'schema'})
@@ -2421,6 +2514,12 @@ class Schema {
24212514 * @throws Exception
24222515 */
24232516 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+ }
24242523 return new Schema(
24252524 Schema::fromItems($obj->{'items'})
24262525 ,Schema::fromType($obj->{'type'})
@@ -2521,6 +2620,9 @@ class Items {
25212620 * @throws Exception
25222621 */
25232622 public static function from(stdClass $obj): Items {
2623+ if (!property_exists($obj, '$ref')) {
2624+ throw new Exception("Missing required property");
2625+ }
25242626 return new Items(
25252627 Items::fromRef($obj->{'$ref'})
25262628 );
Test case

test/inputs/json/misc/e64a0.json

1 generated file · +24 −0
Mphpdefault / TopLevel.php+24 −0
@@ -242,6 +242,18 @@ class TopLevel {
242242 * @throws Exception
243243 */
244244 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+ }
245257 return new TopLevel(
246258 TopLevel::fromArgs($obj->{'args'})
247259 ,TopLevel::fromHeaders($obj->{'headers'})
@@ -547,6 +559,18 @@ class Headers {
547559 * @throws Exception
548560 */
549561 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+ }
550574 return new Headers(
551575 Headers::fromAcceptEncoding($obj->{'Accept-Encoding'})
552576 ,Headers::fromConnection($obj->{'Connection'})
Test case

test/inputs/json/misc/e8a0b.json

1 generated file · +18 −0
Mphpdefault / TopLevel.php+18 −0
@@ -345,6 +345,24 @@ class TopLevel {
345345 * @throws Exception
346346 */
347347 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+ }
348366 return new TopLevel(
349367 TopLevel::fromAge($obj->{'age'})
350368 ,TopLevel::fromCountry($obj->{'country'})
Test case

test/inputs/json/misc/e8b04.json

1 generated file · +180 −0
Mphpdefault / TopLevel.php+180 −0
@@ -2322,6 +2322,81 @@ class TopLevel {
23222322 * @throws Exception
23232323 */
23242324 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+ }
23252400 return new TopLevel(
23262401 TopLevel::fromAverageRating($obj->{'averageRating'})
23272402 ,TopLevel::fromCategory($obj->{'category'})
@@ -2725,6 +2800,15 @@ class Grant {
27252800 * @throws Exception
27262801 */
27272802 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+ }
27282812 return new Grant(
27292813 Grant::fromFlags($obj->{'flags'})
27302814 ,Grant::fromInherited($obj->{'inherited'})
@@ -3619,6 +3703,9 @@ class CustomFields {
36193703 * @throws Exception
36203704 */
36213705 public static function from(stdClass $obj): CustomFields {
3706+ if (!property_exists($obj, 'TEST')) {
3707+ throw new Exception("Missing required property");
3708+ }
36223709 return new CustomFields(
36233710 CustomFields::fromTest($obj->{'TEST'})
36243711 );
@@ -3717,6 +3804,9 @@ class Test {
37173804 * @throws Exception
37183805 */
37193806 public static function from(stdClass $obj): Test {
3807+ if (!property_exists($obj, 'CFPB1')) {
3808+ throw new Exception("Missing required property");
3809+ }
37203810 return new Test(
37213811 Test::fromCfpb1($obj->{'CFPB1'})
37223812 );
@@ -4152,6 +4242,9 @@ class Group {
41524242 * @throws Exception
41534243 */
41544244 public static function from(stdClass $obj): Group {
4245+ if (!property_exists($obj, 'columnFieldName')) {
4246+ throw new Exception("Missing required property");
4247+ }
41554248 return new Group(
41564249 Group::fromColumnFieldName($obj->{'columnFieldName'})
41574250 );
@@ -4303,6 +4396,12 @@ class Order {
43034396 * @throws Exception
43044397 */
43054398 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+ }
43064405 return new Order(
43074406 Order::fromAscending($obj->{'ascending'})
43084407 ,Order::fromColumnFieldName($obj->{'columnFieldName'})
@@ -4518,6 +4617,9 @@ class Select {
45184617 * @throws Exception
45194618 */
45204619 public static function from(stdClass $obj): Select {
4620+ if (!property_exists($obj, 'columnFieldName')) {
4621+ throw new Exception("Missing required property");
4622+ }
45214623 return new Select(
45224624 Select::fromAggregate($obj->{'aggregate'})
45234625 ,Select::fromColumnFieldName($obj->{'columnFieldName'})
@@ -4881,6 +4983,9 @@ class Where {
48814983 * @throws Exception
48824984 */
48834985 public static function from(stdClass $obj): Where {
4986+ if (!property_exists($obj, 'operator')) {
4987+ throw new Exception("Missing required property");
4988+ }
48844989 return new Where(
48854990 Where::fromChildren($obj->{'children'})
48864991 ,Where::fromColumnFieldName($obj->{'columnFieldName'})
@@ -5166,6 +5271,12 @@ class Child {
51665271 * @throws Exception
51675272 */
51685273 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+ }
51695280 return new Child(
51705281 Child::fromColumnFieldName($obj->{'columnFieldName'})
51715282 ,Child::fromMetadata($obj->{'metadata'})
@@ -5820,6 +5931,9 @@ class TableColumnID {
58205931 * @throws Exception
58215932 */
58225933 public static function from(stdClass $obj): TableColumnID {
5934+ if (!property_exists($obj, '2819740')) {
5935+ throw new Exception("Missing required property");
5936+ }
58235937 return new TableColumnID(
58245938 TableColumnID::fromThe2819740($obj->{'2819740'})
58255939 );
@@ -6017,6 +6131,9 @@ class MetadataRenderTypeConfig {
60176131 * @throws Exception
60186132 */
60196133 public static function from(stdClass $obj): MetadataRenderTypeConfig {
6134+ if (!property_exists($obj, 'visible')) {
6135+ throw new Exception("Missing required property");
6136+ }
60206137 return new MetadataRenderTypeConfig(
60216138 MetadataRenderTypeConfig::fromVisible($obj->{'visible'})
60226139 );
@@ -6288,6 +6405,9 @@ class RichRendererConfigs {
62886405 * @throws Exception
62896406 */
62906407 public static function from(stdClass $obj): RichRendererConfigs {
6408+ if (!property_exists($obj, 'fatRow')) {
6409+ throw new Exception("Missing required property");
6410+ }
62916411 return new RichRendererConfigs(
62926412 RichRendererConfigs::fromFatRow($obj->{'fatRow'})
62936413 );
@@ -6398,6 +6518,9 @@ class FatRow {
63986518 * @throws Exception
63996519 */
64006520 public static function from(stdClass $obj): FatRow {
6521+ if (!property_exists($obj, 'columns')) {
6522+ throw new Exception("Missing required property");
6523+ }
64016524 return new FatRow(
64026525 FatRow::fromColumns($obj->{'columns'})
64036526 );
@@ -6561,6 +6684,12 @@ class Column {
65616684 * @throws Exception
65626685 */
65636686 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+ }
65646693 return new Column(
65656694 Column::fromRows($obj->{'rows'})
65666695 ,Column::fromStyles($obj->{'styles'})
@@ -6673,6 +6802,9 @@ class Row {
66736802 * @throws Exception
66746803 */
66756804 public static function from(stdClass $obj): Row {
6805+ if (!property_exists($obj, 'fields')) {
6806+ throw new Exception("Missing required property");
6807+ }
66766808 return new Row(
66776809 Row::fromFields($obj->{'fields'})
66786810 );
@@ -6824,6 +6956,12 @@ class Field {
68246956 * @throws Exception
68256957 */
68266958 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+ }
68276965 return new Field(
68286966 Field::fromTableColumnID($obj->{'tableColumnId'})
68296967 ,Field::fromType($obj->{'type'})
@@ -6974,6 +7112,9 @@ class Styles {
69747112 * @throws Exception
69757113 */
69767114 public static function from(stdClass $obj): Styles {
7115+ if (!property_exists($obj, 'width')) {
7116+ throw new Exception("Missing required property");
7117+ }
69777118 return new Styles(
69787119 Styles::fromWidth($obj->{'width'})
69797120 );
@@ -7235,6 +7376,15 @@ class V1ArchivedProperties {
72357376 * @throws Exception
72367377 */
72377378 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+ }
72387388 return new V1ArchivedProperties(
72397389 V1ArchivedProperties::fromAccessPoints($obj->{'accessPoints'})
72407390 ,V1ArchivedProperties::fromBlistID($obj->{'blist_id'})
@@ -7337,6 +7487,9 @@ class AccessPoints {
73377487 * @throws Exception
73387488 */
73397489 public static function from(stdClass $obj): AccessPoints {
7490+ if (!property_exists($obj, 'new_view')) {
7491+ throw new Exception("Missing required property");
7492+ }
73407493 return new AccessPoints(
73417494 AccessPoints::fromNewView($obj->{'new_view'})
73427495 );
@@ -7436,6 +7589,9 @@ class V1ArchivedPropertiesRenderTypeConfig {
74367589 * @throws Exception
74377590 */
74387591 public static function from(stdClass $obj): V1ArchivedPropertiesRenderTypeConfig {
7592+ if (!property_exists($obj, 'visible')) {
7593+ throw new Exception("Missing required property");
7594+ }
74397595 return new V1ArchivedPropertiesRenderTypeConfig(
74407596 V1ArchivedPropertiesRenderTypeConfig::fromVisible($obj->{'visible'})
74417597 );
@@ -7534,6 +7690,9 @@ class FluffyVisible {
75347690 * @throws Exception
75357691 */
75367692 public static function from(stdClass $obj): FluffyVisible {
7693+ if (!property_exists($obj, 'href')) {
7694+ throw new Exception("Missing required property");
7695+ }
75377696 return new FluffyVisible(
75387697 FluffyVisible::fromHref($obj->{'href'})
75397698 );
@@ -8244,6 +8403,15 @@ class Owner {
82448403 * @throws Exception
82458404 */
82468405 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+ }
82478415 return new Owner(
82488416 Owner::fromDisplayName($obj->{'displayName'})
82498417 ,Owner::fromFlags($obj->{'flags'})
@@ -8499,6 +8667,9 @@ class Ratings {
84998667 * @throws Exception
85008668 */
85018669 public static function from(stdClass $obj): Ratings {
8670+ if (!property_exists($obj, 'rating')) {
8671+ throw new Exception("Missing required property");
8672+ }
85028673 return new Ratings(
85038674 Ratings::fromRating($obj->{'rating'})
85048675 );
@@ -8942,6 +9113,15 @@ class TableAuthor {
89429113 * @throws Exception
89439114 */
89449115 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+ }
89459125 return new TableAuthor(
89469126 TableAuthor::fromDisplayName($obj->{'displayName'})
89479127 ,TableAuthor::fromID($obj->{'id'})
Test case

test/inputs/json/misc/f22f5.json

1 generated file · +204 −0
Mphpdefault / TopLevel.php+204 −0
@@ -137,6 +137,12 @@ class TopLevel {
137137 * @throws Exception
138138 */
139139 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+ }
140146 return new TopLevel(
141147 TopLevel::fromData($obj->{'data'})
142148 ,TopLevel::fromKind($obj->{'kind'})
@@ -408,6 +414,18 @@ class TopLevelData {
408414 * @throws Exception
409415 */
410416 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+ }
411429 return new TopLevelData(
412430 TopLevelData::fromAfter($obj->{'after'})
413431 ,TopLevelData::fromBefore($obj->{'before'})
@@ -566,6 +584,12 @@ class Child {
566584 * @throws Exception
567585 */
568586 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+ }
569593 return new Child(
570594 Child::fromData($obj->{'data'})
571595 ,Child::fromKind($obj->{'kind'})
@@ -3830,6 +3854,186 @@ class ChildData {
38303854 * @throws Exception
38313855 */
38323856 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+ }
38334037 return new ChildData(
38344038 ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'})
38354039 ,ChildData::fromApprovedBy($obj->{'approved_by'})
Test case

test/inputs/json/misc/f3139.json

1 generated file · +6 −0
Mphpdefault / TopLevel.php+6 −0
@@ -136,6 +136,12 @@ class TopLevel {
136136 * @throws Exception
137137 */
138138 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+ }
139145 return new TopLevel(
140146 TopLevel::fromID($obj->{'id'})
141147 ,TopLevel::fromName($obj->{'name'})
Test case

test/inputs/json/misc/f3edf.json

1 generated file · +18 −0
Mphpdefault / TopLevel.php+18 −0
@@ -345,6 +345,24 @@ class TopLevel {
345345 * @throws Exception
346346 */
347347 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+ }
348366 return new TopLevel(
349367 TopLevel::fromAge($obj->{'age'})
350368 ,TopLevel::fromCountry($obj->{'country'})
Test case

test/inputs/json/misc/f466a.json

1 generated file · +18 −0
Mphpdefault / TopLevel.php+18 −0
@@ -345,6 +345,24 @@ class TopLevel {
345345 * @throws Exception
346346 */
347347 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+ }
348366 return new TopLevel(
349367 TopLevel::fromAge($obj->{'age'})
350368 ,TopLevel::fromCountry($obj->{'country'})
Test case

test/inputs/json/misc/f6a65.json

1 generated file · +207 −0
Mphpdefault / TopLevel.php+207 −0
@@ -202,6 +202,15 @@ class TopLevel {
202202 * @throws Exception
203203 */
204204 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+ }
205214 return new TopLevel(
206215 TopLevel::fromData($obj->{'data'})
207216 ,TopLevel::fromMeta($obj->{'meta'})
@@ -1203,6 +1212,57 @@ class Datum {
12031212 * @throws Exception
12041213 */
12051214 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+ }
12061266 return new Datum(
12071267 Datum::fromBitlyGIFURL($obj->{'bitly_gif_url'})
12081268 ,Datum::fromBitlyURL($obj->{'bitly_url'})
@@ -2512,6 +2572,72 @@ class Images {
25122572 * @throws Exception
25132573 */
25142574 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+ }
25152641 return new Images(
25162642 Images::fromDownsized($obj->{'downsized'})
25172643 ,Images::fromDownsizedLarge($obj->{'downsized_large'})
@@ -2820,6 +2946,15 @@ class Downsized {
28202946 * @throws Exception
28212947 */
28222948 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+ }
28232958 return new Downsized(
28242959 Downsized::fromHeight($obj->{'height'})
28252960 ,Downsized::fromSize($obj->{'size'})
@@ -3080,6 +3215,18 @@ class DownsizedSmall {
30803215 * @throws Exception
30813216 */
30823217 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+ }
30833230 return new DownsizedSmall(
30843231 DownsizedSmall::fromHeight($obj->{'height'})
30853232 ,DownsizedSmall::fromMp4($obj->{'mp4'})
@@ -3692,6 +3839,24 @@ class FixedHeight {
36923839 * @throws Exception
36933840 */
36943841 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+ }
36953860 return new FixedHeight(
36963861 FixedHeight::fromFrames($obj->{'frames'})
36973862 ,FixedHeight::fromHash($obj->{'hash'})
@@ -3860,6 +4025,12 @@ class Looping {
38604025 * @throws Exception
38614026 */
38624027 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+ }
38634034 return new Looping(
38644035 Looping::fromMp4($obj->{'mp4'})
38654036 ,Looping::fromMp4Size($obj->{'mp4_size'})
@@ -4323,6 +4494,24 @@ class User {
43234494 * @throws Exception
43244495 */
43254496 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+ }
43264515 return new User(
43274516 User::fromAvatarURL($obj->{'avatar_url'})
43284517 ,User::fromBannerURL($obj->{'banner_url'})
@@ -4592,6 +4781,15 @@ class Meta {
45924781 * @throws Exception
45934782 */
45944783 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+ }
45954793 return new Meta(
45964794 Meta::fromMsg($obj->{'msg'})
45974795 ,Meta::fromResponseID($obj->{'response_id'})
@@ -4798,6 +4996,15 @@ class Pagination {
47984996 * @throws Exception
47994997 */
48004998 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+ }
48015008 return new Pagination(
48025009 Pagination::fromCount($obj->{'count'})
48035010 ,Pagination::fromOffset($obj->{'offset'})
Test case

test/inputs/json/misc/f74d5.json

1 generated file · +204 −0
Mphpdefault / TopLevel.php+204 −0
@@ -182,6 +182,12 @@ class TopLevel {
182182 * @throws Exception
183183 */
184184 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+ }
185191 return new TopLevel(
186192 TopLevel::fromData($obj->{'data'})
187193 ,TopLevel::fromMeta($obj->{'meta'})
@@ -283,6 +289,9 @@ class Meta {
283289 * @throws Exception
284290 */
285291 public static function from(stdClass $obj): Meta {
292+ if (!property_exists($obj, 'view')) {
293+ throw new Exception("Missing required property");
294+ }
286295 return new Meta(
287296 Meta::fromView($obj->{'view'})
288297 );
@@ -2310,6 +2319,117 @@ class View {
23102319 * @throws Exception
23112320 */
23122321 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+ }
23132433 return new View(
23142434 View::fromAverageRating($obj->{'averageRating'})
23152435 ,View::fromCategory($obj->{'category'})
@@ -3058,6 +3178,27 @@ class Column {
30583178 * @throws Exception
30593179 */
30603180 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+ }
30613202 return new Column(
30623203 Column::fromCachedContents($obj->{'cachedContents'})
30633204 ,Column::fromDataTypeName($obj->{'dataTypeName'})
@@ -3520,6 +3661,21 @@ class CachedContents {
35203661 * @throws Exception
35213662 */
35223663 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+ }
35233679 return new CachedContents(
35243680 CachedContents::fromAverage($obj->{'average'})
35253681 ,CachedContents::fromLargest($obj->{'largest'})
@@ -3682,6 +3838,12 @@ class Top {
36823838 * @throws Exception
36833839 */
36843840 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+ }
36853847 return new Top(
36863848 Top::fromCount($obj->{'count'})
36873849 ,Top::fromItem($obj->{'item'})
@@ -3998,6 +4160,15 @@ class Grant {
39984160 * @throws Exception
39994161 */
40004162 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+ }
40014172 return new Grant(
40024173 Grant::fromFlags($obj->{'flags'})
40034174 ,Grant::fromInherited($obj->{'inherited'})
@@ -4100,6 +4271,9 @@ class License {
41004271 * @throws Exception
41014272 */
41024273 public static function from(stdClass $obj): License {
4274+ if (!property_exists($obj, 'name')) {
4275+ throw new Exception("Missing required property");
4276+ }
41034277 return new License(
41044278 License::fromName($obj->{'name'})
41054279 );
@@ -4421,6 +4595,21 @@ class Metadata {
44214595 * @throws Exception
44224596 */
44234597 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+ }
44244613 return new Metadata(
44254614 Metadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'})
44264615 ,Metadata::fromRDFClass($obj->{'rdfClass'})
@@ -4528,6 +4717,9 @@ class RenderTypeConfig {
45284717 * @throws Exception
45294718 */
45304719 public static function from(stdClass $obj): RenderTypeConfig {
4720+ if (!property_exists($obj, 'visible')) {
4721+ throw new Exception("Missing required property");
4722+ }
45314723 return new RenderTypeConfig(
45324724 RenderTypeConfig::fromVisible($obj->{'visible'})
45334725 );
@@ -4626,6 +4818,9 @@ class Visible {
46264818 * @throws Exception
46274819 */
46284820 public static function from(stdClass $obj): Visible {
4821+ if (!property_exists($obj, 'table')) {
4822+ throw new Exception("Missing required property");
4823+ }
46294824 return new Visible(
46304825 Visible::fromTable($obj->{'table'})
46314826 );
@@ -4828,6 +5023,15 @@ class Owner {
48285023 * @throws Exception
48295024 */
48305025 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+ }
48315035 return new Owner(
48325036 Owner::fromDisplayName($obj->{'displayName'})
48335037 ,Owner::fromID($obj->{'id'})
Test case

test/inputs/json/misc/f82d9.json

1 generated file · +132 −0
Mphpdefault / TopLevel.php+132 −0
@@ -479,6 +479,30 @@ class TopLevel {
479479 * @throws Exception
480480 */
481481 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+ }
482506 return new TopLevel(
483507 TopLevel::fromBasePath($obj->{'basePath'})
484508 ,TopLevel::fromDefinitions($obj->{'definitions'})
@@ -592,6 +616,9 @@ class Definitions {
592616 * @throws Exception
593617 */
594618 public static function from(stdClass $obj): Definitions {
619+ if (!property_exists($obj, 'Report')) {
620+ throw new Exception("Missing required property");
621+ }
595622 return new Definitions(
596623 Definitions::fromReport($obj->{'Report'})
597624 );
@@ -691,6 +718,9 @@ class Report {
691718 * @throws Exception
692719 */
693720 public static function from(stdClass $obj): Report {
721+ if (!property_exists($obj, 'properties')) {
722+ throw new Exception("Missing required property");
723+ }
694724 return new Report(
695725 Report::fromProperties($obj->{'properties'})
696726 );
@@ -1267,6 +1297,36 @@ class Properties {
12671297 * @throws Exception
12681298 */
12691299 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+ }
12701330 return new Properties(
12711331 Properties::fromClickURL($obj->{'click_url'})
12721332 ,Properties::fromCountry($obj->{'country'})
@@ -1436,6 +1496,12 @@ class ClickURL {
14361496 * @throws Exception
14371497 */
14381498 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+ }
14391505 return new ClickURL(
14401506 ClickURL::fromDescription($obj->{'description'})
14411507 ,ClickURL::fromType($obj->{'type'})
@@ -1685,6 +1751,15 @@ class Info {
16851751 * @throws Exception
16861752 */
16871753 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+ }
16881763 return new Info(
16891764 Info::fromDescription($obj->{'description'})
16901765 ,Info::fromTitle($obj->{'title'})
@@ -1788,6 +1863,9 @@ class Paths {
17881863 * @throws Exception
17891864 */
17901865 public static function from(stdClass $obj): Paths {
1866+ if (!property_exists($obj, '/market_research_library/search')) {
1867+ throw new Exception("Missing required property");
1868+ }
17911869 return new Paths(
17921870 Paths::fromMarketResearchLibrarySearch($obj->{'/market_research_library/search'})
17931871 );
@@ -1887,6 +1965,9 @@ class MarketResearchLibrarySearch {
18871965 * @throws Exception
18881966 */
18891967 public static function from(stdClass $obj): MarketResearchLibrarySearch {
1968+ if (!property_exists($obj, 'get')) {
1969+ throw new Exception("Missing required property");
1970+ }
18901971 return new MarketResearchLibrarySearch(
18911972 MarketResearchLibrarySearch::fromGet($obj->{'get'})
18921973 );
@@ -2220,6 +2301,21 @@ class Get {
22202301 * @throws Exception
22212302 */
22222303 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+ }
22232319 return new Get(
22242320 Get::fromDescription($obj->{'description'})
22252321 ,Get::fromParameters($obj->{'parameters'})
@@ -2588,6 +2684,24 @@ class Parameter {
25882684 * @throws Exception
25892685 */
25902686 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+ }
25912705 return new Parameter(
25922706 Parameter::fromDescription($obj->{'description'})
25932707 ,Parameter::fromFormat($obj->{'format'})
@@ -2697,6 +2811,9 @@ class Responses {
26972811 * @throws Exception
26982812 */
26992813 public static function from(stdClass $obj): Responses {
2814+ if (!property_exists($obj, '200')) {
2815+ throw new Exception("Missing required property");
2816+ }
27002817 return new Responses(
27012818 Responses::fromThe200($obj->{'200'})
27022819 );
@@ -2848,6 +2965,12 @@ class The200 {
28482965 * @throws Exception
28492966 */
28502967 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+ }
28512974 return new The200(
28522975 The200::fromDescription($obj->{'description'})
28532976 ,The200::fromSchema($obj->{'schema'})
@@ -3001,6 +3124,12 @@ class Schema {
30013124 * @throws Exception
30023125 */
30033126 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+ }
30043133 return new Schema(
30053134 Schema::fromItems($obj->{'items'})
30063135 ,Schema::fromType($obj->{'type'})
@@ -3101,6 +3230,9 @@ class Items {
31013230 * @throws Exception
31023231 */
31033232 public static function from(stdClass $obj): Items {
3233+ if (!property_exists($obj, '$ref')) {
3234+ throw new Exception("Missing required property");
3235+ }
31043236 return new Items(
31053237 Items::fromRef($obj->{'$ref'})
31063238 );
Test case

test/inputs/json/misc/f974d.json

1 generated file · +15 −0
Mphpdefault / TopLevel.php+15 −0
@@ -306,6 +306,21 @@ class TopLevel {
306306 * @throws Exception
307307 */
308308 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+ }
309324 return new TopLevel(
310325 TopLevel::fromBlockIndex($obj->{'block_index'})
311326 ,TopLevel::fromHash($obj->{'hash'})
Test case

test/inputs/json/misc/faff5.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'response')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromResponse($obj->{'response'})
9093 );
@@ -235,6 +238,12 @@ class Response {
235238 * @throws Exception
236239 */
237240 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+ }
238247 return new Response(
239248 Response::fromPlayerCount($obj->{'player_count'})
240249 ,Response::fromResult($obj->{'result'})
Test case

test/inputs/json/misc/fcca3.json

1 generated file · +348 −0
Mphpdefault / TopLevel.php+348 −0
@@ -190,6 +190,12 @@ class TopLevel {
190190 * @throws Exception
191191 */
192192 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+ }
193199 return new TopLevel(
194200 TopLevel::fromData($obj->{'data'})
195201 ,TopLevel::fromMeta($obj->{'meta'})
@@ -291,6 +297,9 @@ class Meta {
291297 * @throws Exception
292298 */
293299 public static function from(stdClass $obj): Meta {
300+ if (!property_exists($obj, 'view')) {
301+ throw new Exception("Missing required property");
302+ }
294303 return new Meta(
295304 Meta::fromView($obj->{'view'})
296305 );
@@ -2331,6 +2340,117 @@ class View {
23312340 * @throws Exception
23322341 */
23332342 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+ }
23342454 return new View(
23352455 View::fromAttribution($obj->{'attribution'})
23362456 ,View::fromAverageRating($obj->{'averageRating'})
@@ -3141,6 +3261,27 @@ class Column {
31413261 * @throws Exception
31423262 */
31433263 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+ }
31443285 return new Column(
31453286 Column::fromCachedContents($obj->{'cachedContents'})
31463287 ,Column::fromDataTypeName($obj->{'dataTypeName'})
@@ -3605,6 +3746,21 @@ class CachedContents {
36053746 * @throws Exception
36063747 */
36073748 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+ }
36083764 return new CachedContents(
36093765 CachedContents::fromAverage($obj->{'average'})
36103766 ,CachedContents::fromLargest($obj->{'largest'})
@@ -3767,6 +3923,12 @@ class Top {
37673923 * @throws Exception
37683924 */
37693925 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+ }
37703932 return new Top(
37713933 Top::fromCount($obj->{'count'})
37723934 ,Top::fromItem($obj->{'item'})
@@ -4274,6 +4436,15 @@ class Grant {
42744436 * @throws Exception
42754437 */
42764438 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+ }
42774448 return new Grant(
42784449 Grant::fromFlags($obj->{'flags'})
42794450 ,Grant::fromInherited($obj->{'inherited'})
@@ -4770,6 +4941,30 @@ class ViewMetadata {
47704941 * @throws Exception
47714942 */
47724943 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+ }
47734968 return new ViewMetadata(
47744969 ViewMetadata::fromAttachments($obj->{'attachments'})
47754970 ,ViewMetadata::fromAvailableDisplayTypes($obj->{'availableDisplayTypes'})
@@ -5038,6 +5233,18 @@ class Attachment {
50385233 * @throws Exception
50395234 */
50405235 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+ }
50415248 return new Attachment(
50425249 Attachment::fromAssetID($obj->{'assetId'})
50435250 ,Attachment::fromBlobID($obj->{'blobId'})
@@ -5302,6 +5509,18 @@ class CustomFields {
53025509 * @throws Exception
53035510 */
53045511 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+ }
53055524 return new CustomFields(
53065525 CustomFields::fromCommonCore($obj->{'Common Core'})
53075526 ,CustomFields::fromDatasetInformation($obj->{'Dataset Information'})
@@ -5510,6 +5729,15 @@ class CommonCore {
55105729 * @throws Exception
55115730 */
55125731 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+ }
55135741 return new CommonCore(
55145742 CommonCore::fromContactEmail($obj->{'Contact Email'})
55155743 ,CommonCore::fromContactName($obj->{'Contact Name'})
@@ -5612,6 +5840,9 @@ class DatasetInformation {
56125840 * @throws Exception
56135841 */
56145842 public static function from(stdClass $obj): DatasetInformation {
5843+ if (!property_exists($obj, 'Agency')) {
5844+ throw new Exception("Missing required property");
5845+ }
56155846 return new DatasetInformation(
56165847 DatasetInformation::fromAgency($obj->{'Agency'})
56175848 );
@@ -5970,6 +6201,24 @@ class DatasetSummary {
59706201 * @throws Exception
59716202 */
59726203 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+ }
59736222 return new DatasetSummary(
59746223 DatasetSummary::fromContactInformation($obj->{'Contact Information'})
59756224 ,DatasetSummary::fromCoverage($obj->{'Coverage'})
@@ -6130,6 +6379,12 @@ class Disclaimers {
61306379 * @throws Exception
61316380 */
61326381 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+ }
61336388 return new Disclaimers(
61346389 Disclaimers::fromDisclaimer($obj->{'Disclaimer'})
61356390 ,Disclaimers::fromLimitations($obj->{'Limitations'})
@@ -6399,6 +6654,18 @@ class FilterCondition {
63996654 * @throws Exception
64006655 */
64016656 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+ }
64026669 return new FilterCondition(
64036670 FilterCondition::fromChildren($obj->{'children'})
64046671 ,FilterCondition::fromMetadata($obj->{'metadata'})
@@ -6608,6 +6875,15 @@ class Child {
66086875 * @throws Exception
66096876 */
66106877 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+ }
66116887 return new Child(
66126888 Child::fromMetadata($obj->{'metadata'})
66136889 ,Child::fromType($obj->{'type'})
@@ -6840,6 +7116,15 @@ class ChildMetadata {
68407116 * @throws Exception
68417117 */
68427118 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+ }
68437128 return new ChildMetadata(
68447129 ChildMetadata::fromCustomValues($obj->{'customValues'})
68457130 ,ChildMetadata::fromOperator($obj->{'operator'})
@@ -6942,6 +7227,9 @@ class TableColumnID {
69427227 * @throws Exception
69437228 */
69447229 public static function from(stdClass $obj): TableColumnID {
7230+ if (!property_exists($obj, '703610')) {
7231+ throw new Exception("Missing required property");
7232+ }
69457233 return new TableColumnID(
69467234 TableColumnID::fromThe703610($obj->{'703610'})
69477235 );
@@ -7092,6 +7380,12 @@ class FilterConditionMetadata {
70927380 * @throws Exception
70937381 */
70947382 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+ }
70957389 return new FilterConditionMetadata(
70967390 FilterConditionMetadata::fromAdvanced($obj->{'advanced'})
70977391 ,FilterConditionMetadata::fromUnifiedVersion($obj->{'unifiedVersion'})
@@ -7204,6 +7498,9 @@ class JSONQuery {
72047498 * @throws Exception
72057499 */
72067500 public static function from(stdClass $obj): JSONQuery {
7501+ if (!property_exists($obj, 'order')) {
7502+ throw new Exception("Missing required property");
7503+ }
72077504 return new JSONQuery(
72087505 JSONQuery::fromOrder($obj->{'order'})
72097506 );
@@ -7354,6 +7651,12 @@ class Order {
73547651 * @throws Exception
73557652 */
73567653 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+ }
73577660 return new Order(
73587661 Order::fromAscending($obj->{'ascending'})
73597662 ,Order::fromColumnFieldName($obj->{'columnFieldName'})
@@ -7455,6 +7758,9 @@ class RenderTypeConfig {
74557758 * @throws Exception
74567759 */
74577760 public static function from(stdClass $obj): RenderTypeConfig {
7761+ if (!property_exists($obj, 'visible')) {
7762+ throw new Exception("Missing required property");
7763+ }
74587764 return new RenderTypeConfig(
74597765 RenderTypeConfig::fromVisible($obj->{'visible'})
74607766 );
@@ -7553,6 +7859,9 @@ class Visible {
75537859 * @throws Exception
75547860 */
75557861 public static function from(stdClass $obj): Visible {
7862+ if (!property_exists($obj, 'table')) {
7863+ throw new Exception("Missing required property");
7864+ }
75567865 return new Visible(
75577866 Visible::fromTable($obj->{'table'})
75587867 );
@@ -8029,6 +8338,30 @@ class Owner {
80298338 * @throws Exception
80308339 */
80318340 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+ }
80328365 return new Owner(
80338366 Owner::fromDisplayName($obj->{'displayName'})
80348367 ,Owner::fromID($obj->{'id'})
@@ -8153,6 +8486,9 @@ class Query {
81538486 * @throws Exception
81548487 */
81558488 public static function from(stdClass $obj): Query {
8489+ if (!property_exists($obj, 'orderBys')) {
8490+ throw new Exception("Missing required property");
8491+ }
81568492 return new Query(
81578493 Query::fromOrderBys($obj->{'orderBys'})
81588494 );
@@ -8304,6 +8640,12 @@ class OrderBy {
83048640 * @throws Exception
83058641 */
83068642 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+ }
83078649 return new OrderBy(
83088650 OrderBy::fromAscending($obj->{'ascending'})
83098651 ,OrderBy::fromExpression($obj->{'expression'})
@@ -8456,6 +8798,12 @@ class Expression {
84568798 * @throws Exception
84578799 */
84588800 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+ }
84598807 return new Expression(
84608808 Expression::fromColumnID($obj->{'columnId'})
84618809 ,Expression::fromType($obj->{'type'})
Test case

test/inputs/json/misc/fd329.json

1 generated file · +24 −0
Mphpdefault / TopLevel.php+24 −0
@@ -152,6 +152,12 @@ class TopLevel {
152152 * @throws Exception
153153 */
154154 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+ }
155161 return new TopLevel(
156162 TopLevel::fromData($obj->{'data'})
157163 ,TopLevel::fromDescription($obj->{'description'})
@@ -304,6 +310,12 @@ class Datum {
304310 * @throws Exception
305311 */
306312 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+ }
307319 return new Datum(
308320 Datum::fromAnomaly($obj->{'anomaly'})
309321 ,Datum::fromValue($obj->{'value'})
@@ -560,6 +572,18 @@ class Description {
560572 * @throws Exception
561573 */
562574 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+ }
563587 return new Description(
564588 Description::fromBasePeriod($obj->{'base_period'})
565589 ,Description::fromMissing($obj->{'missing'})
Test case

test/inputs/json/priority/blns-object.json

1 generated file · +1,784 −23
Mphpdefault / TopLevel.php+1,784 −23
@@ -191,6 +191,15 @@ class TopLevel {
191191 * @throws Exception
192192 */
193193 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+ }
194203 return new TopLevel(
195204 TopLevel::fromA($obj->{'a'})
196205 ,TopLevel::fromB($obj->{'b'})
@@ -12201,6 +12210,696 @@ class A {
1220112210 * @throws Exception
1220212211 */
1220312212 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&#1&#2&#3&#4&#5&#6&#7&#8&#11&#12script: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&#x0A;ascript:alert(\'XSS\');">')) {
12478+ throw new Exception("Missing required property");
12479+ }
12480+ if (!property_exists($obj, '<IMG SRC="jav&#x0D;ascript:alert(\'XSS\');">')) {
12481+ throw new Exception("Missing required property");
12482+ }
12483+ if (!property_exists($obj, '<IMG SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#88;&#83;&#83;&#39;&#41;>')) {
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+ }
1220412903 return new A(
1220512904 A::from1($obj->{'ثم نفس سقطت وبالتحديد،, جزيرتي باستخدام أن دنو. إذ هنا؟ الستار وتنصيب كان. أهّل ايطاليا، بريطانيا-فرنسا قد أخذ. سليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو.'})
1220612905 ,A::from2($obj->{'٠١٢٣٤٥٦٧٨٩'})
@@ -20973,29 +21672,506 @@ class B {
2097321672 * @throws Exception
2097421673 */
2097521674 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...for my greatest trick...')) {
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=" &#14; javascript:alert(\'XSS\');">')) {
21880+ throw new Exception("Missing required property");
21881+ }
21882+ if (!property_exists($obj, '<IMG SRC="jav&#x09;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=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>')) {
21889+ throw new Exception("Missing required property");
21890+ }
21891+ if (!property_exists($obj, '<IMG SRC=&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041>')) {
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'})
2099922175 ,B::fromAbcDivStyleXX0DexpressionJavascriptAlert1DEF($obj->{'ABC<div style="x:\\x0Dexpression(javascript:alert(1)">DEF'})
2100022176 ,B::fromAbcDivStyleXXE2X80X82ExpressionJavascriptAlert1DEF($obj->{'ABC<div style="x:\\xE2\\x80\\x82expression(javascript:alert(1)">DEF'})
2100122177 ,B::fromAbcDivStyleXXE2X80X83ExpressionJavascriptAlert1DEF($obj->{'ABC<div style="x:\\xE2\\x80\\x83expression(javascript:alert(1)">DEF'})
@@ -31475,6 +32651,591 @@ class C {
3147532651 * @throws Exception
3147632652 */
3147732653 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, '&lt;script&gt;alert(&#39;123&#39;);&lt;/script&gt;')) {
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 red, violets are blue. 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, 'test⁠test‫')) {
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+ }
3147833239 return new C(
3147933240 C::from1($obj->{'مُنَاقَشَةُ سُبُلِ اِسْتِخْدَامِ اللُّغَةِ فِي النُّظُمِ الْقَائِمَةِ وَفِيم يَخُصَّ التَّطْبِيقَاتُ الْحاسُوبِيَّةُ، '})
3148033241 ,C::from2($obj->{'١٢٣'})
Test case

test/inputs/json/priority/bug2037.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -99,6 +99,9 @@ class TopLevel {
9999 * @throws Exception
100100 */
101101 public static function from(stdClass $obj): TopLevel {
102+ if (!property_exists($obj, 'mission_specs')) {
103+ throw new Exception("Missing required property");
104+ }
102105 return new TopLevel(
103106 TopLevel::fromMissionSpecs($obj->{'mission_specs'})
104107 );
@@ -212,6 +215,9 @@ class MissionSpec {
212215 * @throws Exception
213216 */
214217 public static function from(stdClass $obj): MissionSpec {
218+ if (!property_exists($obj, 'objectives')) {
219+ throw new Exception("Missing required property");
220+ }
215221 return new MissionSpec(
216222 MissionSpec::fromObjectives($obj->{'objectives'})
217223 );
@@ -325,6 +331,9 @@ class Objective {
325331 * @throws Exception
326332 */
327333 public static function from(stdClass $obj): Objective {
334+ if (!property_exists($obj, 'rewards')) {
335+ throw new Exception("Missing required property");
336+ }
328337 return new Objective(
329338 Objective::fromRewards($obj->{'rewards'})
330339 );
Test case

test/inputs/json/priority/bug2521.json

1 generated file · +6 −0
Mphpdefault / TopLevel.php+6 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'options')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromOptions($obj->{'options'})
101104 );
@@ -256,6 +259,9 @@ class Option {
256259 * @throws Exception
257260 */
258261 public static function from(stdClass $obj): Option {
262+ if (!property_exists($obj, 'name')) {
263+ throw new Exception("Missing required property");
264+ }
259265 return new Option(
260266 Option::fromFoo($obj->{'foo'})
261267 ,Option::fromName($obj->{'name'})
Test case

test/inputs/json/priority/bug2590.json

1 generated file · +12 −0
Mphpdefault / TopLevel.php+12 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'invoices')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromInvoices($obj->{'invoices'})
101104 );
@@ -325,6 +328,15 @@ class Invoice {
325328 * @throws Exception
326329 */
327330 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+ }
328340 return new Invoice(
329341 Invoice::fromCreatedAt($obj->{'createdAt'})
330342 ,Invoice::fromDueDate($obj->{'dueDate'})
Test case

test/inputs/json/priority/bug2663.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -195,6 +195,15 @@ class TopLevel {
195195 * @throws Exception
196196 */
197197 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+ }
198207 return new TopLevel(
199208 TopLevel::fromBirthday($obj->{'birthday'})
200209 ,TopLevel::fromLastSeen($obj->{'lastSeen'})
Test case

test/inputs/json/priority/bug2793.json

1 generated file · +12 −0
Mphpdefault / TopLevel.php+12 −0
@@ -138,6 +138,12 @@ class TopLevel {
138138 * @throws Exception
139139 */
140140 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+ }
141147 return new TopLevel(
142148 TopLevel::fromHints($obj->{'Hints'})
143149 ,TopLevel::fromLabels($obj->{'Labels'})
@@ -335,6 +341,12 @@ class Labels {
335341 * @throws Exception
336342 */
337343 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+ }
338350 return new Labels(
339351 Labels::fromAccountNumber($obj->{'AccountNumber'})
340352 ,Labels::fromTitle($obj->{'Title'})
Test case

test/inputs/json/priority/bug427.json

1 generated file · +612 −0
Mphpdefault / TopLevel.php+612 −0
@@ -369,6 +369,24 @@ class TopLevel {
369369 * @throws Exception
370370 */
371371 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+ }
372390 return new TopLevel(
373391 TopLevel::fromChildren($obj->{'children'})
374392 ,TopLevel::fromFlags($obj->{'flags'})
@@ -994,6 +1012,33 @@ class TopLevelChild {
9941012 * @throws Exception
9951013 */
9961014 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+ }
9971042 return new TopLevelChild(
9981043 TopLevelChild::fromChildren($obj->{'children'})
9991044 ,TopLevelChild::fromComment($obj->{'comment'})
@@ -2164,6 +2209,24 @@ class PurpleChild {
21642209 * @throws Exception
21652210 */
21662211 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+ }
21672230 return new PurpleChild(
21682231 PurpleChild::fromChildren($obj->{'children'})
21692232 ,PurpleChild::fromComment($obj->{'comment'})
@@ -3293,6 +3356,24 @@ class FluffyChild {
32933356 * @throws Exception
32943357 */
32953358 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+ }
32963377 return new FluffyChild(
32973378 FluffyChild::fromChildren($obj->{'children'})
32983379 ,FluffyChild::fromComment($obj->{'comment'})
@@ -3959,6 +4040,24 @@ class TentacledChild {
39594040 * @throws Exception
39604041 */
39614042 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+ }
39624061 return new TentacledChild(
39634062 TentacledChild::fromComment($obj->{'comment'})
39644063 ,TentacledChild::fromDefaultValue($obj->{'defaultValue'})
@@ -4075,6 +4174,9 @@ class PurpleComment {
40754174 * @throws Exception
40764175 */
40774176 public static function from(stdClass $obj): PurpleComment {
4177+ if (!property_exists($obj, 'shortText')) {
4178+ throw new Exception("Missing required property");
4179+ }
40784180 return new PurpleComment(
40794181 PurpleComment::fromShortText($obj->{'shortText'})
40804182 );
@@ -4748,6 +4850,27 @@ class PurpleSignature {
47484850 * @throws Exception
47494851 */
47504852 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+ }
47514874 return new PurpleSignature(
47524875 PurpleSignature::fromComment($obj->{'comment'})
47534876 ,PurpleSignature::fromFlags($obj->{'flags'})
@@ -5144,6 +5267,9 @@ class GetSignatureType {
51445267 * @throws Exception
51455268 */
51465269 public static function from(stdClass $obj): GetSignatureType {
5270+ if (!property_exists($obj, 'type')) {
5271+ throw new Exception("Missing required property");
5272+ }
51475273 return new GetSignatureType(
51485274 GetSignatureType::fromDeclaration($obj->{'declaration'})
51495275 ,GetSignatureType::fromElementType($obj->{'elementType'})
@@ -5584,6 +5710,24 @@ class IndexSignatureElement {
55845710 * @throws Exception
55855711 */
55865712 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+ }
55875731 return new IndexSignatureElement(
55885732 IndexSignatureElement::fromFlags($obj->{'flags'})
55895733 ,IndexSignatureElement::fromID($obj->{'id'})
@@ -5821,6 +5965,9 @@ class PurpleType {
58215965 * @throws Exception
58225966 */
58235967 public static function from(stdClass $obj): PurpleType {
5968+ if (!property_exists($obj, 'type')) {
5969+ throw new Exception("Missing required property");
5970+ }
58245971 return new PurpleType(
58255972 PurpleType::fromDeclaration($obj->{'declaration'})
58265973 ,PurpleType::fromName($obj->{'name'})
@@ -6313,6 +6460,27 @@ class GetSignatureChild {
63136460 * @throws Exception
63146461 */
63156462 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+ }
63166484 return new GetSignatureChild(
63176485 GetSignatureChild::fromComment($obj->{'comment'})
63186486 ,GetSignatureChild::fromFlags($obj->{'flags'})
@@ -7266,6 +7434,21 @@ class GetSignature {
72667434 * @throws Exception
72677435 */
72687436 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+ }
72697452 return new GetSignature(
72707453 GetSignature::fromChildren($obj->{'children'})
72717454 ,GetSignature::fromComment($obj->{'comment'})
@@ -7444,6 +7627,12 @@ class ElementType {
74447627 * @throws Exception
74457628 */
74467629 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+ }
74477636 return new ElementType(
74487637 ElementType::fromName($obj->{'name'})
74497638 ,ElementType::fromType($obj->{'type'})
@@ -7694,6 +7883,9 @@ class FluffyComment {
76947883 * @throws Exception
76957884 */
76967885 public static function from(stdClass $obj): FluffyComment {
7886+ if (!property_exists($obj, 'text')) {
7887+ throw new Exception("Missing required property");
7888+ }
76977889 return new FluffyComment(
76987890 FluffyComment::fromText($obj->{'text'})
76997891 );
@@ -8005,6 +8197,15 @@ class Source {
80058197 * @throws Exception
80068198 */
80078199 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+ }
80088209 return new Source(
80098210 Source::fromCharacter($obj->{'character'})
80108211 ,Source::fromFileName($obj->{'fileName'})
@@ -8554,6 +8755,15 @@ class Group {
85548755 * @throws Exception
85558756 */
85568757 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+ }
85578767 return new Group(
85588768 Group::fromChildren($obj->{'children'})
85598769 ,Group::fromKind($obj->{'kind'})
@@ -8982,6 +9192,24 @@ class GetSignatureParameter {
89829192 * @throws Exception
89839193 */
89849194 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+ }
89859213 return new GetSignatureParameter(
89869214 GetSignatureParameter::fromComment($obj->{'comment'})
89879215 ,GetSignatureParameter::fromFlags($obj->{'flags'})
@@ -9682,6 +9910,9 @@ class FluffyType {
96829910 * @throws Exception
96839911 */
96849912 public static function from(stdClass $obj): FluffyType {
9913+ if (!property_exists($obj, 'type')) {
9914+ throw new Exception("Missing required property");
9915+ }
96859916 return new FluffyType(
96869917 FluffyType::fromElementType($obj->{'elementType'})
96879918 ,FluffyType::fromName($obj->{'name'})
@@ -9913,6 +10144,9 @@ class TentacledType {
991310144 * @throws Exception
991410145 */
991510146 public static function from(stdClass $obj): TentacledType {
10147+ if (!property_exists($obj, 'type')) {
10148+ throw new Exception("Missing required property");
10149+ }
991610150 return new TentacledType(
991710151 TentacledType::fromDeclaration($obj->{'declaration'})
991810152 ,TentacledType::fromName($obj->{'name'})
@@ -10352,6 +10586,27 @@ class PurpleDeclaration {
1035210586 * @throws Exception
1035310587 */
1035410588 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+ }
1035510610 return new PurpleDeclaration(
1035610611 PurpleDeclaration::fromChildren($obj->{'children'})
1035710612 ,PurpleDeclaration::fromFlags($obj->{'flags'})
@@ -10726,6 +10981,9 @@ class TypeElement {
1072610981 * @throws Exception
1072710982 */
1072810983 public static function from(stdClass $obj): TypeElement {
10984+ if (!property_exists($obj, 'type')) {
10985+ throw new Exception("Missing required property");
10986+ }
1072910987 return new TypeElement(
1073010988 TypeElement::fromDeclaration($obj->{'declaration'})
1073110989 ,TypeElement::fromElementType($obj->{'elementType'})
@@ -11196,6 +11454,12 @@ class Tag {
1119611454 * @throws Exception
1119711455 */
1119811456 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+ }
1119911463 return new Tag(
1120011464 Tag::fromTag($obj->{'tag'})
1120111465 ,Tag::fromText($obj->{'text'})
@@ -12040,6 +12304,12 @@ class ExtendedBy {
1204012304 * @throws Exception
1204112305 */
1204212306 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+ }
1204312313 return new ExtendedBy(
1204412314 ExtendedBy::fromConstraint($obj->{'constraint'})
1204512315 ,ExtendedBy::fromID($obj->{'id'})
@@ -12809,6 +13079,24 @@ class FluffySignature {
1280913079 * @throws Exception
1281013080 */
1281113081 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+ }
1281213100 return new FluffySignature(
1281313101 FluffySignature::fromComment($obj->{'comment'})
1281413102 ,FluffySignature::fromFlags($obj->{'flags'})
@@ -13427,6 +13715,24 @@ class PurpleParameter {
1342713715 * @throws Exception
1342813716 */
1342913717 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+ }
1343013736 return new PurpleParameter(
1343113737 PurpleParameter::fromComment($obj->{'comment'})
1343213738 ,PurpleParameter::fromFlags($obj->{'flags'})
@@ -13999,6 +14305,9 @@ class StickyType {
1399914305 * @throws Exception
1400014306 */
1400114307 public static function from(stdClass $obj): StickyType {
14308+ if (!property_exists($obj, 'type')) {
14309+ throw new Exception("Missing required property");
14310+ }
1400214311 return new StickyType(
1400314312 StickyType::fromConstraint($obj->{'constraint'})
1400414313 ,StickyType::fromDeclaration($obj->{'declaration'})
@@ -14647,6 +14956,9 @@ class IndigoType {
1464714956 * @throws Exception
1464814957 */
1464914958 public static function from(stdClass $obj): IndigoType {
14959+ if (!property_exists($obj, 'type')) {
14960+ throw new Exception("Missing required property");
14961+ }
1465014962 return new IndigoType(
1465114963 IndigoType::fromConstraint($obj->{'constraint'})
1465214964 ,IndigoType::fromDeclaration($obj->{'declaration'})
@@ -15319,6 +15631,24 @@ class FluffyDeclaration {
1531915631 * @throws Exception
1532015632 */
1532115633 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+ }
1532215652 return new FluffyDeclaration(
1532315653 FluffyDeclaration::fromChildren($obj->{'children'})
1532415654 ,FluffyDeclaration::fromFlags($obj->{'flags'})
@@ -15825,6 +16155,27 @@ class StickyChild {
1582516155 * @throws Exception
1582616156 */
1582716157 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+ }
1582816179 return new StickyChild(
1582916180 StickyChild::fromComment($obj->{'comment'})
1583016181 ,StickyChild::fromFlags($obj->{'flags'})
@@ -16138,6 +16489,9 @@ class IndecentType {
1613816489 * @throws Exception
1613916490 */
1614016491 public static function from(stdClass $obj): IndecentType {
16492+ if (!property_exists($obj, 'type')) {
16493+ throw new Exception("Missing required property");
16494+ }
1614116495 return new IndecentType(
1614216496 IndecentType::fromDeclaration($obj->{'declaration'})
1614316497 ,IndecentType::fromElements($obj->{'elements'})
@@ -16568,6 +16922,27 @@ class IndexSignature {
1656816922 * @throws Exception
1656916923 */
1657016924 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+ }
1657116946 return new IndexSignature(
1657216947 IndexSignature::fromFlags($obj->{'flags'})
1657316948 ,IndexSignature::fromID($obj->{'id'})
@@ -16732,6 +17107,12 @@ class HilariousType {
1673217107 * @throws Exception
1673317108 */
1673417109 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+ }
1673517116 return new HilariousType(
1673617117 HilariousType::fromDeclaration($obj->{'declaration'})
1673717118 ,HilariousType::fromType($obj->{'type'})
@@ -17232,6 +17613,24 @@ class TentacledSignature {
1723217613 * @throws Exception
1723317614 */
1723417615 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+ }
1723517634 return new TentacledSignature(
1723617635 TentacledSignature::fromComment($obj->{'comment'})
1723717636 ,TentacledSignature::fromFlags($obj->{'flags'})
@@ -17396,6 +17795,12 @@ class IndigoComment {
1739617795 * @throws Exception
1739717796 */
1739817797 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+ }
1739917804 return new IndigoComment(
1740017805 IndigoComment::fromReturns($obj->{'returns'})
1740117806 ,IndigoComment::fromShortText($obj->{'shortText'})
@@ -17895,6 +18300,24 @@ class FluffyParameter {
1789518300 * @throws Exception
1789618301 */
1789718302 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+ }
1789818321 return new FluffyParameter(
1789918322 FluffyParameter::fromComment($obj->{'comment'})
1790018323 ,FluffyParameter::fromFlags($obj->{'flags'})
@@ -18112,6 +18535,15 @@ class PurpleTypeArgument {
1811218535 * @throws Exception
1811318536 */
1811418537 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+ }
1811518547 return new PurpleTypeArgument(
1811618548 PurpleTypeArgument::fromOperator($obj->{'operator'})
1811718549 ,PurpleTypeArgument::fromTarget($obj->{'target'})
@@ -19243,6 +19675,27 @@ class StickySignature {
1924319675 * @throws Exception
1924419676 */
1924519677 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+ }
1924619699 return new StickySignature(
1924719700 StickySignature::fromComment($obj->{'comment'})
1924819701 ,StickySignature::fromFlags($obj->{'flags'})
@@ -19807,6 +20260,24 @@ class TentacledParameter {
1980720260 * @throws Exception
1980820261 */
1980920262 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+ }
1981020281 return new TentacledParameter(
1981120282 TentacledParameter::fromComment($obj->{'comment'})
1981220283 ,TentacledParameter::fromDefaultValue($obj->{'defaultValue'})
@@ -20246,6 +20717,9 @@ class AmbitiousType {
2024620717 * @throws Exception
2024720718 */
2024820719 public static function from(stdClass $obj): AmbitiousType {
20720+ if (!property_exists($obj, 'type')) {
20721+ throw new Exception("Missing required property");
20722+ }
2024920723 return new AmbitiousType(
2025020724 AmbitiousType::fromDeclaration($obj->{'declaration'})
2025120725 ,AmbitiousType::fromElementType($obj->{'elementType'})
@@ -20912,6 +21386,24 @@ class TentacledDeclaration {
2091221386 * @throws Exception
2091321387 */
2091421388 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+ }
2091521407 return new TentacledDeclaration(
2091621408 TentacledDeclaration::fromChildren($obj->{'children'})
2091721409 ,TentacledDeclaration::fromFlags($obj->{'flags'})
@@ -21470,6 +21962,30 @@ class IndigoChild {
2147021962 * @throws Exception
2147121963 */
2147221964 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+ }
2147321989 return new IndigoChild(
2147421990 IndigoChild::fromComment($obj->{'comment'})
2147521991 ,IndigoChild::fromDefaultValue($obj->{'defaultValue'})
@@ -21847,6 +22363,9 @@ class CunningType {
2184722363 * @throws Exception
2184822364 */
2184922365 public static function from(stdClass $obj): CunningType {
22366+ if (!property_exists($obj, 'type')) {
22367+ throw new Exception("Missing required property");
22368+ }
2185022369 return new CunningType(
2185122370 CunningType::fromDeclaration($obj->{'declaration'})
2185222371 ,CunningType::fromID($obj->{'id'})
@@ -22488,6 +23007,9 @@ class MagentaType {
2248823007 * @throws Exception
2248923008 */
2249023009 public static function from(stdClass $obj): MagentaType {
23010+ if (!property_exists($obj, 'type')) {
23011+ throw new Exception("Missing required property");
23012+ }
2249123013 return new MagentaType(
2249223014 MagentaType::fromDeclaration($obj->{'declaration'})
2249323015 ,MagentaType::fromElementType($obj->{'elementType'})
@@ -23087,6 +23609,27 @@ class StickyDeclaration {
2308723609 * @throws Exception
2308823610 */
2308923611 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+ }
2309023633 return new StickyDeclaration(
2309123634 StickyDeclaration::fromChildren($obj->{'children'})
2309223635 ,StickyDeclaration::fromFlags($obj->{'flags'})
@@ -23528,6 +24071,27 @@ class IndecentChild {
2352824071 * @throws Exception
2352924072 */
2353024073 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+ }
2353124095 return new IndecentChild(
2353224096 IndecentChild::fromFlags($obj->{'flags'})
2353324097 ,IndecentChild::fromID($obj->{'id'})
@@ -23765,6 +24329,9 @@ class FriskyType {
2376524329 * @throws Exception
2376624330 */
2376724331 public static function from(stdClass $obj): FriskyType {
24332+ if (!property_exists($obj, 'type')) {
24333+ throw new Exception("Missing required property");
24334+ }
2376824335 return new FriskyType(
2376924336 FriskyType::fromDeclaration($obj->{'declaration'})
2377024337 ,FriskyType::fromName($obj->{'name'})
@@ -24362,6 +24929,24 @@ class IndigoDeclaration {
2436224929 * @throws Exception
2436324930 */
2436424931 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+ }
2436524950 return new IndigoDeclaration(
2436624951 IndigoDeclaration::fromChildren($obj->{'children'})
2436724952 ,IndigoDeclaration::fromFlags($obj->{'flags'})
@@ -24541,6 +25126,12 @@ class FluffyTypeArgument {
2454125126 * @throws Exception
2454225127 */
2454325128 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+ }
2454425135 return new FluffyTypeArgument(
2454525136 FluffyTypeArgument::fromType($obj->{'type'})
2454625137 ,FluffyTypeArgument::fromTypes($obj->{'types'})
@@ -24976,6 +25567,21 @@ class TypeParameter {
2497625567 * @throws Exception
2497725568 */
2497825569 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+ }
2497925585 return new TypeParameter(
2498025586 TypeParameter::fromComment($obj->{'comment'})
2498125587 ,TypeParameter::fromFlags($obj->{'flags'})
@@ -25336,6 +25942,9 @@ class MischievousType {
2533625942 * @throws Exception
2533725943 */
2533825944 public static function from(stdClass $obj): MischievousType {
25945+ if (!property_exists($obj, 'type')) {
25946+ throw new Exception("Missing required property");
25947+ }
2533925948 return new MischievousType(
2534025949 MischievousType::fromID($obj->{'id'})
2534125950 ,MischievousType::fromName($obj->{'name'})
@@ -25516,6 +26125,9 @@ class IndecentComment {
2551626125 * @throws Exception
2551726126 */
2551826127 public static function from(stdClass $obj): IndecentComment {
26128+ if (!property_exists($obj, 'shortText')) {
26129+ throw new Exception("Missing required property");
26130+ }
2551926131 return new IndecentComment(
2552026132 IndecentComment::fromShortText($obj->{'shortText'})
2552126133 ,IndecentComment::fromTags($obj->{'tags'})
Test case

test/inputs/json/priority/bug790.json

1 generated file · +24 −0
Mphpdefault / TopLevel.php+24 −0
@@ -460,6 +460,30 @@ class TopLevel {
460460 * @throws Exception
461461 */
462462 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+ }
463487 return new TopLevel(
464488 TopLevel::fromChildrenData($obj->{'children_data'})
465489 ,TopLevel::fromID($obj->{'id'})
Test case

test/inputs/json/priority/bug855-short.json

1 generated file · +15 −0
Mphpdefault / TopLevel.php+15 −0
@@ -296,6 +296,21 @@ class TopLevelValue {
296296 * @throws Exception
297297 */
298298 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+ }
299314 return new TopLevelValue(
300315 TopLevelValue::fromChannelID($obj->{'channel_id'})
301316 ,TopLevelValue::fromChannelName($obj->{'channel_name'})
Test case

test/inputs/json/priority/coin-pairs.json

1 generated file · +30 −0
Mphpdefault / TopLevel.php+30 −0
@@ -151,6 +151,12 @@ class TopLevel {
151151 * @throws Exception
152152 */
153153 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+ }
154160 return new TopLevel(
155161 TopLevel::fromPairs($obj->{'pairs'})
156162 ,TopLevel::fromServerTime($obj->{'server_time'})
@@ -615,6 +621,30 @@ class Pair {
615621 * @throws Exception
616622 */
617623 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+ }
618648 return new Pair(
619649 Pair::fromDecimalPlaces($obj->{'decimal_places'})
620650 ,Pair::fromFee($obj->{'fee'})
Test case

test/inputs/json/priority/combinations1.json

1 generated file · +639 −0
Mphpdefault / TopLevel.php+639 −0
@@ -3957,6 +3957,135 @@ class TopLevel {
39573957 * @throws Exception
39583958 */
39593959 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+ }
39604089 return new TopLevel(
39614090 TopLevel::fromCentrodesmose($obj->{'centrodesmose'})
39624091 ,TopLevel::fromCerograph($obj->{'cerograph'})
@@ -5187,6 +5316,66 @@ class Cerograph {
51875316 * @throws Exception
51885317 */
51895318 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+ }
51905379 return new Cerograph(
51915380 Cerograph::fromApotropaion($obj->{'apotropaion'})
51925381 ,Cerograph::fromCasuary($obj->{'casuary'})
@@ -7031,6 +7220,21 @@ class Cimelia {
70317220 * @throws Exception
70327221 */
70337222 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+ }
70347238 return new Cimelia(
70357239 Cimelia::fromCatharticalness($obj->{'catharticalness'})
70367240 ,Cimelia::fromChirotherium($obj->{'Chirotherium'})
@@ -9682,6 +9886,66 @@ class Credulity {
96829886 * @throws Exception
96839887 */
96849888 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+ }
96859949 return new Credulity(
96869950 Credulity::fromAmmonolytic($obj->{'ammonolytic'})
96879951 ,Credulity::fromBushmaster($obj->{'bushmaster'})
@@ -10866,6 +11130,66 @@ class Deruralize {
1086611130 * @throws Exception
1086711131 */
1086811132 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+ }
1086911193 return new Deruralize(
1087011194 Deruralize::fromBockerel($obj->{'bockerel'})
1087111195 ,Deruralize::fromBoulder($obj->{'boulder'})
@@ -12050,6 +12374,66 @@ class Diaerese {
1205012374 * @throws Exception
1205112375 */
1205212376 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+ }
1205312437 return new Diaerese(
1205412438 Diaerese::fromAmoreuxia($obj->{'Amoreuxia'})
1205512439 ,Diaerese::fromAni($obj->{'ani'})
@@ -13234,6 +13618,66 @@ class Encrust {
1323413618 * @throws Exception
1323513619 */
1323613620 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+ }
1323713681 return new Encrust(
1323813682 Encrust::fromComradely($obj->{'comradely'})
1323913683 ,Encrust::fromDiacanthous($obj->{'diacanthous'})
@@ -14418,6 +14862,66 @@ class Faggingly {
1441814862 * @throws Exception
1441914863 */
1442014864 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+ }
1442114925 return new Faggingly(
1442214926 Faggingly::fromAbranchian($obj->{'abranchian'})
1442314927 ,Faggingly::fromAculeiform($obj->{'aculeiform'})
@@ -15602,6 +16106,66 @@ class Fenk {
1560216106 * @throws Exception
1560316107 */
1560416108 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+ }
1560516169 return new Fenk(
1560616170 Fenk::fromApoise($obj->{'apoise'})
1560716171 ,Fenk::fromAstronomize($obj->{'astronomize'})
@@ -16786,6 +17350,66 @@ class Flagmaking {
1678617350 * @throws Exception
1678717351 */
1678817352 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+ }
1678917413 return new Flagmaking(
1679017414 Flagmaking::fromAlbarco($obj->{'albarco'})
1679117415 ,Flagmaking::fromBunodonta($obj->{'Bunodonta'})
@@ -18630,6 +19254,21 @@ class Interacinar {
1863019254 * @throws Exception
1863119255 */
1863219256 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+ }
1863319272 return new Interacinar(
1863419273 Interacinar::fromAssapan($obj->{'assapan'})
1863519274 ,Interacinar::fromBenefactorship($obj->{'benefactorship'})
Test case

test/inputs/json/priority/combinations2.json

1 generated file · +510 −0
Mphpdefault / TopLevel.php+510 −0
@@ -4256,6 +4256,141 @@ class TopLevel {
42564256 * @throws Exception
42574257 */
42584258 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+ }
42594394 return new TopLevel(
42604395 TopLevel::fromAbranchiata($obj->{'Abranchiata'})
42614396 ,TopLevel::fromAcademe($obj->{'academe'})
@@ -5490,6 +5625,66 @@ class Alleviate {
54905625 * @throws Exception
54915626 */
54925627 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+ }
54935688 return new Alleviate(
54945689 Alleviate::fromApriori($obj->{'apriori'})
54955690 ,Alleviate::fromBeggarer($obj->{'beggarer'})
@@ -5837,6 +6032,21 @@ class Rebecca {
58376032 * @throws Exception
58386033 */
58396034 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+ }
58406050 return new Rebecca(
58416051 Rebecca::fromCatharticalness($obj->{'catharticalness'})
58426052 ,Rebecca::fromChirotherium($obj->{'Chirotherium'})
@@ -8628,6 +8838,66 @@ class Ankee {
86288838 * @throws Exception
86298839 */
86308840 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+ }
86318901 return new Ankee(
86328902 Ankee::fromAnomoean($obj->{'Anomoean'})
86338903 ,Ankee::fromBarleyhood($obj->{'barleyhood'})
@@ -9812,6 +10082,66 @@ class Ansarie {
981210082 * @throws Exception
981310083 */
981410084 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+ }
981510145 return new Ansarie(
981610146 Ansarie::fromAccension($obj->{'accension'})
981710147 ,Ansarie::fromAlida($obj->{'Alida'})
@@ -10996,6 +11326,66 @@ class Chytridiaceae {
1099611326 * @throws Exception
1099711327 */
1099811328 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+ }
1099911389 return new Chytridiaceae(
1100011390 Chytridiaceae::fromBatidaceae($obj->{'Batidaceae'})
1100111391 ,Chytridiaceae::fromBrechites($obj->{'Brechites'})
@@ -13817,6 +14207,66 @@ class Gryphosaurus {
1381714207 * @throws Exception
1381814208 */
1381914209 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+ }
1382014270 return new Gryphosaurus(
1382114271 Gryphosaurus::fromAmissibility($obj->{'amissibility'})
1382214272 ,Gryphosaurus::fromBurushaski($obj->{'Burushaski'})
@@ -16638,6 +17088,66 @@ class Oskar {
1663817088 * @throws Exception
1663917089 */
1664017090 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+ }
1664117151 return new Oskar(
1664217152 Oskar::fromAcrobates($obj->{'Acrobates'})
1664317153 ,Oskar::fromBeanshooter($obj->{'beanshooter'})
Test case

test/inputs/json/priority/combinations3.json

1 generated file · +576 −0
Mphpdefault / TopLevel.php+576 −0
@@ -3969,6 +3969,132 @@ class TopLevel {
39693969 * @throws Exception
39703970 */
39713971 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+ }
39724098 return new TopLevel(
39734099 TopLevel::fromJuror($obj->{'juror'})
39744100 ,TopLevel::fromKongoni($obj->{'kongoni'})
@@ -5197,6 +5323,66 @@ class Juror {
51975323 * @throws Exception
51985324 */
51995325 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+ }
52005386 return new Juror(
52015387 Juror::fromAdipsy($obj->{'adipsy'})
52025388 ,Juror::fromAuxiliator($obj->{'auxiliator'})
@@ -6381,6 +6567,66 @@ class Ladronism {
63816567 * @throws Exception
63826568 */
63836569 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+ }
63846630 return new Ladronism(
63856631 Ladronism::fromAcclaimer($obj->{'acclaimer'})
63866632 ,Ladronism::fromAchree($obj->{'achree'})
@@ -7565,6 +7811,66 @@ class Landlubberly {
75657811 * @throws Exception
75667812 */
75677813 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+ }
75687874 return new Landlubberly(
75697875 Landlubberly::fromAcropoleis($obj->{'acropoleis'})
75707876 ,Landlubberly::fromAminate($obj->{'aminate'})
@@ -12326,6 +12632,21 @@ class Monazite {
1232612632 * @throws Exception
1232712633 */
1232812634 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+ }
1232912650 return new Monazite(
1233012651 Monazite::fromCatharticalness($obj->{'catharticalness'})
1233112652 ,Monazite::fromChirotherium($obj->{'Chirotherium'})
@@ -14140,6 +14461,21 @@ class Noncontributing {
1414014461 * @throws Exception
1414114462 */
1414214463 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+ }
1414314479 return new Noncontributing(
1414414480 Noncontributing::fromEstevin($obj->{'estevin'})
1414514481 ,Noncontributing::fromJolterhead($obj->{'jolterhead'})
@@ -15294,6 +15630,66 @@ class Occupationalist {
1529415630 * @throws Exception
1529515631 */
1529615632 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+ }
1529715693 return new Occupationalist(
1529815694 Occupationalist::fromBeholdable($obj->{'beholdable'})
1529915695 ,Occupationalist::fromBrotuliform($obj->{'brotuliform'})
@@ -16478,6 +16874,66 @@ class Outrival {
1647816874 * @throws Exception
1647916875 */
1648016876 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+ }
1648116937 return new Outrival(
1648216938 Outrival::fromAdroitly($obj->{'adroitly'})
1648316939 ,Outrival::fromBridehood($obj->{'bridehood'})
@@ -20796,6 +21252,66 @@ class Potwhisky {
2079621252 * @throws Exception
2079721253 */
2079821254 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+ }
2079921315 return new Potwhisky(
2080021316 Potwhisky::fromArciform($obj->{'arciform'})
2080121317 ,Potwhisky::fromCresolin($obj->{'cresolin'})
@@ -21980,6 +22496,66 @@ class Prefreshman {
2198022496 * @throws Exception
2198122497 */
2198222498 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+ }
2198322559 return new Prefreshman(
2198422560 Prefreshman::fromAzorubine($obj->{'azorubine'})
2198522561 ,Prefreshman::fromChoroiditis($obj->{'choroiditis'})
Test case

test/inputs/json/priority/combinations4.json

1 generated file · +711 −0
Mphpdefault / TopLevel.php+711 −0
@@ -4884,6 +4884,162 @@ class TopLevel {
48844884 * @throws Exception
48854885 */
48864886 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+ }
48875043 return new TopLevel(
48885044 TopLevel::fromProtrusive($obj->{'protrusive'})
48895045 ,TopLevel::fromPulpitism($obj->{'pulpitism'})
@@ -6132,6 +6288,66 @@ class Pulpitism {
61326288 * @throws Exception
61336289 */
61346290 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+ }
61356351 return new Pulpitism(
61366352 Pulpitism::fromAbnet($obj->{'abnet'})
61376353 ,Pulpitism::fromBuckhorn($obj->{'buckhorn'})
@@ -7316,6 +7532,66 @@ class Pyodermia {
73167532 * @throws Exception
73177533 */
73187534 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+ }
73197595 return new Pyodermia(
73207596 Pyodermia::fromAphoristically($obj->{'aphoristically'})
73217597 ,Pyodermia::fromApophyllous($obj->{'apophyllous'})
@@ -7663,6 +7939,21 @@ class Quebrachine {
76637939 * @throws Exception
76647940 */
76657941 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+ }
76667957 return new Quebrachine(
76677958 Quebrachine::fromCatharticalness($obj->{'catharticalness'})
76687959 ,Quebrachine::fromChirotherium($obj->{'Chirotherium'})
@@ -10254,6 +10545,66 @@ class Ressaut {
1025410545 * @throws Exception
1025510546 */
1025610547 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+ }
1025710608 return new Ressaut(
1025810609 Ressaut::fromApperceptive($obj->{'apperceptive'})
1025910610 ,Ressaut::fromCuttoo($obj->{'cuttoo'})
@@ -11438,6 +11789,66 @@ class Rewrite {
1143811789 * @throws Exception
1143911790 */
1144011791 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+ }
1144111852 return new Rewrite(
1144211853 Rewrite::fromAccountancy($obj->{'accountancy'})
1144311854 ,Rewrite::fromCacotrophic($obj->{'cacotrophic'})
@@ -12622,6 +13033,66 @@ class Santir {
1262213033 * @throws Exception
1262313034 */
1262413035 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+ }
1262513096 return new Santir(
1262613097 Santir::fromAdmiredly($obj->{'admiredly'})
1262713098 ,Santir::fromDemicaponier($obj->{'demicaponier'})
@@ -15303,6 +15774,66 @@ class Scatty {
1530315774 * @throws Exception
1530415775 */
1530515776 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+ }
1530615837 return new Scatty(
1530715838 Scatty::fromAeriferous($obj->{'aeriferous'})
1530815839 ,Scatty::fromAntical($obj->{'antical'})
@@ -16487,6 +17018,66 @@ class Sistering {
1648717018 * @throws Exception
1648817019 */
1648917020 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+ }
1649017081 return new Sistering(
1649117082 Sistering::fromAmphicarpic($obj->{'amphicarpic'})
1649217083 ,Sistering::fromChianti($obj->{'Chianti'})
@@ -24079,6 +24670,66 @@ class Unstressed {
2407924670 * @throws Exception
2408024671 */
2408124672 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+ }
2408224733 return new Unstressed(
2408324734 Unstressed::fromAlain($obj->{'Alain'})
2408424735 ,Unstressed::fromAmphirhina($obj->{'Amphirhina'})
@@ -25263,6 +25914,66 @@ class Wrothy {
2526325914 * @throws Exception
2526425915 */
2526525916 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+ }
2526625977 return new Wrothy(
2526725978 Wrothy::fromAeschynanthus($obj->{'Aeschynanthus'})
2526825979 ,Wrothy::fromAquiferous($obj->{'aquiferous'})
Test case

test/inputs/json/priority/combined-enum.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -160,6 +160,12 @@ class TopLevel {
160160 * @throws Exception
161161 */
162162 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+ }
163169 return new TopLevel(
164170 TopLevel::fromBar($obj->{'bar'})
165171 ,TopLevel::fromFoo($obj->{'foo'})
@@ -261,6 +267,9 @@ class Bar {
261267 * @throws Exception
262268 */
263269 public static function from(stdClass $obj): Bar {
270+ if (!property_exists($obj, 'x')) {
271+ throw new Exception("Missing required property");
272+ }
264273 return new Bar(
265274 Bar::fromX($obj->{'x'})
266275 );
Test case

test/inputs/json/priority/direct-recursive.json

1 generated file · +12 −0
Mphpdefault / TopLevel.php+12 −0
@@ -303,6 +303,18 @@ class TopLevel {
303303 * @throws Exception
304304 */
305305 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+ }
306318 return new TopLevel(
307319 TopLevel::fromAlso($obj->{'also'})
308320 ,TopLevel::fromBar($obj->{'bar'})
Test case

test/inputs/json/priority/empty-enum.json

1 generated file · +3 −0
Mphpdefault / TopLevel.php+3 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'foo')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromFoo($obj->{'foo'})
101104 );
Test case

test/inputs/json/priority/identifiers.json

1 generated file · +42 −0
Mphpdefault / TopLevel.php+42 −0
@@ -349,6 +349,24 @@ class TopLevel {
349349 * @throws Exception
350350 */
351351 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+ }
352370 return new TopLevel(
353371 TopLevel::fromBla($obj->{'bla'})
354372 ,TopLevel::fromEmpty($obj->{''})
@@ -457,6 +475,9 @@ class TopLevelBla {
457475 * @throws Exception
458476 */
459477 public static function from(stdClass $obj): TopLevelBla {
478+ if (!property_exists($obj, 'bar')) {
479+ throw new Exception("Missing required property");
480+ }
460481 return new TopLevelBla(
461482 TopLevelBla::fromBar($obj->{'bar'})
462483 );
@@ -555,6 +576,9 @@ class TopLevelClass {
555576 * @throws Exception
556577 */
557578 public static function from(stdClass $obj): TopLevelClass {
579+ if (!property_exists($obj, 'x')) {
580+ throw new Exception("Missing required property");
581+ }
558582 return new TopLevelClass(
559583 TopLevelClass::fromX($obj->{'x'})
560584 );
@@ -758,6 +782,15 @@ class Foo {
758782 * @throws Exception
759783 */
760784 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+ }
761794 return new Foo(
762795 Foo::fromBla($obj->{'bla'})
763796 ,Foo::fromEmpty($obj->{'_'})
@@ -957,6 +990,12 @@ class ThisIsAToughOne {
957990 * @throws Exception
958991 */
959992 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+ }
960999 return new ThisIsAToughOne(
9611000 ThisIsAToughOne::fromEmpty($obj->{'' . "\n" . '' . "\n" . '' . "\n" . ''})
9621001 ,ThisIsAToughOne::fromThisIsAToughOne($obj->{'"'})
@@ -1057,6 +1096,9 @@ class EmptyClass {
10571096 * @throws Exception
10581097 */
10591098 public static function from(stdClass $obj): EmptyClass {
1099+ if (!property_exists($obj, 'y')) {
1100+ throw new Exception("Missing required property");
1101+ }
10601102 return new EmptyClass(
10611103 EmptyClass::fromY($obj->{'y'})
10621104 );
Test case

test/inputs/json/priority/issue2680-object-array.json

1 generated file · +3 −0
Mphpdefault / TopLevel.php+3 −0
@@ -84,6 +84,9 @@ class TopLevel {
8484 * @throws Exception
8585 */
8686 public static function from(stdClass $obj): TopLevel {
87+ if (!property_exists($obj, 'key')) {
88+ throw new Exception("Missing required property");
89+ }
8790 return new TopLevel(
8891 TopLevel::fromKey($obj->{'key'})
8992 );
Test case

test/inputs/json/priority/keywords.json

1 generated file · +1,707 −0
Mphpdefault / TopLevel.php+1,707 −0
@@ -349,6 +349,24 @@ class TopLevel {
349349 * @throws Exception
350350 */
351351 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+ }
352370 return new TopLevel(
353371 TopLevel::fromDummy($obj->{'dummy'})
354372 ,TopLevel::fromObj1($obj->{'obj1'})
@@ -3902,6 +3920,204 @@ class Obj1 {
39023920 * @throws Exception
39033921 */
39043922 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+ }
39054121 return new Obj1(
39064122 Obj1::fromAbstract($obj->{'abstract'})
39074123 ,Obj1::fromAlignas($obj->{'alignas'})
@@ -4130,6 +4346,9 @@ class AbstractClass {
41304346 * @throws Exception
41314347 */
41324348 public static function from(stdClass $obj): AbstractClass {
4349+ if (!property_exists($obj, 'abstract')) {
4350+ throw new Exception("Missing required property");
4351+ }
41334352 return new AbstractClass(
41344353 AbstractClass::fromAbstract($obj->{'abstract'})
41354354 );
@@ -4228,6 +4447,9 @@ class Alignas {
42284447 * @throws Exception
42294448 */
42304449 public static function from(stdClass $obj): Alignas {
4450+ if (!property_exists($obj, 'alignas')) {
4451+ throw new Exception("Missing required property");
4452+ }
42314453 return new Alignas(
42324454 Alignas::fromAlignas($obj->{'alignas'})
42334455 );
@@ -4326,6 +4548,9 @@ class Alignof {
43264548 * @throws Exception
43274549 */
43284550 public static function from(stdClass $obj): Alignof {
4551+ if (!property_exists($obj, 'alignof')) {
4552+ throw new Exception("Missing required property");
4553+ }
43294554 return new Alignof(
43304555 Alignof::fromAlignof($obj->{'alignof'})
43314556 );
@@ -4424,6 +4649,9 @@ class AndClass {
44244649 * @throws Exception
44254650 */
44264651 public static function from(stdClass $obj): AndClass {
4652+ if (!property_exists($obj, 'and')) {
4653+ throw new Exception("Missing required property");
4654+ }
44274655 return new AndClass(
44284656 AndClass::fromAnd($obj->{'and'})
44294657 );
@@ -4522,6 +4750,9 @@ class AndEq {
45224750 * @throws Exception
45234751 */
45244752 public static function from(stdClass $obj): AndEq {
4753+ if (!property_exists($obj, 'and_eq')) {
4754+ throw new Exception("Missing required property");
4755+ }
45254756 return new AndEq(
45264757 AndEq::fromAndEq($obj->{'and_eq'})
45274758 );
@@ -4620,6 +4851,9 @@ class Any {
46204851 * @throws Exception
46214852 */
46224853 public static function from(stdClass $obj): Any {
4854+ if (!property_exists($obj, 'Any')) {
4855+ throw new Exception("Missing required property");
4856+ }
46234857 return new Any(
46244858 Any::fromAny($obj->{'Any'})
46254859 );
@@ -4718,6 +4952,9 @@ class ArrayClass {
47184952 * @throws Exception
47194953 */
47204954 public static function from(stdClass $obj): ArrayClass {
4955+ if (!property_exists($obj, 'array')) {
4956+ throw new Exception("Missing required property");
4957+ }
47214958 return new ArrayClass(
47224959 ArrayClass::fromArray($obj->{'array'})
47234960 );
@@ -4816,6 +5053,9 @@ class AsClass {
48165053 * @throws Exception
48175054 */
48185055 public static function from(stdClass $obj): AsClass {
5056+ if (!property_exists($obj, 'as')) {
5057+ throw new Exception("Missing required property");
5058+ }
48195059 return new AsClass(
48205060 AsClass::fromAs($obj->{'as'})
48215061 );
@@ -4914,6 +5154,9 @@ class ASM {
49145154 * @throws Exception
49155155 */
49165156 public static function from(stdClass $obj): ASM {
5157+ if (!property_exists($obj, 'asm')) {
5158+ throw new Exception("Missing required property");
5159+ }
49175160 return new ASM(
49185161 ASM::fromASM($obj->{'asm'})
49195162 );
@@ -5012,6 +5255,9 @@ class Assert {
50125255 * @throws Exception
50135256 */
50145257 public static function from(stdClass $obj): Assert {
5258+ if (!property_exists($obj, 'assert')) {
5259+ throw new Exception("Missing required property");
5260+ }
50155261 return new Assert(
50165262 Assert::fromAssert($obj->{'assert'})
50175263 );
@@ -5110,6 +5356,9 @@ class Associatedtype {
51105356 * @throws Exception
51115357 */
51125358 public static function from(stdClass $obj): Associatedtype {
5359+ if (!property_exists($obj, 'associatedtype')) {
5360+ throw new Exception("Missing required property");
5361+ }
51135362 return new Associatedtype(
51145363 Associatedtype::fromAssociatedtype($obj->{'associatedtype'})
51155364 );
@@ -5208,6 +5457,9 @@ class Associativity {
52085457 * @throws Exception
52095458 */
52105459 public static function from(stdClass $obj): Associativity {
5460+ if (!property_exists($obj, 'associativity')) {
5461+ throw new Exception("Missing required property");
5462+ }
52115463 return new Associativity(
52125464 Associativity::fromAssociativity($obj->{'associativity'})
52135465 );
@@ -5306,6 +5558,9 @@ class Async {
53065558 * @throws Exception
53075559 */
53085560 public static function from(stdClass $obj): Async {
5561+ if (!property_exists($obj, 'async')) {
5562+ throw new Exception("Missing required property");
5563+ }
53095564 return new Async(
53105565 Async::fromAsync($obj->{'async'})
53115566 );
@@ -5404,6 +5659,9 @@ class Atomic {
54045659 * @throws Exception
54055660 */
54065661 public static function from(stdClass $obj): Atomic {
5662+ if (!property_exists($obj, 'atomic')) {
5663+ throw new Exception("Missing required property");
5664+ }
54075665 return new Atomic(
54085666 Atomic::fromAtomic($obj->{'atomic'})
54095667 );
@@ -5502,6 +5760,9 @@ class AtomicCancel {
55025760 * @throws Exception
55035761 */
55045762 public static function from(stdClass $obj): AtomicCancel {
5763+ if (!property_exists($obj, 'atomic_cancel')) {
5764+ throw new Exception("Missing required property");
5765+ }
55055766 return new AtomicCancel(
55065767 AtomicCancel::fromAtomicCancel($obj->{'atomic_cancel'})
55075768 );
@@ -5600,6 +5861,9 @@ class AtomicCommit {
56005861 * @throws Exception
56015862 */
56025863 public static function from(stdClass $obj): AtomicCommit {
5864+ if (!property_exists($obj, 'atomic_commit')) {
5865+ throw new Exception("Missing required property");
5866+ }
56035867 return new AtomicCommit(
56045868 AtomicCommit::fromAtomicCommit($obj->{'atomic_commit'})
56055869 );
@@ -5698,6 +5962,9 @@ class AtomicNoexcept {
56985962 * @throws Exception
56995963 */
57005964 public static function from(stdClass $obj): AtomicNoexcept {
5965+ if (!property_exists($obj, 'atomic_noexcept')) {
5966+ throw new Exception("Missing required property");
5967+ }
57015968 return new AtomicNoexcept(
57025969 AtomicNoexcept::fromAtomicNoexcept($obj->{'atomic_noexcept'})
57035970 );
@@ -5796,6 +6063,9 @@ class Auto {
57966063 * @throws Exception
57976064 */
57986065 public static function from(stdClass $obj): Auto {
6066+ if (!property_exists($obj, 'auto')) {
6067+ throw new Exception("Missing required property");
6068+ }
57996069 return new Auto(
58006070 Auto::fromAuto($obj->{'auto'})
58016071 );
@@ -5894,6 +6164,9 @@ class Await {
58946164 * @throws Exception
58956165 */
58966166 public static function from(stdClass $obj): Await {
6167+ if (!property_exists($obj, 'await')) {
6168+ throw new Exception("Missing required property");
6169+ }
58976170 return new Await(
58986171 Await::fromAwait($obj->{'await'})
58996172 );
@@ -5992,6 +6265,9 @@ class Base {
59926265 * @throws Exception
59936266 */
59946267 public static function from(stdClass $obj): Base {
6268+ if (!property_exists($obj, 'base')) {
6269+ throw new Exception("Missing required property");
6270+ }
59956271 return new Base(
59966272 Base::fromBase($obj->{'base'})
59976273 );
@@ -6090,6 +6366,9 @@ class Bitand {
60906366 * @throws Exception
60916367 */
60926368 public static function from(stdClass $obj): Bitand {
6369+ if (!property_exists($obj, 'bitand')) {
6370+ throw new Exception("Missing required property");
6371+ }
60936372 return new Bitand(
60946373 Bitand::fromBitand($obj->{'bitand'})
60956374 );
@@ -6188,6 +6467,9 @@ class Bitor {
61886467 * @throws Exception
61896468 */
61906469 public static function from(stdClass $obj): Bitor {
6470+ if (!property_exists($obj, 'bitor')) {
6471+ throw new Exception("Missing required property");
6472+ }
61916473 return new Bitor(
61926474 Bitor::fromBitor($obj->{'bitor'})
61936475 );
@@ -6286,6 +6568,9 @@ class BOOLClass {
62866568 * @throws Exception
62876569 */
62886570 public static function from(stdClass $obj): BOOLClass {
6571+ if (!property_exists($obj, 'BOOL')) {
6572+ throw new Exception("Missing required property");
6573+ }
62896574 return new BOOLClass(
62906575 BOOLClass::fromBool($obj->{'BOOL'})
62916576 );
@@ -6384,6 +6669,9 @@ class Boolean {
63846669 * @throws Exception
63856670 */
63866671 public static function from(stdClass $obj): Boolean {
6672+ if (!property_exists($obj, 'boolean')) {
6673+ throw new Exception("Missing required property");
6674+ }
63876675 return new Boolean(
63886676 Boolean::fromBoolean($obj->{'boolean'})
63896677 );
@@ -6482,6 +6770,9 @@ class BreakClass {
64826770 * @throws Exception
64836771 */
64846772 public static function from(stdClass $obj): BreakClass {
6773+ if (!property_exists($obj, 'break')) {
6774+ throw new Exception("Missing required property");
6775+ }
64856776 return new BreakClass(
64866777 BreakClass::fromBreak($obj->{'break'})
64876778 );
@@ -6580,6 +6871,9 @@ class Bycopy {
65806871 * @throws Exception
65816872 */
65826873 public static function from(stdClass $obj): Bycopy {
6874+ if (!property_exists($obj, 'bycopy')) {
6875+ throw new Exception("Missing required property");
6876+ }
65836877 return new Bycopy(
65846878 Bycopy::fromBycopy($obj->{'bycopy'})
65856879 );
@@ -6678,6 +6972,9 @@ class Byref {
66786972 * @throws Exception
66796973 */
66806974 public static function from(stdClass $obj): Byref {
6975+ if (!property_exists($obj, 'byref')) {
6976+ throw new Exception("Missing required property");
6977+ }
66816978 return new Byref(
66826979 Byref::fromByref($obj->{'byref'})
66836980 );
@@ -6776,6 +7073,9 @@ class Byte {
67767073 * @throws Exception
67777074 */
67787075 public static function from(stdClass $obj): Byte {
7076+ if (!property_exists($obj, 'byte')) {
7077+ throw new Exception("Missing required property");
7078+ }
67797079 return new Byte(
67807080 Byte::fromByte($obj->{'byte'})
67817081 );
@@ -6874,6 +7174,9 @@ class CaseClass {
68747174 * @throws Exception
68757175 */
68767176 public static function from(stdClass $obj): CaseClass {
7177+ if (!property_exists($obj, 'case')) {
7178+ throw new Exception("Missing required property");
7179+ }
68777180 return new CaseClass(
68787181 CaseClass::fromCase($obj->{'case'})
68797182 );
@@ -6972,6 +7275,9 @@ class CatchClass {
69727275 * @throws Exception
69737276 */
69747277 public static function from(stdClass $obj): CatchClass {
7278+ if (!property_exists($obj, 'catch')) {
7279+ throw new Exception("Missing required property");
7280+ }
69757281 return new CatchClass(
69767282 CatchClass::fromCatch($obj->{'catch'})
69777283 );
@@ -7070,6 +7376,9 @@ class Chan {
70707376 * @throws Exception
70717377 */
70727378 public static function from(stdClass $obj): Chan {
7379+ if (!property_exists($obj, 'chan')) {
7380+ throw new Exception("Missing required property");
7381+ }
70737382 return new Chan(
70747383 Chan::fromChan($obj->{'chan'})
70757384 );
@@ -7168,6 +7477,9 @@ class Char {
71687477 * @throws Exception
71697478 */
71707479 public static function from(stdClass $obj): Char {
7480+ if (!property_exists($obj, 'char')) {
7481+ throw new Exception("Missing required property");
7482+ }
71717483 return new Char(
71727484 Char::fromChar($obj->{'char'})
71737485 );
@@ -7266,6 +7578,9 @@ class Char16T {
72667578 * @throws Exception
72677579 */
72687580 public static function from(stdClass $obj): Char16T {
7581+ if (!property_exists($obj, 'char16_t')) {
7582+ throw new Exception("Missing required property");
7583+ }
72697584 return new Char16T(
72707585 Char16T::fromChar16T($obj->{'char16_t'})
72717586 );
@@ -7364,6 +7679,9 @@ class Char32T {
73647679 * @throws Exception
73657680 */
73667681 public static function from(stdClass $obj): Char32T {
7682+ if (!property_exists($obj, 'char32_t')) {
7683+ throw new Exception("Missing required property");
7684+ }
73677685 return new Char32T(
73687686 Char32T::fromChar32T($obj->{'char32_t'})
73697687 );
@@ -7462,6 +7780,9 @@ class Checked {
74627780 * @throws Exception
74637781 */
74647782 public static function from(stdClass $obj): Checked {
7783+ if (!property_exists($obj, 'checked')) {
7784+ throw new Exception("Missing required property");
7785+ }
74657786 return new Checked(
74667787 Checked::fromChecked($obj->{'checked'})
74677788 );
@@ -7560,6 +7881,9 @@ class ClassClass {
75607881 * @throws Exception
75617882 */
75627883 public static function from(stdClass $obj): ClassClass {
7884+ if (!property_exists($obj, 'Class')) {
7885+ throw new Exception("Missing required property");
7886+ }
75637887 return new ClassClass(
75647888 ClassClass::fromClass($obj->{'Class'})
75657889 );
@@ -7658,6 +7982,9 @@ class CloneClass {
76587982 * @throws Exception
76597983 */
76607984 public static function from(stdClass $obj): CloneClass {
7985+ if (!property_exists($obj, 'clone')) {
7986+ throw new Exception("Missing required property");
7987+ }
76617988 return new CloneClass(
76627989 CloneClass::fromClone($obj->{'clone'})
76637990 );
@@ -7756,6 +8083,9 @@ class CoAwait {
77568083 * @throws Exception
77578084 */
77588085 public static function from(stdClass $obj): CoAwait {
8086+ if (!property_exists($obj, 'co_await')) {
8087+ throw new Exception("Missing required property");
8088+ }
77598089 return new CoAwait(
77608090 CoAwait::fromCoAwait($obj->{'co_await'})
77618091 );
@@ -7854,6 +8184,9 @@ class CoReturn {
78548184 * @throws Exception
78558185 */
78568186 public static function from(stdClass $obj): CoReturn {
8187+ if (!property_exists($obj, 'co_return')) {
8188+ throw new Exception("Missing required property");
8189+ }
78578190 return new CoReturn(
78588191 CoReturn::fromCoReturn($obj->{'co_return'})
78598192 );
@@ -7952,6 +8285,9 @@ class CoYield {
79528285 * @throws Exception
79538286 */
79548287 public static function from(stdClass $obj): CoYield {
8288+ if (!property_exists($obj, 'co_yield')) {
8289+ throw new Exception("Missing required property");
8290+ }
79558291 return new CoYield(
79568292 CoYield::fromCoYield($obj->{'co_yield'})
79578293 );
@@ -8050,6 +8386,9 @@ class Compl {
80508386 * @throws Exception
80518387 */
80528388 public static function from(stdClass $obj): Compl {
8389+ if (!property_exists($obj, 'compl')) {
8390+ throw new Exception("Missing required property");
8391+ }
80538392 return new Compl(
80548393 Compl::fromCompl($obj->{'compl'})
80558394 );
@@ -8148,6 +8487,9 @@ class Complex {
81488487 * @throws Exception
81498488 */
81508489 public static function from(stdClass $obj): Complex {
8490+ if (!property_exists($obj, '_Complex')) {
8491+ throw new Exception("Missing required property");
8492+ }
81518493 return new Complex(
81528494 Complex::fromComplex($obj->{'_Complex'})
81538495 );
@@ -8246,6 +8588,9 @@ class Concept {
82468588 * @throws Exception
82478589 */
82488590 public static function from(stdClass $obj): Concept {
8591+ if (!property_exists($obj, 'concept')) {
8592+ throw new Exception("Missing required property");
8593+ }
82498594 return new Concept(
82508595 Concept::fromConcept($obj->{'concept'})
82518596 );
@@ -8344,6 +8689,9 @@ class Console {
83448689 * @throws Exception
83458690 */
83468691 public static function from(stdClass $obj): Console {
8692+ if (!property_exists($obj, 'console')) {
8693+ throw new Exception("Missing required property");
8694+ }
83478695 return new Console(
83488696 Console::fromConsole($obj->{'console'})
83498697 );
@@ -8442,6 +8790,9 @@ class ConstClass {
84428790 * @throws Exception
84438791 */
84448792 public static function from(stdClass $obj): ConstClass {
8793+ if (!property_exists($obj, 'const')) {
8794+ throw new Exception("Missing required property");
8795+ }
84458796 return new ConstClass(
84468797 ConstClass::fromConst($obj->{'const'})
84478798 );
@@ -8540,6 +8891,9 @@ class ConstCast {
85408891 * @throws Exception
85418892 */
85428893 public static function from(stdClass $obj): ConstCast {
8894+ if (!property_exists($obj, 'const_cast')) {
8895+ throw new Exception("Missing required property");
8896+ }
85438897 return new ConstCast(
85448898 ConstCast::fromConstCast($obj->{'const_cast'})
85458899 );
@@ -8638,6 +8992,9 @@ class Constexpr {
86388992 * @throws Exception
86398993 */
86408994 public static function from(stdClass $obj): Constexpr {
8995+ if (!property_exists($obj, 'constexpr')) {
8996+ throw new Exception("Missing required property");
8997+ }
86418998 return new Constexpr(
86428999 Constexpr::fromConstexpr($obj->{'constexpr'})
86439000 );
@@ -8736,6 +9093,9 @@ class Constructor {
87369093 * @throws Exception
87379094 */
87389095 public static function from(stdClass $obj): Constructor {
9096+ if (!property_exists($obj, 'constructor')) {
9097+ throw new Exception("Missing required property");
9098+ }
87399099 return new Constructor(
87409100 Constructor::fromConstructor($obj->{'constructor'})
87419101 );
@@ -8834,6 +9194,9 @@ class ContinueClass {
88349194 * @throws Exception
88359195 */
88369196 public static function from(stdClass $obj): ContinueClass {
9197+ if (!property_exists($obj, 'continue')) {
9198+ throw new Exception("Missing required property");
9199+ }
88379200 return new ContinueClass(
88389201 ContinueClass::fromContinue($obj->{'continue'})
88399202 );
@@ -8932,6 +9295,9 @@ class Convenience {
89329295 * @throws Exception
89339296 */
89349297 public static function from(stdClass $obj): Convenience {
9298+ if (!property_exists($obj, 'convenience')) {
9299+ throw new Exception("Missing required property");
9300+ }
89359301 return new Convenience(
89369302 Convenience::fromConvenience($obj->{'convenience'})
89379303 );
@@ -9030,6 +9396,9 @@ class Convert {
90309396 * @throws Exception
90319397 */
90329398 public static function from(stdClass $obj): Convert {
9399+ if (!property_exists($obj, 'convert')) {
9400+ throw new Exception("Missing required property");
9401+ }
90339402 return new Convert(
90349403 Convert::fromConvert($obj->{'convert'})
90359404 );
@@ -9128,6 +9497,9 @@ class ConverterClass {
91289497 * @throws Exception
91299498 */
91309499 public static function from(stdClass $obj): ConverterClass {
9500+ if (!property_exists($obj, 'converter')) {
9501+ throw new Exception("Missing required property");
9502+ }
91319503 return new ConverterClass(
91329504 ConverterClass::fromConverter($obj->{'converter'})
91339505 );
@@ -9226,6 +9598,9 @@ class Date {
92269598 * @throws Exception
92279599 */
92289600 public static function from(stdClass $obj): Date {
9601+ if (!property_exists($obj, 'date')) {
9602+ throw new Exception("Missing required property");
9603+ }
92299604 return new Date(
92309605 Date::fromDate($obj->{'date'})
92319606 );
@@ -9324,6 +9699,9 @@ class DateParseHandling {
93249699 * @throws Exception
93259700 */
93269701 public static function from(stdClass $obj): DateParseHandling {
9702+ if (!property_exists($obj, 'date_parse_handling')) {
9703+ throw new Exception("Missing required property");
9704+ }
93279705 return new DateParseHandling(
93289706 DateParseHandling::fromDateParseHandling($obj->{'date_parse_handling'})
93299707 );
@@ -9422,6 +9800,9 @@ class Debugger {
94229800 * @throws Exception
94239801 */
94249802 public static function from(stdClass $obj): Debugger {
9803+ if (!property_exists($obj, 'debugger')) {
9804+ throw new Exception("Missing required property");
9805+ }
94259806 return new Debugger(
94269807 Debugger::fromDebugger($obj->{'debugger'})
94279808 );
@@ -9520,6 +9901,9 @@ class Decimal {
95209901 * @throws Exception
95219902 */
95229903 public static function from(stdClass $obj): Decimal {
9904+ if (!property_exists($obj, 'decimal')) {
9905+ throw new Exception("Missing required property");
9906+ }
95239907 return new Decimal(
95249908 Decimal::fromDecimal($obj->{'decimal'})
95259909 );
@@ -9618,6 +10002,9 @@ class DeclareClass {
961810002 * @throws Exception
961910003 */
962010004 public static function from(stdClass $obj): DeclareClass {
10005+ if (!property_exists($obj, 'declare')) {
10006+ throw new Exception("Missing required property");
10007+ }
962110008 return new DeclareClass(
962210009 DeclareClass::fromDeclare($obj->{'declare'})
962310010 );
@@ -9716,6 +10103,9 @@ class Decltype {
971610103 * @throws Exception
971710104 */
971810105 public static function from(stdClass $obj): Decltype {
10106+ if (!property_exists($obj, 'decltype')) {
10107+ throw new Exception("Missing required property");
10108+ }
971910109 return new Decltype(
972010110 Decltype::fromDecltype($obj->{'decltype'})
972110111 );
@@ -9814,6 +10204,9 @@ class DecodeString {
981410204 * @throws Exception
981510205 */
981610206 public static function from(stdClass $obj): DecodeString {
10207+ if (!property_exists($obj, 'decode_string')) {
10208+ throw new Exception("Missing required property");
10209+ }
981710210 return new DecodeString(
981810211 DecodeString::fromDecodeString($obj->{'decode_string'})
981910212 );
@@ -9912,6 +10305,9 @@ class Purple {
991210305 * @throws Exception
991310306 */
991410307 public static function from(stdClass $obj): Purple {
10308+ if (!property_exists($obj, '_')) {
10309+ throw new Exception("Missing required property");
10310+ }
991510311 return new Purple(
991610312 Purple::fromEmpty($obj->{'_'})
991710313 );
@@ -10010,6 +10406,9 @@ class Imaginery {
1001010406 * @throws Exception
1001110407 */
1001210408 public static function from(stdClass $obj): Imaginery {
10409+ if (!property_exists($obj, '_Imaginery')) {
10410+ throw new Exception("Missing required property");
10411+ }
1001310412 return new Imaginery(
1001410413 Imaginery::fromImaginery($obj->{'_Imaginery'})
1001510414 );
@@ -10108,6 +10507,9 @@ class AnyClass {
1010810507 * @throws Exception
1010910508 */
1011010509 public static function from(stdClass $obj): AnyClass {
10510+ if (!property_exists($obj, 'any')) {
10511+ throw new Exception("Missing required property");
10512+ }
1011110513 return new AnyClass(
1011210514 AnyClass::fromAny($obj->{'any'})
1011310515 );
@@ -10206,6 +10608,9 @@ class Obj1Bool {
1020610608 * @throws Exception
1020710609 */
1020810610 public static function from(stdClass $obj): Obj1Bool {
10611+ if (!property_exists($obj, '_Bool')) {
10612+ throw new Exception("Missing required property");
10613+ }
1020910614 return new Obj1Bool(
1021010615 Obj1Bool::fromBool($obj->{'_Bool'})
1021110616 );
@@ -10304,6 +10709,9 @@ class Obj1Class {
1030410709 * @throws Exception
1030510710 */
1030610711 public static function from(stdClass $obj): Obj1Class {
10712+ if (!property_exists($obj, 'class')) {
10713+ throw new Exception("Missing required property");
10714+ }
1030710715 return new Obj1Class(
1030810716 Obj1Class::fromClass($obj->{'class'})
1030910717 );
@@ -10402,6 +10810,9 @@ class Obj1BoolClass {
1040210810 * @throws Exception
1040310811 */
1040410812 public static function from(stdClass $obj): Obj1BoolClass {
10813+ if (!property_exists($obj, 'bool')) {
10814+ throw new Exception("Missing required property");
10815+ }
1040510816 return new Obj1BoolClass(
1040610817 Obj1BoolClass::fromBool($obj->{'bool'})
1040710818 );
@@ -13945,6 +14356,204 @@ class Obj2 {
1394514356 * @throws Exception
1394614357 */
1394714358 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+ }
1394814557 return new Obj2(
1394914558 Obj2::fromDef($obj->{'def'})
1395014559 ,Obj2::fromDefault($obj->{'default'})
@@ -14173,6 +14782,9 @@ class Def {
1417314782 * @throws Exception
1417414783 */
1417514784 public static function from(stdClass $obj): Def {
14785+ if (!property_exists($obj, 'def')) {
14786+ throw new Exception("Missing required property");
14787+ }
1417614788 return new Def(
1417714789 Def::fromDef($obj->{'def'})
1417814790 );
@@ -14271,6 +14883,9 @@ class DefaultClass {
1427114883 * @throws Exception
1427214884 */
1427314885 public static function from(stdClass $obj): DefaultClass {
14886+ if (!property_exists($obj, 'default')) {
14887+ throw new Exception("Missing required property");
14888+ }
1427414889 return new DefaultClass(
1427514890 DefaultClass::fromDefault($obj->{'default'})
1427614891 );
@@ -14369,6 +14984,9 @@ class Defer {
1436914984 * @throws Exception
1437014985 */
1437114986 public static function from(stdClass $obj): Defer {
14987+ if (!property_exists($obj, 'defer')) {
14988+ throw new Exception("Missing required property");
14989+ }
1437214990 return new Defer(
1437314991 Defer::fromDefer($obj->{'defer'})
1437414992 );
@@ -14467,6 +15085,9 @@ class Deinit {
1446715085 * @throws Exception
1446815086 */
1446915087 public static function from(stdClass $obj): Deinit {
15088+ if (!property_exists($obj, 'deinit')) {
15089+ throw new Exception("Missing required property");
15090+ }
1447015091 return new Deinit(
1447115092 Deinit::fromDeinit($obj->{'deinit'})
1447215093 );
@@ -14565,6 +15186,9 @@ class Del {
1456515186 * @throws Exception
1456615187 */
1456715188 public static function from(stdClass $obj): Del {
15189+ if (!property_exists($obj, 'del')) {
15190+ throw new Exception("Missing required property");
15191+ }
1456815192 return new Del(
1456915193 Del::fromDel($obj->{'del'})
1457015194 );
@@ -14663,6 +15287,9 @@ class Delegate {
1466315287 * @throws Exception
1466415288 */
1466515289 public static function from(stdClass $obj): Delegate {
15290+ if (!property_exists($obj, 'delegate')) {
15291+ throw new Exception("Missing required property");
15292+ }
1466615293 return new Delegate(
1466715294 Delegate::fromDelegate($obj->{'delegate'})
1466815295 );
@@ -14761,6 +15388,9 @@ class Delete {
1476115388 * @throws Exception
1476215389 */
1476315390 public static function from(stdClass $obj): Delete {
15391+ if (!property_exists($obj, 'delete')) {
15392+ throw new Exception("Missing required property");
15393+ }
1476415394 return new Delete(
1476515395 Delete::fromDelete($obj->{'delete'})
1476615396 );
@@ -14859,6 +15489,9 @@ class Dict {
1485915489 * @throws Exception
1486015490 */
1486115491 public static function from(stdClass $obj): Dict {
15492+ if (!property_exists($obj, 'dict')) {
15493+ throw new Exception("Missing required property");
15494+ }
1486215495 return new Dict(
1486315496 Dict::fromDict($obj->{'dict'})
1486415497 );
@@ -14957,6 +15590,9 @@ class Dictionary {
1495715590 * @throws Exception
1495815591 */
1495915592 public static function from(stdClass $obj): Dictionary {
15593+ if (!property_exists($obj, 'dictionary')) {
15594+ throw new Exception("Missing required property");
15595+ }
1496015596 return new Dictionary(
1496115597 Dictionary::fromDictionary($obj->{'dictionary'})
1496215598 );
@@ -15055,6 +15691,9 @@ class DidSet {
1505515691 * @throws Exception
1505615692 */
1505715693 public static function from(stdClass $obj): DidSet {
15694+ if (!property_exists($obj, 'didSet')) {
15695+ throw new Exception("Missing required property");
15696+ }
1505815697 return new DidSet(
1505915698 DidSet::fromDidSet($obj->{'didSet'})
1506015699 );
@@ -15153,6 +15792,9 @@ class DoClass {
1515315792 * @throws Exception
1515415793 */
1515515794 public static function from(stdClass $obj): DoClass {
15795+ if (!property_exists($obj, 'do')) {
15796+ throw new Exception("Missing required property");
15797+ }
1515615798 return new DoClass(
1515715799 DoClass::fromDo($obj->{'do'})
1515815800 );
@@ -15251,6 +15893,9 @@ class Double {
1525115893 * @throws Exception
1525215894 */
1525315895 public static function from(stdClass $obj): Double {
15896+ if (!property_exists($obj, 'double')) {
15897+ throw new Exception("Missing required property");
15898+ }
1525415899 return new Double(
1525515900 Double::fromDouble($obj->{'double'})
1525615901 );
@@ -15349,6 +15994,9 @@ class Dynamic {
1534915994 * @throws Exception
1535015995 */
1535115996 public static function from(stdClass $obj): Dynamic {
15997+ if (!property_exists($obj, 'dynamic')) {
15998+ throw new Exception("Missing required property");
15999+ }
1535216000 return new Dynamic(
1535316001 Dynamic::fromDynamic($obj->{'dynamic'})
1535416002 );
@@ -15447,6 +16095,9 @@ class DynamicCast {
1544716095 * @throws Exception
1544816096 */
1544916097 public static function from(stdClass $obj): DynamicCast {
16098+ if (!property_exists($obj, 'dynamic_cast')) {
16099+ throw new Exception("Missing required property");
16100+ }
1545016101 return new DynamicCast(
1545116102 DynamicCast::fromDynamicCast($obj->{'dynamic_cast'})
1545216103 );
@@ -15545,6 +16196,9 @@ class Elif {
1554516196 * @throws Exception
1554616197 */
1554716198 public static function from(stdClass $obj): Elif {
16199+ if (!property_exists($obj, 'elif')) {
16200+ throw new Exception("Missing required property");
16201+ }
1554816202 return new Elif(
1554916203 Elif::fromElif($obj->{'elif'})
1555016204 );
@@ -15643,6 +16297,9 @@ class ElseClass {
1564316297 * @throws Exception
1564416298 */
1564516299 public static function from(stdClass $obj): ElseClass {
16300+ if (!property_exists($obj, 'else')) {
16301+ throw new Exception("Missing required property");
16302+ }
1564616303 return new ElseClass(
1564716304 ElseClass::fromElse($obj->{'else'})
1564816305 );
@@ -15741,6 +16398,9 @@ class EncodeQuickType {
1574116398 * @throws Exception
1574216399 */
1574316400 public static function from(stdClass $obj): EncodeQuickType {
16401+ if (!property_exists($obj, 'encode_quick_type')) {
16402+ throw new Exception("Missing required property");
16403+ }
1574416404 return new EncodeQuickType(
1574516405 EncodeQuickType::fromEncodeQuickType($obj->{'encode_quick_type'})
1574616406 );
@@ -15839,6 +16499,9 @@ class EnumClass {
1583916499 * @throws Exception
1584016500 */
1584116501 public static function from(stdClass $obj): EnumClass {
16502+ if (!property_exists($obj, 'enum')) {
16503+ throw new Exception("Missing required property");
16504+ }
1584216505 return new EnumClass(
1584316506 EnumClass::fromEnum($obj->{'enum'})
1584416507 );
@@ -15937,6 +16600,9 @@ class EqualityContract {
1593716600 * @throws Exception
1593816601 */
1593916602 public static function from(stdClass $obj): EqualityContract {
16603+ if (!property_exists($obj, 'equalityContract')) {
16604+ throw new Exception("Missing required property");
16605+ }
1594016606 return new EqualityContract(
1594116607 EqualityContract::fromEqualityContract($obj->{'equalityContract'})
1594216608 );
@@ -16035,6 +16701,9 @@ class Event {
1603516701 * @throws Exception
1603616702 */
1603716703 public static function from(stdClass $obj): Event {
16704+ if (!property_exists($obj, 'event')) {
16705+ throw new Exception("Missing required property");
16706+ }
1603816707 return new Event(
1603916708 Event::fromEvent($obj->{'event'})
1604016709 );
@@ -16133,6 +16802,9 @@ class Except {
1613316802 * @throws Exception
1613416803 */
1613516804 public static function from(stdClass $obj): Except {
16805+ if (!property_exists($obj, 'except')) {
16806+ throw new Exception("Missing required property");
16807+ }
1613616808 return new Except(
1613716809 Except::fromExcept($obj->{'except'})
1613816810 );
@@ -16231,6 +16903,9 @@ class ExceptionClass {
1623116903 * @throws Exception
1623216904 */
1623316905 public static function from(stdClass $obj): ExceptionClass {
16906+ if (!property_exists($obj, 'exception')) {
16907+ throw new Exception("Missing required property");
16908+ }
1623416909 return new ExceptionClass(
1623516910 ExceptionClass::fromException($obj->{'exception'})
1623616911 );
@@ -16329,6 +17004,9 @@ class Explicit {
1632917004 * @throws Exception
1633017005 */
1633117006 public static function from(stdClass $obj): Explicit {
17007+ if (!property_exists($obj, 'explicit')) {
17008+ throw new Exception("Missing required property");
17009+ }
1633217010 return new Explicit(
1633317011 Explicit::fromExplicit($obj->{'explicit'})
1633417012 );
@@ -16427,6 +17105,9 @@ class Export {
1642717105 * @throws Exception
1642817106 */
1642917107 public static function from(stdClass $obj): Export {
17108+ if (!property_exists($obj, 'export')) {
17109+ throw new Exception("Missing required property");
17110+ }
1643017111 return new Export(
1643117112 Export::fromExport($obj->{'export'})
1643217113 );
@@ -16525,6 +17206,9 @@ class Exposing {
1652517206 * @throws Exception
1652617207 */
1652717208 public static function from(stdClass $obj): Exposing {
17209+ if (!property_exists($obj, 'exposing')) {
17210+ throw new Exception("Missing required property");
17211+ }
1652817212 return new Exposing(
1652917213 Exposing::fromExposing($obj->{'exposing'})
1653017214 );
@@ -16623,6 +17307,9 @@ class ExtendsClass {
1662317307 * @throws Exception
1662417308 */
1662517309 public static function from(stdClass $obj): ExtendsClass {
17310+ if (!property_exists($obj, 'extends')) {
17311+ throw new Exception("Missing required property");
17312+ }
1662617313 return new ExtendsClass(
1662717314 ExtendsClass::fromExtends($obj->{'extends'})
1662817315 );
@@ -16721,6 +17408,9 @@ class Extension {
1672117408 * @throws Exception
1672217409 */
1672317410 public static function from(stdClass $obj): Extension {
17411+ if (!property_exists($obj, 'extension')) {
17412+ throw new Exception("Missing required property");
17413+ }
1672417414 return new Extension(
1672517415 Extension::fromExtension($obj->{'extension'})
1672617416 );
@@ -16819,6 +17509,9 @@ class Extern {
1681917509 * @throws Exception
1682017510 */
1682117511 public static function from(stdClass $obj): Extern {
17512+ if (!property_exists($obj, 'extern')) {
17513+ throw new Exception("Missing required property");
17514+ }
1682217515 return new Extern(
1682317516 Extern::fromExtern($obj->{'extern'})
1682417517 );
@@ -16917,6 +17610,9 @@ class Fallthrough {
1691717610 * @throws Exception
1691817611 */
1691917612 public static function from(stdClass $obj): Fallthrough {
17613+ if (!property_exists($obj, 'fallthrough')) {
17614+ throw new Exception("Missing required property");
17615+ }
1692017616 return new Fallthrough(
1692117617 Fallthrough::fromFallthrough($obj->{'fallthrough'})
1692217618 );
@@ -17015,6 +17711,9 @@ class FalseClass {
1701517711 * @throws Exception
1701617712 */
1701717713 public static function from(stdClass $obj): FalseClass {
17714+ if (!property_exists($obj, 'False')) {
17715+ throw new Exception("Missing required property");
17716+ }
1701817717 return new FalseClass(
1701917718 FalseClass::fromFalse($obj->{'False'})
1702017719 );
@@ -17113,6 +17812,9 @@ class Fileprivate {
1711317812 * @throws Exception
1711417813 */
1711517814 public static function from(stdClass $obj): Fileprivate {
17815+ if (!property_exists($obj, 'fileprivate')) {
17816+ throw new Exception("Missing required property");
17817+ }
1711617818 return new Fileprivate(
1711717819 Fileprivate::fromFileprivate($obj->{'fileprivate'})
1711817820 );
@@ -17211,6 +17913,9 @@ class FinalClass {
1721117913 * @throws Exception
1721217914 */
1721317915 public static function from(stdClass $obj): FinalClass {
17916+ if (!property_exists($obj, 'final')) {
17917+ throw new Exception("Missing required property");
17918+ }
1721417919 return new FinalClass(
1721517920 FinalClass::fromFinal($obj->{'final'})
1721617921 );
@@ -17309,6 +18014,9 @@ class FinallyClass {
1730918014 * @throws Exception
1731018015 */
1731118016 public static function from(stdClass $obj): FinallyClass {
18017+ if (!property_exists($obj, 'finally')) {
18018+ throw new Exception("Missing required property");
18019+ }
1731218020 return new FinallyClass(
1731318021 FinallyClass::fromFinally($obj->{'finally'})
1731418022 );
@@ -17407,6 +18115,9 @@ class Fixed {
1740718115 * @throws Exception
1740818116 */
1740918117 public static function from(stdClass $obj): Fixed {
18118+ if (!property_exists($obj, 'fixed')) {
18119+ throw new Exception("Missing required property");
18120+ }
1741018121 return new Fixed(
1741118122 Fixed::fromFixed($obj->{'fixed'})
1741218123 );
@@ -17505,6 +18216,9 @@ class FloatClass {
1750518216 * @throws Exception
1750618217 */
1750718218 public static function from(stdClass $obj): FloatClass {
18219+ if (!property_exists($obj, 'float')) {
18220+ throw new Exception("Missing required property");
18221+ }
1750818222 return new FloatClass(
1750918223 FloatClass::fromFloat($obj->{'float'})
1751018224 );
@@ -17603,6 +18317,9 @@ class ForClass {
1760318317 * @throws Exception
1760418318 */
1760518319 public static function from(stdClass $obj): ForClass {
18320+ if (!property_exists($obj, 'for')) {
18321+ throw new Exception("Missing required property");
18322+ }
1760618323 return new ForClass(
1760718324 ForClass::fromFor($obj->{'for'})
1760818325 );
@@ -17701,6 +18418,9 @@ class ForeachClass {
1770118418 * @throws Exception
1770218419 */
1770318420 public static function from(stdClass $obj): ForeachClass {
18421+ if (!property_exists($obj, 'foreach')) {
18422+ throw new Exception("Missing required property");
18423+ }
1770418424 return new ForeachClass(
1770518425 ForeachClass::fromForeach($obj->{'foreach'})
1770618426 );
@@ -17799,6 +18519,9 @@ class Friend {
1779918519 * @throws Exception
1780018520 */
1780118521 public static function from(stdClass $obj): Friend {
18522+ if (!property_exists($obj, 'friend')) {
18523+ throw new Exception("Missing required property");
18524+ }
1780218525 return new Friend(
1780318526 Friend::fromFriend($obj->{'friend'})
1780418527 );
@@ -17897,6 +18620,9 @@ class From {
1789718620 * @throws Exception
1789818621 */
1789918622 public static function from(stdClass $obj): From {
18623+ if (!property_exists($obj, 'from')) {
18624+ throw new Exception("Missing required property");
18625+ }
1790018626 return new From(
1790118627 From::fromFrom($obj->{'from'})
1790218628 );
@@ -17995,6 +18721,9 @@ class FromJSON {
1799518721 * @throws Exception
1799618722 */
1799718723 public static function from(stdClass $obj): FromJSON {
18724+ if (!property_exists($obj, 'from_json')) {
18725+ throw new Exception("Missing required property");
18726+ }
1799818727 return new FromJSON(
1799918728 FromJSON::fromFromJSON($obj->{'from_json'})
1800018729 );
@@ -18093,6 +18822,9 @@ class Func {
1809318822 * @throws Exception
1809418823 */
1809518824 public static function from(stdClass $obj): Func {
18825+ if (!property_exists($obj, 'func')) {
18826+ throw new Exception("Missing required property");
18827+ }
1809618828 return new Func(
1809718829 Func::fromFunc($obj->{'func'})
1809818830 );
@@ -18191,6 +18923,9 @@ class FunctionClass {
1819118923 * @throws Exception
1819218924 */
1819318925 public static function from(stdClass $obj): FunctionClass {
18926+ if (!property_exists($obj, 'function')) {
18927+ throw new Exception("Missing required property");
18928+ }
1819418929 return new FunctionClass(
1819518930 FunctionClass::fromFunction($obj->{'function'})
1819618931 );
@@ -18289,6 +19024,9 @@ class Get {
1828919024 * @throws Exception
1829019025 */
1829119026 public static function from(stdClass $obj): Get {
19027+ if (!property_exists($obj, 'get')) {
19028+ throw new Exception("Missing required property");
19029+ }
1829219030 return new Get(
1829319031 Get::fromGet($obj->{'get'})
1829419032 );
@@ -18387,6 +19125,9 @@ class GlobalClass {
1838719125 * @throws Exception
1838819126 */
1838919127 public static function from(stdClass $obj): GlobalClass {
19128+ if (!property_exists($obj, 'global')) {
19129+ throw new Exception("Missing required property");
19130+ }
1839019131 return new GlobalClass(
1839119132 GlobalClass::fromGlobal($obj->{'global'})
1839219133 );
@@ -18485,6 +19226,9 @@ class Go {
1848519226 * @throws Exception
1848619227 */
1848719228 public static function from(stdClass $obj): Go {
19229+ if (!property_exists($obj, 'go')) {
19230+ throw new Exception("Missing required property");
19231+ }
1848819232 return new Go(
1848919233 Go::fromGo($obj->{'go'})
1849019234 );
@@ -18583,6 +19327,9 @@ class GotoClass {
1858319327 * @throws Exception
1858419328 */
1858519329 public static function from(stdClass $obj): GotoClass {
19330+ if (!property_exists($obj, 'goto')) {
19331+ throw new Exception("Missing required property");
19332+ }
1858619333 return new GotoClass(
1858719334 GotoClass::fromGoto($obj->{'goto'})
1858819335 );
@@ -18681,6 +19428,9 @@ class Guard {
1868119428 * @throws Exception
1868219429 */
1868319430 public static function from(stdClass $obj): Guard {
19431+ if (!property_exists($obj, 'guard')) {
19432+ throw new Exception("Missing required property");
19433+ }
1868419434 return new Guard(
1868519435 Guard::fromGuard($obj->{'guard'})
1868619436 );
@@ -18779,6 +19529,9 @@ class HasOwnProperty {
1877919529 * @throws Exception
1878019530 */
1878119531 public static function from(stdClass $obj): HasOwnProperty {
19532+ if (!property_exists($obj, 'hasOwnProperty')) {
19533+ throw new Exception("Missing required property");
19534+ }
1878219535 return new HasOwnProperty(
1878319536 HasOwnProperty::fromHasOwnProperty($obj->{'hasOwnProperty'})
1878419537 );
@@ -18877,6 +19630,9 @@ class ID {
1887719630 * @throws Exception
1887819631 */
1887919632 public static function from(stdClass $obj): ID {
19633+ if (!property_exists($obj, 'id')) {
19634+ throw new Exception("Missing required property");
19635+ }
1888019636 return new ID(
1888119637 ID::fromID($obj->{'id'})
1888219638 );
@@ -18975,6 +19731,9 @@ class IfClass {
1897519731 * @throws Exception
1897619732 */
1897719733 public static function from(stdClass $obj): IfClass {
19734+ if (!property_exists($obj, 'if')) {
19735+ throw new Exception("Missing required property");
19736+ }
1897819737 return new IfClass(
1897919738 IfClass::fromIf($obj->{'if'})
1898019739 );
@@ -19073,6 +19832,9 @@ class Imp {
1907319832 * @throws Exception
1907419833 */
1907519834 public static function from(stdClass $obj): Imp {
19835+ if (!property_exists($obj, 'IMP')) {
19836+ throw new Exception("Missing required property");
19837+ }
1907619838 return new Imp(
1907719839 Imp::fromImp($obj->{'IMP'})
1907819840 );
@@ -19171,6 +19933,9 @@ class ImplementsClass {
1917119933 * @throws Exception
1917219934 */
1917319935 public static function from(stdClass $obj): ImplementsClass {
19936+ if (!property_exists($obj, 'implements')) {
19937+ throw new Exception("Missing required property");
19938+ }
1917419939 return new ImplementsClass(
1917519940 ImplementsClass::fromImplements($obj->{'implements'})
1917619941 );
@@ -19269,6 +20034,9 @@ class Implicit {
1926920034 * @throws Exception
1927020035 */
1927120036 public static function from(stdClass $obj): Implicit {
20037+ if (!property_exists($obj, 'implicit')) {
20038+ throw new Exception("Missing required property");
20039+ }
1927220040 return new Implicit(
1927320041 Implicit::fromImplicit($obj->{'implicit'})
1927420042 );
@@ -19367,6 +20135,9 @@ class Import {
1936720135 * @throws Exception
1936820136 */
1936920137 public static function from(stdClass $obj): Import {
20138+ if (!property_exists($obj, 'import')) {
20139+ throw new Exception("Missing required property");
20140+ }
1937020141 return new Import(
1937120142 Import::fromImport($obj->{'import'})
1937220143 );
@@ -19465,6 +20236,9 @@ class In {
1946520236 * @throws Exception
1946620237 */
1946720238 public static function from(stdClass $obj): In {
20239+ if (!property_exists($obj, 'in')) {
20240+ throw new Exception("Missing required property");
20241+ }
1946820242 return new In(
1946920243 In::fromIn($obj->{'in'})
1947020244 );
@@ -19563,6 +20337,9 @@ class Indirect {
1956320337 * @throws Exception
1956420338 */
1956520339 public static function from(stdClass $obj): Indirect {
20340+ if (!property_exists($obj, 'indirect')) {
20341+ throw new Exception("Missing required property");
20342+ }
1956620343 return new Indirect(
1956720344 Indirect::fromIndirect($obj->{'indirect'})
1956820345 );
@@ -19661,6 +20438,9 @@ class Infix {
1966120438 * @throws Exception
1966220439 */
1966320440 public static function from(stdClass $obj): Infix {
20441+ if (!property_exists($obj, 'infix')) {
20442+ throw new Exception("Missing required property");
20443+ }
1966420444 return new Infix(
1966520445 Infix::fromInfix($obj->{'infix'})
1966620446 );
@@ -19759,6 +20539,9 @@ class Init {
1975920539 * @throws Exception
1976020540 */
1976120541 public static function from(stdClass $obj): Init {
20542+ if (!property_exists($obj, 'init')) {
20543+ throw new Exception("Missing required property");
20544+ }
1976220545 return new Init(
1976320546 Init::fromInit($obj->{'init'})
1976420547 );
@@ -19857,6 +20640,9 @@ class Inline {
1985720640 * @throws Exception
1985820641 */
1985920642 public static function from(stdClass $obj): Inline {
20643+ if (!property_exists($obj, 'inline')) {
20644+ throw new Exception("Missing required property");
20645+ }
1986020646 return new Inline(
1986120647 Inline::fromInline($obj->{'inline'})
1986220648 );
@@ -19955,6 +20741,9 @@ class Inout {
1995520741 * @throws Exception
1995620742 */
1995720743 public static function from(stdClass $obj): Inout {
20744+ if (!property_exists($obj, 'inout')) {
20745+ throw new Exception("Missing required property");
20746+ }
1995820747 return new Inout(
1995920748 Inout::fromInout($obj->{'inout'})
1996020749 );
@@ -20053,6 +20842,9 @@ class InstanceofClass {
2005320842 * @throws Exception
2005420843 */
2005520844 public static function from(stdClass $obj): InstanceofClass {
20845+ if (!property_exists($obj, 'instanceof')) {
20846+ throw new Exception("Missing required property");
20847+ }
2005620848 return new InstanceofClass(
2005720849 InstanceofClass::fromInstanceof($obj->{'instanceof'})
2005820850 );
@@ -20151,6 +20943,9 @@ class IntClass {
2015120943 * @throws Exception
2015220944 */
2015320945 public static function from(stdClass $obj): IntClass {
20946+ if (!property_exists($obj, 'int')) {
20947+ throw new Exception("Missing required property");
20948+ }
2015420949 return new IntClass(
2015520950 IntClass::fromInt($obj->{'int'})
2015620951 );
@@ -20249,6 +21044,9 @@ class InterfaceClass {
2024921044 * @throws Exception
2025021045 */
2025121046 public static function from(stdClass $obj): InterfaceClass {
21047+ if (!property_exists($obj, 'interface')) {
21048+ throw new Exception("Missing required property");
21049+ }
2025221050 return new InterfaceClass(
2025321051 InterfaceClass::fromInterface($obj->{'interface'})
2025421052 );
@@ -20347,6 +21145,9 @@ class Internal {
2034721145 * @throws Exception
2034821146 */
2034921147 public static function from(stdClass $obj): Internal {
21148+ if (!property_exists($obj, 'internal')) {
21149+ throw new Exception("Missing required property");
21150+ }
2035021151 return new Internal(
2035121152 Internal::fromInternal($obj->{'internal'})
2035221153 );
@@ -20445,6 +21246,9 @@ class Obj2False {
2044521246 * @throws Exception
2044621247 */
2044721248 public static function from(stdClass $obj): Obj2False {
21249+ if (!property_exists($obj, 'false')) {
21250+ throw new Exception("Missing required property");
21251+ }
2044821252 return new Obj2False(
2044921253 Obj2False::fromFalse($obj->{'false'})
2045021254 );
@@ -23988,6 +24792,204 @@ class Obj3 {
2398824792 * @throws Exception
2398924793 */
2399024794 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+ }
2399124993 return new Obj3(
2399224994 Obj3::fromDummy($obj->{'dummy'})
2399324995 ,Obj3::fromIs($obj->{'is'})
@@ -24216,6 +25218,9 @@ class Is {
2421625218 * @throws Exception
2421725219 */
2421825220 public static function from(stdClass $obj): Is {
25221+ if (!property_exists($obj, 'is')) {
25222+ throw new Exception("Missing required property");
25223+ }
2421925224 return new Is(
2422025225 Is::fromIs($obj->{'is'})
2422125226 );
@@ -24314,6 +25319,9 @@ class IterableClass {
2431425319 * @throws Exception
2431525320 */
2431625321 public static function from(stdClass $obj): IterableClass {
25322+ if (!property_exists($obj, 'iterable')) {
25323+ throw new Exception("Missing required property");
25324+ }
2431725325 return new IterableClass(
2431825326 IterableClass::fromIterable($obj->{'iterable'})
2431925327 );
@@ -24412,6 +25420,9 @@ class Jdec {
2441225420 * @throws Exception
2441325421 */
2441425422 public static function from(stdClass $obj): Jdec {
25423+ if (!property_exists($obj, 'jdec')) {
25424+ throw new Exception("Missing required property");
25425+ }
2441525426 return new Jdec(
2441625427 Jdec::fromJdec($obj->{'jdec'})
2441725428 );
@@ -24510,6 +25521,9 @@ class Jenc {
2451025521 * @throws Exception
2451125522 */
2451225523 public static function from(stdClass $obj): Jenc {
25524+ if (!property_exists($obj, 'jenc')) {
25525+ throw new Exception("Missing required property");
25526+ }
2451325527 return new Jenc(
2451425528 Jenc::fromJenc($obj->{'jenc'})
2451525529 );
@@ -24608,6 +25622,9 @@ class Jpipe {
2460825622 * @throws Exception
2460925623 */
2461025624 public static function from(stdClass $obj): Jpipe {
25625+ if (!property_exists($obj, 'jpipe')) {
25626+ throw new Exception("Missing required property");
25627+ }
2461125628 return new Jpipe(
2461225629 Jpipe::fromJpipe($obj->{'jpipe'})
2461325630 );
@@ -24706,6 +25723,9 @@ class JSON {
2470625723 * @throws Exception
2470725724 */
2470825725 public static function from(stdClass $obj): JSON {
25726+ if (!property_exists($obj, 'json')) {
25727+ throw new Exception("Missing required property");
25728+ }
2470925729 return new JSON(
2471025730 JSON::fromJSON($obj->{'json'})
2471125731 );
@@ -24804,6 +25824,9 @@ class JSONConverter {
2480425824 * @throws Exception
2480525825 */
2480625826 public static function from(stdClass $obj): JSONConverter {
25827+ if (!property_exists($obj, 'json_converter')) {
25828+ throw new Exception("Missing required property");
25829+ }
2480725830 return new JSONConverter(
2480825831 JSONConverter::fromJSONConverter($obj->{'json_converter'})
2480925832 );
@@ -24902,6 +25925,9 @@ class JSONSerializer {
2490225925 * @throws Exception
2490325926 */
2490425927 public static function from(stdClass $obj): JSONSerializer {
25928+ if (!property_exists($obj, 'json_serializer')) {
25929+ throw new Exception("Missing required property");
25930+ }
2490525931 return new JSONSerializer(
2490625932 JSONSerializer::fromJSONSerializer($obj->{'json_serializer'})
2490725933 );
@@ -25000,6 +26026,9 @@ class JSONToken {
2500026026 * @throws Exception
2500126027 */
2500226028 public static function from(stdClass $obj): JSONToken {
26029+ if (!property_exists($obj, 'json_token')) {
26030+ throw new Exception("Missing required property");
26031+ }
2500326032 return new JSONToken(
2500426033 JSONToken::fromJSONToken($obj->{'json_token'})
2500526034 );
@@ -25098,6 +26127,9 @@ class JSONWriter {
2509826127 * @throws Exception
2509926128 */
2510026129 public static function from(stdClass $obj): JSONWriter {
26130+ if (!property_exists($obj, 'json_writer')) {
26131+ throw new Exception("Missing required property");
26132+ }
2510126133 return new JSONWriter(
2510226134 JSONWriter::fromJSONWriter($obj->{'json_writer'})
2510326135 );
@@ -25196,6 +26228,9 @@ class Lambda {
2519626228 * @throws Exception
2519726229 */
2519826230 public static function from(stdClass $obj): Lambda {
26231+ if (!property_exists($obj, 'lambda')) {
26232+ throw new Exception("Missing required property");
26233+ }
2519926234 return new Lambda(
2520026235 Lambda::fromLambda($obj->{'lambda'})
2520126236 );
@@ -25294,6 +26329,9 @@ class Lazy {
2529426329 * @throws Exception
2529526330 */
2529626331 public static function from(stdClass $obj): Lazy {
26332+ if (!property_exists($obj, 'lazy')) {
26333+ throw new Exception("Missing required property");
26334+ }
2529726335 return new Lazy(
2529826336 Lazy::fromLazy($obj->{'lazy'})
2529926337 );
@@ -25392,6 +26430,9 @@ class Left {
2539226430 * @throws Exception
2539326431 */
2539426432 public static function from(stdClass $obj): Left {
26433+ if (!property_exists($obj, 'left')) {
26434+ throw new Exception("Missing required property");
26435+ }
2539526436 return new Left(
2539626437 Left::fromLeft($obj->{'left'})
2539726438 );
@@ -25490,6 +26531,9 @@ class Let {
2549026531 * @throws Exception
2549126532 */
2549226533 public static function from(stdClass $obj): Let {
26534+ if (!property_exists($obj, 'let')) {
26535+ throw new Exception("Missing required property");
26536+ }
2549326537 return new Let(
2549426538 Let::fromLet($obj->{'let'})
2549526539 );
@@ -25588,6 +26632,9 @@ class ListClass {
2558826632 * @throws Exception
2558926633 */
2559026634 public static function from(stdClass $obj): ListClass {
26635+ if (!property_exists($obj, 'list')) {
26636+ throw new Exception("Missing required property");
26637+ }
2559126638 return new ListClass(
2559226639 ListClass::fromList($obj->{'list'})
2559326640 );
@@ -25686,6 +26733,9 @@ class Lock {
2568626733 * @throws Exception
2568726734 */
2568826735 public static function from(stdClass $obj): Lock {
26736+ if (!property_exists($obj, 'lock')) {
26737+ throw new Exception("Missing required property");
26738+ }
2568926739 return new Lock(
2569026740 Lock::fromLock($obj->{'lock'})
2569126741 );
@@ -25784,6 +26834,9 @@ class Long {
2578426834 * @throws Exception
2578526835 */
2578626836 public static function from(stdClass $obj): Long {
26837+ if (!property_exists($obj, 'long')) {
26838+ throw new Exception("Missing required property");
26839+ }
2578726840 return new Long(
2578826841 Long::fromLong($obj->{'long'})
2578926842 );
@@ -25882,6 +26935,9 @@ class Map {
2588226935 * @throws Exception
2588326936 */
2588426937 public static function from(stdClass $obj): Map {
26938+ if (!property_exists($obj, 'map')) {
26939+ throw new Exception("Missing required property");
26940+ }
2588526941 return new Map(
2588626942 Map::fromMap($obj->{'map'})
2588726943 );
@@ -25980,6 +27036,9 @@ class MetadataPropertyHandling {
2598027036 * @throws Exception
2598127037 */
2598227038 public static function from(stdClass $obj): MetadataPropertyHandling {
27039+ if (!property_exists($obj, 'metadata_property_handling')) {
27040+ throw new Exception("Missing required property");
27041+ }
2598327042 return new MetadataPropertyHandling(
2598427043 MetadataPropertyHandling::fromMetadataPropertyHandling($obj->{'metadata_property_handling'})
2598527044 );
@@ -26078,6 +27137,9 @@ class Module {
2607827137 * @throws Exception
2607927138 */
2608027139 public static function from(stdClass $obj): Module {
27140+ if (!property_exists($obj, 'module')) {
27141+ throw new Exception("Missing required property");
27142+ }
2608127143 return new Module(
2608227144 Module::fromModule($obj->{'module'})
2608327145 );
@@ -26176,6 +27238,9 @@ class Mutable {
2617627238 * @throws Exception
2617727239 */
2617827240 public static function from(stdClass $obj): Mutable {
27241+ if (!property_exists($obj, 'mutable')) {
27242+ throw new Exception("Missing required property");
27243+ }
2617927244 return new Mutable(
2618027245 Mutable::fromMutable($obj->{'mutable'})
2618127246 );
@@ -26274,6 +27339,9 @@ class Mutating {
2627427339 * @throws Exception
2627527340 */
2627627341 public static function from(stdClass $obj): Mutating {
27342+ if (!property_exists($obj, 'mutating')) {
27343+ throw new Exception("Missing required property");
27344+ }
2627727345 return new Mutating(
2627827346 Mutating::fromMutating($obj->{'mutating'})
2627927347 );
@@ -26372,6 +27440,9 @@ class NamespaceClass {
2637227440 * @throws Exception
2637327441 */
2637427442 public static function from(stdClass $obj): NamespaceClass {
27443+ if (!property_exists($obj, 'namespace')) {
27444+ throw new Exception("Missing required property");
27445+ }
2637527446 return new NamespaceClass(
2637627447 NamespaceClass::fromNamespace($obj->{'namespace'})
2637727448 );
@@ -26470,6 +27541,9 @@ class Native {
2647027541 * @throws Exception
2647127542 */
2647227543 public static function from(stdClass $obj): Native {
27544+ if (!property_exists($obj, 'native')) {
27545+ throw new Exception("Missing required property");
27546+ }
2647327547 return new Native(
2647427548 Native::fromNative($obj->{'native'})
2647527549 );
@@ -26568,6 +27642,9 @@ class NewClass {
2656827642 * @throws Exception
2656927643 */
2657027644 public static function from(stdClass $obj): NewClass {
27645+ if (!property_exists($obj, 'new')) {
27646+ throw new Exception("Missing required property");
27647+ }
2657127648 return new NewClass(
2657227649 NewClass::fromNew($obj->{'new'})
2657327650 );
@@ -26666,6 +27743,9 @@ class Newtonsoft {
2666627743 * @throws Exception
2666727744 */
2666827745 public static function from(stdClass $obj): Newtonsoft {
27746+ if (!property_exists($obj, 'newtonsoft')) {
27747+ throw new Exception("Missing required property");
27748+ }
2666927749 return new Newtonsoft(
2667027750 Newtonsoft::fromNewtonsoft($obj->{'newtonsoft'})
2667127751 );
@@ -26764,6 +27844,9 @@ class Nil {
2676427844 * @throws Exception
2676527845 */
2676627846 public static function from(stdClass $obj): Nil {
27847+ if (!property_exists($obj, 'nil')) {
27848+ throw new Exception("Missing required property");
27849+ }
2676727850 return new Nil(
2676827851 Nil::fromNil($obj->{'nil'})
2676927852 );
@@ -26862,6 +27945,9 @@ class No {
2686227945 * @throws Exception
2686327946 */
2686427947 public static function from(stdClass $obj): No {
27948+ if (!property_exists($obj, 'NO')) {
27949+ throw new Exception("Missing required property");
27950+ }
2686527951 return new No(
2686627952 No::fromNo($obj->{'NO'})
2686727953 );
@@ -26960,6 +28046,9 @@ class Noexcept {
2696028046 * @throws Exception
2696128047 */
2696228048 public static function from(stdClass $obj): Noexcept {
28049+ if (!property_exists($obj, 'noexcept')) {
28050+ throw new Exception("Missing required property");
28051+ }
2696328052 return new Noexcept(
2696428053 Noexcept::fromNoexcept($obj->{'noexcept'})
2696528054 );
@@ -27058,6 +28147,9 @@ class Nonatomic {
2705828147 * @throws Exception
2705928148 */
2706028149 public static function from(stdClass $obj): Nonatomic {
28150+ if (!property_exists($obj, 'nonatomic')) {
28151+ throw new Exception("Missing required property");
28152+ }
2706128153 return new Nonatomic(
2706228154 Nonatomic::fromNonatomic($obj->{'nonatomic'})
2706328155 );
@@ -27156,6 +28248,9 @@ class None {
2715628248 * @throws Exception
2715728249 */
2715828250 public static function from(stdClass $obj): None {
28251+ if (!property_exists($obj, 'None')) {
28252+ throw new Exception("Missing required property");
28253+ }
2715928254 return new None(
2716028255 None::fromNone($obj->{'None'})
2716128256 );
@@ -27254,6 +28349,9 @@ class Nonlocal {
2725428349 * @throws Exception
2725528350 */
2725628351 public static function from(stdClass $obj): Nonlocal {
28352+ if (!property_exists($obj, 'nonlocal')) {
28353+ throw new Exception("Missing required property");
28354+ }
2725728355 return new Nonlocal(
2725828356 Nonlocal::fromNonlocal($obj->{'nonlocal'})
2725928357 );
@@ -27352,6 +28450,9 @@ class Nonmutating {
2735228450 * @throws Exception
2735328451 */
2735428452 public static function from(stdClass $obj): Nonmutating {
28453+ if (!property_exists($obj, 'nonmutating')) {
28454+ throw new Exception("Missing required property");
28455+ }
2735528456 return new Nonmutating(
2735628457 Nonmutating::fromNonmutating($obj->{'nonmutating'})
2735728458 );
@@ -27450,6 +28551,9 @@ class Not {
2745028551 * @throws Exception
2745128552 */
2745228553 public static function from(stdClass $obj): Not {
28554+ if (!property_exists($obj, 'not')) {
28555+ throw new Exception("Missing required property");
28556+ }
2745328557 return new Not(
2745428558 Not::fromNot($obj->{'not'})
2745528559 );
@@ -27548,6 +28652,9 @@ class NotEq {
2754828652 * @throws Exception
2754928653 */
2755028654 public static function from(stdClass $obj): NotEq {
28655+ if (!property_exists($obj, 'not_eq')) {
28656+ throw new Exception("Missing required property");
28657+ }
2755128658 return new NotEq(
2755228659 NotEq::fromNotEq($obj->{'not_eq'})
2755328660 );
@@ -27646,6 +28753,9 @@ class NSString {
2764628753 * @throws Exception
2764728754 */
2764828755 public static function from(stdClass $obj): NSString {
28756+ if (!property_exists($obj, 'NSString')) {
28757+ throw new Exception("Missing required property");
28758+ }
2764928759 return new NSString(
2765028760 NSString::fromNSString($obj->{'NSString'})
2765128761 );
@@ -27744,6 +28854,9 @@ class NULLClass {
2774428854 * @throws Exception
2774528855 */
2774628856 public static function from(stdClass $obj): NULLClass {
28857+ if (!property_exists($obj, 'NULL')) {
28858+ throw new Exception("Missing required property");
28859+ }
2774728860 return new NULLClass(
2774828861 NULLClass::fromNull($obj->{'NULL'})
2774928862 );
@@ -27842,6 +28955,9 @@ class Nullptr {
2784228955 * @throws Exception
2784328956 */
2784428957 public static function from(stdClass $obj): Nullptr {
28958+ if (!property_exists($obj, 'nullptr')) {
28959+ throw new Exception("Missing required property");
28960+ }
2784528961 return new Nullptr(
2784628962 Nullptr::fromNullptr($obj->{'nullptr'})
2784728963 );
@@ -27940,6 +29056,9 @@ class Number {
2794029056 * @throws Exception
2794129057 */
2794229058 public static function from(stdClass $obj): Number {
29059+ if (!property_exists($obj, 'number')) {
29060+ throw new Exception("Missing required property");
29061+ }
2794329062 return new Number(
2794429063 Number::fromNumber($obj->{'number'})
2794529064 );
@@ -28038,6 +29157,9 @@ class NoneClass {
2803829157 * @throws Exception
2803929158 */
2804029159 public static function from(stdClass $obj): NoneClass {
29160+ if (!property_exists($obj, 'none')) {
29161+ throw new Exception("Missing required property");
29162+ }
2804129163 return new NoneClass(
2804229164 NoneClass::fromNone($obj->{'none'})
2804329165 );
@@ -28136,6 +29258,9 @@ class Obj3Null {
2813629258 * @throws Exception
2813729259 */
2813829260 public static function from(stdClass $obj): Obj3Null {
29261+ if (!property_exists($obj, 'null')) {
29262+ throw new Exception("Missing required property");
29263+ }
2813929264 return new Obj3Null(
2814029265 Obj3Null::fromNull($obj->{'null'})
2814129266 );
@@ -28234,6 +29359,9 @@ class ProtocolClass {
2823429359 * @throws Exception
2823529360 */
2823629361 public static function from(stdClass $obj): ProtocolClass {
29362+ if (!property_exists($obj, 'protocol')) {
29363+ throw new Exception("Missing required property");
29364+ }
2823729365 return new ProtocolClass(
2823829366 ProtocolClass::fromProtocol($obj->{'protocol'})
2823929367 );
@@ -28332,6 +29460,9 @@ class ObjectClass {
2833229460 * @throws Exception
2833329461 */
2833429462 public static function from(stdClass $obj): ObjectClass {
29463+ if (!property_exists($obj, 'object')) {
29464+ throw new Exception("Missing required property");
29465+ }
2833529466 return new ObjectClass(
2833629467 ObjectClass::fromObject($obj->{'object'})
2833729468 );
@@ -28430,6 +29561,9 @@ class Of {
2843029561 * @throws Exception
2843129562 */
2843229563 public static function from(stdClass $obj): Of {
29564+ if (!property_exists($obj, 'of')) {
29565+ throw new Exception("Missing required property");
29566+ }
2843329567 return new Of(
2843429568 Of::fromOf($obj->{'of'})
2843529569 );
@@ -28528,6 +29662,9 @@ class Oneway {
2852829662 * @throws Exception
2852929663 */
2853029664 public static function from(stdClass $obj): Oneway {
29665+ if (!property_exists($obj, 'oneway')) {
29666+ throw new Exception("Missing required property");
29667+ }
2853129668 return new Oneway(
2853229669 Oneway::fromOneway($obj->{'oneway'})
2853329670 );
@@ -28626,6 +29763,9 @@ class Open {
2862629763 * @throws Exception
2862729764 */
2862829765 public static function from(stdClass $obj): Open {
29766+ if (!property_exists($obj, 'open')) {
29767+ throw new Exception("Missing required property");
29768+ }
2862929769 return new Open(
2863029770 Open::fromOpen($obj->{'open'})
2863129771 );
@@ -28724,6 +29864,9 @@ class Operator {
2872429864 * @throws Exception
2872529865 */
2872629866 public static function from(stdClass $obj): Operator {
29867+ if (!property_exists($obj, 'operator')) {
29868+ throw new Exception("Missing required property");
29869+ }
2872729870 return new Operator(
2872829871 Operator::fromOperator($obj->{'operator'})
2872929872 );
@@ -28822,6 +29965,9 @@ class Optional {
2882229965 * @throws Exception
2882329966 */
2882429967 public static function from(stdClass $obj): Optional {
29968+ if (!property_exists($obj, 'optional')) {
29969+ throw new Exception("Missing required property");
29970+ }
2882529971 return new Optional(
2882629972 Optional::fromOptional($obj->{'optional'})
2882729973 );
@@ -28920,6 +30066,9 @@ class OrClass {
2892030066 * @throws Exception
2892130067 */
2892230068 public static function from(stdClass $obj): OrClass {
30069+ if (!property_exists($obj, 'or')) {
30070+ throw new Exception("Missing required property");
30071+ }
2892330072 return new OrClass(
2892430073 OrClass::fromOr($obj->{'or'})
2892530074 );
@@ -29018,6 +30167,9 @@ class OrEq {
2901830167 * @throws Exception
2901930168 */
2902030169 public static function from(stdClass $obj): OrEq {
30170+ if (!property_exists($obj, 'or_eq')) {
30171+ throw new Exception("Missing required property");
30172+ }
2902130173 return new OrEq(
2902230174 OrEq::fromOrEq($obj->{'or_eq'})
2902330175 );
@@ -29116,6 +30268,9 @@ class Out {
2911630268 * @throws Exception
2911730269 */
2911830270 public static function from(stdClass $obj): Out {
30271+ if (!property_exists($obj, 'out')) {
30272+ throw new Exception("Missing required property");
30273+ }
2911930274 return new Out(
2912030275 Out::fromOut($obj->{'out'})
2912130276 );
@@ -29214,6 +30369,9 @@ class OverrideClass {
2921430369 * @throws Exception
2921530370 */
2921630371 public static function from(stdClass $obj): OverrideClass {
30372+ if (!property_exists($obj, 'override')) {
30373+ throw new Exception("Missing required property");
30374+ }
2921730375 return new OverrideClass(
2921830376 OverrideClass::fromOverride($obj->{'override'})
2921930377 );
@@ -29312,6 +30470,9 @@ class Package {
2931230470 * @throws Exception
2931330471 */
2931430472 public static function from(stdClass $obj): Package {
30473+ if (!property_exists($obj, 'package')) {
30474+ throw new Exception("Missing required property");
30475+ }
2931530476 return new Package(
2931630477 Package::fromPackage($obj->{'package'})
2931730478 );
@@ -29410,6 +30571,9 @@ class Params {
2941030571 * @throws Exception
2941130572 */
2941230573 public static function from(stdClass $obj): Params {
30574+ if (!property_exists($obj, 'params')) {
30575+ throw new Exception("Missing required property");
30576+ }
2941330577 return new Params(
2941430578 Params::fromParams($obj->{'params'})
2941530579 );
@@ -29508,6 +30672,9 @@ class Pass {
2950830672 * @throws Exception
2950930673 */
2951030674 public static function from(stdClass $obj): Pass {
30675+ if (!property_exists($obj, 'pass')) {
30676+ throw new Exception("Missing required property");
30677+ }
2951130678 return new Pass(
2951230679 Pass::fromPass($obj->{'pass'})
2951330680 );
@@ -29606,6 +30773,9 @@ class Port {
2960630773 * @throws Exception
2960730774 */
2960830775 public static function from(stdClass $obj): Port {
30776+ if (!property_exists($obj, 'port')) {
30777+ throw new Exception("Missing required property");
30778+ }
2960930779 return new Port(
2961030780 Port::fromPort($obj->{'port'})
2961130781 );
@@ -29704,6 +30874,9 @@ class Postfix {
2970430874 * @throws Exception
2970530875 */
2970630876 public static function from(stdClass $obj): Postfix {
30877+ if (!property_exists($obj, 'postfix')) {
30878+ throw new Exception("Missing required property");
30879+ }
2970730880 return new Postfix(
2970830881 Postfix::fromPostfix($obj->{'postfix'})
2970930882 );
@@ -29802,6 +30975,9 @@ class Precedence {
2980230975 * @throws Exception
2980330976 */
2980430977 public static function from(stdClass $obj): Precedence {
30978+ if (!property_exists($obj, 'precedence')) {
30979+ throw new Exception("Missing required property");
30980+ }
2980530981 return new Precedence(
2980630982 Precedence::fromPrecedence($obj->{'precedence'})
2980730983 );
@@ -29900,6 +31076,9 @@ class Prefix {
2990031076 * @throws Exception
2990131077 */
2990231078 public static function from(stdClass $obj): Prefix {
31079+ if (!property_exists($obj, 'prefix')) {
31080+ throw new Exception("Missing required property");
31081+ }
2990331082 return new Prefix(
2990431083 Prefix::fromPrefix($obj->{'prefix'})
2990531084 );
@@ -29998,6 +31177,9 @@ class PrintClass {
2999831177 * @throws Exception
2999931178 */
3000031179 public static function from(stdClass $obj): PrintClass {
31180+ if (!property_exists($obj, 'print')) {
31181+ throw new Exception("Missing required property");
31182+ }
3000131183 return new PrintClass(
3000231184 PrintClass::fromPrint($obj->{'print'})
3000331185 );
@@ -30096,6 +31278,9 @@ class PrintMembers {
3009631278 * @throws Exception
3009731279 */
3009831280 public static function from(stdClass $obj): PrintMembers {
31281+ if (!property_exists($obj, 'printMembers')) {
31282+ throw new Exception("Missing required property");
31283+ }
3009931284 return new PrintMembers(
3010031285 PrintMembers::fromPrintMembers($obj->{'printMembers'})
3010131286 );
@@ -30194,6 +31379,9 @@ class Printf {
3019431379 * @throws Exception
3019531380 */
3019631381 public static function from(stdClass $obj): Printf {
31382+ if (!property_exists($obj, 'printf')) {
31383+ throw new Exception("Missing required property");
31384+ }
3019731385 return new Printf(
3019831386 Printf::fromPrintf($obj->{'printf'})
3019931387 );
@@ -30292,6 +31480,9 @@ class PrivateClass {
3029231480 * @throws Exception
3029331481 */
3029431482 public static function from(stdClass $obj): PrivateClass {
31483+ if (!property_exists($obj, 'private')) {
31484+ throw new Exception("Missing required property");
31485+ }
3029531486 return new PrivateClass(
3029631487 PrivateClass::fromPrivate($obj->{'private'})
3029731488 );
@@ -30390,6 +31581,9 @@ class ProtectedClass {
3039031581 * @throws Exception
3039131582 */
3039231583 public static function from(stdClass $obj): ProtectedClass {
31584+ if (!property_exists($obj, 'protected')) {
31585+ throw new Exception("Missing required property");
31586+ }
3039331587 return new ProtectedClass(
3039431588 ProtectedClass::fromProtected($obj->{'protected'})
3039531589 );
@@ -30488,6 +31682,9 @@ class Protocol {
3048831682 * @throws Exception
3048931683 */
3049031684 public static function from(stdClass $obj): Protocol {
31685+ if (!property_exists($obj, 'Protocol')) {
31686+ throw new Exception("Missing required property");
31687+ }
3049131688 return new Protocol(
3049231689 Protocol::fromProtocol($obj->{'Protocol'})
3049331690 );
@@ -33978,6 +35175,201 @@ class Obj4 {
3397835175 * @throws Exception
3397935176 */
3398035177 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+ }
3398135373 return new Obj4(
3398235374 Obj4::fromDummy($obj->{'dummy'})
3398335375 ,Obj4::fromObj4Self($obj->{'self'})
@@ -34204,6 +35596,9 @@ class Obj4Self {
3420435596 * @throws Exception
3420535597 */
3420635598 public static function from(stdClass $obj): Obj4Self {
35599+ if (!property_exists($obj, 'self')) {
35600+ throw new Exception("Missing required property");
35601+ }
3420735602 return new Obj4Self(
3420835603 Obj4Self::fromSelf($obj->{'self'})
3420935604 );
@@ -34302,6 +35697,9 @@ class This {
3430235697 * @throws Exception
3430335698 */
3430435699 public static function from(stdClass $obj): This {
35700+ if (!property_exists($obj, 'this')) {
35701+ throw new Exception("Missing required property");
35702+ }
3430535703 return new This(
3430635704 This::fromThisThis($obj->{'this'})
3430735705 );
@@ -34400,6 +35798,9 @@ class Obj4True {
3440035798 * @throws Exception
3440135799 */
3440235800 public static function from(stdClass $obj): Obj4True {
35801+ if (!property_exists($obj, 'true')) {
35802+ throw new Exception("Missing required property");
35803+ }
3440335804 return new Obj4True(
3440435805 Obj4True::fromTrue($obj->{'true'})
3440535806 );
@@ -34498,6 +35899,9 @@ class TypeClass {
3449835899 * @throws Exception
3449935900 */
3450035901 public static function from(stdClass $obj): TypeClass {
35902+ if (!property_exists($obj, 'type')) {
35903+ throw new Exception("Missing required property");
35904+ }
3450135905 return new TypeClass(
3450235906 TypeClass::fromType($obj->{'type'})
3450335907 );
@@ -34596,6 +36000,9 @@ class PublicClass {
3459636000 * @throws Exception
3459736001 */
3459836002 public static function from(stdClass $obj): PublicClass {
36003+ if (!property_exists($obj, 'public')) {
36004+ throw new Exception("Missing required property");
36005+ }
3459936006 return new PublicClass(
3460036007 PublicClass::fromPublic($obj->{'public'})
3460136008 );
@@ -34694,6 +36101,9 @@ class Quicktype {
3469436101 * @throws Exception
3469536102 */
3469636103 public static function from(stdClass $obj): Quicktype {
36104+ if (!property_exists($obj, 'quicktype')) {
36105+ throw new Exception("Missing required property");
36106+ }
3469736107 return new Quicktype(
3469836108 Quicktype::fromQuicktype($obj->{'quicktype'})
3469936109 );
@@ -34792,6 +36202,9 @@ class Raise {
3479236202 * @throws Exception
3479336203 */
3479436204 public static function from(stdClass $obj): Raise {
36205+ if (!property_exists($obj, 'raise')) {
36206+ throw new Exception("Missing required property");
36207+ }
3479536208 return new Raise(
3479636209 Raise::fromRaise($obj->{'raise'})
3479736210 );
@@ -34890,6 +36303,9 @@ class Range {
3489036303 * @throws Exception
3489136304 */
3489236305 public static function from(stdClass $obj): Range {
36306+ if (!property_exists($obj, 'range')) {
36307+ throw new Exception("Missing required property");
36308+ }
3489336309 return new Range(
3489436310 Range::fromRange($obj->{'range'})
3489536311 );
@@ -34988,6 +36404,9 @@ class ReadonlyClass {
3498836404 * @throws Exception
3498936405 */
3499036406 public static function from(stdClass $obj): ReadonlyClass {
36407+ if (!property_exists($obj, 'readonly')) {
36408+ throw new Exception("Missing required property");
36409+ }
3499136410 return new ReadonlyClass(
3499236411 ReadonlyClass::fromReadonly($obj->{'readonly'})
3499336412 );
@@ -35086,6 +36505,9 @@ class Ref {
3508636505 * @throws Exception
3508736506 */
3508836507 public static function from(stdClass $obj): Ref {
36508+ if (!property_exists($obj, 'ref')) {
36509+ throw new Exception("Missing required property");
36510+ }
3508936511 return new Ref(
3509036512 Ref::fromRef($obj->{'ref'})
3509136513 );
@@ -35184,6 +36606,9 @@ class Register {
3518436606 * @throws Exception
3518536607 */
3518636608 public static function from(stdClass $obj): Register {
36609+ if (!property_exists($obj, 'register')) {
36610+ throw new Exception("Missing required property");
36611+ }
3518736612 return new Register(
3518836613 Register::fromRegister($obj->{'register'})
3518936614 );
@@ -35282,6 +36707,9 @@ class ReinterpretCast {
3528236707 * @throws Exception
3528336708 */
3528436709 public static function from(stdClass $obj): ReinterpretCast {
36710+ if (!property_exists($obj, 'reinterpret_cast')) {
36711+ throw new Exception("Missing required property");
36712+ }
3528536713 return new ReinterpretCast(
3528636714 ReinterpretCast::fromReinterpretCast($obj->{'reinterpret_cast'})
3528736715 );
@@ -35380,6 +36808,9 @@ class Repeat {
3538036808 * @throws Exception
3538136809 */
3538236810 public static function from(stdClass $obj): Repeat {
36811+ if (!property_exists($obj, 'repeat')) {
36812+ throw new Exception("Missing required property");
36813+ }
3538336814 return new Repeat(
3538436815 Repeat::fromRepeat($obj->{'repeat'})
3538536816 );
@@ -35478,6 +36909,9 @@ class RequireClass {
3547836909 * @throws Exception
3547936910 */
3548036911 public static function from(stdClass $obj): RequireClass {
36912+ if (!property_exists($obj, 'require')) {
36913+ throw new Exception("Missing required property");
36914+ }
3548136915 return new RequireClass(
3548236916 RequireClass::fromRequire($obj->{'require'})
3548336917 );
@@ -35576,6 +37010,9 @@ class Required {
3557637010 * @throws Exception
3557737011 */
3557837012 public static function from(stdClass $obj): Required {
37013+ if (!property_exists($obj, 'required')) {
37014+ throw new Exception("Missing required property");
37015+ }
3557937016 return new Required(
3558037017 Required::fromRequired($obj->{'required'})
3558137018 );
@@ -35674,6 +37111,9 @@ class Requires {
3567437111 * @throws Exception
3567537112 */
3567637113 public static function from(stdClass $obj): Requires {
37114+ if (!property_exists($obj, 'requires')) {
37115+ throw new Exception("Missing required property");
37116+ }
3567737117 return new Requires(
3567837118 Requires::fromRequires($obj->{'requires'})
3567937119 );
@@ -35772,6 +37212,9 @@ class Restrict {
3577237212 * @throws Exception
3577337213 */
3577437214 public static function from(stdClass $obj): Restrict {
37215+ if (!property_exists($obj, 'restrict')) {
37216+ throw new Exception("Missing required property");
37217+ }
3577537218 return new Restrict(
3577637219 Restrict::fromRestrict($obj->{'restrict'})
3577737220 );
@@ -35870,6 +37313,9 @@ class Retain {
3587037313 * @throws Exception
3587137314 */
3587237315 public static function from(stdClass $obj): Retain {
37316+ if (!property_exists($obj, 'retain')) {
37317+ throw new Exception("Missing required property");
37318+ }
3587337319 return new Retain(
3587437320 Retain::fromRetain($obj->{'retain'})
3587537321 );
@@ -35968,6 +37414,9 @@ class Rethrows {
3596837414 * @throws Exception
3596937415 */
3597037416 public static function from(stdClass $obj): Rethrows {
37417+ if (!property_exists($obj, 'rethrows')) {
37418+ throw new Exception("Missing required property");
37419+ }
3597137420 return new Rethrows(
3597237421 Rethrows::fromRethrows($obj->{'rethrows'})
3597337422 );
@@ -36066,6 +37515,9 @@ class ReturnClass {
3606637515 * @throws Exception
3606737516 */
3606837517 public static function from(stdClass $obj): ReturnClass {
37518+ if (!property_exists($obj, 'return')) {
37519+ throw new Exception("Missing required property");
37520+ }
3606937521 return new ReturnClass(
3607037522 ReturnClass::fromReturn($obj->{'return'})
3607137523 );
@@ -36164,6 +37616,9 @@ class Right {
3616437616 * @throws Exception
3616537617 */
3616637618 public static function from(stdClass $obj): Right {
37619+ if (!property_exists($obj, 'right')) {
37620+ throw new Exception("Missing required property");
37621+ }
3616737622 return new Right(
3616837623 Right::fromRight($obj->{'right'})
3616937624 );
@@ -36262,6 +37717,9 @@ class Sbyte {
3626237717 * @throws Exception
3626337718 */
3626437719 public static function from(stdClass $obj): Sbyte {
37720+ if (!property_exists($obj, 'sbyte')) {
37721+ throw new Exception("Missing required property");
37722+ }
3626537723 return new Sbyte(
3626637724 Sbyte::fromSbyte($obj->{'sbyte'})
3626737725 );
@@ -36360,6 +37818,9 @@ class Sealed {
3636037818 * @throws Exception
3636137819 */
3636237820 public static function from(stdClass $obj): Sealed {
37821+ if (!property_exists($obj, 'sealed')) {
37822+ throw new Exception("Missing required property");
37823+ }
3636337824 return new Sealed(
3636437825 Sealed::fromSealed($obj->{'sealed'})
3636537826 );
@@ -36458,6 +37919,9 @@ class Sel {
3645837919 * @throws Exception
3645937920 */
3646037921 public static function from(stdClass $obj): Sel {
37922+ if (!property_exists($obj, 'SEL')) {
37923+ throw new Exception("Missing required property");
37924+ }
3646137925 return new Sel(
3646237926 Sel::fromSel($obj->{'SEL'})
3646337927 );
@@ -36556,6 +38020,9 @@ class Select {
3655638020 * @throws Exception
3655738021 */
3655838022 public static function from(stdClass $obj): Select {
38023+ if (!property_exists($obj, 'select')) {
38024+ throw new Exception("Missing required property");
38025+ }
3655938026 return new Select(
3656038027 Select::fromSelect($obj->{'select'})
3656138028 );
@@ -36654,6 +38121,9 @@ class SelfClass {
3665438121 * @throws Exception
3665538122 */
3665638123 public static function from(stdClass $obj): SelfClass {
38124+ if (!property_exists($obj, 'Self')) {
38125+ throw new Exception("Missing required property");
38126+ }
3665738127 return new SelfClass(
3665838128 SelfClass::fromSelf($obj->{'Self'})
3665938129 );
@@ -36752,6 +38222,9 @@ class Serialize {
3675238222 * @throws Exception
3675338223 */
3675438224 public static function from(stdClass $obj): Serialize {
38225+ if (!property_exists($obj, 'serialize')) {
38226+ throw new Exception("Missing required property");
38227+ }
3675538228 return new Serialize(
3675638229 Serialize::fromSerialize($obj->{'serialize'})
3675738230 );
@@ -36850,6 +38323,9 @@ class Set {
3685038323 * @throws Exception
3685138324 */
3685238325 public static function from(stdClass $obj): Set {
38326+ if (!property_exists($obj, 'set')) {
38327+ throw new Exception("Missing required property");
38328+ }
3685338329 return new Set(
3685438330 Set::fromSet($obj->{'set'})
3685538331 );
@@ -36948,6 +38424,9 @@ class Short {
3694838424 * @throws Exception
3694938425 */
3695038426 public static function from(stdClass $obj): Short {
38427+ if (!property_exists($obj, 'short')) {
38428+ throw new Exception("Missing required property");
38429+ }
3695138430 return new Short(
3695238431 Short::fromShort($obj->{'short'})
3695338432 );
@@ -37046,6 +38525,9 @@ class Signed {
3704638525 * @throws Exception
3704738526 */
3704838527 public static function from(stdClass $obj): Signed {
38528+ if (!property_exists($obj, 'signed')) {
38529+ throw new Exception("Missing required property");
38530+ }
3704938531 return new Signed(
3705038532 Signed::fromSigned($obj->{'signed'})
3705138533 );
@@ -37144,6 +38626,9 @@ class Sizeof {
3714438626 * @throws Exception
3714538627 */
3714638628 public static function from(stdClass $obj): Sizeof {
38629+ if (!property_exists($obj, 'sizeof')) {
38630+ throw new Exception("Missing required property");
38631+ }
3714738632 return new Sizeof(
3714838633 Sizeof::fromSizeof($obj->{'sizeof'})
3714938634 );
@@ -37242,6 +38727,9 @@ class Stackalloc {
3724238727 * @throws Exception
3724338728 */
3724438729 public static function from(stdClass $obj): Stackalloc {
38730+ if (!property_exists($obj, 'stackalloc')) {
38731+ throw new Exception("Missing required property");
38732+ }
3724538733 return new Stackalloc(
3724638734 Stackalloc::fromStackalloc($obj->{'stackalloc'})
3724738735 );
@@ -37340,6 +38828,9 @@ class StaticClass {
3734038828 * @throws Exception
3734138829 */
3734238830 public static function from(stdClass $obj): StaticClass {
38831+ if (!property_exists($obj, 'static')) {
38832+ throw new Exception("Missing required property");
38833+ }
3734338834 return new StaticClass(
3734438835 StaticClass::fromStatic($obj->{'static'})
3734538836 );
@@ -37438,6 +38929,9 @@ class StaticAssert {
3743838929 * @throws Exception
3743938930 */
3744038931 public static function from(stdClass $obj): StaticAssert {
38932+ if (!property_exists($obj, 'static_assert')) {
38933+ throw new Exception("Missing required property");
38934+ }
3744138935 return new StaticAssert(
3744238936 StaticAssert::fromStaticAssert($obj->{'static_assert'})
3744338937 );
@@ -37536,6 +39030,9 @@ class StaticCast {
3753639030 * @throws Exception
3753739031 */
3753839032 public static function from(stdClass $obj): StaticCast {
39033+ if (!property_exists($obj, 'static_cast')) {
39034+ throw new Exception("Missing required property");
39035+ }
3753939036 return new StaticCast(
3754039037 StaticCast::fromStaticCast($obj->{'static_cast'})
3754139038 );
@@ -37634,6 +39131,9 @@ class Strictfp {
3763439131 * @throws Exception
3763539132 */
3763639133 public static function from(stdClass $obj): Strictfp {
39134+ if (!property_exists($obj, 'strictfp')) {
39135+ throw new Exception("Missing required property");
39136+ }
3763739137 return new Strictfp(
3763839138 Strictfp::fromStrictfp($obj->{'strictfp'})
3763939139 );
@@ -37732,6 +39232,9 @@ class StringClass {
3773239232 * @throws Exception
3773339233 */
3773439234 public static function from(stdClass $obj): StringClass {
39235+ if (!property_exists($obj, 'string')) {
39236+ throw new Exception("Missing required property");
39237+ }
3773539238 return new StringClass(
3773639239 StringClass::fromString($obj->{'string'})
3773739240 );
@@ -37830,6 +39333,9 @@ class Struct {
3783039333 * @throws Exception
3783139334 */
3783239335 public static function from(stdClass $obj): Struct {
39336+ if (!property_exists($obj, 'struct')) {
39337+ throw new Exception("Missing required property");
39338+ }
3783339339 return new Struct(
3783439340 Struct::fromStruct($obj->{'struct'})
3783539341 );
@@ -37928,6 +39434,9 @@ class Subscript {
3792839434 * @throws Exception
3792939435 */
3793039436 public static function from(stdClass $obj): Subscript {
39437+ if (!property_exists($obj, 'subscript')) {
39438+ throw new Exception("Missing required property");
39439+ }
3793139440 return new Subscript(
3793239441 Subscript::fromSubscript($obj->{'subscript'})
3793339442 );
@@ -38026,6 +39535,9 @@ class Super {
3802639535 * @throws Exception
3802739536 */
3802839537 public static function from(stdClass $obj): Super {
39538+ if (!property_exists($obj, 'super')) {
39539+ throw new Exception("Missing required property");
39540+ }
3802939541 return new Super(
3803039542 Super::fromSuper($obj->{'super'})
3803139543 );
@@ -38124,6 +39636,9 @@ class SwitchClass {
3812439636 * @throws Exception
3812539637 */
3812639638 public static function from(stdClass $obj): SwitchClass {
39639+ if (!property_exists($obj, 'switch')) {
39640+ throw new Exception("Missing required property");
39641+ }
3812739642 return new SwitchClass(
3812839643 SwitchClass::fromSwitch($obj->{'switch'})
3812939644 );
@@ -38222,6 +39737,9 @@ class Symbol {
3822239737 * @throws Exception
3822339738 */
3822439739 public static function from(stdClass $obj): Symbol {
39740+ if (!property_exists($obj, 'symbol')) {
39741+ throw new Exception("Missing required property");
39742+ }
3822539743 return new Symbol(
3822639744 Symbol::fromSymbol($obj->{'symbol'})
3822739745 );
@@ -38320,6 +39838,9 @@ class Synchronized {
3832039838 * @throws Exception
3832139839 */
3832239840 public static function from(stdClass $obj): Synchronized {
39841+ if (!property_exists($obj, 'synchronized')) {
39842+ throw new Exception("Missing required property");
39843+ }
3832339844 return new Synchronized(
3832439845 Synchronized::fromSynchronized($obj->{'synchronized'})
3832539846 );
@@ -38418,6 +39939,9 @@ class System {
3841839939 * @throws Exception
3841939940 */
3842039941 public static function from(stdClass $obj): System {
39942+ if (!property_exists($obj, 'system')) {
39943+ throw new Exception("Missing required property");
39944+ }
3842139945 return new System(
3842239946 System::fromSystem($obj->{'system'})
3842339947 );
@@ -38516,6 +40040,9 @@ class Template {
3851640040 * @throws Exception
3851740041 */
3851840042 public static function from(stdClass $obj): Template {
40043+ if (!property_exists($obj, 'template')) {
40044+ throw new Exception("Missing required property");
40045+ }
3851940046 return new Template(
3852040047 Template::fromTemplate($obj->{'template'})
3852140048 );
@@ -38614,6 +40141,9 @@ class Then {
3861440141 * @throws Exception
3861540142 */
3861640143 public static function from(stdClass $obj): Then {
40144+ if (!property_exists($obj, 'then')) {
40145+ throw new Exception("Missing required property");
40146+ }
3861740147 return new Then(
3861840148 Then::fromThen($obj->{'then'})
3861940149 );
@@ -38712,6 +40242,9 @@ class ThreadLocal {
3871240242 * @throws Exception
3871340243 */
3871440244 public static function from(stdClass $obj): ThreadLocal {
40245+ if (!property_exists($obj, 'thread_local')) {
40246+ throw new Exception("Missing required property");
40247+ }
3871540248 return new ThreadLocal(
3871640249 ThreadLocal::fromThreadLocal($obj->{'thread_local'})
3871740250 );
@@ -38810,6 +40343,9 @@ class ThrowClass {
3881040343 * @throws Exception
3881140344 */
3881240345 public static function from(stdClass $obj): ThrowClass {
40346+ if (!property_exists($obj, 'throw')) {
40347+ throw new Exception("Missing required property");
40348+ }
3881340349 return new ThrowClass(
3881440350 ThrowClass::fromThrow($obj->{'throw'})
3881540351 );
@@ -38908,6 +40444,9 @@ class Throws {
3890840444 * @throws Exception
3890940445 */
3891040446 public static function from(stdClass $obj): Throws {
40447+ if (!property_exists($obj, 'throws')) {
40448+ throw new Exception("Missing required property");
40449+ }
3891140450 return new Throws(
3891240451 Throws::fromThrows($obj->{'throws'})
3891340452 );
@@ -39006,6 +40545,9 @@ class ToJSON {
3900640545 * @throws Exception
3900740546 */
3900840547 public static function from(stdClass $obj): ToJSON {
40548+ if (!property_exists($obj, 'to_json')) {
40549+ throw new Exception("Missing required property");
40550+ }
3900940551 return new ToJSON(
3901040552 ToJSON::fromToJSON($obj->{'to_json'})
3901140553 );
@@ -39104,6 +40646,9 @@ class TopLevelClass {
3910440646 * @throws Exception
3910540647 */
3910640648 public static function from(stdClass $obj): TopLevelClass {
40649+ if (!property_exists($obj, 'top_level')) {
40650+ throw new Exception("Missing required property");
40651+ }
3910740652 return new TopLevelClass(
3910840653 TopLevelClass::fromTopLevel($obj->{'top_level'})
3910940654 );
@@ -39202,6 +40747,9 @@ class Transient {
3920240747 * @throws Exception
3920340748 */
3920440749 public static function from(stdClass $obj): Transient {
40750+ if (!property_exists($obj, 'transient')) {
40751+ throw new Exception("Missing required property");
40752+ }
3920540753 return new Transient(
3920640754 Transient::fromTransient($obj->{'transient'})
3920740755 );
@@ -39300,6 +40848,9 @@ class TrueClass {
3930040848 * @throws Exception
3930140849 */
3930240850 public static function from(stdClass $obj): TrueClass {
40851+ if (!property_exists($obj, 'True')) {
40852+ throw new Exception("Missing required property");
40853+ }
3930340854 return new TrueClass(
3930440855 TrueClass::fromTrue($obj->{'True'})
3930540856 );
@@ -39398,6 +40949,9 @@ class TryClass {
3939840949 * @throws Exception
3939940950 */
3940040951 public static function from(stdClass $obj): TryClass {
40952+ if (!property_exists($obj, 'try')) {
40953+ throw new Exception("Missing required property");
40954+ }
3940140955 return new TryClass(
3940240956 TryClass::fromTry($obj->{'try'})
3940340957 );
@@ -39496,6 +41050,9 @@ class Type {
3949641050 * @throws Exception
3949741051 */
3949841052 public static function from(stdClass $obj): Type {
41053+ if (!property_exists($obj, 'Type')) {
41054+ throw new Exception("Missing required property");
41055+ }
3949941056 return new Type(
3950041057 Type::fromType($obj->{'Type'})
3950141058 );
@@ -39594,6 +41151,9 @@ class Typealias {
3959441151 * @throws Exception
3959541152 */
3959641153 public static function from(stdClass $obj): Typealias {
41154+ if (!property_exists($obj, 'typealias')) {
41155+ throw new Exception("Missing required property");
41156+ }
3959741157 return new Typealias(
3959841158 Typealias::fromTypealias($obj->{'typealias'})
3959941159 );
@@ -39692,6 +41252,9 @@ class Typedef {
3969241252 * @throws Exception
3969341253 */
3969441254 public static function from(stdClass $obj): Typedef {
41255+ if (!property_exists($obj, 'typedef')) {
41256+ throw new Exception("Missing required property");
41257+ }
3969541258 return new Typedef(
3969641259 Typedef::fromTypedef($obj->{'typedef'})
3969741260 );
@@ -39790,6 +41353,9 @@ class Typeid {
3979041353 * @throws Exception
3979141354 */
3979241355 public static function from(stdClass $obj): Typeid {
41356+ if (!property_exists($obj, 'typeid')) {
41357+ throw new Exception("Missing required property");
41358+ }
3979341359 return new Typeid(
3979441360 Typeid::fromTypeid($obj->{'typeid'})
3979541361 );
@@ -39888,6 +41454,9 @@ class Typename {
3988841454 * @throws Exception
3988941455 */
3989041456 public static function from(stdClass $obj): Typename {
41457+ if (!property_exists($obj, 'typename')) {
41458+ throw new Exception("Missing required property");
41459+ }
3989141460 return new Typename(
3989241461 Typename::fromTypename($obj->{'typename'})
3989341462 );
@@ -39986,6 +41555,9 @@ class Typeof {
3998641555 * @throws Exception
3998741556 */
3998841557 public static function from(stdClass $obj): Typeof {
41558+ if (!property_exists($obj, 'typeof')) {
41559+ throw new Exception("Missing required property");
41560+ }
3998941561 return new Typeof(
3999041562 Typeof::fromTypeof($obj->{'typeof'})
3999141563 );
@@ -40084,6 +41656,9 @@ class Uint {
4008441656 * @throws Exception
4008541657 */
4008641658 public static function from(stdClass $obj): Uint {
41659+ if (!property_exists($obj, 'uint')) {
41660+ throw new Exception("Missing required property");
41661+ }
4008741662 return new Uint(
4008841663 Uint::fromUint($obj->{'uint'})
4008941664 );
@@ -40182,6 +41757,9 @@ class Ulong {
4018241757 * @throws Exception
4018341758 */
4018441759 public static function from(stdClass $obj): Ulong {
41760+ if (!property_exists($obj, 'ulong')) {
41761+ throw new Exception("Missing required property");
41762+ }
4018541763 return new Ulong(
4018641764 Ulong::fromUlong($obj->{'ulong'})
4018741765 );
@@ -40280,6 +41858,9 @@ class Unchecked {
4028041858 * @throws Exception
4028141859 */
4028241860 public static function from(stdClass $obj): Unchecked {
41861+ if (!property_exists($obj, 'unchecked')) {
41862+ throw new Exception("Missing required property");
41863+ }
4028341864 return new Unchecked(
4028441865 Unchecked::fromUnchecked($obj->{'unchecked'})
4028541866 );
@@ -40378,6 +41959,9 @@ class Undefined {
4037841959 * @throws Exception
4037941960 */
4038041961 public static function from(stdClass $obj): Undefined {
41962+ if (!property_exists($obj, 'undefined')) {
41963+ throw new Exception("Missing required property");
41964+ }
4038141965 return new Undefined(
4038241966 Undefined::fromUndefined($obj->{'undefined'})
4038341967 );
@@ -41536,6 +43120,69 @@ class Obj5 {
4153643120 * @throws Exception
4153743121 */
4153843122 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+ }
4153943186 return new Obj5(
4154043187 Obj5::fromDummy($obj->{'dummy'})
4154143188 ,Obj5::fromUnion($obj->{'union'})
@@ -41674,6 +43321,9 @@ class Union {
4167443321 * @throws Exception
4167543322 */
4167643323 public static function from(stdClass $obj): Union {
43324+ if (!property_exists($obj, 'union')) {
43325+ throw new Exception("Missing required property");
43326+ }
4167743327 return new Union(
4167843328 Union::fromUnion($obj->{'union'})
4167943329 );
@@ -41772,6 +43422,9 @@ class Unowned {
4177243422 * @throws Exception
4177343423 */
4177443424 public static function from(stdClass $obj): Unowned {
43425+ if (!property_exists($obj, 'unowned')) {
43426+ throw new Exception("Missing required property");
43427+ }
4177543428 return new Unowned(
4177643429 Unowned::fromUnowned($obj->{'unowned'})
4177743430 );
@@ -41870,6 +43523,9 @@ class Unsafe {
4187043523 * @throws Exception
4187143524 */
4187243525 public static function from(stdClass $obj): Unsafe {
43526+ if (!property_exists($obj, 'unsafe')) {
43527+ throw new Exception("Missing required property");
43528+ }
4187343529 return new Unsafe(
4187443530 Unsafe::fromUnsafe($obj->{'unsafe'})
4187543531 );
@@ -41968,6 +43624,9 @@ class Unsigned {
4196843624 * @throws Exception
4196943625 */
4197043626 public static function from(stdClass $obj): Unsigned {
43627+ if (!property_exists($obj, 'unsigned')) {
43628+ throw new Exception("Missing required property");
43629+ }
4197143630 return new Unsigned(
4197243631 Unsigned::fromUnsigned($obj->{'unsigned'})
4197343632 );
@@ -42066,6 +43725,9 @@ class Ushort {
4206643725 * @throws Exception
4206743726 */
4206843727 public static function from(stdClass $obj): Ushort {
43728+ if (!property_exists($obj, 'ushort')) {
43729+ throw new Exception("Missing required property");
43730+ }
4206943731 return new Ushort(
4207043732 Ushort::fromUshort($obj->{'ushort'})
4207143733 );
@@ -42164,6 +43826,9 @@ class Using {
4216443826 * @throws Exception
4216543827 */
4216643828 public static function from(stdClass $obj): Using {
43829+ if (!property_exists($obj, 'using')) {
43830+ throw new Exception("Missing required property");
43831+ }
4216743832 return new Using(
4216843833 Using::fromUsing($obj->{'using'})
4216943834 );
@@ -42262,6 +43927,9 @@ class VarClass {
4226243927 * @throws Exception
4226343928 */
4226443929 public static function from(stdClass $obj): VarClass {
43930+ if (!property_exists($obj, 'var')) {
43931+ throw new Exception("Missing required property");
43932+ }
4226543933 return new VarClass(
4226643934 VarClass::fromVar($obj->{'var'})
4226743935 );
@@ -42360,6 +44028,9 @@ class Virtual {
4236044028 * @throws Exception
4236144029 */
4236244030 public static function from(stdClass $obj): Virtual {
44031+ if (!property_exists($obj, 'virtual')) {
44032+ throw new Exception("Missing required property");
44033+ }
4236344034 return new Virtual(
4236444035 Virtual::fromVirtual($obj->{'virtual'})
4236544036 );
@@ -42458,6 +44129,9 @@ class VoidClass {
4245844129 * @throws Exception
4245944130 */
4246044131 public static function from(stdClass $obj): VoidClass {
44132+ if (!property_exists($obj, 'void')) {
44133+ throw new Exception("Missing required property");
44134+ }
4246144135 return new VoidClass(
4246244136 VoidClass::fromVoid($obj->{'void'})
4246344137 );
@@ -42556,6 +44230,9 @@ class Volatile {
4255644230 * @throws Exception
4255744231 */
4255844232 public static function from(stdClass $obj): Volatile {
44233+ if (!property_exists($obj, 'volatile')) {
44234+ throw new Exception("Missing required property");
44235+ }
4255944236 return new Volatile(
4256044237 Volatile::fromVolatile($obj->{'volatile'})
4256144238 );
@@ -42654,6 +44331,9 @@ class WcharT {
4265444331 * @throws Exception
4265544332 */
4265644333 public static function from(stdClass $obj): WcharT {
44334+ if (!property_exists($obj, 'wchar_t')) {
44335+ throw new Exception("Missing required property");
44336+ }
4265744337 return new WcharT(
4265844338 WcharT::fromWcharT($obj->{'wchar_t'})
4265944339 );
@@ -42752,6 +44432,9 @@ class Weak {
4275244432 * @throws Exception
4275344433 */
4275444434 public static function from(stdClass $obj): Weak {
44435+ if (!property_exists($obj, 'weak')) {
44436+ throw new Exception("Missing required property");
44437+ }
4275544438 return new Weak(
4275644439 Weak::fromWeak($obj->{'weak'})
4275744440 );
@@ -42850,6 +44533,9 @@ class Where {
4285044533 * @throws Exception
4285144534 */
4285244535 public static function from(stdClass $obj): Where {
44536+ if (!property_exists($obj, 'where')) {
44537+ throw new Exception("Missing required property");
44538+ }
4285344539 return new Where(
4285444540 Where::fromWhere($obj->{'where'})
4285544541 );
@@ -42948,6 +44634,9 @@ class WhileClass {
4294844634 * @throws Exception
4294944635 */
4295044636 public static function from(stdClass $obj): WhileClass {
44637+ if (!property_exists($obj, 'while')) {
44638+ throw new Exception("Missing required property");
44639+ }
4295144640 return new WhileClass(
4295244641 WhileClass::fromWhile($obj->{'while'})
4295344642 );
@@ -43046,6 +44735,9 @@ class WillSet {
4304644735 * @throws Exception
4304744736 */
4304844737 public static function from(stdClass $obj): WillSet {
44738+ if (!property_exists($obj, 'willSet')) {
44739+ throw new Exception("Missing required property");
44740+ }
4304944741 return new WillSet(
4305044742 WillSet::fromWillSet($obj->{'willSet'})
4305144743 );
@@ -43144,6 +44836,9 @@ class With {
4314444836 * @throws Exception
4314544837 */
4314644838 public static function from(stdClass $obj): With {
44839+ if (!property_exists($obj, 'with')) {
44840+ throw new Exception("Missing required property");
44841+ }
4314744842 return new With(
4314844843 With::fromWith($obj->{'with'})
4314944844 );
@@ -43242,6 +44937,9 @@ class XorClass {
4324244937 * @throws Exception
4324344938 */
4324444939 public static function from(stdClass $obj): XorClass {
44940+ if (!property_exists($obj, 'xor')) {
44941+ throw new Exception("Missing required property");
44942+ }
4324544943 return new XorClass(
4324644944 XorClass::fromXor($obj->{'xor'})
4324744945 );
@@ -43340,6 +45038,9 @@ class XorEq {
4334045038 * @throws Exception
4334145039 */
4334245040 public static function from(stdClass $obj): XorEq {
45041+ if (!property_exists($obj, 'xor_eq')) {
45042+ throw new Exception("Missing required property");
45043+ }
4334345044 return new XorEq(
4334445045 XorEq::fromXorEq($obj->{'xor_eq'})
4334545046 );
@@ -43438,6 +45139,9 @@ class Yes {
4343845139 * @throws Exception
4343945140 */
4344045141 public static function from(stdClass $obj): Yes {
45142+ if (!property_exists($obj, 'YES')) {
45143+ throw new Exception("Missing required property");
45144+ }
4344145145 return new Yes(
4344245146 Yes::fromYes($obj->{'YES'})
4344345147 );
@@ -43536,6 +45240,9 @@ class YieldClass {
4353645240 * @throws Exception
4353745241 */
4353845242 public static function from(stdClass $obj): YieldClass {
45243+ if (!property_exists($obj, 'yield')) {
45244+ throw new Exception("Missing required property");
45245+ }
4353945246 return new YieldClass(
4354045247 YieldClass::fromYield($obj->{'yield'})
4354145248 );
Test case

test/inputs/json/priority/kotlin-enum-class-case-collision.json

1 generated file · +3 −0
Mphpdefault / TopLevel.php+3 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'category')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromCategory($obj->{'category'})
9093 );
Test case

test/inputs/json/priority/list.json

1 generated file · +6 −0
Mphpdefault / TopLevel.php+6 −0
@@ -147,6 +147,12 @@ class TopLevel {
147147 * @throws Exception
148148 */
149149 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+ }
150156 return new TopLevel(
151157 TopLevel::fromData($obj->{'data'})
152158 ,TopLevel::fromNext($obj->{'next'})
Test case

test/inputs/json/priority/name-style.json

1 generated file · +21 −0
Mphpdefault / TopLevel.php+21 −0
@@ -396,6 +396,27 @@ class TopLevel {
396396 * @throws Exception
397397 */
398398 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+ }
399420 return new TopLevel(
400421 TopLevel::fromAnEasyOne($obj->{'anEasyOne'})
401422 ,TopLevel::fromIsMNISTLetter($obj->{'isMNISTLetter'})
Test case

test/inputs/json/priority/nbl-stats.json

1 generated file · +588 −0
Mphpdefault / TopLevel.php+588 −0
@@ -1193,6 +1193,66 @@ class TopLevel {
11931193 * @throws Exception
11941194 */
11951195 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+ }
11961256 return new TopLevel(
11971257 TopLevel::fromAttendance($obj->{'attendance'})
11981258 ,TopLevel::fromClock($obj->{'clock'})
@@ -1913,6 +1973,39 @@ class Othermatch {
19131973 * @throws Exception
19141974 */
19151975 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+ }
19162009 return new Othermatch(
19172010 Othermatch::fromClock($obj->{'clock'})
19182011 ,Othermatch::fromCompetitionName($obj->{'competitionName'})
@@ -2232,6 +2325,18 @@ class Team {
22322325 * @throws Exception
22332326 */
22342327 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+ }
22352340 return new Team(
22362341 Team::fromTeamCode($obj->{'teamCode'})
22372342 ,Team::fromTeamCodeInternational($obj->{'teamCodeInternational'})
@@ -3629,6 +3734,51 @@ class Pbp {
36293734 * @throws Exception
36303735 */
36313736 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+ }
36323782 return new Pbp(
36333783 Pbp::fromActionType($obj->{'actionType'})
36343784 ,Pbp::fromFamilyName($obj->{'familyName'})
@@ -5297,6 +5447,15 @@ class Scorer {
52975447 * @throws Exception
52985448 */
52995449 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+ }
53005459 return new Scorer(
53015460 Scorer::fromFamilyName($obj->{'familyName'})
53025461 ,Scorer::fromFamilyNameInitial($obj->{'familyNameInitial'})
@@ -5538,6 +5697,15 @@ class Time {
55385697 * @throws Exception
55395698 */
55405699 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+ }
55415709 return new Time(
55425710 Time::fromGt($obj->{'gt'})
55435711 ,Time::fromPer($obj->{'per'})
@@ -9008,6 +9176,201 @@ class Tm {
90089176 * @throws Exception
90099177 */
90109178 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+ }
90119374 return new Tm(
90129375 Tm::fromCode($obj->{'code'})
90139376 ,Tm::fromCodeInternational($obj->{'codeInternational'})
@@ -9503,6 +9866,21 @@ class Lds {
95039866 * @throws Exception
95049867 */
95059868 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+ }
95069884 return new Lds(
95079885 Lds::fromSAssists($obj->{'sAssists'})
95089886 ,Lds::fromSBlocks($obj->{'sBlocks'})
@@ -9610,6 +9988,9 @@ class SBlocks {
96109988 * @throws Exception
96119989 */
96129990 public static function from(stdClass $obj): SBlocks {
9991+ if (!property_exists($obj, '1')) {
9992+ throw new Exception("Missing required property");
9993+ }
96139994 return new SBlocks(
96149995 SBlocks::fromThe1($obj->{'1'})
96159996 );
@@ -12304,6 +12685,150 @@ class Pl {
1230412685 * @throws Exception
1230512686 */
1230612687 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+ }
1230712832 return new Pl(
1230812833 Pl::fromActive($obj->{'active'})
1230912834 ,Pl::fromCaptain($obj->{'captain'})
@@ -12656,6 +13181,18 @@ class Comp {
1265613181 * @throws Exception
1265713182 */
1265813183 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+ }
1265913196 return new Comp(
1266013197 Comp::fromSAssistsAverage($obj->{'sAssistsAverage'})
1266113198 ,Comp::fromSMinutesAverage($obj->{'sMinutesAverage'})
@@ -13335,6 +13872,42 @@ class Shot {
1333513872 * @throws Exception
1333613873 */
1333713874 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+ }
1333813911 return new Shot(
1333913912 Shot::fromActionType($obj->{'actionType'})
1334013913 ,Shot::fromP($obj->{'p'})
@@ -13791,6 +14364,21 @@ class Totallds {
1379114364 * @throws Exception
1379214365 */
1379314366 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+ }
1379414382 return new Totallds(
1379514383 Totallds::fromSAssists($obj->{'sAssists'})
1379614384 ,Totallds::fromSBlocks($obj->{'sBlocks'})
Test case

test/inputs/json/priority/nested-objects.json

1 generated file · +6 −0
Mphpdefault / TopLevel.php+6 −0
@@ -170,6 +170,12 @@ class TopLevel {
170170 * @throws Exception
171171 */
172172 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+ }
173179 return new TopLevel(
174180 TopLevel::fromA($obj->{'a'})
175181 ,TopLevel::fromB($obj->{'b'})
Test case

test/inputs/json/priority/nst-test-suite.json

1 generated file · +318 −0
Mphpdefault / TopLevel.php+318 −0
@@ -5977,6 +5977,285 @@ class TopLevel {
59775977 * @throws Exception
59785978 */
59795979 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+ }
59806259 return new TopLevel(
59816260 TopLevel::fromTopLevelYNumber0E1JSON($obj->{'y_number_0e1.json'})
59826261 ,TopLevel::fromYArrayArraysWithSpacesJSON($obj->{'y_array_arraysWithSpaces.json'})
@@ -6304,6 +6583,9 @@ class YObjectBasicJSON {
63046583 * @throws Exception
63056584 */
63066585 public static function from(stdClass $obj): YObjectBasicJSON {
6586+ if (!property_exists($obj, 'asd')) {
6587+ throw new Exception("Missing required property");
6588+ }
63076589 return new YObjectBasicJSON(
63086590 YObjectBasicJSON::fromAsd($obj->{'asd'})
63096591 );
@@ -6402,6 +6684,9 @@ class YObjectEmptyKeyJSON {
64026684 * @throws Exception
64036685 */
64046686 public static function from(stdClass $obj): YObjectEmptyKeyJSON {
6687+ if (!property_exists($obj, '')) {
6688+ throw new Exception("Missing required property");
6689+ }
64056690 return new YObjectEmptyKeyJSON(
64066691 YObjectEmptyKeyJSON::fromEmpty($obj->{''})
64076692 );
@@ -6500,6 +6785,9 @@ class YObjectEscapedNullInKeyJSON {
65006785 * @throws Exception
65016786 */
65026787 public static function from(stdClass $obj): YObjectEscapedNullInKeyJSON {
6788+ if (!property_exists($obj, 'foobar')) {
6789+ throw new Exception("Missing required property");
6790+ }
65036791 return new YObjectEscapedNullInKeyJSON(
65046792 YObjectEscapedNullInKeyJSON::fromFooBar($obj->{'foobar'})
65056793 );
@@ -6650,6 +6938,12 @@ class YObjectExtremeNumbersJSON {
66506938 * @throws Exception
66516939 */
66526940 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+ }
66536947 return new YObjectExtremeNumbersJSON(
66546948 YObjectExtremeNumbersJSON::fromMax($obj->{'max'})
66556949 ,YObjectExtremeNumbersJSON::fromMin($obj->{'min'})
@@ -6802,6 +7096,12 @@ class YObjectJSON {
68027096 * @throws Exception
68037097 */
68047098 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+ }
68057105 return new YObjectJSON(
68067106 YObjectJSON::fromAsd($obj->{'asd'})
68077107 ,YObjectJSON::fromDfg($obj->{'dfg'})
@@ -6966,6 +7266,12 @@ class YObjectLongStringsJSON {
69667266 * @throws Exception
69677267 */
69687268 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+ }
69697275 return new YObjectLongStringsJSON(
69707276 YObjectLongStringsJSON::fromID($obj->{'id'})
69717277 ,YObjectLongStringsJSON::fromX($obj->{'x'})
@@ -7066,6 +7372,9 @@ class X {
70667372 * @throws Exception
70677373 */
70687374 public static function from(stdClass $obj): X {
7375+ if (!property_exists($obj, 'id')) {
7376+ throw new Exception("Missing required property");
7377+ }
70697378 return new X(
70707379 X::fromID($obj->{'id'})
70717380 );
@@ -7175,6 +7484,9 @@ class YObjectSimpleJSON {
71757484 * @throws Exception
71767485 */
71777486 public static function from(stdClass $obj): YObjectSimpleJSON {
7487+ if (!property_exists($obj, 'a')) {
7488+ throw new Exception("Missing required property");
7489+ }
71787490 return new YObjectSimpleJSON(
71797491 YObjectSimpleJSON::fromA($obj->{'a'})
71807492 );
@@ -7273,6 +7585,9 @@ class YObjectStringUnicodeJSON {
72737585 * @throws Exception
72747586 */
72757587 public static function from(stdClass $obj): YObjectStringUnicodeJSON {
7588+ if (!property_exists($obj, 'title')) {
7589+ throw new Exception("Missing required property");
7590+ }
72767591 return new YObjectStringUnicodeJSON(
72777592 YObjectStringUnicodeJSON::fromTitle($obj->{'title'})
72787593 );
@@ -7371,6 +7686,9 @@ class YObjectWithNewlinesJSON {
73717686 * @throws Exception
73727687 */
73737688 public static function from(stdClass $obj): YObjectWithNewlinesJSON {
7689+ if (!property_exists($obj, 'a')) {
7690+ throw new Exception("Missing required property");
7691+ }
73747692 return new YObjectWithNewlinesJSON(
73757693 YObjectWithNewlinesJSON::fromA($obj->{'a'})
73767694 );
Test case

test/inputs/json/priority/number-map.json

1 generated file · +3 −0
Mphpdefault / TopLevel.php+3 −0
@@ -101,6 +101,9 @@ class TopLevel {
101101 * @throws Exception
102102 */
103103 public static function from(stdClass $obj): TopLevel {
104+ if (!property_exists($obj, 'foo')) {
105+ throw new Exception("Missing required property");
106+ }
104107 return new TopLevel(
105108 TopLevel::fromFoo($obj->{'foo'})
106109 );
Test case

test/inputs/json/priority/omit-empty.json

1 generated file · +6 −0
Mphpdefault / TopLevel.php+6 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'results')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromResults($obj->{'results'})
101104 );
@@ -249,6 +252,9 @@ class Result {
249252 * @throws Exception
250253 */
251254 public static function from(stdClass $obj): Result {
255+ if (!property_exists($obj, 'age')) {
256+ throw new Exception("Missing required property");
257+ }
252258 return new Result(
253259 Result::fromAge($obj->{'age'})
254260 ,Result::fromName($obj->{'name'})
Test case

test/inputs/json/priority/php-mixed-union.json

1 generated file · +6 −0
Mphpdefault / TopLevel.php+6 −0
@@ -140,6 +140,9 @@ class TopLevel {
140140 * @throws Exception
141141 */
142142 public static function from(stdClass $obj): TopLevel {
143+ if (!property_exists($obj, 'mixed')) {
144+ throw new Exception("Missing required property");
145+ }
143146 return new TopLevel(
144147 TopLevel::fromMixed($obj->{'mixed'})
145148 );
@@ -238,6 +241,9 @@ class MixedClass {
238241 * @throws Exception
239242 */
240243 public static function from(stdClass $obj): MixedClass {
244+ if (!property_exists($obj, 'nested')) {
245+ throw new Exception("Missing required property");
246+ }
241247 return new MixedClass(
242248 MixedClass::fromNested($obj->{'nested'})
243249 );
Test case

test/inputs/json/priority/php-validation.json

1 generated file · +15 −0
Mphpdefault / TopLevel.php+15 −0
@@ -306,6 +306,21 @@ class TopLevel {
306306 * @throws Exception
307307 */
308308 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+ }
309324 return new TopLevel(
310325 TopLevel::fromBoolean($obj->{'boolean'})
311326 ,TopLevel::fromInteger($obj->{'integer'})
Test case

test/inputs/json/priority/recursive.json

1 generated file · +213 −0
Mphpdefault / TopLevel.php+213 −0
@@ -566,6 +566,36 @@ class TopLevel {
566566 * @throws Exception
567567 */
568568 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+ }
569599 return new TopLevel(
570600 TopLevel::fromCategory($obj->{'category'})
571601 ,TopLevel::fromDetails($obj->{'details'})
@@ -1059,6 +1089,30 @@ class Category {
10591089 * @throws Exception
10601090 */
10611091 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+ }
10621116 return new Category(
10631117 Category::fromConcatenatecategoryname($obj->{'concatenatecategoryname'})
10641118 ,Category::fromHasoffer($obj->{'hasoffer'})
@@ -1172,6 +1226,9 @@ class LinkElement {
11721226 * @throws Exception
11731227 */
11741228 public static function from(stdClass $obj): LinkElement {
1229+ if (!property_exists($obj, 'link')) {
1230+ throw new Exception("Missing required property");
1231+ }
11751232 return new LinkElement(
11761233 LinkElement::fromLink($obj->{'link'})
11771234 );
@@ -1322,6 +1379,12 @@ class LinkLink {
13221379 * @throws Exception
13231380 */
13241381 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+ }
13251388 return new LinkLink(
13261389 LinkLink::fromType($obj->{'type'})
13271390 ,LinkLink::fromURL($obj->{'url'})
@@ -1422,6 +1485,9 @@ class CategoryThumbnail {
14221485 * @throws Exception
14231486 */
14241487 public static function from(stdClass $obj): CategoryThumbnail {
1488+ if (!property_exists($obj, 'url')) {
1489+ throw new Exception("Missing required property");
1490+ }
14251491 return new CategoryThumbnail(
14261492 CategoryThumbnail::fromURL($obj->{'url'})
14271493 );
@@ -1833,6 +1899,27 @@ class Details {
18331899 * @throws Exception
18341900 */
18351901 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+ }
18361923 return new Details(
18371924 Details::fromApplicationid($obj->{'applicationid'})
18381925 ,Details::fromApplicationversion($obj->{'applicationversion'})
@@ -2465,6 +2552,39 @@ class Date {
24652552 * @throws Exception
24662553 */
24672554 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+ }
24682588 return new Date(
24692589 Date::fromDay($obj->{'day'})
24702590 ,Date::fromEonandyear($obj->{'eonandyear'})
@@ -2583,6 +2703,9 @@ class Eonandyear {
25832703 * @throws Exception
25842704 */
25852705 public static function from(stdClass $obj): Eonandyear {
2706+ if (!property_exists($obj, 'lowestsetbit')) {
2707+ throw new Exception("Missing required property");
2708+ }
25862709 return new Eonandyear(
25872710 Eonandyear::fromLowestsetbit($obj->{'lowestsetbit'})
25882711 );
@@ -2785,6 +2908,15 @@ class Xmlschematype {
27852908 * @throws Exception
27862909 */
27872910 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+ }
27882920 return new Xmlschematype(
27892921 Xmlschematype::fromLocalpart($obj->{'localpart'})
27902922 ,Xmlschematype::fromNamespaceuri($obj->{'namespaceuri'})
@@ -2888,6 +3020,9 @@ class ProductElement {
28883020 * @throws Exception
28893021 */
28903022 public static function from(stdClass $obj): ProductElement {
3023+ if (!property_exists($obj, 'product')) {
3024+ throw new Exception("Missing required property");
3025+ }
28913026 return new ProductElement(
28923027 ProductElement::fromProduct($obj->{'product'})
28933028 );
@@ -3782,6 +3917,54 @@ class ProductProduct {
37823917 * @throws Exception
37833918 */
37843919 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+ }
37853968 return new ProductProduct(
37863969 ProductProduct::fromCategoryid($obj->{'categoryid'})
37873970 ,ProductProduct::fromCurrency($obj->{'currency'})
@@ -3910,6 +4093,9 @@ class Currency {
39104093 * @throws Exception
39114094 */
39124095 public static function from(stdClass $obj): Currency {
4096+ if (!property_exists($obj, 'abbreviation')) {
4097+ throw new Exception("Missing required property");
4098+ }
39134099 return new Currency(
39144100 Currency::fromAbbreviation($obj->{'abbreviation'})
39154101 );
@@ -4009,6 +4195,9 @@ class Rating {
40094195 * @throws Exception
40104196 */
40114197 public static function from(stdClass $obj): Rating {
4198+ if (!property_exists($obj, 'useraveragerating')) {
4199+ throw new Exception("Missing required property");
4200+ }
40124201 return new Rating(
40134202 Rating::fromUseraveragerating($obj->{'useraveragerating'})
40144203 );
@@ -4223,6 +4412,15 @@ class Useraveragerating {
42234412 * @throws Exception
42244413 */
42254414 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+ }
42264424 return new Useraveragerating(
42274425 Useraveragerating::fromLinks($obj->{'links'})
42284426 ,Useraveragerating::fromNumcomments($obj->{'numcomments'})
@@ -4337,6 +4535,9 @@ class Specification {
43374535 * @throws Exception
43384536 */
43394537 public static function from(stdClass $obj): Specification {
4538+ if (!property_exists($obj, 'links')) {
4539+ throw new Exception("Missing required property");
4540+ }
43404541 return new Specification(
43414542 Specification::fromLinks($obj->{'links'})
43424543 );
@@ -4436,6 +4637,9 @@ class Format {
44364637 * @throws Exception
44374638 */
44384639 public static function from(stdClass $obj): Format {
4640+ if (!property_exists($obj, 'formats')) {
4641+ throw new Exception("Missing required property");
4642+ }
44394643 return new Format(
44404644 Format::fromFormats($obj->{'formats'})
44414645 );
@@ -4712,6 +4916,15 @@ class FormatsClass {
47124916 * @throws Exception
47134917 */
47144918 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+ }
47154928 return new FormatsClass(
47164929 FormatsClass::fromFormats($obj->{'formats'})
47174930 ,FormatsClass::fromHeight($obj->{'height'})
Test case

test/inputs/json/priority/simple-identifiers.json

1 generated file · +27 −0
Mphpdefault / TopLevel.php+27 −0
@@ -500,6 +500,33 @@ class TopLevel {
500500 * @throws Exception
501501 */
502502 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+ }
503530 return new TopLevel(
504531 TopLevel::fromContinue($obj->{'continue'})
505532 ,TopLevel::fromEmpty($obj->{''})
Test case

test/inputs/json/priority/union-constructor-clash.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -171,6 +171,12 @@ class TopLevel {
171171 * @throws Exception
172172 */
173173 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+ }
174180 return new TopLevel(
175181 TopLevel::fromBoolInUnion($obj->{'BoolInUnion'})
176182 ,TopLevel::fromUnion($obj->{'union'})
@@ -271,6 +277,9 @@ class BoolInUnion {
271277 * @throws Exception
272278 */
273279 public static function from(stdClass $obj): BoolInUnion {
280+ if (!property_exists($obj, 'a')) {
281+ throw new Exception("Missing required property");
282+ }
274283 return new BoolInUnion(
275284 BoolInUnion::fromA($obj->{'a'})
276285 );
Test case

test/inputs/json/priority/unions.json

1 generated file · +12 −0
Mphpdefault / TopLevel.php+12 −0
@@ -303,6 +303,15 @@ class TopLevel {
303303 * @throws Exception
304304 */
305305 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+ }
306315 return new TopLevel(
307316 TopLevel::fromX($obj->{'x'})
308317 ,TopLevel::fromY($obj->{'y'})
@@ -405,6 +414,9 @@ class Z {
405414 * @throws Exception
406415 */
407416 public static function from(stdClass $obj): Z {
417+ if (!property_exists($obj, 'a')) {
418+ throw new Exception("Missing required property");
419+ }
408420 return new Z(
409421 Z::fromA($obj->{'a'})
410422 );
Test case

test/inputs/json/priority/url.json

1 generated file · +6 −0
Mphpdefault / TopLevel.php+6 −0
@@ -136,6 +136,12 @@ class TopLevel {
136136 * @throws Exception
137137 */
138138 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+ }
139145 return new TopLevel(
140146 TopLevel::fromFromURL($obj->{'fromURL'})
141147 ,TopLevel::purpleFromURL($obj->{'url'})
Test case

test/inputs/json/priority/uuids.json

1 generated file · +18 −0
Mphpdefault / TopLevel.php+18 −0
@@ -364,6 +364,24 @@ class TopLevel {
364364 * @throws Exception
365365 */
366366 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+ }
367385 return new TopLevel(
368386 TopLevel::fromBooleanValue($obj->{'booleanValue'})
369387 ,TopLevel::fromDoubleValue($obj->{'doubleValue'})
Test case

test/inputs/json/samples/bitcoin-block.json

1 generated file · +15 −0
Mphpdefault / TopLevel.php+15 −0
@@ -306,6 +306,21 @@ class TopLevel {
306306 * @throws Exception
307307 */
308308 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+ }
309324 return new TopLevel(
310325 TopLevel::fromBlockIndex($obj->{'block_index'})
311326 ,TopLevel::fromHash($obj->{'hash'})
Test case

test/inputs/json/samples/getting-started.json

1 generated file · +6 −0
Mphpdefault / TopLevel.php+6 −0
@@ -150,6 +150,12 @@ class TopLevel {
150150 * @throws Exception
151151 */
152152 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+ }
153159 return new TopLevel(
154160 TopLevel::fromGreeting($obj->{'greeting'})
155161 ,TopLevel::fromInstructions($obj->{'instructions'})
Test case

test/inputs/json/samples/github-events.json

1 generated file · +648 −0
Mphpdefault / TopLevel.php+648 −0
@@ -469,6 +469,27 @@ class TopLevel {
469469 * @throws Exception
470470 */
471471 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+ }
472493 return new TopLevel(
473494 TopLevel::fromActor($obj->{'actor'})
474495 ,TopLevel::fromCreatedAt($obj->{'created_at'})
@@ -851,6 +872,21 @@ class Actor {
851872 * @throws Exception
852873 */
853874 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+ }
854890 return new Actor(
855891 Actor::fromAvatarURL($obj->{'avatar_url'})
856892 ,Actor::fromDisplayLogin($obj->{'display_login'})
@@ -2421,6 +2457,30 @@ class Comment {
24212457 * @throws Exception
24222458 */
24232459 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+ }
24242484 return new Comment(
24252485 Comment::fromBody($obj->{'body'})
24262486 ,Comment::fromCreatedAt($obj->{'created_at'})
@@ -3366,6 +3426,57 @@ class User {
33663426 * @throws Exception
33673427 */
33683428 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+ }
33693480 return new User(
33703481 User::fromAvatarURL($obj->{'avatar_url'})
33713482 ,User::fromEventsURL($obj->{'events_url'})
@@ -3754,6 +3865,21 @@ class Commit {
37543865 * @throws Exception
37553866 */
37563867 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+ }
37573883 return new Commit(
37583884 Commit::fromAuthor($obj->{'author'})
37593885 ,Commit::fromDistinct($obj->{'distinct'})
@@ -3912,6 +4038,12 @@ class Author {
39124038 * @throws Exception
39134039 */
39144040 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+ }
39154047 return new Author(
39164048 Author::fromEmail($obj->{'email'})
39174049 ,Author::fromName($obj->{'name'})
@@ -5184,6 +5316,69 @@ class Issue {
51845316 * @throws Exception
51855317 */
51865318 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+ }
51875382 return new Issue(
51885383 Issue::fromAssignee($obj->{'assignee'})
51895384 ,Issue::fromAssignees($obj->{'assignees'})
@@ -5532,6 +5727,21 @@ class Label {
55325727 * @throws Exception
55335728 */
55345729 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+ }
55355745 return new Label(
55365746 Label::fromColor($obj->{'color'})
55375747 ,Label::fromDefault($obj->{'default'})
@@ -6401,6 +6611,51 @@ class Milestone {
64016611 * @throws Exception
64026612 */
64036613 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+ }
64046659 return new Milestone(
64056660 Milestone::fromClosedAt($obj->{'closed_at'})
64066661 ,Milestone::fromClosedIssues($obj->{'closed_issues'})
@@ -6683,6 +6938,18 @@ class IssuePullRequest {
66836938 * @throws Exception
66846939 */
66856940 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+ }
66866953 return new IssuePullRequest(
66876954 IssuePullRequest::fromDiffURL($obj->{'diff_url'})
66886955 ,IssuePullRequest::fromHTMLURL($obj->{'html_url'})
@@ -8934,6 +9201,129 @@ class PayloadPullRequest {
89349201 * @throws Exception
89359202 */
89369203 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+ }
89379327 return new PayloadPullRequest(
89389328 PayloadPullRequest::fromAdditions($obj->{'additions'})
89399329 ,PayloadPullRequest::fromAssignee($obj->{'assignee'})
@@ -9322,6 +9712,21 @@ class Base {
93229712 * @throws Exception
93239713 */
93249714 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+ }
93259730 return new Base(
93269731 Base::fromLabel($obj->{'label'})
93279732 ,Base::fromRef($obj->{'ref'})
@@ -12989,6 +13394,213 @@ class BaseRepo {
1298913394 * @throws Exception
1299013395 */
1299113396 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+ }
1299213604 return new BaseRepo(
1299313605 BaseRepo::fromArchiveURL($obj->{'archive_url'})
1299413606 ,BaseRepo::fromAssigneesURL($obj->{'assignees_url'})
@@ -13595,6 +14207,30 @@ class Links {
1359514207 * @throws Exception
1359614208 */
1359714209 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+ }
1359814234 return new Links(
1359914235 Links::fromComments($obj->{'comments'})
1360014236 ,Links::fromCommits($obj->{'commits'})
@@ -13707,6 +14343,9 @@ class Comments {
1370714343 * @throws Exception
1370814344 */
1370914345 public static function from(stdClass $obj): Comments {
14346+ if (!property_exists($obj, 'href')) {
14347+ throw new Exception("Missing required property");
14348+ }
1371014349 return new Comments(
1371114350 Comments::fromHref($obj->{'href'})
1371214351 );
@@ -13909,6 +14548,15 @@ class TopLevelRepo {
1390914548 * @throws Exception
1391014549 */
1391114550 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+ }
1391214560 return new TopLevelRepo(
1391314561 TopLevelRepo::fromID($obj->{'id'})
1391414562 ,TopLevelRepo::fromName($obj->{'name'})
Test case

test/inputs/json/samples/kitchen-sink.json

1 generated file · +57 −0
Mphpdefault / TopLevel.php+57 −0
@@ -918,6 +918,48 @@ class TopLevel {
918918 * @throws Exception
919919 */
920920 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+ }
921963 return new TopLevel(
922964 TopLevel::fromBooleanValue($obj->{'booleanValue'})
923965 ,TopLevel::fromDateValue($obj->{'dateValue'})
@@ -1042,6 +1084,9 @@ class DifferentThing {
10421084 * @throws Exception
10431085 */
10441086 public static function from(stdClass $obj): DifferentThing {
1087+ if (!property_exists($obj, 'name')) {
1088+ throw new Exception("Missing required property");
1089+ }
10451090 return new DifferentThing(
10461091 DifferentThing::fromName($obj->{'name'})
10471092 );
@@ -1277,6 +1322,12 @@ class PersonElement {
12771322 * @throws Exception
12781323 */
12791324 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+ }
12801331 return new PersonElement(
12811332 PersonElement::fromIntOrString($obj->{'intOrString'})
12821333 ,PersonElement::fromName($obj->{'name'})
@@ -1431,6 +1482,12 @@ class PurplePerson {
14311482 * @throws Exception
14321483 */
14331484 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+ }
14341491 return new PurplePerson(
14351492 PurplePerson::fromIntOrString($obj->{'intOrString'})
14361493 ,PurplePerson::fromName($obj->{'name'})
Test case

test/inputs/json/samples/null-safe.json

1 generated file · +18 −0
Mphpdefault / TopLevel.php+18 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'item')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromItem($obj->{'item'})
101104 );
@@ -388,6 +391,12 @@ class Item {
388391 * @throws Exception
389392 */
390393 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+ }
391400 return new Item(
392401 Item::fromAddress($obj->{'address'})
393402 ,Item::fromCreatedAt($obj->{'created_at'})
@@ -596,6 +605,15 @@ class Address {
596605 * @throws Exception
597606 */
598607 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+ }
599617 return new Address(
600618 Address::fromCity($obj->{'city'})
601619 ,Address::fromCountry($obj->{'country'})
Test case

test/inputs/json/samples/pokedex.json

1 generated file · +51 −0
Mphpdefault / TopLevel.php+51 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'pokemon')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromPokemon($obj->{'pokemon'})
101104 );
@@ -1129,6 +1132,48 @@ class Pokemon {
11291132 * @throws Exception
11301133 */
11311134 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+ }
11321177 return new Pokemon(
11331178 Pokemon::fromAvgSpawns($obj->{'avg_spawns'})
11341179 ,Pokemon::fromCandy($obj->{'candy'})
@@ -1372,6 +1417,12 @@ class Evolution {
13721417 * @throws Exception
13731418 */
13741419 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+ }
13751426 return new Evolution(
13761427 Evolution::fromName($obj->{'name'})
13771428 ,Evolution::fromNum($obj->{'num'})
Test case

test/inputs/json/samples/reddit.json

1 generated file · +255 −0
Mphpdefault / TopLevel.php+255 −0
@@ -137,6 +137,12 @@ class TopLevel {
137137 * @throws Exception
138138 */
139139 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+ }
140146 return new TopLevel(
141147 TopLevel::fromData($obj->{'data'})
142148 ,TopLevel::fromKind($obj->{'kind'})
@@ -408,6 +414,18 @@ class TopLevelData {
408414 * @throws Exception
409415 */
410416 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+ }
411429 return new TopLevelData(
412430 TopLevelData::fromAfter($obj->{'after'})
413431 ,TopLevelData::fromBefore($obj->{'before'})
@@ -566,6 +584,12 @@ class Child {
566584 * @throws Exception
567585 */
568586 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+ }
569593 return new Child(
570594 Child::fromData($obj->{'data'})
571595 ,Child::fromKind($obj->{'kind'})
@@ -4168,6 +4192,204 @@ class ChildData {
41684192 * @throws Exception
41694193 */
41704194 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+ }
41714393 return new ChildData(
41724394 ChildData::fromApprovedAtUTC($obj->{'approved_at_utc'})
41734395 ,ChildData::fromApprovedBy($obj->{'approved_by'})
@@ -4656,6 +4878,12 @@ class Preview {
46564878 * @throws Exception
46574879 */
46584880 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+ }
46594887 return new Preview(
46604888 Preview::fromEnabled($obj->{'enabled'})
46614889 ,Preview::fromImages($obj->{'images'})
@@ -4926,6 +5154,18 @@ class Image {
49265154 * @throws Exception
49275155 */
49285156 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+ }
49295169 return new Image(
49305170 Image::fromID($obj->{'id'})
49315171 ,Image::fromResolutions($obj->{'resolutions'})
@@ -5134,6 +5374,15 @@ class Source {
51345374 * @throws Exception
51355375 */
51365376 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+ }
51375386 return new Source(
51385387 Source::fromHeight($obj->{'height'})
51395388 ,Source::fromURL($obj->{'url'})
@@ -5475,6 +5724,12 @@ class GIF {
54755724 * @throws Exception
54765725 */
54775726 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+ }
54785733 return new GIF(
54795734 GIF::fromResolutions($obj->{'resolutions'})
54805735 ,GIF::fromSource($obj->{'source'})
Test case

test/inputs/json/samples/simple-object.json

1 generated file · +9 −0
Mphpdefault / TopLevel.php+9 −0
@@ -188,6 +188,15 @@ class TopLevel {
188188 * @throws Exception
189189 */
190190 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+ }
191200 return new TopLevel(
192201 TopLevel::fromDate($obj->{'date'})
193202 ,TopLevel::fromTitle($obj->{'title'})
Test case

test/inputs/json/samples/spotify-album.json

1 generated file · +150 −0
Mphpdefault / TopLevel.php+150 −0
@@ -980,6 +980,57 @@ class TopLevel {
980980 * @throws Exception
981981 */
982982 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+ }
9831034 return new TopLevel(
9841035 TopLevel::fromAlbumType($obj->{'album_type'})
9851036 ,TopLevel::fromArtists($obj->{'artists'})
@@ -1371,6 +1422,24 @@ class Artist {
13711422 * @throws Exception
13721423 */
13731424 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+ }
13741443 return new Artist(
13751444 Artist::fromExternalUrls($obj->{'external_urls'})
13761445 ,Artist::fromHref($obj->{'href'})
@@ -1479,6 +1548,9 @@ class ExternalUrls {
14791548 * @throws Exception
14801549 */
14811550 public static function from(stdClass $obj): ExternalUrls {
1551+ if (!property_exists($obj, 'spotify')) {
1552+ throw new Exception("Missing required property");
1553+ }
14821554 return new ExternalUrls(
14831555 ExternalUrls::fromSpotify($obj->{'spotify'})
14841556 );
@@ -1629,6 +1701,12 @@ class Copyright {
16291701 * @throws Exception
16301702 */
16311703 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+ }
16321710 return new Copyright(
16331711 Copyright::fromText($obj->{'text'})
16341712 ,Copyright::fromType($obj->{'type'})
@@ -1729,6 +1807,9 @@ class ExternalIDS {
17291807 * @throws Exception
17301808 */
17311809 public static function from(stdClass $obj): ExternalIDS {
1810+ if (!property_exists($obj, 'upc')) {
1811+ throw new Exception("Missing required property");
1812+ }
17321813 return new ExternalIDS(
17331814 ExternalIDS::fromUpc($obj->{'upc'})
17341815 );
@@ -1931,6 +2012,15 @@ class Image {
19312012 * @throws Exception
19322013 */
19332014 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+ }
19342024 return new Image(
19352025 Image::fromHeight($obj->{'height'})
19362026 ,Image::fromURL($obj->{'url'})
@@ -2363,6 +2453,27 @@ class Tracks {
23632453 * @throws Exception
23642454 */
23652455 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+ }
23662477 return new Tracks(
23672478 Tracks::fromHref($obj->{'href'})
23682479 ,Tracks::fromItems($obj->{'items'})
@@ -3124,6 +3235,45 @@ class Item {
31243235 * @throws Exception
31253236 */
31263237 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+ }
31273277 return new Item(
31283278 Item::fromArtists($obj->{'artists'})
31293279 ,Item::fromAvailableMarkets($obj->{'available_markets'})
Test case

test/inputs/json/samples/us-avg-temperatures.json

1 generated file · +24 −0
Mphpdefault / TopLevel.php+24 −0
@@ -152,6 +152,12 @@ class TopLevel {
152152 * @throws Exception
153153 */
154154 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+ }
155161 return new TopLevel(
156162 TopLevel::fromData($obj->{'data'})
157163 ,TopLevel::fromDescription($obj->{'description'})
@@ -304,6 +310,12 @@ class Datum {
304310 * @throws Exception
305311 */
306312 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+ }
307319 return new Datum(
308320 Datum::fromAnomaly($obj->{'anomaly'})
309321 ,Datum::fromValue($obj->{'value'})
@@ -560,6 +572,18 @@ class Description {
560572 * @throws Exception
561573 */
562574 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+ }
563587 return new Description(
564588 Description::fromBasePeriod($obj->{'base_period'})
565589 ,Description::fromMissing($obj->{'missing'})
Test case

test/inputs/json/samples/us-senators.json

1 generated file · +141 −0
Mphpdefault / TopLevel.php+141 −0
@@ -149,6 +149,12 @@ class TopLevel {
149149 * @throws Exception
150150 */
151151 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+ }
152158 return new TopLevel(
153159 TopLevel::fromMeta($obj->{'meta'})
154160 ,TopLevel::fromObjects($obj->{'objects'})
@@ -353,6 +359,15 @@ class Meta {
353359 * @throws Exception
354360 */
355361 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+ }
356371 return new Meta(
357372 Meta::fromLimit($obj->{'limit'})
358373 ,Meta::fromOffset($obj->{'offset'})
@@ -1596,6 +1611,72 @@ class ObjectElement {
15961611 * @throws Exception
15971612 */
15981613 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+ }
15991680 return new ObjectElement(
16001681 ObjectElement::fromCaucus($obj->{'caucus'})
16011682 ,ObjectElement::fromCongressNumbers($obj->{'congress_numbers'})
@@ -2017,6 +2098,15 @@ class Extra {
20172098 * @throws Exception
20182099 */
20192100 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+ }
20202110 return new Extra(
20212111 Extra::fromAddress($obj->{'address'})
20222112 ,Extra::fromContactForm($obj->{'contact_form'})
@@ -2978,6 +3068,57 @@ class Person {
29783068 * @throws Exception
29793069 */
29803070 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+ }
29813122 return new Person(
29823123 Person::fromBioguideid($obj->{'bioguideid'})
29833124 ,Person::fromBirthday($obj->{'birthday'})
Test case

test/inputs/schema/accessors.schema

1 generated file · +12 −0
Mschema-phpdefault / TopLevel.php+12 −0
@@ -264,6 +264,18 @@ class TopLevel {
264264 * @throws Exception
265265 */
266266 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+ }
267279 return new TopLevel(
268280 TopLevel::fromBarre($obj->{'bar'})
269281 ,TopLevel::fromEnumerification($obj->{'enum'})
Test case

test/inputs/schema/all-of-additional-properties-false.schema

1 generated file · +9 −0
Mschema-phpdefault / TopLevel.php+9 −0
@@ -252,6 +252,15 @@ class TopLevel {
252252 * @throws Exception
253253 */
254254 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+ }
255264 return new TopLevel(
256265 TopLevel::fromAmount($obj->{'amount'})
257266 ,TopLevel::fromFrequency($obj->{'frequency'})
Test case

test/inputs/schema/any.schema

1 generated file · +6 −0
Mschema-phpdefault / TopLevel.php+6 −0
@@ -150,6 +150,12 @@ class TopLevel {
150150 * @throws Exception
151151 */
152152 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+ }
153159 return new TopLevel(
154160 TopLevel::fromFoo($obj->{'foo'})
155161 ,TopLevel::fromValues($obj->{'values'})
Test case

test/inputs/schema/bool-string.schema

1 generated file · +12 −0
Mschema-phpdefault / TopLevel.php+12 −0
@@ -520,6 +520,18 @@ class TopLevel {
520520 * @throws Exception
521521 */
522522 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+ }
523535 return new TopLevel(
524536 TopLevel::fromArrNullable($obj->{'arrNullable'})
525537 ,TopLevel::fromArrOne($obj->{'arrOne'})
Test case

test/inputs/schema/boolean-subschema.schema

1 generated file · +6 −0
Mschema-phpdefault / TopLevel.php+6 −0
@@ -251,6 +251,12 @@ class TopLevel {
251251 * @throws Exception
252252 */
253253 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+ }
254260 return new TopLevel(
255261 TopLevel::fromDisallowed($obj->{'disallowed'})
256262 ,TopLevel::fromEmpty($obj->{'empty'})
Test case

test/inputs/schema/comment-injection-enum-nested-comment.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -110,6 +110,9 @@ class TopLevel {
110110 * @throws Exception
111111 */
112112 public static function from(stdClass $obj): TopLevel {
113+ if (!property_exists($obj, 'kind')) {
114+ throw new Exception("Missing required property");
115+ }
113116 return new TopLevel(
114117 TopLevel::fromKind($obj->{'kind'})
115118 );
Test case

test/inputs/schema/comment-injection-enum.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -125,6 +125,9 @@ class TopLevel {
125125 * @throws Exception
126126 */
127127 public static function from(stdClass $obj): TopLevel {
128+ if (!property_exists($obj, 'kind')) {
129+ throw new Exception("Missing required property");
130+ }
128131 return new TopLevel(
129132 TopLevel::fromKind($obj->{'kind'})
130133 );
Test case

test/inputs/schema/comment-injection-nested-comment.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -109,6 +109,9 @@ class TopLevel {
109109 * @throws Exception
110110 */
111111 public static function from(stdClass $obj): TopLevel {
112+ if (!property_exists($obj, 'value')) {
113+ throw new Exception("Missing required property");
114+ }
112115 return new TopLevel(
113116 TopLevel::fromValue($obj->{'value'})
114117 );
Test case

test/inputs/schema/comment-injection.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -365,6 +365,9 @@ class TopLevel {
365365 * @throws Exception
366366 */
367367 public static function from(stdClass $obj): TopLevel {
368+ if (!property_exists($obj, 'value')) {
369+ throw new Exception("Missing required property");
370+ }
368371 return new TopLevel(
369372 TopLevel::fromTrailingBackslash($obj->{'trailingBackslash'})
370373 ,TopLevel::fromTrailingQuote($obj->{'trailingQuote'})
Test case

test/inputs/schema/const-non-string.schema

1 generated file · +15 −0
Mschema-phpdefault / TopLevel.php+15 −0
@@ -293,6 +293,21 @@ class TopLevel {
293293 * @throws Exception
294294 */
295295 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+ }
296311 return new TopLevel(
297312 TopLevel::fromAmount($obj->{'amount'})
298313 ,TopLevel::fromEnabled($obj->{'enabled'})
Test case

test/inputs/schema/cut-enum.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -84,6 +84,9 @@ class TopLevel {
8484 * @throws Exception
8585 */
8686 public static function from(stdClass $obj): TopLevel {
87+ if (!property_exists($obj, 'foo')) {
88+ throw new Exception("Missing required property");
89+ }
8790 return new TopLevel(
8891 TopLevel::fromFoo($obj->{'foo'})
8992 );
Test case

test/inputs/schema/date-time-or-string.schema

1 generated file · +6 −0
Mschema-phpdefault / TopLevel.php+6 −0
@@ -161,6 +161,12 @@ class TopLevel {
161161 * @throws Exception
162162 */
163163 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+ }
164170 return new TopLevel(
165171 TopLevel::fromBar($obj->{'bar'})
166172 ,TopLevel::fromFoo($obj->{'foo'})
Test case

test/inputs/schema/date-time.schema

1 generated file · +15 −0
Mschema-phpdefault / TopLevel.php+15 −0
@@ -357,6 +357,21 @@ class TopLevel {
357357 * @throws Exception
358358 */
359359 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+ }
360375 return new TopLevel(
361376 TopLevel::fromComplexUnionArray($obj->{'complex-union-array'})
362377 ,TopLevel::fromDate($obj->{'date'})
Test case

test/inputs/schema/default-value.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -84,6 +84,9 @@ class TopLevel {
8484 * @throws Exception
8585 */
8686 public static function from(stdClass $obj): TopLevel {
87+ if (!property_exists($obj, 'id')) {
88+ throw new Exception("Missing required property");
89+ }
8790 return new TopLevel(
8891 TopLevel::fromID($obj->{'id'})
8992 );
Test case

test/inputs/schema/description.schema

1 generated file · +12 −0
Mschema-phpdefault / TopLevel.php+12 −0
@@ -387,6 +387,15 @@ class TopLevel {
387387 * @throws Exception
388388 */
389389 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+ }
390399 return new TopLevel(
391400 TopLevel::fromBar($obj->{'bar'})
392401 ,TopLevel::fromEnum($obj->{'enum'})
@@ -555,6 +564,9 @@ class ObjectOrString {
555564 * @throws Exception
556565 */
557566 public static function from(stdClass $obj): ObjectOrString {
567+ if (!property_exists($obj, 'prop')) {
568+ throw new Exception("Missing required property");
569+ }
558570 return new ObjectOrString(
559571 ObjectOrString::fromProp($obj->{'prop'})
560572 );
Test case

test/inputs/schema/direct-union.schema

1 generated file · +6 −0
Mschema-phpdefault / TopLevel.php+6 −0
@@ -99,6 +99,9 @@ class TopLevel {
9999 * @throws Exception
100100 */
101101 public static function from(stdClass $obj): TopLevel {
102+ if (!property_exists($obj, 'stuff')) {
103+ throw new Exception("Missing required property");
104+ }
102105 return new TopLevel(
103106 TopLevel::fromStuff($obj->{'stuff'})
104107 );
@@ -409,6 +412,9 @@ class Thing {
409412 * @throws Exception
410413 */
411414 public static function from(stdClass $obj): Thing {
415+ if (!property_exists($obj, 'required')) {
416+ throw new Exception("Missing required property");
417+ }
412418 return new Thing(
413419 Thing::fromOptional($obj->{'optional'})
414420 ,Thing::fromRequired($obj->{'required'})
Test case

test/inputs/schema/enum-large.schema

1 generated file · +6 −0
Mschema-phpdefault / TopLevel.php+6 −0
@@ -138,6 +138,12 @@ class TopLevel {
138138 * @throws Exception
139139 */
140140 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+ }
141147 return new TopLevel(
142148 TopLevel::fromCallsign($obj->{'callsign'})
143149 ,TopLevel::fromPriority($obj->{'priority'})
Test case

test/inputs/schema/enum-with-null.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -95,6 +95,9 @@ class TopLevel {
9595 * @throws Exception
9696 */
9797 public static function from(stdClass $obj): TopLevel {
98+ if (!property_exists($obj, 'enum')) {
99+ throw new Exception("Missing required property");
100+ }
98101 return new TopLevel(
99102 TopLevel::fromEnum($obj->{'enum'})
100103 );
Test case

test/inputs/schema/enum-with-values.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'weekdays')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromWeekdays($obj->{'weekdays'})
9093 );
Test case

test/inputs/schema/enum.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -378,6 +378,9 @@ class TopLevel {
378378 * @throws Exception
379379 */
380380 public static function from(stdClass $obj): TopLevel {
381+ if (!property_exists($obj, 'gve')) {
382+ throw new Exception("Missing required property");
383+ }
381384 return new TopLevel(
382385 TopLevel::fromArr($obj->{'arr'})
383386 ,TopLevel::fromFor($obj->{'for'})
Test case

test/inputs/schema/go-schema-pattern-properties.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -101,6 +101,9 @@ class TopLevel {
101101 * @throws Exception
102102 */
103103 public static function from(stdClass $obj): TopLevel {
104+ if (!property_exists($obj, 'map')) {
105+ throw new Exception("Missing required property");
106+ }
104107 return new TopLevel(
105108 TopLevel::fromMap($obj->{'map'})
106109 );
Test case

test/inputs/schema/haskell-enum-forbidden.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'health')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromHealth($obj->{'health'})
9093 );
Test case

test/inputs/schema/id-no-address.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -84,6 +84,9 @@ class TopLevel {
8484 * @throws Exception
8585 */
8686 public static function from(stdClass $obj): TopLevel {
87+ if (!property_exists($obj, 'item')) {
88+ throw new Exception("Missing required property");
89+ }
8790 return new TopLevel(
8891 TopLevel::fromItem($obj->{'item'})
8992 );
Test case

test/inputs/schema/id-root.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -84,6 +84,9 @@ class TopLevel {
8484 * @throws Exception
8585 */
8686 public static function from(stdClass $obj): TopLevel {
87+ if (!property_exists($obj, 'bar')) {
88+ throw new Exception("Missing required property");
89+ }
8790 return new TopLevel(
8891 TopLevel::fromBar($obj->{'bar'})
8992 );
Test case

test/inputs/schema/ie-suffix-singularization.schema

1 generated file · +9 −0
Mschema-phpdefault / TopLevel.php+9 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'cookies')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromCookies($obj->{'cookies'})
101104 );
@@ -246,6 +249,12 @@ class Cookie {
246249 * @throws Exception
247250 */
248251 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+ }
249258 return new Cookie(
250259 Cookie::fromName($obj->{'name'})
251260 ,Cookie::fromValue($obj->{'value'})
Test case

test/inputs/schema/implicit-all-of.schema

1 generated file · +9 −0
Mschema-phpdefault / TopLevel.php+9 −0
@@ -188,6 +188,15 @@ class TopLevel {
188188 * @throws Exception
189189 */
190190 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+ }
191200 return new TopLevel(
192201 TopLevel::fromFoo($obj->{'foo'})
193202 ,TopLevel::fromBar($obj->{'bar'})
Test case

test/inputs/schema/implicit-class-array-union.schema

1 generated file · +6 −0
Mschema-phpdefault / TopLevel.php+6 −0
@@ -154,6 +154,9 @@ class TopLevel {
154154 * @throws Exception
155155 */
156156 public static function from(stdClass $obj): TopLevel {
157+ if (!property_exists($obj, 'foo')) {
158+ throw new Exception("Missing required property");
159+ }
157160 return new TopLevel(
158161 TopLevel::fromFoo($obj->{'foo'})
159162 );
@@ -252,6 +255,9 @@ class Foo {
252255 * @throws Exception
253256 */
254257 public static function from(stdClass $obj): Foo {
258+ if (!property_exists($obj, 'bar')) {
259+ throw new Exception("Missing required property");
260+ }
255261 return new Foo(
256262 Foo::fromBar($obj->{'bar'})
257263 );
Test case

test/inputs/schema/implicit-one-of.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -208,6 +208,9 @@ class TopLevel {
208208 * @throws Exception
209209 */
210210 public static function from(stdClass $obj): TopLevel {
211+ if (!property_exists($obj, 'foo')) {
212+ throw new Exception("Missing required property");
213+ }
211214 return new TopLevel(
212215 TopLevel::fromFoo($obj->{'foo'})
213216 ,TopLevel::fromBar($obj->{'bar'})
Test case

test/inputs/schema/integer-float-union.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -107,6 +107,9 @@ class TopLevel {
107107 * @throws Exception
108108 */
109109 public static function from(stdClass $obj): TopLevel {
110+ if (!property_exists($obj, 'number')) {
111+ throw new Exception("Missing required property");
112+ }
110113 return new TopLevel(
111114 TopLevel::fromNumber($obj->{'number'})
112115 );
Test case

test/inputs/schema/integer-string.schema

1 generated file · +12 −0
Mschema-phpdefault / TopLevel.php+12 −0
@@ -520,6 +520,18 @@ class TopLevel {
520520 * @throws Exception
521521 */
522522 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+ }
523535 return new TopLevel(
524536 TopLevel::fromArrNullable($obj->{'arrNullable'})
525537 ,TopLevel::fromArrOne($obj->{'arrOne'})
Test case

test/inputs/schema/integer-type.schema

1 generated file · +27 −0
Mschema-phpdefault / TopLevel.php+27 −0
@@ -514,6 +514,33 @@ class TopLevel {
514514 * @throws Exception
515515 */
516516 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+ }
517544 return new TopLevel(
518545 TopLevel::fromAboveI32Max($obj->{'above_i32_max'})
519546 ,TopLevel::fromBelowI32Min($obj->{'below_i32_min'})
Test case

test/inputs/schema/intersection.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -255,6 +255,9 @@ class Intersection {
255255 * @throws Exception
256256 */
257257 public static function from(stdClass $obj): Intersection {
258+ if (!property_exists($obj, 'foo')) {
259+ throw new Exception("Missing required property");
260+ }
258261 return new Intersection(
259262 Intersection::fromFoo($obj->{'foo'})
260263 ,Intersection::fromBar($obj->{'bar'})
Test case

test/inputs/schema/light.schema

1 generated file · +12 −0
Mschema-phpdefault / TopLevel.php+12 −0
@@ -85,6 +85,9 @@ class TopLevel {
8585 * @throws Exception
8686 */
8787 public static function from(stdClass $obj): TopLevel {
88+ if (!property_exists($obj, 'LightParams')) {
89+ throw new Exception("Missing required property");
90+ }
8891 return new TopLevel(
8992 TopLevel::fromLightParams($obj->{'LightParams'})
9093 );
@@ -287,6 +290,15 @@ class LightParams {
287290 * @throws Exception
288291 */
289292 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+ }
290302 return new LightParams(
291303 LightParams::fromAppID($obj->{'app_id'})
292304 ,LightParams::fromOutletID($obj->{'outlet_id'})
Test case

test/inputs/schema/min-max-items.schema

1 generated file · +15 −0
Mschema-phpdefault / TopLevel.php+15 −0
@@ -387,6 +387,21 @@ class TopLevel {
387387 * @throws Exception
388388 */
389389 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+ }
390405 return new TopLevel(
391406 TopLevel::fromMaxOnly($obj->{'maxOnly'})
392407 ,TopLevel::fromMinAndMax($obj->{'minAndMax'})
Test case

test/inputs/schema/minmax-integer.schema

1 generated file · +24 −0
Mschema-phpdefault / TopLevel.php+24 −0
@@ -458,6 +458,30 @@ class TopLevel {
458458 * @throws Exception
459459 */
460460 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+ }
461485 return new TopLevel(
462486 TopLevel::fromFree($obj->{'free'})
463487 ,TopLevel::fromIntersection($obj->{'intersection'})
Test case

test/inputs/schema/minmax.schema

1 generated file · +24 −0
Mschema-phpdefault / TopLevel.php+24 −0
@@ -458,6 +458,30 @@ class TopLevel {
458458 * @throws Exception
459459 */
460460 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+ }
461485 return new TopLevel(
462486 TopLevel::fromFree($obj->{'free'})
463487 ,TopLevel::fromIntersection($obj->{'intersection'})
Test case

test/inputs/schema/minmaxlength.schema

1 generated file · +24 −0
Mschema-phpdefault / TopLevel.php+24 −0
@@ -507,6 +507,30 @@ class TopLevel {
507507 * @throws Exception
508508 */
509509 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+ }
510534 return new TopLevel(
511535 TopLevel::fromIntersection($obj->{'intersection'})
512536 ,TopLevel::fromInUnion($obj->{'inUnion'})
Test case

test/inputs/schema/multi-type-enum.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -121,6 +121,9 @@ class TopLevel {
121121 * @throws Exception
122122 */
123123 public static function from(stdClass $obj): TopLevel {
124+ if (!property_exists($obj, 'foo')) {
125+ throw new Exception("Missing required property");
126+ }
124127 return new TopLevel(
125128 TopLevel::fromFoo($obj->{'foo'})
126129 );
Test case

test/inputs/schema/mutually-recursive.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -112,6 +112,9 @@ class Bar {
112112 * @throws Exception
113113 */
114114 public static function from(stdClass $obj): Bar {
115+ if (!property_exists($obj, 'foo')) {
116+ throw new Exception("Missing required property");
117+ }
115118 return new Bar(
116119 Bar::fromFoo($obj->{'foo'})
117120 );
Test case

test/inputs/schema/nested-intersection-union.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -96,6 +96,9 @@ class TopLevel {
9696 * @throws Exception
9797 */
9898 public static function from(stdClass $obj): TopLevel {
99+ if (!property_exists($obj, 'input')) {
100+ throw new Exception("Missing required property");
101+ }
99102 return new TopLevel(
100103 TopLevel::fromInput($obj->{'input'})
101104 );
Test case

test/inputs/schema/non-standard-ref.schema

1 generated file · +9 −0
Mschema-phpdefault / TopLevel.php+9 −0
@@ -188,6 +188,15 @@ class TopLevel {
188188 * @throws Exception
189189 */
190190 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+ }
191200 return new TopLevel(
192201 TopLevel::fromBar($obj->{'bar'})
193202 ,TopLevel::fromFoo($obj->{'foo'})
Test case

test/inputs/schema/nullable-optional-one-of.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -147,6 +147,9 @@ class TopLevel {
147147 * @throws Exception
148148 */
149149 public static function from(stdClass $obj): TopLevel {
150+ if (!property_exists($obj, 'kind')) {
151+ throw new Exception("Missing required property");
152+ }
150153 return new TopLevel(
151154 TopLevel::fromB($obj->{'b'})
152155 ,TopLevel::fromKind($obj->{'kind'})
Test case

test/inputs/schema/object-type-required.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -146,6 +146,9 @@ class TopLevel {
146146 * @throws Exception
147147 */
148148 public static function from(stdClass $obj): TopLevel {
149+ if (!property_exists($obj, 'foo')) {
150+ throw new Exception("Missing required property");
151+ }
149152 return new TopLevel(
150153 TopLevel::fromFoo($obj->{'foo'})
151154 ,TopLevel::fromBar($obj->{'bar'})
Test case

test/inputs/schema/optional-any.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -136,6 +136,9 @@ class TopLevel {
136136 * @throws Exception
137137 */
138138 public static function from(stdClass $obj): TopLevel {
139+ if (!property_exists($obj, 'bar')) {
140+ throw new Exception("Missing required property");
141+ }
139142 return new TopLevel(
140143 TopLevel::fromBar($obj->{'bar'})
141144 ,TopLevel::fromFoo($obj->{'foo'})
Test case

test/inputs/schema/optional-const-ref.schema

1 generated file · +15 −0
Mschema-phpdefault / TopLevel.php+15 −0
@@ -478,6 +478,15 @@ class TopLevel {
478478 * @throws Exception
479479 */
480480 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+ }
481490 return new TopLevel(
482491 TopLevel::fromCoordinates($obj->{'coordinates'})
483492 ,TopLevel::fromCount($obj->{'count'})
@@ -640,6 +649,12 @@ class Coordinate {
640649 * @throws Exception
641650 */
642651 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+ }
643658 return new Coordinate(
644659 Coordinate::fromLatitude($obj->{'latitude'})
645660 ,Coordinate::fromLongitude($obj->{'longitude'})
Test case

test/inputs/schema/optional-constraints.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -347,6 +347,9 @@ class TopLevel {
347347 * @throws Exception
348348 */
349349 public static function from(stdClass $obj): TopLevel {
350+ if (!property_exists($obj, 'reqZeroMin')) {
351+ throw new Exception("Missing required property");
352+ }
350353 return new TopLevel(
351354 TopLevel::fromOptDouble($obj->{'optDouble'})
352355 ,TopLevel::fromOptInt($obj->{'optInt'})
Test case

test/inputs/schema/optional-date-time.schema

1 generated file · +9 −0
Mschema-phpdefault / TopLevel.php+9 −0
@@ -388,6 +388,15 @@ class TopLevel {
388388 * @throws Exception
389389 */
390390 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+ }
391400 return new TopLevel(
392401 TopLevel::fromOptionalDate($obj->{'optional-date'})
393402 ,TopLevel::fromOptionalDateTime($obj->{'optional-date-time'})
Test case

test/inputs/schema/optional-enum.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -147,6 +147,9 @@ class TopLevel {
147147 * @throws Exception
148148 */
149149 public static function from(stdClass $obj): TopLevel {
150+ if (!property_exists($obj, 'name')) {
151+ throw new Exception("Missing required property");
152+ }
150153 return new TopLevel(
151154 TopLevel::fromName($obj->{'name'})
152155 ,TopLevel::fromShortcut($obj->{'shortcut'})
Test case

test/inputs/schema/pattern.schema

1 generated file · +9 −0
Mschema-phpdefault / TopLevel.php+9 −0
@@ -197,6 +197,15 @@ class TopLevel {
197197 * @throws Exception
198198 */
199199 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+ }
200209 return new TopLevel(
201210 TopLevel::fromPattern1($obj->{'pattern1'})
202211 ,TopLevel::fromPattern2($obj->{'pattern2'})
Test case

test/inputs/schema/prefix-items.schema

1 generated file · +6 −0
Mschema-phpdefault / TopLevel.php+6 −0
@@ -204,6 +204,12 @@ class TopLevel {
204204 * @throws Exception
205205 */
206206 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+ }
207213 return new TopLevel(
208214 TopLevel::fromOpen($obj->{'open'})
209215 ,TopLevel::fromTuple($obj->{'tuple'})
Test case

test/inputs/schema/ref-id-files.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -84,6 +84,9 @@ class TopLevel {
8484 * @throws Exception
8585 */
8686 public static function from(stdClass $obj): TopLevel {
87+ if (!property_exists($obj, 'foo')) {
88+ throw new Exception("Missing required property");
89+ }
8790 return new TopLevel(
8891 TopLevel::fromFoo($obj->{'foo'})
8992 );
Test case

test/inputs/schema/required-draft3.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -84,6 +84,9 @@ class TopLevel {
8484 * @throws Exception
8585 */
8686 public static function from(stdClass $obj): TopLevel {
87+ if (!property_exists($obj, 'longitude')) {
88+ throw new Exception("Missing required property");
89+ }
8790 return new TopLevel(
8891 TopLevel::fromLongitude($obj->{'longitude'})
8992 );
Test case

test/inputs/schema/required-non-properties.schema

1 generated file · +6 −0
Mschema-phpdefault / TopLevel.php+6 −0
@@ -136,6 +136,12 @@ class TopLevel {
136136 * @throws Exception
137137 */
138138 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+ }
139145 return new TopLevel(
140146 TopLevel::fromFoo($obj->{'foo'})
141147 ,TopLevel::fromBar($obj->{'bar'})
Test case

test/inputs/schema/required.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -84,6 +84,9 @@ class TopLevel {
8484 * @throws Exception
8585 */
8686 public static function from(stdClass $obj): TopLevel {
87+ if (!property_exists($obj, 'longitude')) {
88+ throw new Exception("Missing required property");
89+ }
8790 return new TopLevel(
8891 TopLevel::fromLongitude($obj->{'longitude'})
8992 );
Test case

test/inputs/schema/rust-cycle-breaker-union.schema

1 generated file · +6 −0
Mschema-phpdefault / TopLevel.php+6 −0
@@ -165,6 +165,9 @@ class TopLevel {
165165 * @throws Exception
166166 */
167167 public static function from(stdClass $obj): TopLevel {
168+ if (!property_exists($obj, 'value')) {
169+ throw new Exception("Missing required property");
170+ }
168171 return new TopLevel(
169172 TopLevel::fromNext($obj->{'next'})
170173 ,TopLevel::fromValue($obj->{'value'})
@@ -346,6 +349,9 @@ class Node {
346349 * @throws Exception
347350 */
348351 public static function from(stdClass $obj): Node {
352+ if (!property_exists($obj, 'value')) {
353+ throw new Exception("Missing required property");
354+ }
349355 return new Node(
350356 Node::fromNext($obj->{'next'})
351357 ,Node::fromValue($obj->{'value'})
Test case

test/inputs/schema/schema-constraints.schema

1 generated file · +6 −0
Mschema-phpdefault / TopLevel.php+6 −0
@@ -144,6 +144,12 @@ class TopLevel {
144144 * @throws Exception
145145 */
146146 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+ }
147153 return new TopLevel(
148154 TopLevel::fromMinMaxLength($obj->{'minMaxLength'})
149155 ,TopLevel::fromPercent($obj->{'percent'})
Test case

test/inputs/schema/strict-optional.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -94,6 +94,9 @@ class TopLevel {
9494 * @throws Exception
9595 */
9696 public static function from(stdClass $obj): TopLevel {
97+ if (!property_exists($obj, 'foo')) {
98+ throw new Exception("Missing required property");
99+ }
97100 return new TopLevel(
98101 TopLevel::fromFoo($obj->{'foo'})
99102 );
Test case

test/inputs/schema/top-level-array.schema

1 generated file · +6 −0
Mschema-phpdefault / TopLevel.php+6 −0
@@ -136,6 +136,12 @@ class TopLevel {
136136 * @throws Exception
137137 */
138138 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+ }
139145 return new TopLevel(
140146 TopLevel::fromLabel($obj->{'label'})
141147 ,TopLevel::fromScore($obj->{'score'})
Test case

test/inputs/schema/tuple.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -118,6 +118,9 @@ class TopLevel {
118118 * @throws Exception
119119 */
120120 public static function from(stdClass $obj): TopLevel {
121+ if (!property_exists($obj, 'tuple')) {
122+ throw new Exception("Missing required property");
123+ }
121124 return new TopLevel(
122125 TopLevel::fromTuple($obj->{'tuple'})
123126 );
Test case

test/inputs/schema/unevaluated-properties.schema

1 generated file · +6 −0
Mschema-phpdefault / TopLevel.php+6 −0
@@ -609,6 +609,12 @@ class Item {
609609 * @throws Exception
610610 */
611611 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+ }
612618 return new Item(
613619 Item::fromKey($obj->{'key'})
614620 ,Item::fromValue($obj->{'value'})
Test case

test/inputs/schema/union-int-double.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -115,6 +115,9 @@ class TopLevel {
115115 * @throws Exception
116116 */
117117 public static function from(stdClass $obj): TopLevel {
118+ if (!property_exists($obj, 'value')) {
119+ throw new Exception("Missing required property");
120+ }
118121 return new TopLevel(
119122 TopLevel::fromValue($obj->{'value'})
120123 );
Test case

test/inputs/schema/union-list.schema

1 generated file · +6 −0
Mschema-phpdefault / TopLevel.php+6 −0
@@ -105,6 +105,9 @@ class TopLevel {
105105 * @throws Exception
106106 */
107107 public static function from(stdClass $obj): TopLevel {
108+ if (!property_exists($obj, 'list')) {
109+ throw new Exception("Missing required property");
110+ }
108111 return new TopLevel(
109112 TopLevel::fromList($obj->{'list'})
110113 );
@@ -224,6 +227,9 @@ class UnionList {
224227 * @throws Exception
225228 */
226229 public static function from(stdClass $obj): UnionList {
230+ if (!property_exists($obj, 'next')) {
231+ throw new Exception("Missing required property");
232+ }
227233 return new UnionList(
228234 UnionList::fromNext($obj->{'next'})
229235 );
Test case

test/inputs/schema/union.schema

1 generated file · +3 −0
Mschema-phpdefault / TopLevel.php+3 −0
@@ -208,6 +208,9 @@ class TopLevel {
208208 * @throws Exception
209209 */
210210 public static function from(stdClass $obj): TopLevel {
211+ if (!property_exists($obj, 'two')) {
212+ throw new Exception("Missing required property");
213+ }
211214 return new TopLevel(
212215 TopLevel::fromOne($obj->{'one'})
213216 ,TopLevel::fromTwo($obj->{'two'})
Test case

test/inputs/schema/uuid.schema

1 generated file · +9 −0
Mschema-phpdefault / TopLevel.php+9 −0
@@ -461,6 +461,15 @@ class TopLevel {
461461 * @throws Exception
462462 */
463463 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+ }
464473 return new TopLevel(
465474 TopLevel::fromArrNullable($obj->{'arrNullable'})
466475 ,TopLevel::fromArrOne($obj->{'arrOne'})
Test case

test/inputs/schema/vega-lite.schema

1 generated file · +60 −0
Mschema-phpdefault / TopLevel.php+60 −0
@@ -29035,6 +29035,9 @@ class VGBinding {
2903529035 * @throws Exception
2903629036 */
2903729037 public static function from(stdClass $obj): VGBinding {
29038+ if (!property_exists($obj, 'input')) {
29039+ throw new Exception("Missing required property");
29040+ }
2903829041 return new VGBinding(
2903929042 VGBinding::fromElement($obj->{'element'})
2904029043 ,VGBinding::fromInput($obj->{'input'})
@@ -43789,6 +43792,9 @@ class ConditionalValueDef {
4378943792 * @throws Exception
4379043793 */
4379143794 public static function from(stdClass $obj): ConditionalValueDef {
43795+ if (!property_exists($obj, 'value')) {
43796+ throw new Exception("Missing required property");
43797+ }
4379243798 return new ConditionalValueDef(
4379343799 ConditionalValueDef::fromTest($obj->{'test'})
4379443800 ,ConditionalValueDef::fromValue($obj->{'value'})
@@ -47410,6 +47416,9 @@ class RepeatRef {
4741047416 * @throws Exception
4741147417 */
4741247418 public static function from(stdClass $obj): RepeatRef {
47419+ if (!property_exists($obj, 'repeat')) {
47420+ throw new Exception("Missing required property");
47421+ }
4741347422 return new RepeatRef(
4741447423 RepeatRef::fromRepeat($obj->{'repeat'})
4741547424 );
@@ -50814,6 +50823,9 @@ class SelectionDomain {
5081450823 * @throws Exception
5081550824 */
5081650825 public static function from(stdClass $obj): SelectionDomain {
50826+ if (!property_exists($obj, 'selection')) {
50827+ throw new Exception("Missing required property");
50828+ }
5081750829 return new SelectionDomain(
5081850830 SelectionDomain::fromField($obj->{'field'})
5081950831 ,SelectionDomain::fromSelection($obj->{'selection'})
@@ -51024,6 +51036,9 @@ class InterpolateParams {
5102451036 * @throws Exception
5102551037 */
5102651038 public static function from(stdClass $obj): InterpolateParams {
51039+ if (!property_exists($obj, 'type')) {
51040+ throw new Exception("Missing required property");
51041+ }
5102751042 return new InterpolateParams(
5102851043 InterpolateParams::fromGamma($obj->{'gamma'})
5102951044 ,InterpolateParams::fromType($obj->{'type'})
@@ -51229,6 +51244,12 @@ class Nice {
5122951244 * @throws Exception
5123051245 */
5123151246 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+ }
5123251253 return new Nice(
5123351254 Nice::fromInterval($obj->{'interval'})
5123451255 ,Nice::fromStep($obj->{'step'})
@@ -51519,6 +51540,9 @@ class SchemeParams {
5151951540 * @throws Exception
5152051541 */
5152151542 public static function from(stdClass $obj): SchemeParams {
51543+ if (!property_exists($obj, 'name')) {
51544+ throw new Exception("Missing required property");
51545+ }
5152251546 return new SchemeParams(
5152351547 SchemeParams::fromExtent($obj->{'extent'})
5152451548 ,SchemeParams::fromName($obj->{'name'})
@@ -51951,6 +51975,9 @@ class SortField {
5195151975 * @throws Exception
5195251976 */
5195351977 public static function from(stdClass $obj): SortField {
51978+ if (!property_exists($obj, 'op')) {
51979+ throw new Exception("Missing required property");
51980+ }
5195451981 return new SortField(
5195551982 SortField::fromField($obj->{'field'})
5195651983 ,SortField::fromOp($obj->{'op'})
@@ -52780,6 +52807,9 @@ class FacetFieldDef {
5278052807 * @throws Exception
5278152808 */
5278252809 public static function from(stdClass $obj): FacetFieldDef {
52810+ if (!property_exists($obj, 'type')) {
52811+ throw new Exception("Missing required property");
52812+ }
5278352813 return new FacetFieldDef(
5278452814 FacetFieldDef::fromAggregate($obj->{'aggregate'})
5278552815 ,FacetFieldDef::fromBin($obj->{'bin'})
@@ -53712,6 +53742,9 @@ class FieldDef {
5371253742 * @throws Exception
5371353743 */
5371453744 public static function from(stdClass $obj): FieldDef {
53745+ if (!property_exists($obj, 'type')) {
53746+ throw new Exception("Missing required property");
53747+ }
5371553748 return new FieldDef(
5371653749 FieldDef::fromAggregate($obj->{'aggregate'})
5371753750 ,FieldDef::fromBin($obj->{'bin'})
@@ -55992,6 +56025,9 @@ class OrderFieldDef {
5599256025 * @throws Exception
5599356026 */
5599456027 public static function from(stdClass $obj): OrderFieldDef {
56028+ if (!property_exists($obj, 'type')) {
56029+ throw new Exception("Missing required property");
56030+ }
5599556031 return new OrderFieldDef(
5599656032 OrderFieldDef::fromAggregate($obj->{'aggregate'})
5599756033 ,OrderFieldDef::fromBin($obj->{'bin'})
@@ -69109,6 +69145,9 @@ class MarkDef {
6910969145 * @throws Exception
6911069146 */
6911169147 public static function from(stdClass $obj): MarkDef {
69148+ if (!property_exists($obj, 'type')) {
69149+ throw new Exception("Missing required property");
69150+ }
6911269151 return new MarkDef(
6911369152 MarkDef::fromAlign($obj->{'align'})
6911469153 ,MarkDef::fromAngle($obj->{'angle'})
@@ -72940,6 +72979,9 @@ class SelectionDef {
7294072979 * @throws Exception
7294172980 */
7294272981 public static function from(stdClass $obj): SelectionDef {
72982+ if (!property_exists($obj, 'type')) {
72983+ throw new Exception("Missing required property");
72984+ }
7294372985 return new SelectionDef(
7294472986 SelectionDef::fromBind($obj->{'bind'})
7294572987 ,SelectionDef::fromEmpty($obj->{'empty'})
@@ -73510,6 +73552,9 @@ class TitleParams {
7351073552 * @throws Exception
7351173553 */
7351273554 public static function from(stdClass $obj): TitleParams {
73555+ if (!property_exists($obj, 'text')) {
73556+ throw new Exception("Missing required property");
73557+ }
7351373558 return new TitleParams(
7351473559 TitleParams::fromAnchor($obj->{'anchor'})
7351573560 ,TitleParams::fromOffset($obj->{'offset'})
@@ -74832,6 +74877,15 @@ class AggregatedFieldDef {
7483274877 * @throws Exception
7483374878 */
7483474879 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+ }
7483574889 return new AggregatedFieldDef(
7483674890 AggregatedFieldDef::fromAs($obj->{'as'})
7483774891 ,AggregatedFieldDef::fromField($obj->{'field'})
@@ -75098,6 +75152,12 @@ class LookupData {
7509875152 * @throws Exception
7509975153 */
7510075154 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+ }
7510175161 return new LookupData(
7510275162 LookupData::fromData($obj->{'data'})
7510375163 ,LookupData::fromFields($obj->{'fields'})
No generated files match these filters.