PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
← All changes | php/Flat_Files/Handlers/Functions_Snippet_Handler.php +1 -9 3.10.2 → trunk View file →
@@ -32,17 +32,9 @@
32 32 return 'php';
33 33 }
34 34
35 35 /**
36 - * Wrap functions snippets by adding a header that disallows direct access.
37 - *
38 - * The guard cannot simply be prepended. PHP requires `declare` and
39 - * `namespace` to come before any other statement, so a snippet opening with
40 - * either used to fatal on load with "Namespace declaration statement has to
41 - * be the very first statement" — taking down every page of the site, with
42 - * nothing written to the error log. The guard is inserted after that
43 - * prologue instead, and inside the braces when a namespace uses block
44 - * syntax, since no code may sit outside `namespace {}` blocks.
36 + * Wrap functions snippets by adding a header that disallows direct access, compatible with PHP namespaces.
45 37 *
46 38 * @param string $code Snippet PHP code.
47 39 *
48 40 * @return string Content snippet code with header prepended.