41        $chars = str_split(
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx');
 
   43        foreach ($chars as 
$i => $char) {
 
   45                $chars[
$i] = dechex(random_int(0, 15));
 
   46            } elseif ($char === 
'y') {
 
   47                $chars[
$i] = dechex(random_int(8, 11));
 
   51        return implode(
'', $chars);
 
   56        $conditionalFormattingRuleExtensions = [];
 
   57        $conditionalFormattingRuleExtensionXml = 
null;
 
   58        if ($extLstXml instanceof SimpleXMLElement) {
 
   59            foreach ((count($extLstXml) > 0 ? $extLstXml : [$extLstXml]) as $extLst) {
 
   62                if (isset($extLst->ext[
'uri']) && (
string) $extLst->ext[
'uri'] === 
'{78C0D931-6437-407d-A8EE-F0AAD7539E65}') {
 
   63                    $conditionalFormattingRuleExtensionXml = $extLst->ext;
 
   67            if ($conditionalFormattingRuleExtensionXml) {
 
   68                $ns = $conditionalFormattingRuleExtensionXml->getNamespaces(
true);
 
   69                $extFormattingsXml = $conditionalFormattingRuleExtensionXml->children($ns[
'x14']);
 
   71                foreach ($extFormattingsXml->children($ns[
'x14']) as $extFormattingXml) {
 
   72                    $extCfRuleXml = $extFormattingXml->cfRule;
 
   77                    $extFormattingRuleObj = 
new self((string) $extCfRuleXml->attributes()->id);
 
   78                    $extFormattingRuleObj->setSqref((
string) $extFormattingXml->children($ns[
'xm'])->sqref);
 
   79                    $conditionalFormattingRuleExtensions[$extFormattingRuleObj->getId()] = $extFormattingRuleObj;
 
   82                    $extFormattingRuleObj->setDataBarExt($extDataBarObj);
 
   83                    $dataBarXml = $extCfRuleXml->dataBar;
 
   90        return $conditionalFormattingRuleExtensions;
 
   95        SimpleXMLElement $dataBarXml
 
   97        $dataBarAttribute = $dataBarXml->attributes();
 
   98        if ($dataBarAttribute->minLength) {
 
   99            $extDataBarObj->
setMinLength((
int) $dataBarAttribute->minLength);
 
  101        if ($dataBarAttribute->maxLength) {
 
  102            $extDataBarObj->
setMaxLength((
int) $dataBarAttribute->maxLength);
 
  104        if ($dataBarAttribute->border) {
 
  105            $extDataBarObj->
setBorder((
bool) (
string) $dataBarAttribute->border);
 
  107        if ($dataBarAttribute->gradient) {
 
  108            $extDataBarObj->
setGradient((
bool) (
string) $dataBarAttribute->gradient);
 
  110        if ($dataBarAttribute->direction) {
 
  111            $extDataBarObj->
setDirection((
string) $dataBarAttribute->direction);
 
  113        if ($dataBarAttribute->negativeBarBorderColorSameAsPositive) {
 
  116        if ($dataBarAttribute->axisPosition) {
 
  117            $extDataBarObj->
setAxisPosition((
string) $dataBarAttribute->axisPosition);
 
  123        if ($dataBarXml->borderColor) {
 
  124            $extDataBarObj->
setBorderColor((
string) $dataBarXml->borderColor->attributes()[
'rgb']);
 
  126        if ($dataBarXml->negativeFillColor) {
 
  127            $extDataBarObj->
setNegativeFillColor((
string) $dataBarXml->negativeFillColor->attributes()[
'rgb']);
 
  129        if ($dataBarXml->negativeBorderColor) {
 
  132        if ($dataBarXml->axisColor) {
 
  133            $axisColorAttr = $dataBarXml->axisColor->attributes();
 
  134            $extDataBarObj->
setAxisColor((
string) $axisColorAttr[
'rgb'], (
string) $axisColorAttr[
'theme'], (
string) $axisColorAttr[
'tint']);
 
  137        foreach ($dataBarXml->cfvo as $cfvo) {
 
  138            $f = (string) $cfvo->children($ns[
'xm'])->f;
 
  139            if ($cfvoIndex === 0) {
 
  142            if ($cfvoIndex === 1) {
 
  169        return $this->cfRule;
 
  174        $this->cfRule = $cfRule;
 
  181        return $this->dataBar;
 
  186        $this->dataBar = $dataBar;
 
  198        $this->sqref = $sqref;
 
An exception for terminatinating execution or to throw for unit testing.
if(!array_key_exists('StateId', $_REQUEST)) $id