Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
publish:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/setup
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "release/**"
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/setup
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
# Implementation is too outdated to test in GitHub Actions
# - elm,schema-elm

# Language is too niche / obscure to test easily on ubuntu-22.04
# Language is too niche / obscure to test easily on ubuntu-latest
# - pike,schema-pike

# Not yet started
Expand All @@ -56,7 +56,7 @@ jobs:
# Never tested?
# - crystal

runs-on: [ubuntu-22.04]
runs-on: [ubuntu-latest]

include:
# Rust is very slow, so we use a larger runner
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
test-complete:
if: ${{ cancelled() || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'failure') }}
needs: test
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- run: |
echo "Some workflows have failed!"
Expand Down
42 changes: 18 additions & 24 deletions packages/quicktype-core/src/language/Php/PhpRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,19 +385,16 @@ export class PhpRenderer extends ConvenienceRenderer {
(_classType) =>
this.emitLine(...lhs, ...args, "->to(); ", "/*class*/"),
(mapType) => {
this.emitBlock(["function to($my): stdClass"], () => {
this.emitLine("$out = new stdClass();");
this.emitBlock(["foreach ($my as $k => $v)"], () => {
this.phpToObjConvert(
className,
mapType.values,
["$my->$k = "],
["$v"],
);
});
this.emitLine("return $out;");
this.emitLine("$out = new stdClass();");
this.emitBlock(["foreach (", ...args, " as $k => $v)"], () => {
this.phpToObjConvert(
className,
mapType.values,
["$out->$k = "],
["$v"],
);
});
this.emitLine("return to(", ...args, ");");
this.emitLine("return $out;");
},
(enumType) =>
this.emitLine(
Expand Down Expand Up @@ -494,19 +491,16 @@ export class PhpRenderer extends ConvenienceRenderer {
"/*class*/",
),
(mapType) => {
this.emitBlock(["function from($my): stdClass"], () => {
this.emitLine("$out = new stdClass();");
this.emitBlock(["foreach ($my as $k => $v)"], () => {
this.phpFromObjConvert(
className,
mapType.values,
["$out->$k = "],
["$v"],
);
});
this.emitLine("return $out;");
this.emitLine("$out = new stdClass();");
this.emitBlock(["foreach (", ...args, " as $k => $v)"], () => {
this.phpFromObjConvert(
className,
mapType.values,
["$out->$k = "],
["$v"],
);
});
this.emitLine("return from(", ...args, ");");
this.emitLine("return $out;");
},
(enumType) =>
this.emitLine(
Expand Down