← All changes
|
php/Flat_Files/Handlers/Functions_Snippet_Handler.php
+1
-9
3.10.1
→
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. |