Open mindplay-dk opened 9 years ago
Yes sorry it's the <?php
tag that is confusing, I added it for syntax highliting but it's supposed to be part of the hooks.php
file. Putting the whole config file would just have been even more confusing
I usually put //...
to indicate that irrelevant lines was taken out of an example - that way you can still show the opening/closing array and php tag :-)
Would you mind sending a quick PR for this?
Well, I don't know what the code sample was supposed to look like ;-)
What I mean is, just comment-out the irrelevant parts, so if you have:
return array(
'foo' => 1,
'bar' => 2,
'baz' => 3,
);
But the example deals only with baz
, just comment out the rest:
return array(
// ...
'baz' => 3,
);
But preserve context (parens, nesting, identation etc.) so that it's still valid PHP, so it illustrates where the relevant parts would appear :-)
I think maybe just adding the other arrays above it but empty would make it clearer, like:
hooks.php
<?php return [
'before' => [],
'after' => [
// The curent example
],
'custom' => [],
];
What do you think?
The first sample on this page isn't valid PHP code. Looks like half an array? Pretty confusing.