Skip to content

Commit 2108a1d

Browse files
committed
Static array for processed patterns
1 parent 5f66c96 commit 2108a1d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/aleksip/DataTransformPlugin/DataTransformer.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@
55
use Drupal\Core\Template\Attribute;
66
use PatternLab\Data;
77
use PatternLab\PatternData;
8-
use PatternLab\PatternEngine;
98

109
class DataTransformer
1110
{
11+
protected static $processed = array();
12+
1213
protected $env;
1314
protected $reservedKeys;
1415
protected $patternDataStore;
15-
protected $processed;
1616

1717
public function __construct(\Twig_Environment $env)
1818
{
1919
$this->env = $env;
2020
// TODO: Add an accessor function for $reservedKeys to the Data class?
2121
$this->reservedKeys = array("cacheBuster","link","patternSpecific","patternLabHead","patternLabFoot");
2222
$this->patternDataStore = PatternData::get();
23-
$this->processed = array();
2423
}
2524

2625
public function run()
@@ -36,12 +35,12 @@ public function run()
3635

3736
protected function isProcessed($pattern)
3837
{
39-
return isset($this->processed[$pattern]);
38+
return isset(self::$processed[$pattern]);
4039
}
4140

4241
protected function setProcessed($pattern)
4342
{
44-
$this->processed[$pattern] = true;
43+
self::$processed[$pattern] = true;
4544
}
4645

4746
protected function processPattern($pattern)

0 commit comments

Comments
 (0)