rspec/rules/S2000/php/rule.adoc

52 lines
801 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Having characters before ``++<?php++`` can cause "Cannot modify header information" errors and similar problems with Ajax requests.
=== 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
----
test<?php //Noncompliant
// ...
----
and
2022-02-04 17:28:24 +01:00
[source,php]
2021-04-28 16:49:39 +02:00
----
// Noncompliant; newline before opening tag
<?php
// ...
----
=== 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
----
<?php
// ...
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Remove the extra characters before the open tag.
'''
== Comments And Links
(visible only on this page)
=== on 19 Sep 2014, 14:30:34 Freddy Mallet wrote:
@Ann, do you know the kind of problems we can face when having some characters before "<?php" ?
endif::env-github,rspecator-view[]