ErrorParser
11 months ago
Parser
11 months ago
Serializer
11 months ago
AbstractModel.php
11 months ago
ApiProvider.php
11 months ago
DateTimeResult.php
11 months ago
DocModel.php
11 months ago
ListShape.php
11 months ago
MapShape.php
11 months ago
Operation.php
11 months ago
Service.php
11 months ago
Shape.php
11 months ago
ShapeMap.php
11 months ago
StructureShape.php
11 months ago
TimestampShape.php
11 months ago
Validator.php
11 months ago
ListShape.php
36 lines
| 1 | <?php |
| 2 | namespace Aws\Api; |
| 3 | |
| 4 | /** |
| 5 | * Represents a list shape. |
| 6 | */ |
| 7 | class ListShape extends Shape |
| 8 | { |
| 9 | private $member; |
| 10 | |
| 11 | public function __construct(array $definition, ShapeMap $shapeMap) |
| 12 | { |
| 13 | $definition['type'] = 'list'; |
| 14 | parent::__construct($definition, $shapeMap); |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * @return Shape |
| 19 | * @throws \RuntimeException if no member is specified |
| 20 | */ |
| 21 | public function getMember() |
| 22 | { |
| 23 | if (!$this->member) { |
| 24 | if (!isset($this->definition['member'])) { |
| 25 | throw new \RuntimeException('No member attribute specified'); |
| 26 | } |
| 27 | $this->member = Shape::create( |
| 28 | $this->definition['member'], |
| 29 | $this->shapeMap |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | return $this->member; |
| 34 | } |
| 35 | } |
| 36 |