| 163 | | protected function dumpValue($value) |
|---|
| 164 | | { |
|---|
| 165 | | if (is_array($value)) |
|---|
| 166 | | { |
|---|
| 167 | | $code = array(); |
|---|
| 168 | | foreach ($value as $k => $v) |
|---|
| 169 | | { |
|---|
| 170 | | $code[$k] = $this->dumpValue($v); |
|---|
| 171 | | } |
|---|
| 172 | | |
|---|
| 173 | | return $code; |
|---|
| 174 | | } |
|---|
| 175 | | elseif (is_object($value) && $value instanceof sfServiceReference) |
|---|
| 176 | | { |
|---|
| 177 | | return sprintf("<service id=\"%s\" />", (string) $value); |
|---|
| 178 | | } |
|---|
| 179 | | elseif (is_object($value) || is_resource($value)) |
|---|
| 180 | | { |
|---|
| 181 | | throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.'); |
|---|
| 182 | | } |
|---|
| 183 | | else |
|---|
| 184 | | { |
|---|
| 185 | | return $value; |
|---|
| 186 | | } |
|---|
| 187 | | } |
|---|
| 188 | | |
|---|