From 2c8cc21897d8112e0f5e174fea89cd3fcbc5620b Mon Sep 17 00:00:00 2001 From: Jeroen Versteeg Date: Tue, 22 Oct 2024 11:13:18 +0200 Subject: [PATCH] Code for types tag uses Twig types in examples instead of PHP Thanks, @smnandre! --- src/TokenParser/TypesTokenParser.php | 2 +- tests/Node/TypesTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TokenParser/TypesTokenParser.php b/src/TokenParser/TypesTokenParser.php index 2e0850e7e9b..b97eb3b2e4c 100644 --- a/src/TokenParser/TypesTokenParser.php +++ b/src/TokenParser/TypesTokenParser.php @@ -20,7 +20,7 @@ /** * Declare variable types. * - * {% types {foo: 'int', bar?: 'string'} %} + * {% types {foo: 'number', bar?: 'string'} %} * * @author Jeroen Versteeg * diff --git a/tests/Node/TypesTest.php b/tests/Node/TypesTest.php index e5a94b6a995..7c74a5f7aa2 100644 --- a/tests/Node/TypesTest.php +++ b/tests/Node/TypesTest.php @@ -9,14 +9,14 @@ class TypesTest extends NodeTestCase { private static function getValidMapping(): array { - // {foo: 'string', bar?: 'int'} + // {foo: 'string', bar?: 'number'} return [ 'foo' => [ 'type' => 'string', 'optional' => false, ], 'bar' => [ - 'type' => 'int', + 'type' => 'number', 'optional' => true, ], ];