public function trackStackDependency($type, $stack, $resource, Blueprint $sourceBlueprint = null, $sourceType = null, $sourceKey = null) { if (!isset($this->stacks[$type])) { $this->stacks[$type] = []; } if (!isset($this->stacks[$type][$stack])) { $this->stacks[$type][$stack] = []; } if (!isset($this->stacks[$type][$stack][$resource])) { $this->stacks[$type][$stack][$resource] = []; } $this->stacks[$type][$stack][$resource][] = ['type' => $sourceType ? $sourceType : '', 'blueprint' => $sourceBlueprint ? $sourceBlueprint->getName() : '', 'key' => $sourceKey ? $sourceKey : '']; }