| 1 |
<?php |
| 2 |
|
| 3 |
namespace Dudlewebs\WPMCS\s3\Aws\Api; |
| 4 |
|
| 5 |
/** |
| 6 |
* Represents a list shape. |
| 7 |
*/ |
| 8 |
class ListShape extends Shape |
| 9 |
{ |
| 10 |
private $member; |
| 11 |
public function __construct(array $definition, ShapeMap $shapeMap) |
| 12 |
{ |
| 13 |
$definition['type'] = 'list'; |
| 14 |
parent::__construct($definition, $shapeMap); |
| 15 |
} |
| 16 |
/** |
| 17 |
* @return Shape |
| 18 |
* @throws \RuntimeException if no member is specified |
| 19 |
*/ |
| 20 |
public function getMember() |
| 21 |
{ |
| 22 |
if (!$this->member) { |
| 23 |
if (!isset($this->definition['member'])) { |
| 24 |
throw new \RuntimeException('No member attribute specified'); |
| 25 |
} |
| 26 |
$this->member = Shape::create($this->definition['member'], $this->shapeMap); |
| 27 |
} |
| 28 |
return $this->member; |
| 29 |
} |
| 30 |
} |
| 31 |
|