| @@ 10-30 (lines=21) @@ | ||
| 7 | use mcorten87\rabbitmq_api\objects\Method; |
|
| 8 | use mcorten87\rabbitmq_api\objects\Url; |
|
| 9 | ||
| 10 | class JobVirtualHostCreateMapper extends BaseMapper |
|
| 11 | { |
|
| 12 | ||
| 13 | /** |
|
| 14 | * @return Method |
|
| 15 | */ |
|
| 16 | protected function mapMethod() : Method |
|
| 17 | { |
|
| 18 | return new Method(Method::PUT); |
|
| 19 | } |
|
| 20 | ||
| 21 | /** |
|
| 22 | * @param JobVirtualHostCreate $job |
|
| 23 | * @return Url |
|
| 24 | */ |
|
| 25 | protected function mapUrl(JobBase $job) : Url |
|
| 26 | { |
|
| 27 | return new Url( |
|
| 28 | 'vhosts/' |
|
| 29 | .urlencode((string)$job->getVirtualHost()) |
|
| 30 | ); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 10-30 (lines=21) @@ | ||
| 7 | use mcorten87\rabbitmq_api\objects\Method; |
|
| 8 | use mcorten87\rabbitmq_api\objects\Url; |
|
| 9 | ||
| 10 | class JobVirtualHostDeleteMapper extends BaseMapper |
|
| 11 | { |
|
| 12 | ||
| 13 | /** |
|
| 14 | * @return Method |
|
| 15 | */ |
|
| 16 | protected function mapMethod() : Method |
|
| 17 | { |
|
| 18 | return new Method(Method::DELETE); |
|
| 19 | } |
|
| 20 | ||
| 21 | /** |
|
| 22 | * @param JobVirtualHostDelete $job |
|
| 23 | * @return Url |
|
| 24 | */ |
|
| 25 | protected function mapUrl(JobBase $job) : Url |
|
| 26 | { |
|
| 27 | return new Url( |
|
| 28 | 'vhosts/' |
|
| 29 | .urlencode((string)$job->getVirtualHost()) |
|
| 30 | ); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||