1: <?php
2:
3: namespace Guzzle\Service\Command\LocationVisitor\Request;
4:
5: use Guzzle\Http\Message\RequestInterface;
6: use Guzzle\Http\Message\PostFileInterface;
7: use Guzzle\Service\Command\CommandInterface;
8: use Guzzle\Service\Description\Parameter;
9:
10: 11: 12:
13: class PostFileVisitor extends AbstractRequestVisitor
14: {
15: 16: 17:
18: public function visit(CommandInterface $command, RequestInterface $request, Parameter $param, $value)
19: {
20: $value = $param->filter($value);
21: if ($value instanceof PostFileInterface) {
22: $request->addPostFile($value);
23: } else {
24: $request->addPostFile($param->getWireName(), $value);
25: }
26: }
27: }
28: