@@ -75,6 +75,11 @@ public static function provideFixCases(): iterable
7575 '<?php class Foo { public const BAR = null; } ' ,
7676 ];
7777
78+ yield 'NULL ' => [
79+ '<?php class Foo { public const null BAR = NULL; } ' ,
80+ '<?php class Foo { public const BAR = NULL; } ' ,
81+ ];
82+
7883 yield 'string with double quotes ' => [
7984 '<?php class Foo { public const string BAR = "Jane Doe"; } ' ,
8085 '<?php class Foo { public const BAR = "Jane Doe"; } ' ,
@@ -94,5 +99,36 @@ public static function provideFixCases(): iterable
9499 '<?php class Foo { public const mixed BAR = 10 * (FLOAT_OR_INTEGER + 7); } ' ,
95100 '<?php class Foo { public const BAR = 10 * (FLOAT_OR_INTEGER + 7); } ' ,
96101 ];
102+
103+ yield 'multiple constants ' => [
104+ <<<'PHP'
105+ <?php
106+ class Foo {
107+ public const int ONE = 1;
108+ public const bool ALREADY_TYPED = true;
109+ public const string NAME = 'name';
110+ }
111+ const NOT_CLASS = true;
112+ class Bar {
113+ public const array ARRAY_LONG_SYNTAX = array();
114+ public const array ARRAY_SHORT_SYNTAX = [];
115+ public const string lowercased_name = 'lowercased_name';
116+ }
117+ PHP,
118+ <<<'PHP'
119+ <?php
120+ class Foo {
121+ public const ONE = 1;
122+ public const bool ALREADY_TYPED = true;
123+ public const NAME = 'name';
124+ }
125+ const NOT_CLASS = true;
126+ class Bar {
127+ public const ARRAY_LONG_SYNTAX = array();
128+ public const ARRAY_SHORT_SYNTAX = [];
129+ public const lowercased_name = 'lowercased_name';
130+ }
131+ PHP,
132+ ];
97133 }
98134}
0 commit comments