
constant_case
¶The PHP constants true
, false
, and null
MUST be written using the
correct casing.
case
¶Whether to use the upper
or lower
case syntax.
Allowed values: 'lower'
, 'upper'
Default value: 'lower'
Default configuration.
--- Original
+++ New
<?php
-$a = FALSE;
-$b = True;
-$c = nuLL;
+$a = false;
+$b = true;
+$c = null;
With configuration: ['case' => 'upper']
.
--- Original
+++ New
<?php
$a = FALSE;
-$b = True;
-$c = nuLL;
+$b = TRUE;
+$c = NULL;
The rule is part of the following rule sets:
Using the @PER rule set will enable the constant_case
rule with the default config.
Using the @PSR2 rule set will enable the constant_case
rule with the default config.
Using the @PSR12 rule set will enable the constant_case
rule with the default config.
Using the @PhpCsFixer rule set will enable the constant_case
rule with the default config.
Using the @Symfony rule set will enable the constant_case
rule with the default config.