process() публичный Метод

Process the payload.
public process ( $payload ) : mixed
$payload
Результат mixed
Пример #1
0
 /**
  * Resolve placeholders
  *
  * @param $string
  * @param Blueprint|null $sourceBlueprint
  * @param string $sourceType
  * @param string $sourceKey
  * @param int $circuitBreaker
  * @return mixed
  * @throws \Exception
  */
 public function resolvePlaceholders($string, Blueprint $sourceBlueprint = null, $sourceType = null, $sourceKey = null, $circuitBreaker = 0)
 {
     if ($circuitBreaker > 20) {
         throw new \Exception('Max nesting level reached. Looks like a circular dependency.');
     }
     $stageClasses = ['\\StackFormation\\ValueResolver\\Stage\\ProfileSwitcher', '\\StackFormation\\ValueResolver\\Stage\\EnvironmentVariable', '\\StackFormation\\ValueResolver\\Stage\\EnvironmentVariableWithFallback', '\\StackFormation\\ValueResolver\\Stage\\Variable', '\\StackFormation\\ValueResolver\\Stage\\ConditionalValue', '\\StackFormation\\ValueResolver\\Stage\\Tstamp', '\\StackFormation\\ValueResolver\\Stage\\Md5', '\\StackFormation\\ValueResolver\\Stage\\StackOutput', '\\StackFormation\\ValueResolver\\Stage\\StackResource', '\\StackFormation\\ValueResolver\\Stage\\StackParameter', '\\StackFormation\\ValueResolver\\Stage\\Clean'];
     $pipeline = new Pipeline();
     foreach ($stageClasses as $stageClass) {
         $pipeline->addStage(new $stageClass($this, $sourceBlueprint, $sourceType, $sourceKey));
     }
     $originalString = $string;
     $string = $pipeline->process($string);
     return $string == $originalString ? $string : $this->resolvePlaceholders($string, $sourceBlueprint, $sourceType, $sourceKey, $circuitBreaker + 1);
 }