| @@ 101-119 (lines=19) @@ | ||
| 98 | return $this->originalMessage->getBodyAsTransported(); |
|
| 99 | } |
|
| 100 | ||
| 101 | private function buildAttributes(array $attributes) |
|
| 102 | { |
|
| 103 | if($this->newBody instanceof Body) |
|
| 104 | { |
|
| 105 | $attributes['content_type'] = $this->newBody->getContentType(); |
|
| 106 | } |
|
| 107 | ||
| 108 | $attributes['routing_key'] = $this->newRoutingKey; |
|
| 109 | ||
| 110 | foreach($this->newAttributeValues as $name => $value) |
|
| 111 | { |
|
| 112 | if(isset($attributes[$name])) |
|
| 113 | { |
|
| 114 | $attributes[$name] = $value; |
|
| 115 | } |
|
| 116 | } |
|
| 117 | ||
| 118 | return $attributes; |
|
| 119 | } |
|
| 120 | ||
| 121 | private function buildHeaders(array $headers) |
|
| 122 | { |
|
| @@ 121-142 (lines=22) @@ | ||
| 118 | return $attributes; |
|
| 119 | } |
|
| 120 | ||
| 121 | private function buildHeaders(array $headers) |
|
| 122 | { |
|
| 123 | foreach($this->droppedHeaders as $droppedHeader) |
|
| 124 | { |
|
| 125 | if(isset($headers[$droppedHeader])) |
|
| 126 | { |
|
| 127 | unset($headers[$droppedHeader]); |
|
| 128 | } |
|
| 129 | } |
|
| 130 | ||
| 131 | if($this->newBody instanceof Body) |
|
| 132 | { |
|
| 133 | $headers['transport_content_type'] = $this->newBody->getContentType(); |
|
| 134 | } |
|
| 135 | ||
| 136 | foreach($this->newHeaders as $name => $value) |
|
| 137 | { |
|
| 138 | $headers[$name] = $value; |
|
| 139 | } |
|
| 140 | ||
| 141 | return $headers; |
|
| 142 | } |
|
| 143 | } |
|
| 144 | ||