private function dispatch(Shape $shape, $value) { static $methods = ['structure' => 'check_structure', 'list' => 'check_list', 'map' => 'check_map', 'blob' => 'check_blob', 'boolean' => 'check_boolean', 'integer' => 'check_numeric', 'float' => 'check_numeric', 'long' => 'check_numeric', 'string' => 'check_string', 'byte' => 'check_string', 'char' => 'check_string']; $type = $shape->getType(); if (isset($methods[$type])) { $this->{$methods[$type]}($shape, $value); } $this->check_pattern($shape, $value); }
private function applyHeader(RequestInterface $request, $name, Shape $member, $value) { if ($member->getType() == 'timestamp') { $value = TimestampShape::format($value, 'rfc822'); } $request->setHeader($member['locationName'] ?: $name, $value); }