rspec/rules/S1781/php/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

42 lines
980 B
Plaintext

== Why is this an issue?
In PHP, keywords and constants are case-insensitive, meaning they can be written in either lower case or upper case without affecting their functionality.
This allows for more flexibility and ease of use when writing code.
However, it is generally recommended to follow a consistent casing convention for readability and maintainability purposes.
Relevant constants are `true`, `false` and `null`.
=== Noncompliant code example
[source,php,diff-id=1,diff-type=noncompliant]
----
<?php ECHO 'Hello World'; ?>
----
=== Compliant solution
[source,php,diff-id=1,diff-type=compliant]
----
<?php echo 'Hello World'; ?>
----
== Resources
=== Documentation
* https://www.php.net/manual/en/reserved.constants.php[PHP Manual - Predefined Constants]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Write this "XXXX" [keyword|constant] in lower case.
endif::env-github,rspecator-view[]