diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml index 6373ea6deee5..0057c5a05c1a 100644 --- a/.github/workflows/lint-pr-title.yml +++ b/.github/workflows/lint-pr-title.yml @@ -53,6 +53,7 @@ jobs: parser ir cli-v2 + cli-generator requireScope: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CLAUDE.md b/CLAUDE.md index 8bc27af2941d..9d05ec2474f2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -343,7 +343,7 @@ When creating pull requests in this repository: **Allowed types**: `fix`, `feat`, `revert`, `break`, `chore` - **Allowed scopes**: `docs`, `changelog`, `internal`, `cli`, `typescript`, `python`, `java`, `csharp`, `go`, `php`, `ruby`, `seed`, `ci`, `lint`, `fastapi`, `spring`, `openapi`, `deps`, `deps-dev`, `pydantic`, `ai-search`, `swift`, `rust` + **Allowed scopes**: `docs`, `changelog`, `internal`, `cli`, `typescript`, `python`, `java`, `csharp`, `go`, `php`, `ruby`, `seed`, `ci`, `lint`, `openapi`, `deps`, `deps-dev`, `pydantic`, `ai-search`, `swift`, `rust`, `generator-cli`, `parser`, `ir`, `cli-v2`, `cli-generator` **Examples**: `chore(docs): update guidelines`, `feat(python): add new feature`, `fix(cli): resolve config loading bug` diff --git a/generators/php/base/src/asIs/Json/JsonSerializableType.Template.php b/generators/php/base/src/asIs/Json/JsonSerializableType.Template.php index d55d15ed26c5..432b5154c1ab 100644 --- a/generators/php/base/src/asIs/Json/JsonSerializableType.Template.php +++ b/generators/php/base/src/asIs/Json/JsonSerializableType.Template.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/generators/php/model/src/union/UnionGenerator.ts b/generators/php/model/src/union/UnionGenerator.ts index 5589addc8075..dd3ca131c40f 100644 --- a/generators/php/model/src/union/UnionGenerator.ts +++ b/generators/php/model/src/union/UnionGenerator.ts @@ -84,8 +84,6 @@ export class UnionGenerator extends FileGenerator { - writer.write("$decodedJson = "); - writer.writeNodeStatement( - php.invokeMethod({ - method: "decode", - arguments_: [php.codeblock("$json")], - static_: true, - on: this.context.getJsonDecoderClassReference() - }) - ); - - const negation = php.codeblock((_writer) => { - _writer.write("!"); - _writer.writeNode( - php.invokeMethod({ - method: "is_array", - arguments_: [php.codeblock("$decodedJson")], - static_: true - }) - ); - }); - writer.controlFlow("if", negation); - writer.writeNodeStatement( - php.throwException({ - classReference: this.context.getExceptionClassReference(), - arguments_: [php.codeblock('"Unexpected non-array decoded type: " . gettype($decodedJson)')] - }) - ); - writer.endControlFlow(); - writer.write("return "); - writer.writeNodeStatement( - php.invokeMethod({ - method: "jsonDeserialize", - arguments_: [php.codeblock("$decodedJson")], - static_: true, - on: php.codeblock("self") - }) - ); - }), - static_: true - }); - } - private jsonDeserializeMethod(): php.Method { const discriminantPropertyName = this.context.getPropertyName(this.unionTypeDeclaration.discriminant); const discriminantVariableName = this.context.getVariableName(this.unionTypeDeclaration.discriminant); diff --git a/generators/php/sdk/changes/2.10.4/collapse-union-fromjson-via-lsb.yml b/generators/php/sdk/changes/2.10.4/collapse-union-fromjson-via-lsb.yml new file mode 100644 index 000000000000..ec32c0fb5b91 --- /dev/null +++ b/generators/php/sdk/changes/2.10.4/collapse-union-fromjson-via-lsb.yml @@ -0,0 +1,8 @@ +- summary: | + Generated discriminated unions no longer emit a `fromJson()` override. The base + `JsonSerializableType::fromJson` now uses late static binding (`static::jsonDeserialize`) + so subclasses' typed `jsonDeserialize` overrides dispatch correctly. This eliminates ~50 + lines of duplicated code per union and resolves a PHPStan strict failure where the union + override's `$decodedJson` was narrowed to `array` instead of + `array`. + type: fix diff --git a/generators/php/sdk/versions.yml b/generators/php/sdk/versions.yml index 77dc7ea80f6f..2e9f978285a4 100644 --- a/generators/php/sdk/versions.yml +++ b/generators/php/sdk/versions.yml @@ -1,4 +1,16 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 2.10.4 + changelogEntry: + - summary: | + Generated discriminated unions no longer emit a `fromJson()` override. The base + `JsonSerializableType::fromJson` now uses late static binding (`static::jsonDeserialize`) + so subclasses' typed `jsonDeserialize` overrides dispatch correctly. This eliminates ~50 + lines of duplicated code per union and resolves a PHPStan strict failure where the union + override's `$decodedJson` was narrowed to `array` instead of + `array`. + type: fix + createdAt: "2026-05-22" + irVersion: 66 - version: 2.10.3 changelogEntry: - summary: | diff --git a/packages/cli/cli-v2/src/sdk/config/converter/constants.ts b/packages/cli/cli-v2/src/sdk/config/converter/constants.ts index 8882d4e5827e..acff55234819 100644 --- a/packages/cli/cli-v2/src/sdk/config/converter/constants.ts +++ b/packages/cli/cli-v2/src/sdk/config/converter/constants.ts @@ -56,7 +56,8 @@ export const DOCKER_IMAGE_TO_GENERATOR_ID: Record = { "fernapi/fern-go-model": "go-model", "fernapi/fern-csharp-sdk": "csharp-sdk", "fernapi/fern-csharp-model": "csharp-model", - "fernapi/fern-ruby-sdk": "ruby-sdk", + "fernapi/fern-ruby-sdk": "ruby-sdk-v2", + "fernapi/fern-ruby-sdk-v2": "ruby-sdk-v2", "fernapi/fern-php-sdk": "php-sdk", "fernapi/fern-php-model": "php-model", "fernapi/fern-rust-sdk": "rust-sdk", diff --git a/packages/cli/cli/changes/5.37.8/fix-ruby-sdk-fdr-lookup.yml b/packages/cli/cli/changes/5.37.8/fix-ruby-sdk-fdr-lookup.yml new file mode 100644 index 000000000000..13e2440c877d --- /dev/null +++ b/packages/cli/cli/changes/5.37.8/fix-ruby-sdk-fdr-lookup.yml @@ -0,0 +1,6 @@ +- summary: | + Fix FDR generator version lookup for Ruby SDK to use the correct registry ID + (`ruby-sdk-v2`) instead of the stale legacy ID (`ruby-sdk`). This ensures + `fern generator upgrade` and IR version resolution return the actual latest + Ruby SDK generator version. + type: fix diff --git a/packages/cli/cli/changes/5.37.9/add-cli-generator-pr-scope.yml b/packages/cli/cli/changes/5.37.9/add-cli-generator-pr-scope.yml new file mode 100644 index 000000000000..b70f40967198 --- /dev/null +++ b/packages/cli/cli/changes/5.37.9/add-cli-generator-pr-scope.yml @@ -0,0 +1,5 @@ +# yaml-language-server: $schema=../../../../../fern-changes-yml.schema.json + +- summary: | + Add `cli-generator` to the allowed PR title scopes enforced by the lint-pr-title workflow. + type: chore diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index 7e38e1a390c8..f5e4cc8a822a 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,4 +1,21 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 5.37.9 + changelogEntry: + - summary: | + Add `cli-generator` to the allowed PR title scopes enforced by the lint-pr-title workflow. + type: chore + createdAt: "2026-05-22" + irVersion: 66 +- version: 5.37.8 + changelogEntry: + - summary: | + Fix FDR generator version lookup for Ruby SDK to use the correct registry ID + (`ruby-sdk-v2`) instead of the stale legacy ID (`ruby-sdk`). This ensures + `fern generator upgrade` and IR version resolution return the actual latest + Ruby SDK generator version. + type: fix + createdAt: "2026-05-22" + irVersion: 66 - version: 5.37.7 changelogEntry: - summary: | diff --git a/packages/cli/configuration-loader/src/generators-yml/getGeneratorVersions.ts b/packages/cli/configuration-loader/src/generators-yml/getGeneratorVersions.ts index a193fc7b96a9..a968940620ee 100644 --- a/packages/cli/configuration-loader/src/generators-yml/getGeneratorVersions.ts +++ b/packages/cli/configuration-loader/src/generators-yml/getGeneratorVersions.ts @@ -97,7 +97,8 @@ function getGeneratorMetadataFromName(generatorName: string, context?: TaskConte return "csharp-model"; // Ruby case "fern-ruby-sdk": - return "ruby-sdk"; + case "fern-ruby-sdk-v2": + return "ruby-sdk-v2"; // Misc. case "fern-postman": return "postman"; diff --git a/seed/php-sdk/accept-header/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/accept-header/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/accept-header/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/accept-header/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/alias-extends/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/alias-extends/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/alias-extends/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/alias-extends/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/alias/composer-json/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/alias/composer-json/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/alias/composer-json/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/alias/composer-json/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/alias/no-custom-config/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/alias/no-custom-config/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/alias/no-custom-config/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/alias/no-custom-config/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/allof-inline/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/allof-inline/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/allof-inline/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/allof-inline/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/allof/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/allof/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/allof/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/allof/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/any-auth/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/any-auth/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/any-auth/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/any-auth/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/api-wide-base-path-with-default/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/api-wide-base-path-with-default/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/api-wide-base-path-with-default/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/api-wide-base-path-with-default/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/api-wide-base-path/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/api-wide-base-path/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/api-wide-base-path/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/api-wide-base-path/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/audiences/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/audiences/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/audiences/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/audiences/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/basic-auth-environment-variables/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/basic-auth-environment-variables/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/basic-auth-environment-variables/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/basic-auth-environment-variables/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/basic-auth/wire-tests/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/basic-auth/wire-tests/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/basic-auth/wire-tests/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/basic-auth/wire-tests/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/bearer-token-environment-variable/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/bearer-token-environment-variable/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/bearer-token-environment-variable/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/bearer-token-environment-variable/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/bytes-download/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/bytes-download/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/bytes-download/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/bytes-download/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/bytes-upload/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/bytes-upload/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/bytes-upload/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/bytes-upload/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/circular-references-advanced/src/Ast/Types/ContainerValue.php b/seed/php-sdk/circular-references-advanced/src/Ast/Types/ContainerValue.php index 736e71012554..28a90af608f2 100644 --- a/seed/php-sdk/circular-references-advanced/src/Ast/Types/ContainerValue.php +++ b/seed/php-sdk/circular-references-advanced/src/Ast/Types/ContainerValue.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class ContainerValue extends JsonSerializableType { @@ -164,18 +163,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/circular-references-advanced/src/Ast/Types/FieldValue.php b/seed/php-sdk/circular-references-advanced/src/Ast/Types/FieldValue.php index 892a235659bc..3d8653bb3187 100644 --- a/seed/php-sdk/circular-references-advanced/src/Ast/Types/FieldValue.php +++ b/seed/php-sdk/circular-references-advanced/src/Ast/Types/FieldValue.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class FieldValue extends JsonSerializableType { @@ -201,18 +200,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/circular-references-advanced/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/circular-references-advanced/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/circular-references-advanced/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/circular-references-advanced/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/circular-references-extends/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/circular-references-extends/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/circular-references-extends/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/circular-references-extends/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/circular-references/src/Ast/Types/ContainerValue.php b/seed/php-sdk/circular-references/src/Ast/Types/ContainerValue.php index 736e71012554..28a90af608f2 100644 --- a/seed/php-sdk/circular-references/src/Ast/Types/ContainerValue.php +++ b/seed/php-sdk/circular-references/src/Ast/Types/ContainerValue.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class ContainerValue extends JsonSerializableType { @@ -164,18 +163,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/circular-references/src/Ast/Types/FieldValue.php b/seed/php-sdk/circular-references/src/Ast/Types/FieldValue.php index 892a235659bc..3d8653bb3187 100644 --- a/seed/php-sdk/circular-references/src/Ast/Types/FieldValue.php +++ b/seed/php-sdk/circular-references/src/Ast/Types/FieldValue.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class FieldValue extends JsonSerializableType { @@ -201,18 +200,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/circular-references/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/circular-references/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/circular-references/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/circular-references/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/cli-multi-spec-namespaced/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/cli-multi-spec-namespaced/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/cli-multi-spec-namespaced/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/cli-multi-spec-namespaced/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/cli-multi-spec/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/cli-multi-spec/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/cli-multi-spec/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/cli-multi-spec/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/client-side-params/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/client-side-params/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/client-side-params/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/client-side-params/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/content-type/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/content-type/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/content-type/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/content-type/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/cross-package-type-names/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/cross-package-type-names/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/cross-package-type-names/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/cross-package-type-names/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/dollar-string-examples/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/dollar-string-examples/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/dollar-string-examples/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/dollar-string-examples/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/empty-clients/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/empty-clients/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/empty-clients/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/empty-clients/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/endpoint-security-auth/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/endpoint-security-auth/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/endpoint-security-auth/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/endpoint-security-auth/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/enum/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/enum/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/enum/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/enum/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/error-property/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/error-property/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/error-property/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/error-property/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/errors/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/errors/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/errors/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/errors/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/examples/no-custom-config/src/Commons/Types/Types/Data.php b/seed/php-sdk/examples/no-custom-config/src/Commons/Types/Types/Data.php index 3565c94ce984..3ce54b7e2bdb 100644 --- a/seed/php-sdk/examples/no-custom-config/src/Commons/Types/Types/Data.php +++ b/seed/php-sdk/examples/no-custom-config/src/Commons/Types/Types/Data.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class Data extends JsonSerializableType { @@ -157,18 +156,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/examples/no-custom-config/src/Commons/Types/Types/EventInfo.php b/seed/php-sdk/examples/no-custom-config/src/Commons/Types/Types/EventInfo.php index 51bb58d0305d..093a24bc9a3c 100644 --- a/seed/php-sdk/examples/no-custom-config/src/Commons/Types/Types/EventInfo.php +++ b/seed/php-sdk/examples/no-custom-config/src/Commons/Types/Types/EventInfo.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class EventInfo extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/examples/no-custom-config/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/examples/no-custom-config/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/examples/no-custom-config/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/examples/no-custom-config/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/examples/no-custom-config/src/Types/Types/Exception.php b/seed/php-sdk/examples/no-custom-config/src/Types/Types/Exception.php index 53d81db53795..8e4ccde735f5 100644 --- a/seed/php-sdk/examples/no-custom-config/src/Types/Types/Exception.php +++ b/seed/php-sdk/examples/no-custom-config/src/Types/Types/Exception.php @@ -3,7 +3,6 @@ namespace Seed\Types\Types; use Seed\Core\Json\JsonSerializableType; -use Seed\Core\Json\JsonDecoder; class Exception extends JsonSerializableType { @@ -135,17 +134,6 @@ public function jsonSerialize(): array { return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)){ - throw new \\Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/examples/no-custom-config/src/Types/Types/Metadata.php b/seed/php-sdk/examples/no-custom-config/src/Types/Types/Metadata.php index 7d3d6d838f44..9434c424611f 100644 --- a/seed/php-sdk/examples/no-custom-config/src/Types/Types/Metadata.php +++ b/seed/php-sdk/examples/no-custom-config/src/Types/Types/Metadata.php @@ -6,7 +6,6 @@ use Seed\Core\Json\JsonProperty; use Seed\Core\Types\ArrayType; use Exception; -use Seed\Core\Json\JsonDecoder; class Metadata extends JsonSerializableType { @@ -183,18 +182,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/examples/no-custom-config/src/Types/Types/Test.php b/seed/php-sdk/examples/no-custom-config/src/Types/Types/Test.php index 162640567f74..5bb800cecce7 100644 --- a/seed/php-sdk/examples/no-custom-config/src/Types/Types/Test.php +++ b/seed/php-sdk/examples/no-custom-config/src/Types/Types/Test.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class Test extends JsonSerializableType { @@ -157,18 +156,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/examples/readme-config/src/Commons/Types/Types/Data.php b/seed/php-sdk/examples/readme-config/src/Commons/Types/Types/Data.php index 3565c94ce984..3ce54b7e2bdb 100644 --- a/seed/php-sdk/examples/readme-config/src/Commons/Types/Types/Data.php +++ b/seed/php-sdk/examples/readme-config/src/Commons/Types/Types/Data.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class Data extends JsonSerializableType { @@ -157,18 +156,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/examples/readme-config/src/Commons/Types/Types/EventInfo.php b/seed/php-sdk/examples/readme-config/src/Commons/Types/Types/EventInfo.php index 51bb58d0305d..093a24bc9a3c 100644 --- a/seed/php-sdk/examples/readme-config/src/Commons/Types/Types/EventInfo.php +++ b/seed/php-sdk/examples/readme-config/src/Commons/Types/Types/EventInfo.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class EventInfo extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/examples/readme-config/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/examples/readme-config/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/examples/readme-config/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/examples/readme-config/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/examples/readme-config/src/Types/Types/Exception.php b/seed/php-sdk/examples/readme-config/src/Types/Types/Exception.php index 53d81db53795..8e4ccde735f5 100644 --- a/seed/php-sdk/examples/readme-config/src/Types/Types/Exception.php +++ b/seed/php-sdk/examples/readme-config/src/Types/Types/Exception.php @@ -3,7 +3,6 @@ namespace Seed\Types\Types; use Seed\Core\Json\JsonSerializableType; -use Seed\Core\Json\JsonDecoder; class Exception extends JsonSerializableType { @@ -135,17 +134,6 @@ public function jsonSerialize(): array { return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)){ - throw new \\Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/examples/readme-config/src/Types/Types/Metadata.php b/seed/php-sdk/examples/readme-config/src/Types/Types/Metadata.php index 7d3d6d838f44..9434c424611f 100644 --- a/seed/php-sdk/examples/readme-config/src/Types/Types/Metadata.php +++ b/seed/php-sdk/examples/readme-config/src/Types/Types/Metadata.php @@ -6,7 +6,6 @@ use Seed\Core\Json\JsonProperty; use Seed\Core\Types\ArrayType; use Exception; -use Seed\Core\Json\JsonDecoder; class Metadata extends JsonSerializableType { @@ -183,18 +182,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/examples/readme-config/src/Types/Types/Test.php b/seed/php-sdk/examples/readme-config/src/Types/Types/Test.php index 162640567f74..5bb800cecce7 100644 --- a/seed/php-sdk/examples/readme-config/src/Types/Types/Test.php +++ b/seed/php-sdk/examples/readme-config/src/Types/Types/Test.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class Test extends JsonSerializableType { @@ -157,18 +156,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/exhaustive/no-custom-config/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/exhaustive/no-custom-config/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/exhaustive/no-custom-config/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/exhaustive/no-custom-config/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/exhaustive/no-custom-config/src/Types/Union/Types/Animal.php b/seed/php-sdk/exhaustive/no-custom-config/src/Types/Union/Types/Animal.php index 8138ea53a41e..02921a00c0b8 100644 --- a/seed/php-sdk/exhaustive/no-custom-config/src/Types/Union/Types/Animal.php +++ b/seed/php-sdk/exhaustive/no-custom-config/src/Types/Union/Types/Animal.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class Animal extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/exhaustive/wire-tests/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/exhaustive/wire-tests/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/exhaustive/wire-tests/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/exhaustive/wire-tests/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/exhaustive/wire-tests/src/Types/Union/Types/Animal.php b/seed/php-sdk/exhaustive/wire-tests/src/Types/Union/Types/Animal.php index 8138ea53a41e..02921a00c0b8 100644 --- a/seed/php-sdk/exhaustive/wire-tests/src/Types/Union/Types/Animal.php +++ b/seed/php-sdk/exhaustive/wire-tests/src/Types/Union/Types/Animal.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class Animal extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/extends/no-custom-config/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/extends/no-custom-config/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/extends/no-custom-config/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/extends/no-custom-config/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/extends/private/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/extends/private/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/extends/private/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/extends/private/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/extra-properties/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/extra-properties/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/extra-properties/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/extra-properties/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/file-download/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/file-download/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/file-download/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/file-download/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/file-upload-openapi/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/file-upload-openapi/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/file-upload-openapi/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/file-upload-openapi/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/file-upload/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/file-upload/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/file-upload/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/file-upload/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/folders/no-custom-config/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/folders/no-custom-config/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/folders/no-custom-config/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/folders/no-custom-config/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/folders/with-interfaces/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/folders/with-interfaces/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/folders/with-interfaces/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/folders/with-interfaces/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/header-auth-environment-variable/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/header-auth-environment-variable/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/header-auth-environment-variable/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/header-auth-environment-variable/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/header-auth/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/header-auth/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/header-auth/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/header-auth/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/http-head/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/http-head/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/http-head/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/http-head/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/idempotency-headers/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/idempotency-headers/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/idempotency-headers/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/idempotency-headers/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/imdb/clientName/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/imdb/clientName/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/imdb/clientName/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/imdb/clientName/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/imdb/namespace/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/imdb/namespace/src/Core/Json/JsonSerializableType.php index 0738a8e24072..e70c2a2fa35d 100644 --- a/seed/php-sdk/imdb/namespace/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/imdb/namespace/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/imdb/no-custom-config/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/imdb/no-custom-config/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/imdb/no-custom-config/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/imdb/no-custom-config/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/imdb/omit-fern-headers/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/imdb/omit-fern-headers/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/imdb/omit-fern-headers/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/imdb/omit-fern-headers/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/imdb/package-path/src/Custom/Package/Path/Core/Json/JsonSerializableType.php b/seed/php-sdk/imdb/package-path/src/Custom/Package/Path/Core/Json/JsonSerializableType.php index 0821fccd90e8..80cb4bc9dc0a 100644 --- a/seed/php-sdk/imdb/package-path/src/Custom/Package/Path/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/imdb/package-path/src/Custom/Package/Path/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/imdb/packageName/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/imdb/packageName/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/imdb/packageName/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/imdb/packageName/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/imdb/private/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/imdb/private/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/imdb/private/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/imdb/private/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/inferred-auth-explicit/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/inferred-auth-explicit/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/inferred-auth-explicit/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/inferred-auth-explicit/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/inferred-auth-implicit-api-key/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/inferred-auth-implicit-api-key/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/inferred-auth-implicit-api-key/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/inferred-auth-implicit-api-key/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/inferred-auth-implicit-no-expiry/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/inferred-auth-implicit-no-expiry/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/inferred-auth-implicit-no-expiry/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/inferred-auth-implicit-no-expiry/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/inferred-auth-implicit-reference/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/inferred-auth-implicit-reference/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/inferred-auth-implicit-reference/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/inferred-auth-implicit-reference/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/inferred-auth-implicit/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/inferred-auth-implicit/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/inferred-auth-implicit/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/inferred-auth-implicit/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/license/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/license/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/license/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/license/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/literal-user-agent/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/literal-user-agent/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/literal-user-agent/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/literal-user-agent/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/literal/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/literal/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/literal/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/literal/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/literal/src/Inlined/Types/DiscriminatedLiteral.php b/seed/php-sdk/literal/src/Inlined/Types/DiscriminatedLiteral.php index 43ded607874b..26a543204dd9 100644 --- a/seed/php-sdk/literal/src/Inlined/Types/DiscriminatedLiteral.php +++ b/seed/php-sdk/literal/src/Inlined/Types/DiscriminatedLiteral.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class DiscriminatedLiteral extends JsonSerializableType { @@ -243,18 +242,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/literals-unions/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/literals-unions/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/literals-unions/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/literals-unions/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/mixed-case/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/mixed-case/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/mixed-case/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/mixed-case/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/mixed-case/src/Service/Types/Resource.php b/seed/php-sdk/mixed-case/src/Service/Types/Resource.php index 48c26f1fa722..9f6047948f0b 100644 --- a/seed/php-sdk/mixed-case/src/Service/Types/Resource.php +++ b/seed/php-sdk/mixed-case/src/Service/Types/Resource.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Core\Json\JsonProperty; use Exception; -use Seed\Core\Json\JsonDecoder; class Resource extends JsonSerializableType { @@ -172,18 +171,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/mixed-file-directory/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/mixed-file-directory/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/mixed-file-directory/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/mixed-file-directory/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/multi-line-docs/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/multi-line-docs/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/multi-line-docs/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/multi-line-docs/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/multi-url-environment-no-default/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/multi-url-environment-no-default/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/multi-url-environment-no-default/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/multi-url-environment-no-default/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/multi-url-environment-reference/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/multi-url-environment-reference/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/multi-url-environment-reference/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/multi-url-environment-reference/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/multi-url-environment/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/multi-url-environment/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/multi-url-environment/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/multi-url-environment/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/multiple-request-bodies/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/multiple-request-bodies/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/multiple-request-bodies/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/multiple-request-bodies/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/no-content-response/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/no-content-response/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/no-content-response/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/no-content-response/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/no-environment/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/no-environment/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/no-environment/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/no-environment/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/no-retries/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/no-retries/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/no-retries/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/no-retries/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/null-type/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/null-type/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/null-type/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/null-type/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/nullable-allof-extends/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/nullable-allof-extends/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/nullable-allof-extends/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/nullable-allof-extends/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/nullable-optional/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/nullable-optional/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/nullable-optional/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/nullable-optional/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/nullable-optional/src/NullableOptional/Types/NotificationMethod.php b/seed/php-sdk/nullable-optional/src/NullableOptional/Types/NotificationMethod.php index 46b1c7819021..d2499512e3d4 100644 --- a/seed/php-sdk/nullable-optional/src/NullableOptional/Types/NotificationMethod.php +++ b/seed/php-sdk/nullable-optional/src/NullableOptional/Types/NotificationMethod.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; /** * Discriminated union for testing nullable unions @@ -204,18 +203,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/nullable-optional/src/NullableOptional/Types/SearchResult.php b/seed/php-sdk/nullable-optional/src/NullableOptional/Types/SearchResult.php index 65b289d75d43..d58c6d7f2751 100644 --- a/seed/php-sdk/nullable-optional/src/NullableOptional/Types/SearchResult.php +++ b/seed/php-sdk/nullable-optional/src/NullableOptional/Types/SearchResult.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; /** * Undiscriminated union for testing @@ -204,18 +203,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/nullable-request-body/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/nullable-request-body/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/nullable-request-body/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/nullable-request-body/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/nullable/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/nullable/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/nullable/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/nullable/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/nullable/src/Nullable/Types/Status.php b/seed/php-sdk/nullable/src/Nullable/Types/Status.php index 605a48e07733..42304e78a419 100644 --- a/seed/php-sdk/nullable/src/Nullable/Types/Status.php +++ b/seed/php-sdk/nullable/src/Nullable/Types/Status.php @@ -6,7 +6,6 @@ use DateTime; use Exception; use Seed\Core\Json\JsonSerializer; -use Seed\Core\Json\JsonDecoder; class Status extends JsonSerializableType { @@ -193,18 +192,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/oauth-client-credentials-custom/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/oauth-client-credentials-custom/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/oauth-client-credentials-custom/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/oauth-client-credentials-custom/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/oauth-client-credentials-default/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/oauth-client-credentials-default/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/oauth-client-credentials-default/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/oauth-client-credentials-default/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/oauth-client-credentials-environment-variables/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/oauth-client-credentials-environment-variables/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/oauth-client-credentials-environment-variables/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/oauth-client-credentials-environment-variables/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/oauth-client-credentials-mandatory-auth/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/oauth-client-credentials-mandatory-auth/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/oauth-client-credentials-mandatory-auth/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/oauth-client-credentials-mandatory-auth/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/oauth-client-credentials-nested-root/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/oauth-client-credentials-nested-root/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/oauth-client-credentials-nested-root/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/oauth-client-credentials-nested-root/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/oauth-client-credentials-openapi/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/oauth-client-credentials-openapi/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/oauth-client-credentials-openapi/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/oauth-client-credentials-openapi/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/oauth-client-credentials-reference/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/oauth-client-credentials-reference/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/oauth-client-credentials-reference/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/oauth-client-credentials-reference/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/oauth-client-credentials-with-variables/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/oauth-client-credentials-with-variables/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/oauth-client-credentials-with-variables/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/oauth-client-credentials-with-variables/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/oauth-client-credentials/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/oauth-client-credentials/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/oauth-client-credentials/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/oauth-client-credentials/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/object/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/object/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/object/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/object/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/objects-with-imports/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/objects-with-imports/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/objects-with-imports/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/objects-with-imports/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/openapi-request-body-ref/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/openapi-request-body-ref/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/openapi-request-body-ref/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/openapi-request-body-ref/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/optional/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/optional/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/optional/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/optional/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/package-yml/no-custom-config/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/package-yml/no-custom-config/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/package-yml/no-custom-config/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/package-yml/no-custom-config/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/package-yml/private/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/package-yml/private/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/package-yml/private/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/package-yml/private/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/pagination-custom/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/pagination-custom/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/pagination-custom/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/pagination-custom/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/pagination-uri-path/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/pagination-uri-path/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/pagination-uri-path/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/pagination-uri-path/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/pagination/no-custom-config/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/pagination/no-custom-config/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/pagination/no-custom-config/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/pagination/no-custom-config/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/pagination/page-index-semantics/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/pagination/page-index-semantics/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/pagination/page-index-semantics/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/pagination/page-index-semantics/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/pagination/property-accessors/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/pagination/property-accessors/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/pagination/property-accessors/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/pagination/property-accessors/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/path-parameters/inline-path-parameters-private/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/path-parameters/inline-path-parameters-private/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/path-parameters/inline-path-parameters-private/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/path-parameters/inline-path-parameters-private/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/path-parameters/inline-path-parameters/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/path-parameters/inline-path-parameters/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/path-parameters/inline-path-parameters/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/path-parameters/inline-path-parameters/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/path-parameters/no-custom-config/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/path-parameters/no-custom-config/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/path-parameters/no-custom-config/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/path-parameters/no-custom-config/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/plain-text/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/plain-text/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/plain-text/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/plain-text/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/property-access/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/property-access/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/property-access/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/property-access/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/property-access/src/Types/UserOrAdminDiscriminated.php b/seed/php-sdk/property-access/src/Types/UserOrAdminDiscriminated.php index bbaa4c3357c1..079636db6883 100644 --- a/seed/php-sdk/property-access/src/Types/UserOrAdminDiscriminated.php +++ b/seed/php-sdk/property-access/src/Types/UserOrAdminDiscriminated.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Core\Json\JsonProperty; use Exception; -use Seed\Core\Json\JsonDecoder; /** * Example of an discriminated union @@ -217,18 +216,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/public-object/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/public-object/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/public-object/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/public-object/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/query-param-name-conflict/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/query-param-name-conflict/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/query-param-name-conflict/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/query-param-name-conflict/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/query-parameters-openapi-as-objects/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/query-parameters-openapi-as-objects/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/query-parameters-openapi-as-objects/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/query-parameters-openapi-as-objects/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/query-parameters-openapi/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/query-parameters-openapi/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/query-parameters-openapi/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/query-parameters-openapi/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/query-parameters/no-custom-config/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/query-parameters/no-custom-config/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/query-parameters/no-custom-config/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/query-parameters/no-custom-config/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/query-parameters/private/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/query-parameters/private/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/query-parameters/private/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/query-parameters/private/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/request-parameters/no-custom-config/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/request-parameters/no-custom-config/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/request-parameters/no-custom-config/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/request-parameters/no-custom-config/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/request-parameters/with-defaults/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/request-parameters/with-defaults/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/request-parameters/with-defaults/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/request-parameters/with-defaults/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/required-nullable/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/required-nullable/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/required-nullable/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/required-nullable/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/reserved-keywords/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/reserved-keywords/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/reserved-keywords/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/reserved-keywords/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/response-property/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/response-property/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/response-property/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/response-property/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/schemaless-request-body-examples/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/schemaless-request-body-examples/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/schemaless-request-body-examples/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/schemaless-request-body-examples/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/server-sent-event-examples/src/Completions/Types/StreamEvent.php b/seed/php-sdk/server-sent-event-examples/src/Completions/Types/StreamEvent.php index 15d922696879..62094ce7f93a 100644 --- a/seed/php-sdk/server-sent-event-examples/src/Completions/Types/StreamEvent.php +++ b/seed/php-sdk/server-sent-event-examples/src/Completions/Types/StreamEvent.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class StreamEvent extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/server-sent-event-examples/src/Completions/Types/StreamEventContextProtocol.php b/seed/php-sdk/server-sent-event-examples/src/Completions/Types/StreamEventContextProtocol.php index 413461c4ae24..9e9fc24850ad 100644 --- a/seed/php-sdk/server-sent-event-examples/src/Completions/Types/StreamEventContextProtocol.php +++ b/seed/php-sdk/server-sent-event-examples/src/Completions/Types/StreamEventContextProtocol.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class StreamEventContextProtocol extends JsonSerializableType { @@ -201,18 +200,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/server-sent-event-examples/src/Completions/Types/StreamEventDiscriminantInData.php b/seed/php-sdk/server-sent-event-examples/src/Completions/Types/StreamEventDiscriminantInData.php index 040dc56940a1..8170ac58d56c 100644 --- a/seed/php-sdk/server-sent-event-examples/src/Completions/Types/StreamEventDiscriminantInData.php +++ b/seed/php-sdk/server-sent-event-examples/src/Completions/Types/StreamEventDiscriminantInData.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class StreamEventDiscriminantInData extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/server-sent-event-examples/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/server-sent-event-examples/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/server-sent-event-examples/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/server-sent-event-examples/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/server-sent-events-openapi/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/server-sent-events-openapi/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/server-sent-events-openapi/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/server-sent-events-openapi/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamDataContextResponse.php b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamDataContextResponse.php index de1432cf67b5..2c5ad7a17b1d 100644 --- a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamDataContextResponse.php +++ b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamDataContextResponse.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class StreamDataContextResponse extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamDataContextWithEnvelopeSchemaResponse.php b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamDataContextWithEnvelopeSchemaResponse.php index 4b4eb865c929..1fac1534b868 100644 --- a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamDataContextWithEnvelopeSchemaResponse.php +++ b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamDataContextWithEnvelopeSchemaResponse.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class StreamDataContextWithEnvelopeSchemaResponse extends JsonSerializableType { @@ -243,18 +242,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamNoContextResponse.php b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamNoContextResponse.php index cf9e881f6f48..e2e1037b0467 100644 --- a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamNoContextResponse.php +++ b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamNoContextResponse.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class StreamNoContextResponse extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamProtocolCollisionResponse.php b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamProtocolCollisionResponse.php index 78692436111c..4e9d075702cd 100644 --- a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamProtocolCollisionResponse.php +++ b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamProtocolCollisionResponse.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class StreamProtocolCollisionResponse extends JsonSerializableType { @@ -243,18 +242,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamProtocolNoCollisionResponse.php b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamProtocolNoCollisionResponse.php index fd94d65c261e..e4838145d60b 100644 --- a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamProtocolNoCollisionResponse.php +++ b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamProtocolNoCollisionResponse.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class StreamProtocolNoCollisionResponse extends JsonSerializableType { @@ -243,18 +242,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamProtocolWithFlatSchemaResponse.php b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamProtocolWithFlatSchemaResponse.php index f791f9c61a46..768157e9df8d 100644 --- a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamProtocolWithFlatSchemaResponse.php +++ b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamProtocolWithFlatSchemaResponse.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class StreamProtocolWithFlatSchemaResponse extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamXFernStreamingUnionRequest.php b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamXFernStreamingUnionRequest.php index 0cf832ea7afa..92ea63a22651 100644 --- a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamXFernStreamingUnionRequest.php +++ b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamXFernStreamingUnionRequest.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Core\Json\JsonProperty; use Exception; -use Seed\Core\Json\JsonDecoder; /** * A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. @@ -219,18 +218,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamXFernStreamingUnionStreamRequest.php b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamXFernStreamingUnionStreamRequest.php index f534daf1920b..3e81c6516956 100644 --- a/seed/php-sdk/server-sent-events-openapi/src/Types/StreamXFernStreamingUnionStreamRequest.php +++ b/seed/php-sdk/server-sent-events-openapi/src/Types/StreamXFernStreamingUnionStreamRequest.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Core\Json\JsonProperty; use Exception; -use Seed\Core\Json\JsonDecoder; /** * A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. @@ -219,18 +218,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/server-sent-events-openapi/src/Types/UnionStreamRequest.php b/seed/php-sdk/server-sent-events-openapi/src/Types/UnionStreamRequest.php index f935b908c481..64a842564048 100644 --- a/seed/php-sdk/server-sent-events-openapi/src/Types/UnionStreamRequest.php +++ b/seed/php-sdk/server-sent-events-openapi/src/Types/UnionStreamRequest.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; /** * A discriminated union request matching the Vectara pattern (FER-9556). Each variant inherits stream_response from UnionStreamRequestBase via allOf. The importer pins stream_response to Literal[True/False] at this union level, but the allOf inheritance re-introduces it as boolean in each variant, causing the type conflict. @@ -204,18 +203,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/server-sent-events-resumable/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/server-sent-events-resumable/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/server-sent-events-resumable/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/server-sent-events-resumable/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/server-sent-events/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/server-sent-events/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/server-sent-events/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/server-sent-events/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/server-url-templating/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/server-url-templating/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/server-url-templating/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/server-url-templating/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/simple-api/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/simple-api/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/simple-api/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/simple-api/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/simple-fhir/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/simple-fhir/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/simple-fhir/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/simple-fhir/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/single-url-environment-default/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/single-url-environment-default/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/single-url-environment-default/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/single-url-environment-default/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/single-url-environment-no-default/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/single-url-environment-no-default/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/single-url-environment-no-default/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/single-url-environment-no-default/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/streaming-parameter/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/streaming-parameter/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/streaming-parameter/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/streaming-parameter/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/streaming/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/streaming/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/streaming/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/streaming/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/trace/src/Admin/Types/Test.php b/seed/php-sdk/trace/src/Admin/Types/Test.php index 1b25e884ac91..0068a2e71db7 100644 --- a/seed/php-sdk/trace/src/Admin/Types/Test.php +++ b/seed/php-sdk/trace/src/Admin/Types/Test.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class Test extends JsonSerializableType { @@ -157,18 +156,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Commons/Types/DebugVariableValue.php b/seed/php-sdk/trace/src/Commons/Types/DebugVariableValue.php index d2f5acc227ea..f73752206260 100644 --- a/seed/php-sdk/trace/src/Commons/Types/DebugVariableValue.php +++ b/seed/php-sdk/trace/src/Commons/Types/DebugVariableValue.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class DebugVariableValue extends JsonSerializableType { @@ -585,18 +584,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Commons/Types/VariableType.php b/seed/php-sdk/trace/src/Commons/Types/VariableType.php index e53086b39c66..fa3d93009e76 100644 --- a/seed/php-sdk/trace/src/Commons/Types/VariableType.php +++ b/seed/php-sdk/trace/src/Commons/Types/VariableType.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class VariableType extends JsonSerializableType { @@ -353,18 +352,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Commons/Types/VariableValue.php b/seed/php-sdk/trace/src/Commons/Types/VariableValue.php index ecdcde42e9a9..c5cf3cd221db 100644 --- a/seed/php-sdk/trace/src/Commons/Types/VariableValue.php +++ b/seed/php-sdk/trace/src/Commons/Types/VariableValue.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class VariableValue extends JsonSerializableType { @@ -519,18 +518,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/trace/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/trace/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/trace/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/trace/src/Playlist/Types/PlaylistIdNotFoundErrorBody.php b/seed/php-sdk/trace/src/Playlist/Types/PlaylistIdNotFoundErrorBody.php index c86e69ea47f0..628d84d5b8c5 100644 --- a/seed/php-sdk/trace/src/Playlist/Types/PlaylistIdNotFoundErrorBody.php +++ b/seed/php-sdk/trace/src/Playlist/Types/PlaylistIdNotFoundErrorBody.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class PlaylistIdNotFoundErrorBody extends JsonSerializableType { @@ -117,18 +116,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Problem/Types/CreateProblemError.php b/seed/php-sdk/trace/src/Problem/Types/CreateProblemError.php index 37af72692a11..4f49d8612c5b 100644 --- a/seed/php-sdk/trace/src/Problem/Types/CreateProblemError.php +++ b/seed/php-sdk/trace/src/Problem/Types/CreateProblemError.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class CreateProblemError extends JsonSerializableType { @@ -117,18 +116,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Problem/Types/CreateProblemResponse.php b/seed/php-sdk/trace/src/Problem/Types/CreateProblemResponse.php index d6d521282561..d4bc488be5a8 100644 --- a/seed/php-sdk/trace/src/Problem/Types/CreateProblemResponse.php +++ b/seed/php-sdk/trace/src/Problem/Types/CreateProblemResponse.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class CreateProblemResponse extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Problem/Types/ProblemDescriptionBoard.php b/seed/php-sdk/trace/src/Problem/Types/ProblemDescriptionBoard.php index d9e920c0e2b0..462e88699c7d 100644 --- a/seed/php-sdk/trace/src/Problem/Types/ProblemDescriptionBoard.php +++ b/seed/php-sdk/trace/src/Problem/Types/ProblemDescriptionBoard.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Commons\Types\VariableValue; use Exception; -use Seed\Core\Json\JsonDecoder; class ProblemDescriptionBoard extends JsonSerializableType { @@ -200,18 +199,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/ActualResult.php b/seed/php-sdk/trace/src/Submission/Types/ActualResult.php index 146ddec1b4e3..e92c1f7245ea 100644 --- a/seed/php-sdk/trace/src/Submission/Types/ActualResult.php +++ b/seed/php-sdk/trace/src/Submission/Types/ActualResult.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Commons\Types\VariableValue; use Exception; -use Seed\Core\Json\JsonDecoder; class ActualResult extends JsonSerializableType { @@ -202,18 +201,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/CodeExecutionUpdate.php b/seed/php-sdk/trace/src/Submission/Types/CodeExecutionUpdate.php index 6f48aa24cac7..96d298aa001f 100644 --- a/seed/php-sdk/trace/src/Submission/Types/CodeExecutionUpdate.php +++ b/seed/php-sdk/trace/src/Submission/Types/CodeExecutionUpdate.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class CodeExecutionUpdate extends JsonSerializableType { @@ -537,18 +536,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/ErrorInfo.php b/seed/php-sdk/trace/src/Submission/Types/ErrorInfo.php index 977559a86a8b..011a109066ba 100644 --- a/seed/php-sdk/trace/src/Submission/Types/ErrorInfo.php +++ b/seed/php-sdk/trace/src/Submission/Types/ErrorInfo.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class ErrorInfo extends JsonSerializableType { @@ -201,18 +200,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/ExceptionV2.php b/seed/php-sdk/trace/src/Submission/Types/ExceptionV2.php index abd6258c48e1..53bb01012d47 100644 --- a/seed/php-sdk/trace/src/Submission/Types/ExceptionV2.php +++ b/seed/php-sdk/trace/src/Submission/Types/ExceptionV2.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class ExceptionV2 extends JsonSerializableType { @@ -143,18 +142,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/InvalidRequestCause.php b/seed/php-sdk/trace/src/Submission/Types/InvalidRequestCause.php index 507a2853b4fb..ec5941d3e053 100644 --- a/seed/php-sdk/trace/src/Submission/Types/InvalidRequestCause.php +++ b/seed/php-sdk/trace/src/Submission/Types/InvalidRequestCause.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class InvalidRequestCause extends JsonSerializableType { @@ -201,18 +200,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/SubmissionRequest.php b/seed/php-sdk/trace/src/Submission/Types/SubmissionRequest.php index 800245a46d1a..5afcb94a2e3c 100644 --- a/seed/php-sdk/trace/src/Submission/Types/SubmissionRequest.php +++ b/seed/php-sdk/trace/src/Submission/Types/SubmissionRequest.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class SubmissionRequest extends JsonSerializableType { @@ -269,18 +268,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/SubmissionResponse.php b/seed/php-sdk/trace/src/Submission/Types/SubmissionResponse.php index a1d246b771eb..2fcd76cd9e96 100644 --- a/seed/php-sdk/trace/src/Submission/Types/SubmissionResponse.php +++ b/seed/php-sdk/trace/src/Submission/Types/SubmissionResponse.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class SubmissionResponse extends JsonSerializableType { @@ -293,18 +292,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/SubmissionStatusForTestCase.php b/seed/php-sdk/trace/src/Submission/Types/SubmissionStatusForTestCase.php index 0a1ee05794be..b9eb18488be1 100644 --- a/seed/php-sdk/trace/src/Submission/Types/SubmissionStatusForTestCase.php +++ b/seed/php-sdk/trace/src/Submission/Types/SubmissionStatusForTestCase.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class SubmissionStatusForTestCase extends JsonSerializableType { @@ -201,18 +200,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/SubmissionStatusV2.php b/seed/php-sdk/trace/src/Submission/Types/SubmissionStatusV2.php index 26f1f8c21373..e371c72a28a8 100644 --- a/seed/php-sdk/trace/src/Submission/Types/SubmissionStatusV2.php +++ b/seed/php-sdk/trace/src/Submission/Types/SubmissionStatusV2.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class SubmissionStatusV2 extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/SubmissionTypeState.php b/seed/php-sdk/trace/src/Submission/Types/SubmissionTypeState.php index f109561a5669..a393cf7049c6 100644 --- a/seed/php-sdk/trace/src/Submission/Types/SubmissionTypeState.php +++ b/seed/php-sdk/trace/src/Submission/Types/SubmissionTypeState.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class SubmissionTypeState extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/TestCaseGrade.php b/seed/php-sdk/trace/src/Submission/Types/TestCaseGrade.php index 503a04e085f4..beb1c0b274c2 100644 --- a/seed/php-sdk/trace/src/Submission/Types/TestCaseGrade.php +++ b/seed/php-sdk/trace/src/Submission/Types/TestCaseGrade.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class TestCaseGrade extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/TestSubmissionStatus.php b/seed/php-sdk/trace/src/Submission/Types/TestSubmissionStatus.php index 4f7cccd8b0b0..370970075818 100644 --- a/seed/php-sdk/trace/src/Submission/Types/TestSubmissionStatus.php +++ b/seed/php-sdk/trace/src/Submission/Types/TestSubmissionStatus.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class TestSubmissionStatus extends JsonSerializableType { @@ -227,18 +226,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/TestSubmissionUpdateInfo.php b/seed/php-sdk/trace/src/Submission/Types/TestSubmissionUpdateInfo.php index 1c2a1e8a6526..63a51f5adac7 100644 --- a/seed/php-sdk/trace/src/Submission/Types/TestSubmissionUpdateInfo.php +++ b/seed/php-sdk/trace/src/Submission/Types/TestSubmissionUpdateInfo.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class TestSubmissionUpdateInfo extends JsonSerializableType { @@ -293,18 +292,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/WorkspaceSubmissionStatus.php b/seed/php-sdk/trace/src/Submission/Types/WorkspaceSubmissionStatus.php index 5a196cc3a1a3..9c95206bd7fe 100644 --- a/seed/php-sdk/trace/src/Submission/Types/WorkspaceSubmissionStatus.php +++ b/seed/php-sdk/trace/src/Submission/Types/WorkspaceSubmissionStatus.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class WorkspaceSubmissionStatus extends JsonSerializableType { @@ -267,18 +266,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/Submission/Types/WorkspaceSubmissionUpdateInfo.php b/seed/php-sdk/trace/src/Submission/Types/WorkspaceSubmissionUpdateInfo.php index 6b6ca098155f..1003545c4bd8 100644 --- a/seed/php-sdk/trace/src/Submission/Types/WorkspaceSubmissionUpdateInfo.php +++ b/seed/php-sdk/trace/src/Submission/Types/WorkspaceSubmissionUpdateInfo.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class WorkspaceSubmissionUpdateInfo extends JsonSerializableType { @@ -317,18 +316,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/V2/Problem/Types/AssertCorrectnessCheck.php b/seed/php-sdk/trace/src/V2/Problem/Types/AssertCorrectnessCheck.php index c3f41b4d18c1..9c8aa6f95de9 100644 --- a/seed/php-sdk/trace/src/V2/Problem/Types/AssertCorrectnessCheck.php +++ b/seed/php-sdk/trace/src/V2/Problem/Types/AssertCorrectnessCheck.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class AssertCorrectnessCheck extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/V2/Problem/Types/CustomFiles.php b/seed/php-sdk/trace/src/V2/Problem/Types/CustomFiles.php index c71e091facae..fdc9c2f619b6 100644 --- a/seed/php-sdk/trace/src/V2/Problem/Types/CustomFiles.php +++ b/seed/php-sdk/trace/src/V2/Problem/Types/CustomFiles.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Commons\Types\Language; use Exception; -use Seed\Core\Json\JsonDecoder; class CustomFiles extends JsonSerializableType { @@ -160,18 +159,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/V2/Problem/Types/FunctionSignature.php b/seed/php-sdk/trace/src/V2/Problem/Types/FunctionSignature.php index a760f30785a6..18713602bc3b 100644 --- a/seed/php-sdk/trace/src/V2/Problem/Types/FunctionSignature.php +++ b/seed/php-sdk/trace/src/V2/Problem/Types/FunctionSignature.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class FunctionSignature extends JsonSerializableType { @@ -201,18 +200,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/V2/Problem/Types/TestCaseFunction.php b/seed/php-sdk/trace/src/V2/Problem/Types/TestCaseFunction.php index b63fbf037962..4d0deb49c5b6 100644 --- a/seed/php-sdk/trace/src/V2/Problem/Types/TestCaseFunction.php +++ b/seed/php-sdk/trace/src/V2/Problem/Types/TestCaseFunction.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class TestCaseFunction extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/V2/Problem/Types/TestCaseImplementationDescriptionBoard.php b/seed/php-sdk/trace/src/V2/Problem/Types/TestCaseImplementationDescriptionBoard.php index 8cb21ac79d48..cf98f71059f2 100644 --- a/seed/php-sdk/trace/src/V2/Problem/Types/TestCaseImplementationDescriptionBoard.php +++ b/seed/php-sdk/trace/src/V2/Problem/Types/TestCaseImplementationDescriptionBoard.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class TestCaseImplementationDescriptionBoard extends JsonSerializableType { @@ -157,18 +156,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/V2/Problem/Types/TestCaseImplementationReference.php b/seed/php-sdk/trace/src/V2/Problem/Types/TestCaseImplementationReference.php index 526cc0b93538..102fd139d7f5 100644 --- a/seed/php-sdk/trace/src/V2/Problem/Types/TestCaseImplementationReference.php +++ b/seed/php-sdk/trace/src/V2/Problem/Types/TestCaseImplementationReference.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class TestCaseImplementationReference extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/V2/V3/Problem/Types/AssertCorrectnessCheck.php b/seed/php-sdk/trace/src/V2/V3/Problem/Types/AssertCorrectnessCheck.php index 51c211354856..f80a17925930 100644 --- a/seed/php-sdk/trace/src/V2/V3/Problem/Types/AssertCorrectnessCheck.php +++ b/seed/php-sdk/trace/src/V2/V3/Problem/Types/AssertCorrectnessCheck.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class AssertCorrectnessCheck extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/V2/V3/Problem/Types/CustomFiles.php b/seed/php-sdk/trace/src/V2/V3/Problem/Types/CustomFiles.php index 5dce6b241738..c980f36901eb 100644 --- a/seed/php-sdk/trace/src/V2/V3/Problem/Types/CustomFiles.php +++ b/seed/php-sdk/trace/src/V2/V3/Problem/Types/CustomFiles.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Commons\Types\Language; use Exception; -use Seed\Core\Json\JsonDecoder; class CustomFiles extends JsonSerializableType { @@ -160,18 +159,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/V2/V3/Problem/Types/FunctionSignature.php b/seed/php-sdk/trace/src/V2/V3/Problem/Types/FunctionSignature.php index 89d604493192..5c4e3de89815 100644 --- a/seed/php-sdk/trace/src/V2/V3/Problem/Types/FunctionSignature.php +++ b/seed/php-sdk/trace/src/V2/V3/Problem/Types/FunctionSignature.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class FunctionSignature extends JsonSerializableType { @@ -201,18 +200,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/V2/V3/Problem/Types/TestCaseFunction.php b/seed/php-sdk/trace/src/V2/V3/Problem/Types/TestCaseFunction.php index f473efad85dc..6a7a7bfb6049 100644 --- a/seed/php-sdk/trace/src/V2/V3/Problem/Types/TestCaseFunction.php +++ b/seed/php-sdk/trace/src/V2/V3/Problem/Types/TestCaseFunction.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class TestCaseFunction extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/V2/V3/Problem/Types/TestCaseImplementationDescriptionBoard.php b/seed/php-sdk/trace/src/V2/V3/Problem/Types/TestCaseImplementationDescriptionBoard.php index 7f52460dce15..1dd6bf6f9ce7 100644 --- a/seed/php-sdk/trace/src/V2/V3/Problem/Types/TestCaseImplementationDescriptionBoard.php +++ b/seed/php-sdk/trace/src/V2/V3/Problem/Types/TestCaseImplementationDescriptionBoard.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class TestCaseImplementationDescriptionBoard extends JsonSerializableType { @@ -157,18 +156,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/trace/src/V2/V3/Problem/Types/TestCaseImplementationReference.php b/seed/php-sdk/trace/src/V2/V3/Problem/Types/TestCaseImplementationReference.php index 2f2ae64019ae..b304137901c9 100644 --- a/seed/php-sdk/trace/src/V2/V3/Problem/Types/TestCaseImplementationReference.php +++ b/seed/php-sdk/trace/src/V2/V3/Problem/Types/TestCaseImplementationReference.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class TestCaseImplementationReference extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/undiscriminated-union-with-response-property/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/undiscriminated-union-with-response-property/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/undiscriminated-union-with-response-property/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/undiscriminated-union-with-response-property/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/undiscriminated-unions/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/undiscriminated-unions/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/undiscriminated-unions/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/undiscriminated-unions/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/union-query-parameters/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/union-query-parameters/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/union-query-parameters/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/union-query-parameters/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/unions-with-local-date/src/Bigunion/Types/BigUnion.php b/seed/php-sdk/unions-with-local-date/src/Bigunion/Types/BigUnion.php index 146fda428ac3..54972c5b2b4b 100644 --- a/seed/php-sdk/unions-with-local-date/src/Bigunion/Types/BigUnion.php +++ b/seed/php-sdk/unions-with-local-date/src/Bigunion/Types/BigUnion.php @@ -7,7 +7,6 @@ use DateTime; use Seed\Core\Types\Date; use Exception; -use Seed\Core\Json\JsonDecoder; class BigUnion extends JsonSerializableType { @@ -1494,18 +1493,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/unions-with-local-date/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/unions-with-local-date/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/unions-with-local-date/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/Union.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/Union.php index 3e30b4dcf023..235a392e9852 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/Union.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/Union.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; /** * This is a simple union. @@ -162,18 +161,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithBaseProperties.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithBaseProperties.php index 545f7d16d423..43373b89e413 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithBaseProperties.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithBaseProperties.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Core\Json\JsonProperty; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithBaseProperties extends JsonSerializableType { @@ -216,18 +215,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithDiscriminant.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithDiscriminant.php index 12a0ec0e6c63..da5cf2327b96 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithDiscriminant.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithDiscriminant.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithDiscriminant extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithDuplicatePrimitive.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithDuplicatePrimitive.php index 188842b28131..80b093ce64c5 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithDuplicatePrimitive.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithDuplicatePrimitive.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithDuplicatePrimitive extends JsonSerializableType { @@ -239,18 +238,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithDuplicateTypes.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithDuplicateTypes.php index 84dbbf00e1e5..cf17fd2855be 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithDuplicateTypes.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithDuplicateTypes.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithDuplicateTypes extends JsonSerializableType { @@ -157,18 +156,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithLiteral.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithLiteral.php index 233c78542c0f..18b81e1980a8 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithLiteral.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithLiteral.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Core\Json\JsonProperty; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithLiteral extends JsonSerializableType { @@ -128,18 +127,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithMultipleNoProperties.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithMultipleNoProperties.php index 351b56a90bfa..f43e623c4aac 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithMultipleNoProperties.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithMultipleNoProperties.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithMultipleNoProperties extends JsonSerializableType { @@ -167,18 +166,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithNoProperties.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithNoProperties.php index 025656a3dbbf..5edae1ed3447 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithNoProperties.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithNoProperties.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithNoProperties extends JsonSerializableType { @@ -143,18 +142,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithOptionalTime.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithOptionalTime.php index 98db6869d002..73ab9d86d4a1 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithOptionalTime.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithOptionalTime.php @@ -6,7 +6,6 @@ use DateTime; use Exception; use Seed\Core\Json\JsonSerializer; -use Seed\Core\Json\JsonDecoder; class UnionWithOptionalTime extends JsonSerializableType { @@ -167,18 +166,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithPrimitive.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithPrimitive.php index 290460149239..2044db3c9259 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithPrimitive.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithPrimitive.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithPrimitive extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSameNumberTypes.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSameNumberTypes.php index 6deb07c36c12..59c30ec1a6b0 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSameNumberTypes.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSameNumberTypes.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithSameNumberTypes extends JsonSerializableType { @@ -199,18 +198,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSameStringTypes.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSameStringTypes.php index 268ca8d3c7e9..8913c45d2846 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSameStringTypes.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSameStringTypes.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithSameStringTypes extends JsonSerializableType { @@ -197,18 +196,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSingleElement.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSingleElement.php index 63cb0e427d92..dc8ca690c193 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSingleElement.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSingleElement.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithSingleElement extends JsonSerializableType { @@ -117,18 +116,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSubTypes.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSubTypes.php index f3b99d8e2bcb..0a95066a333e 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSubTypes.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithSubTypes.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithSubTypes extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithTime.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithTime.php index 7f6376e49553..44b10aaf3175 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithTime.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithTime.php @@ -6,7 +6,6 @@ use DateTime; use Exception; use Seed\Core\Json\JsonSerializer; -use Seed\Core\Json\JsonDecoder; class UnionWithTime extends JsonSerializableType { @@ -201,18 +200,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithoutKey.php b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithoutKey.php index a91c9824095e..0f4874d1a32e 100644 --- a/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithoutKey.php +++ b/seed/php-sdk/unions-with-local-date/src/Types/Types/UnionWithoutKey.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithoutKey extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions-with-local-date/src/Union/Types/Shape.php b/seed/php-sdk/unions-with-local-date/src/Union/Types/Shape.php index b02c60769705..3ee158f96d03 100644 --- a/seed/php-sdk/unions-with-local-date/src/Union/Types/Shape.php +++ b/seed/php-sdk/unions-with-local-date/src/Union/Types/Shape.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Core\Json\JsonProperty; use Exception; -use Seed\Core\Json\JsonDecoder; class Shape extends JsonSerializableType { @@ -172,18 +171,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Bigunion/Types/BigUnion.php b/seed/php-sdk/unions/no-custom-config/src/Bigunion/Types/BigUnion.php index 146fda428ac3..54972c5b2b4b 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Bigunion/Types/BigUnion.php +++ b/seed/php-sdk/unions/no-custom-config/src/Bigunion/Types/BigUnion.php @@ -7,7 +7,6 @@ use DateTime; use Seed\Core\Types\Date; use Exception; -use Seed\Core\Json\JsonDecoder; class BigUnion extends JsonSerializableType { @@ -1494,18 +1493,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/unions/no-custom-config/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/unions/no-custom-config/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/Union.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/Union.php index 3e30b4dcf023..235a392e9852 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/Union.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/Union.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; /** * This is a simple union. @@ -162,18 +161,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithBaseProperties.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithBaseProperties.php index 545f7d16d423..43373b89e413 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithBaseProperties.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithBaseProperties.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Core\Json\JsonProperty; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithBaseProperties extends JsonSerializableType { @@ -216,18 +215,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDiscriminant.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDiscriminant.php index 12a0ec0e6c63..da5cf2327b96 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDiscriminant.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDiscriminant.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithDiscriminant extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDuplicatePrimitive.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDuplicatePrimitive.php index 188842b28131..80b093ce64c5 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDuplicatePrimitive.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDuplicatePrimitive.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithDuplicatePrimitive extends JsonSerializableType { @@ -239,18 +238,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDuplicateTypes.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDuplicateTypes.php index 84dbbf00e1e5..cf17fd2855be 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDuplicateTypes.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDuplicateTypes.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithDuplicateTypes extends JsonSerializableType { @@ -157,18 +156,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDuplicativeDiscriminants.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDuplicativeDiscriminants.php index 55cd4f13c1bd..d58ccaf252ab 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDuplicativeDiscriminants.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithDuplicativeDiscriminants.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithDuplicativeDiscriminants extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithLiteral.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithLiteral.php index 233c78542c0f..18b81e1980a8 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithLiteral.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithLiteral.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Core\Json\JsonProperty; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithLiteral extends JsonSerializableType { @@ -128,18 +127,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithMultipleNoProperties.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithMultipleNoProperties.php index 351b56a90bfa..f43e623c4aac 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithMultipleNoProperties.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithMultipleNoProperties.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithMultipleNoProperties extends JsonSerializableType { @@ -167,18 +166,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithNoProperties.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithNoProperties.php index 025656a3dbbf..5edae1ed3447 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithNoProperties.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithNoProperties.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithNoProperties extends JsonSerializableType { @@ -143,18 +142,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithNullableReference.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithNullableReference.php index ff968b2363c3..5e9aba83d606 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithNullableReference.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithNullableReference.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithNullableReference extends JsonSerializableType { @@ -167,18 +166,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithOptionalReference.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithOptionalReference.php index d1c40bf2c013..4913a2271914 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithOptionalReference.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithOptionalReference.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithOptionalReference extends JsonSerializableType { @@ -167,18 +166,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithOptionalTime.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithOptionalTime.php index 98db6869d002..73ab9d86d4a1 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithOptionalTime.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithOptionalTime.php @@ -6,7 +6,6 @@ use DateTime; use Exception; use Seed\Core\Json\JsonSerializer; -use Seed\Core\Json\JsonDecoder; class UnionWithOptionalTime extends JsonSerializableType { @@ -167,18 +166,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithPrimitive.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithPrimitive.php index 290460149239..2044db3c9259 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithPrimitive.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithPrimitive.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithPrimitive extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSameNumberTypes.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSameNumberTypes.php index 6deb07c36c12..59c30ec1a6b0 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSameNumberTypes.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSameNumberTypes.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithSameNumberTypes extends JsonSerializableType { @@ -199,18 +198,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSameStringTypes.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSameStringTypes.php index 268ca8d3c7e9..8913c45d2846 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSameStringTypes.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSameStringTypes.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithSameStringTypes extends JsonSerializableType { @@ -197,18 +196,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSingleElement.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSingleElement.php index 63cb0e427d92..dc8ca690c193 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSingleElement.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSingleElement.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithSingleElement extends JsonSerializableType { @@ -117,18 +116,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSubTypes.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSubTypes.php index f3b99d8e2bcb..0a95066a333e 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSubTypes.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithSubTypes.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithSubTypes extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithTime.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithTime.php index 7f6376e49553..44b10aaf3175 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithTime.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithTime.php @@ -6,7 +6,6 @@ use DateTime; use Exception; use Seed\Core\Json\JsonSerializer; -use Seed\Core\Json\JsonDecoder; class UnionWithTime extends JsonSerializableType { @@ -201,18 +200,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithoutKey.php b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithoutKey.php index a91c9824095e..0f4874d1a32e 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithoutKey.php +++ b/seed/php-sdk/unions/no-custom-config/src/Types/Types/UnionWithoutKey.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithoutKey extends JsonSerializableType { @@ -159,18 +158,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/no-custom-config/src/Union/Types/Shape.php b/seed/php-sdk/unions/no-custom-config/src/Union/Types/Shape.php index b02c60769705..3ee158f96d03 100644 --- a/seed/php-sdk/unions/no-custom-config/src/Union/Types/Shape.php +++ b/seed/php-sdk/unions/no-custom-config/src/Union/Types/Shape.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Core\Json\JsonProperty; use Exception; -use Seed\Core\Json\JsonDecoder; class Shape extends JsonSerializableType { @@ -172,18 +171,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Bigunion/Types/BigUnion.php b/seed/php-sdk/unions/property-accessors/src/Bigunion/Types/BigUnion.php index 1bc185a90ba6..113c7d7f6ff5 100644 --- a/seed/php-sdk/unions/property-accessors/src/Bigunion/Types/BigUnion.php +++ b/seed/php-sdk/unions/property-accessors/src/Bigunion/Types/BigUnion.php @@ -7,7 +7,6 @@ use DateTime; use Seed\Core\Types\Date; use Exception; -use Seed\Core\Json\JsonDecoder; class BigUnion extends JsonSerializableType { @@ -1626,18 +1625,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/unions/property-accessors/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/unions/property-accessors/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/unions/property-accessors/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/Union.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/Union.php index 972499e93830..870b7d113a67 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/Union.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/Union.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; /** * This is a simple union. @@ -186,18 +185,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithBaseProperties.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithBaseProperties.php index 6c37f118a68d..c7f01608a600 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithBaseProperties.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithBaseProperties.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Core\Json\JsonProperty; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithBaseProperties extends JsonSerializableType { @@ -260,18 +259,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDiscriminant.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDiscriminant.php index 7e99264021ee..3c5bfa7c17ae 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDiscriminant.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDiscriminant.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithDiscriminant extends JsonSerializableType { @@ -183,18 +182,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDuplicatePrimitive.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDuplicatePrimitive.php index f8eb50c75ad4..605742d78616 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDuplicatePrimitive.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDuplicatePrimitive.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithDuplicatePrimitive extends JsonSerializableType { @@ -265,18 +264,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDuplicateTypes.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDuplicateTypes.php index 3ffc3ab46ca6..33e6d06abb57 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDuplicateTypes.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDuplicateTypes.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithDuplicateTypes extends JsonSerializableType { @@ -180,18 +179,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDuplicativeDiscriminants.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDuplicativeDiscriminants.php index 7777581a7745..a842d49f390f 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDuplicativeDiscriminants.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithDuplicativeDiscriminants.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithDuplicativeDiscriminants extends JsonSerializableType { @@ -183,18 +182,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithLiteral.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithLiteral.php index 1fe5d8f98eb3..034401535a5a 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithLiteral.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithLiteral.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Core\Json\JsonProperty; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithLiteral extends JsonSerializableType { @@ -168,18 +167,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithMultipleNoProperties.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithMultipleNoProperties.php index 07340e32270d..de2b6a777397 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithMultipleNoProperties.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithMultipleNoProperties.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithMultipleNoProperties extends JsonSerializableType { @@ -192,18 +191,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithNoProperties.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithNoProperties.php index ca17ccc69854..633e4713b3d0 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithNoProperties.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithNoProperties.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithNoProperties extends JsonSerializableType { @@ -167,18 +166,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithNullableReference.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithNullableReference.php index e96dc143cca9..320ee29fffe1 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithNullableReference.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithNullableReference.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithNullableReference extends JsonSerializableType { @@ -192,18 +191,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithOptionalReference.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithOptionalReference.php index 08c2224e677f..cc83aa9f2bd9 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithOptionalReference.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithOptionalReference.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithOptionalReference extends JsonSerializableType { @@ -192,18 +191,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithOptionalTime.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithOptionalTime.php index b883f605e520..d4503d1be98a 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithOptionalTime.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithOptionalTime.php @@ -6,7 +6,6 @@ use DateTime; use Exception; use Seed\Core\Json\JsonSerializer; -use Seed\Core\Json\JsonDecoder; class UnionWithOptionalTime extends JsonSerializableType { @@ -191,18 +190,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithPrimitive.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithPrimitive.php index f65cd71a97a0..47a5357aa8c5 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithPrimitive.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithPrimitive.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithPrimitive extends JsonSerializableType { @@ -183,18 +182,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSameNumberTypes.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSameNumberTypes.php index de4d6c216408..0b27321a844c 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSameNumberTypes.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSameNumberTypes.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithSameNumberTypes extends JsonSerializableType { @@ -224,18 +223,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSameStringTypes.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSameStringTypes.php index 2edd72464369..9601cfe44289 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSameStringTypes.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSameStringTypes.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithSameStringTypes extends JsonSerializableType { @@ -221,18 +220,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSingleElement.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSingleElement.php index 7ad629a4bbeb..e71633a22ab5 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSingleElement.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSingleElement.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithSingleElement extends JsonSerializableType { @@ -139,18 +138,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSubTypes.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSubTypes.php index 8c8f5cd502fe..a7078161b624 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSubTypes.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithSubTypes.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithSubTypes extends JsonSerializableType { @@ -183,18 +182,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithTime.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithTime.php index 83eb95faea5c..4514fe14028b 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithTime.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithTime.php @@ -6,7 +6,6 @@ use DateTime; use Exception; use Seed\Core\Json\JsonSerializer; -use Seed\Core\Json\JsonDecoder; class UnionWithTime extends JsonSerializableType { @@ -226,18 +225,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithoutKey.php b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithoutKey.php index 4aadfad75114..225d9c554e51 100644 --- a/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithoutKey.php +++ b/seed/php-sdk/unions/property-accessors/src/Types/Types/UnionWithoutKey.php @@ -4,7 +4,6 @@ use Seed\Core\Json\JsonSerializableType; use Exception; -use Seed\Core\Json\JsonDecoder; class UnionWithoutKey extends JsonSerializableType { @@ -183,18 +182,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unions/property-accessors/src/Union/Types/Shape.php b/seed/php-sdk/unions/property-accessors/src/Union/Types/Shape.php index 3595959f98c3..eef6ca14f463 100644 --- a/seed/php-sdk/unions/property-accessors/src/Union/Types/Shape.php +++ b/seed/php-sdk/unions/property-accessors/src/Union/Types/Shape.php @@ -5,7 +5,6 @@ use Seed\Core\Json\JsonSerializableType; use Seed\Core\Json\JsonProperty; use Exception; -use Seed\Core\Json\JsonDecoder; class Shape extends JsonSerializableType { @@ -214,18 +213,6 @@ public function jsonSerialize(): array return $result; } - /** - * @param string $json - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new Exception("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - /** * @param array $data */ diff --git a/seed/php-sdk/unknown/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/unknown/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/unknown/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/unknown/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/url-form-encoded/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/url-form-encoded/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/url-form-encoded/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/url-form-encoded/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/validation/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/validation/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/validation/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/validation/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/variables/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/variables/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/variables/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/variables/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/version-no-default/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/version-no-default/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/version-no-default/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/version-no-default/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/version/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/version/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/version/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/version/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/webhook-audience/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/webhook-audience/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/webhook-audience/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/webhook-audience/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/webhooks/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/webhooks/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/webhooks/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/webhooks/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/websocket-bearer-auth/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/websocket-bearer-auth/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/websocket-bearer-auth/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/websocket-bearer-auth/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/websocket-inferred-auth/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/websocket-inferred-auth/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/websocket-inferred-auth/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/websocket-inferred-auth/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/websocket-multi-url/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/websocket-multi-url/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/websocket-multi-url/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/websocket-multi-url/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/websocket/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/websocket/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/websocket/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/websocket/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /** diff --git a/seed/php-sdk/x-fern-default/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/x-fern-default/src/Core/Json/JsonSerializableType.php index e0e507b86b53..fc2da76c197c 100644 --- a/seed/php-sdk/x-fern-default/src/Core/Json/JsonSerializableType.php +++ b/seed/php-sdk/x-fern-default/src/Core/Json/JsonSerializableType.php @@ -106,7 +106,8 @@ public static function fromJson(string $json): static throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); } /** @var array $decodedJson */ - return self::jsonDeserialize($decodedJson); + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); } /**