quicktype icon indicating copy to clipboard operation
quicktype copied to clipboard

add php support

Open mabels opened this issue 4 years ago • 13 comments

I built for me working php language adapter. There a still some thing todo like Date/Time/UUID Type support. But I hope it's a nice starting point. To the php language support.

cheers

meno

mabels avatar Nov 26 '20 17:11 mabels

@mabels Thank you so much! Would you mind rebasing your PR onto the latest master? The one you were working on unfortunately doesn't build anymore, but it got fixed in the mean time.

schani avatar Dec 25 '20 18:12 schani

I will rebase it, again.

Meno

On Fri, Dec 25, 2020 at 7:39 PM Mark Probst [email protected] wrote:

@mabels https://github.com/mabels Thank you so much! Would you mind rebasing your PR onto the latest master? The one you were working on unfortunately doesn't build anymore, but it got fixed in the mean time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/quicktype/quicktype/pull/1595#issuecomment-751280511, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEWJU5YIMWWXPEXT5LXTDSWTL4NANCNFSM4UD7H2SA .

mabels avatar Dec 26 '20 09:12 mabels

Hi,

i just updated all so the php stuff is ready for rebase on your side. TODO: add php to your test enviroment:

require_once("./doof.php");

$json1 = json_encode(Purchase::sample()->to());
$json2 = json_encode(Purchase::from(json_decode($json1))->to());

if ($json1 == $json2) {
  echo "all good";
} else {
  echo($json1);
  echo($json2);
}

mabels avatar Dec 26 '20 19:12 mabels

@mabels I added test fixture for PHP here (I couldn't push to your branch, so had to make an independent PR, but feel free to just take whatever you want from there and I'll close mine again): https://github.com/quicktype/quicktype/pull/1616

Unfortunately almost all tests fail. I don't know any PHP, so I have no idea whether it's because of my PHP setup, or because the generated code is incorrect, or some other reason. You can run the tests with

npm run build && FIXTURE=php npm run test

schani avatar Dec 26 '20 23:12 schani

Hi, i stepped yesterday in the tests of quicktype and discovered there are "some" things to do. I will continue the php work in the next days.

sorry

meno

On Sun, Dec 27, 2020 at 12:56 AM Mark Probst [email protected] wrote:

@mabels https://github.com/mabels I added test fixture for PHP here (I couldn't push to your branch, so had to make an independent PR, but feel free to just take whatever you want from there and I'll close mine again): #1616 https://github.com/quicktype/quicktype/pull/1616

Unfortunately almost all tests fail. I don't know any PHP, so I have no idea whether it's because of my PHP setup, or because the generated code is incorrect, or some other reason. You can run the tests with

npm run build && FIXTURE=php npm run test

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/quicktype/quicktype/pull/1595#issuecomment-751408448, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEWJVHRAWURDFFWD3OF63SWZZ3DANCNFSM4UD7H2SA .

mabels avatar Dec 27 '20 15:12 mabels

Thank you so much!

schani avatar Dec 27 '20 21:12 schani

@mabels We got three type check errors:

ERROR: /app/src/quicktype-core/language/Php.ts:795:17 - This type is not allowed in the condition because it could be undefined. Only booleans are allowed.
  | ERROR: /app/src/quicktype-core/language/Php.ts:797:17 - This type is not allowed in the 'if' condition because it could be undefined. Only booleans are allowed.
  | ERROR: /app/src/quicktype-core/language/Php.ts:894:21 - This type is not allowed in the 'if' condition because it could be undefined. Only booleans are allowed.

schani avatar Dec 29 '20 16:12 schani

@mabels Any news on this?

schani avatar Jan 10 '21 00:01 schani

i'm still fighting with all tests. There are some issues with currently with union's. I'm just got back to work today and will hopefully find some time this week

cheers

meno

On Sun, Jan 10, 2021 at 1:58 AM Mark Probst [email protected] wrote:

@mabels https://github.com/mabels Any news on this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/quicktype/quicktype/pull/1595#issuecomment-757392871, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEWJSWO6UCO44K7FFTMQTSZD3UHANCNFSM4UD7H2SA .

mabels avatar Jan 11 '21 18:01 mabels

Can I help with anything?

schani avatar Feb 04 '21 16:02 schani

Hello, how is the state here? I would like to help, but I'm a complete beginner. Does this relate to #1616 ?

Naoero avatar Apr 20 '22 16:04 Naoero

Should the work done by @schani in https://github.com/quicktype/quicktype/pull/1616 be merged in this PR?

rvanlaak avatar Jun 10 '22 09:06 rvanlaak

Any progress? What's up?

alexsandro-xpt avatar Sep 15 '22 22:09 alexsandro-xpt

Superseded by #1616

dvdsgl avatar Dec 31 '22 19:12 dvdsgl