mirror of
https://gh.wpcy.net/https://github.com/pixelabs-wp/whitelabel-plugins-update-server.git
synced 2026-04-18 04:02:15 +08:00
26 lines
661 B
PHP
26 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`'
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|