*/
public function getBlockBBCodes(): array
{
- $bbcodes = [];
- foreach ($this->bbcodes as $name => $bbcode) {
- if ($bbcode->isBlockElement) {
- $bbcodes[] = $name;
+ static $bbcodes;
+
+ if ($bbcodes === null) {
+ $bbcodes = [];
+
+ foreach ($this->bbcodes as $name => $bbcode) {
+ if ($bbcode->isBlockElement) {
+ $bbcodes[] = $name;
+ }
}
}
*/
public function getSourceBBCodes(): array
{
- $bbcodes = [];
- foreach ($this->bbcodes as $name => $bbcode) {
- if ($bbcode->isSourceCode) {
- $bbcodes[] = $name;
+ static $bbcodes;
+
+ if ($bbcodes === null) {
+ $bbcodes = [];
+
+ foreach ($this->bbcodes as $name => $bbcode) {
+ if ($bbcode->isSourceCode) {
+ $bbcodes[] = $name;
+ }
}
}