Skip to content

Commit 51cedb9

Browse files
Merge branch '51Degrees:main' into main
1 parent 6564fb2 commit 51cedb9

13 files changed

+53
-19
lines changed

AspectPropertyValue.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
*/
3333
class AspectPropertyValue
3434
{
35+
private $_value;
36+
public $noValueMessage = null;
37+
public $hasValue = false;
3538

3639
/**
3740
* Constructor for AspectPropertyValue
@@ -59,8 +62,20 @@ public function __construct($noValueMessage = null, $value = "noValue")
5962
*/
6063
public function __get($key)
6164
{
62-
if ($key === "value" && $this->noValueMessage) {
63-
throw new \Exception($this->noValueMessage);
65+
if ($key === "value") {
66+
if ($this->hasValue) {
67+
return $this->_value;
68+
} else if (!empty($this->noValueMessage)) {
69+
throw new \Exception($this->noValueMessage);
70+
}
71+
}
72+
}
73+
74+
public function __set($key, $value)
75+
{
76+
if ($key === "value") {
77+
$this->_value = $value;
78+
$this->hasValue = true;
6479
}
6580
}
6681
}

BasicListEvidenceKeyFilter.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,13 @@ public function __construct($list)
4949
*/
5050
public function filterEvidenceKey($key)
5151
{
52-
$keep = false;
53-
5452
foreach ($this->list as $evidenceKey) {
5553
if (strtolower($key) === strtolower($evidenceKey)) {
56-
$keep = true;
54+
return true;
5755
}
5856
}
5957

60-
return $keep;
58+
return false;
6159
}
6260

6361
/**

ElementDataDictionary.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
**/
3131
class ElementDataDictionary extends ElementData
3232
{
33+
public $contents;
3334

3435
/**
3536
* Constructor for element data dictionary

EvidenceKeyFilter.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
*/
3333
class EvidenceKeyFilter
3434
{
35+
private $_filterEvidenceKey = null;
3536

3637
/**
3738
* filterevidence from an object
@@ -58,6 +59,17 @@ public function filterEvidence($evidenceKeyObject)
5859
*/
5960
public function filterEvidenceKey($key)
6061
{
62+
if ($this->_filterEvidenceKey) {
63+
return call_user_func($this->_filterEvidenceKey, $key);
64+
}
65+
6166
return true;
6267
}
68+
69+
public function __set($name, $value)
70+
{
71+
if ($name === 'filterEvidenceKey') {
72+
$this->_filterEvidenceKey = $value;
73+
}
74+
}
6375
}

FlowData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function getEvidenceDataKey()
171171
$requestedEvidence = array();
172172
$evidence = $this->evidence->getAll();
173173

174-
foreach ($this->Pipeline->flowElements as $flowElement) {
174+
foreach ($this->pipeline->flowElements as $flowElement) {
175175
$requestedEvidence = array_merge($requestedEvidence, $flowElement->filterEvidence($this));
176176
}
177177

FlowElement.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,11 @@
3232
**/
3333
class FlowElement
3434
{
35-
public function __construct()
36-
{
37-
38-
// List of Pipelines the FlowElement has been added to
39-
$this->pipelines = [];
40-
}
41-
4235
public $dataKey;
4336
public $properties = [];
44-
37+
// List of Pipelines the FlowElement has been added to
38+
public $pipelines = [];
39+
4540
/**
4641
* General wrapper function that calls a FlowElement's processInternal method
4742
* @param FlowData

JavascriptBuilder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
*/
3737
class JavascriptBuilderElement extends FlowElement
3838
{
39+
public $settings;
40+
public $minify;
41+
3942
public function __construct($settings = array())
4043
{
4144
$this->settings = [

Logger.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ class Logger
3232

3333
private $levels = ["trace", "debug", "information", "warning", "error", "critical"];
3434

35+
public $settings;
36+
3537
/**
3638
* Create a logger
3739
* @param string level ("trace", "debug", "information", "warning", "error", "critical")

Pipeline.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class Pipeline
3535
public $flowElementsList = array();
3636
public $logger;
3737
public $metaDataStore;
38+
public $suppressProcessExceptions;
39+
public $propertyDatabase;
3840

3941
/**
4042
* Pipeline constructor

PipelineBuilder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
*/
3131
class PipelineBuilder
3232
{
33+
public $pipelines;
34+
public $addJavaScriptBuilder;
35+
public $javascriptBuilderSettings;
36+
public $useSetHeaderProperties;
37+
3338
public function __construct($settings = array())
3439
{
3540

SetHeaderElement.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,14 @@ public function getPropertyValue($flowData, $elementKey, $propertyKey){
152152
}
153153

154154
$propertyKey = strtolower($propertyKey);
155-
try {
155+
if (isset($elementData->$propertyKey)) {
156156
$property = $elementData->$propertyKey;
157-
}
158-
catch (Exception $e) {
157+
} else {
159158
echo sprintf(Messages::PROPERTY_NOT_FOUND, $propertyKey, $elementKey);
160159
return "";
161160
}
162161

163-
if($property->hasValue && !in_array($property->value, ["Unknown", "noValue"])){
162+
if($property && $property->hasValue && !in_array($property->value, ["Unknown", "noValue"])){
164163
$value = $property->value;
165164
}
166165
else{

tests/JavaScriptBundlerTests.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public function processInternal($FlowData)
6767

6868
class TestPipeline
6969
{
70+
public $Pipeline;
71+
7072
public function __construct($minify = NULL)
7173
{
7274
if (is_null($minify)) {

0 commit comments

Comments
 (0)