Files
Testing/include/aws/Aws/EndpointV2/Rule/RuleCreator.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

27 lines
661 B
PHP

<?php
namespace Aws\EndpointV2\Rule;
use Aws\Exception\UnresolvedEndpointException;
class RuleCreator
{
public static function create($type, $definition)
{
switch ($type) {
case 'endpoint':
return new EndpointRule($definition);
case 'error':
return new ErrorRule($definition);
case 'tree':
return new TreeRule($definition);
default:
throw new UnresolvedEndpointException(
'Unknown rule type ' . $type .
' must be of type `endpoint`, `tree` or `error`'
);
}
}
}