Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/processors/tag_processor.php
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | |||||
{ | { | ||||
$method = $tag; | $method = $tag; | ||||
if ( method_exists($this, $method) ) { | if ( method_exists($this, $method) ) { | ||||
return true; | return true; | ||||
} | } | ||||
if ( $this->Application->hasObject('TagsAggregator') ) { | if ( $this->Application->hasObject('TagsAggregator') ) { | ||||
/** @var kArray $aggregator */ | |||||
$aggregator = $this->Application->recallObject('TagsAggregator'); | $aggregator = $this->Application->recallObject('TagsAggregator'); | ||||
/* @var $aggregator kArray */ | |||||
$tmp = $this->Application->processPrefix($prefix); | $tmp = $this->Application->processPrefix($prefix); | ||||
$tag_mapping = $aggregator->GetArrayValue($tmp['prefix'], $method); | $tag_mapping = $aggregator->GetArrayValue($tmp['prefix'], $method); | ||||
if ( $tag_mapping ) { | if ( $tag_mapping ) { | ||||
return true; | return true; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | |||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
function processAggregatedTag($tag, $params, $prefix, $file = 'unknown', $line = 0) | function processAggregatedTag($tag, $params, $prefix, $file = 'unknown', $line = 0) | ||||
{ | { | ||||
if ( $this->Application->hasObject('TagsAggregator') ) { | if ( $this->Application->hasObject('TagsAggregator') ) { | ||||
$Method = $tag; | $Method = $tag; | ||||
Lint: CodingStandard.NamingConventions.ValidVariableName.NotSnakeCaps: Variable "Method" is not in valid snake caps format | |||||
/** @var kArray $aggregator */ | |||||
$aggregator = $this->Application->recallObject('TagsAggregator'); | $aggregator = $this->Application->recallObject('TagsAggregator'); | ||||
/* @var $aggregator kArray */ | |||||
$tmp = $this->Application->processPrefix($prefix); | $tmp = $this->Application->processPrefix($prefix); | ||||
$tag_mapping = $aggregator->GetArrayValue($tmp['prefix'], $Method); | $tag_mapping = $aggregator->GetArrayValue($tmp['prefix'], $Method); | ||||
if ( $tag_mapping ) { | if ( $tag_mapping ) { | ||||
// aggregated tag defined | // aggregated tag defined | ||||
$tmp = $this->Application->processPrefix($tag_mapping[0]); | $tmp = $this->Application->processPrefix($tag_mapping[0]); | ||||
$__tag_processor = $tmp['prefix'] . '_TagProcessor'; | $__tag_processor = $tmp['prefix'] . '_TagProcessor'; | ||||
/** @var kTagProcessor $processor */ | |||||
$processor = $this->Application->recallObject($__tag_processor); | $processor = $this->Application->recallObject($__tag_processor); | ||||
/* @var $processor kTagProcessor */ | |||||
$processor->Init($tmp['prefix'], getArrayValue($tag_mapping, 2) ? $tag_mapping[2] : $tmp['special']); | $processor->Init($tmp['prefix'], getArrayValue($tag_mapping, 2) ? $tag_mapping[2] : $tmp['special']); | ||||
$params['original_tag'] = $Method; // allows to define same method for different aggregated tags in same tag processor | $params['original_tag'] = $Method; // allows to define same method for different aggregated tags in same tag processor | ||||
$params['PrefixSpecial'] = $this->getPrefixSpecial(); // $prefix; | $params['PrefixSpecial'] = $this->getPrefixSpecial(); // $prefix; | ||||
$ret = $processor->ProcessParsedTag($tag_mapping[1], $params, $prefix); | $ret = $processor->ProcessParsedTag($tag_mapping[1], $params, $prefix); | ||||
if ( isset($params['result_to_var']) ) { | if ( isset($params['result_to_var']) ) { | ||||
$this->Application->Parser->SetParam($params['result_to_var'], $ret); | $this->Application->Parser->SetParam($params['result_to_var'], $ret); | ||||
▲ Show 20 Lines • Show All 168 Lines • ▼ Show 20 Line(s) | |||||
function &GetProcessor($prefix, &$tag) | function &GetProcessor($prefix, &$tag) | ||||
{ | { | ||||
if (!isset($this->Processors[$prefix])) | if (!isset($this->Processors[$prefix])) | ||||
$this->CreateProcessor($prefix, $tag); | $this->CreateProcessor($prefix, $tag); | ||||
return $this->Processors[$prefix]; | return $this->Processors[$prefix]; | ||||
} | } | ||||
}*/ | }*/ | ||||
No newline at end of file | No newline at end of file |
Variable "Method" is not in valid snake caps format