| @@ 41-49 (lines=9) @@ | ||
| 38 | * |
|
| 39 | * @return $this |
|
| 40 | */ |
|
| 41 | public function collect($name, $data, $destination = DataCollection::DESTINATION_PROFILER, $type = null) |
|
| 42 | { |
|
| 43 | $this->collectedKeys[] = $name; |
|
| 44 | ||
| 45 | $dataCollection = new DataCollection($name, $data, $destination, $type); |
|
| 46 | $this->data[$this->handleDataKey($name)] = $dataCollection; |
|
| 47 | ||
| 48 | return $this; |
|
| 49 | } |
|
| 50 | ||
| 51 | /** |
|
| 52 | * @param string $name |
|
| @@ 59-68 (lines=10) @@ | ||
| 56 | * |
|
| 57 | * @return $this |
|
| 58 | */ |
|
| 59 | public function collectOnce($name, $data, $destination = DataCollection::DESTINATION_PROFILER, $type = null) |
|
| 60 | { |
|
| 61 | if (!in_array($name, $this->collectedKeys)) { |
|
| 62 | $this->collectedKeys[] = $name; |
|
| 63 | $dataCollection = new DataCollection($name, $data, $destination, $type); |
|
| 64 | $this->data[$this->handleDataKey($name)] = $dataCollection; |
|
| 65 | } |
|
| 66 | ||
| 67 | return $this; |
|
| 68 | } |
|
| 69 | ||
| 70 | /** |
|
| 71 | * @return mixed |
|