Debian Codegraph @

lib/3rdParty/composer/aws/aws-sdk-php/src/EndpointV2/Rule/RuleCreator.php

raw symbols SCIP
1 <?php
2
3 namespace Aws\EndpointV2\Rule;
4
5 use Aws\Exception\UnresolvedEndpointException;
6
7 class RuleCreator
8 {
9 public static function create($type, $definition)
10 {
11 switch ($type) {
12 case 'endpoint':
13 return new EndpointRule($definition);
14 case 'error':
15 return new ErrorRule($definition);
16 case 'tree':
17 return new TreeRule($definition);
18 default:
19 throw new UnresolvedEndpointException(
20 'Unknown rule type ' . $type .
21 ' must be of type `endpoint`, `tree` or `error`'
22 );
23 }
24 }
25 }
26