rspec/rules/S1781/php/rule.adoc

42 lines
980 B
Plaintext
Raw Permalink Normal View History

== 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`.
2021-04-28 16:49:39 +02:00
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
[source,php,diff-id=1,diff-type=noncompliant]
2021-04-28 16:49:39 +02:00
----
<?php ECHO 'Hello World'; ?>
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
[source,php,diff-id=1,diff-type=compliant]
2021-04-28 16:49:39 +02:00
----
<?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[]