<?php declare(strict_types = 1); namespace MailPoet\API\REST; if (!defined('ABSPATH')) exit; use MailPoet\InvalidStateException; use MailPoetVendor\Psr\Container\ContainerInterface; class EndpointContainer { /** @var ContainerInterface */ private $container; public function __construct( ContainerInterface $container ) { $this->container = $container; } public function get(string $class): Endpoint { $endpoint = $this->container->get($class); if (!$endpoint instanceof Endpoint) { throw new InvalidStateException(sprintf("Class '%s' doesn't implement '%s'", $class, Endpoint::class)); } return $endpoint; } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
API.php | File | 3.61 KB | 0644 |
|
Endpoint.php | File | 420 B | 0644 |
|
EndpointContainer.php | File | 662 B | 0644 |
|
ErrorResponse.php | File | 465 B | 0644 |
|
Exception.php | File | 243 B | 0644 |
|
Request.php | File | 606 B | 0644 |
|
Response.php | File | 304 B | 0644 |
|
index.php | File | 6 B | 0644 |
|