Commit 5f752a45 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Ajout du type "builtin" Date.

parent c2e35a5c
......@@ -192,7 +192,7 @@ final class ModelGenerator
$factory = new TypeFactory();
foreach (['Array', 'boolean', 'number', 'null', 'string', 'any', 'never'] as $builtin) {
foreach (['Array', 'Date', 'boolean', 'number', 'null', 'string', 'any', 'never'] as $builtin) {
$factory->add($builtin, BuiltinType::get($builtin));
......@@ -54,6 +54,11 @@ class BuiltinType extends AbstractType
case 'number':
case 'boolean':
return sprintf('%s.toString()', $expr);
case 'true':
case 'false':
return sprintf('"%s"', $this->name);
case 'Date':
return sprintf('%s.toISOString()', $expr);
case 'undefined':
case 'null':
case 'never':
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment