rspec/rules/S2038/php/rule.adoc

49 lines
1003 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Shared coding conventions allow teams to collaborate effectively. Writing colors in upper case makes them stand out at such, thereby making the code easier to read.
This rule checks that hexadecimal color definitions are written in upper case.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,php]
2021-04-28 16:49:39 +02:00
----
$white = '#ffffff'; // Noncompliant
$dkgray = '#006400';
$aqua = '#00ffff'; // Noncompliant
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,php]
2021-04-28 16:49:39 +02:00
----
$white = '#FFFFFF'; // Compliant
$dkgray = '#006400';
$aqua = '#00FFFF'; // Compliant
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Replace "#xxx" with "#XXX".
'''
== Comments And Links
(visible only on this page)
=== on 23 Oct 2014, 14:16:33 Linda Martin wrote:
\[~ann.campbell.2] I allowed myself to updated the description with the values defined http://www.w3schools.com/tags/ref_colornames.asp[w3schools web site].
endif::env-github,rspecator-view[]