Lue dans les fichiers PHP du paquet au commit 5132f9698bdc : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.
AttendeeListInterfaceinterfaceWho comes to an event: one Attendee per ticket.
1 method
CapabilitiesclassWhat a provider is, said before it is asked anything: what it can read, and the terms and limits whoever runs it must keep.
3 methods · 7 properties
ConfigclassA provider's configuration while its factory builds it: the options given, the factory's defaults under them, and the keys that must be filled.
7 methods
EventCatalogInterfaceinterfaceThe events a ticketing service sells: dates, rates, places left, where to buy.
2 methods
ProviderFactoryclassA provider's factory fills a Config - its name ("omniticket.factory_name"), its title ("omniticket.factory_title"), the options it needs ("omniticket.required_options") and the defaults of the others - then builds the provider from it.
3 methods
ProviderFactoryInterfaceinterfaceBuilds a provider from its options (a key, a secret, an organization...).
2 methods
ProviderInterfaceinterfaceOne ticketing service, configured: Weezevent, Billetweb, HelloAsso... Its Capabilities say what it can be asked - list and read events (EventCatalogInterface), list who comes (AttendeeListInterface), check a ticket code (TicketCheckInterface).
3 methods
RegistryclassThe application's ticketing providers by name, each built once from its factory and options:
9 methods
TicketCheckInterfaceinterfaceA ticket code checked at the door: valid, already used, void, unknown.
1 method
InvalidConfigExceptionclassA provider asked for with options it cannot work with, or not configured at all.
InvalidKeyExceptionclassThe provider refused the credentials (401, 403): a wrong or revoked key, a token past its time, a scope not granted.
1 method
NotFoundExceptionclassThe provider has nothing under that identifier (404): an event that does not exist or is not this account's.
1 method
NotSupportedExceptionclassA provider asked for what it cannot do: the attendees of a read-only catalogue, an incremental read it has no filter for.
1 method
OmniticketExceptioninterfaceEvery exception omniticket throws.
ProviderExceptionclassThe provider answered, and not with what was asked: an error status, an answer that is not JSON.
1 method
UnreachableExceptionclassThe provider could not be reached: a network error, a timeout.
JsonApiclassA JSON API called through the application's HTTP client (Symfony's contracts: its own client, or a MockHttpClient in a test), the answer turned into Data and every failure into one of omniticket's exceptions: not reached (UnreachableException), the key refused (401, 403: InvalidKeyException), nothing there (404: NotFoundException), any other error or an answer that is not JSON (ProviderException) - with the provider's own message when it gives one.
3 methods
RedactionclassWhat a failed call may carry of its credentials, taken out before the failure leaves the package: an HTTP client's exception quotes the URL called (a key in its query, a password in its user part), and every exception's trace keeps the arguments of the calls under it (the request options, headers and query with the key) unless PHP runs with zend.exception_ignore_args.
5 methods · 1 constant
AttendeeclassOne ticket and the person it is for.
3 methods · 12 properties
AttendeeStatusenumWhere a ticket stands.
5 cases
AvailabilityclassHow many places are left, as far as the provider says: an unknown remainder is null, not zero; a sale without a limit is unlimited.
5 methods · 5 properties
CheckclassA ticket code checked against an event: valid, already used, void or unknown, with the attendee when one was found. A check reads; it never marks the ticket as scanned at the provider.
5 methods · 3 properties
CheckResultenumWhat the door is told about a ticket code.
4 cases
EventclassAn event as the ticketing service sells it. events() fills what a list gives; event() the whole record - its rates, sessions and places left when the provider has them.
5 methods · 14 properties
EventQueryclassWhich events to list: a period, a keyword, past ones or not, how many.
3 methods · 6 properties
EventStatusenumWhere an event's sale stands, in the words every provider is mapped to.
9 cases
MoneyclassA price: an amount in the currency's minor unit (cents; yen have none) and its ISO 4217 code - never a float, so 9.99 stays 999.
6 methods · 2 properties
RateclassOne price of an event: "Plein tarif", "Early bird", a tier.
2 methods · 8 properties
SessionclassOne date of an event sold for several (a "séance").
2 methods · 6 properties
DataclassA decoded JSON answer, read with types: a provider asks for the string, the number, the date or the list it expects at a dotted path, and gets null (or an empty list) when the answer holds something else.
12 methods · 1 property
FixedTicketingclassA provider that answers from what it was given: an application's tests, a demo, the harness's bare script. Every contract, no network.
8 methods
FixedTicketingFactoryclassFixedTicketing under the name "fixed", for a Registry.
1 method
LoadCheckclassThe check every package of the family runs in its BareTest: each class of the package loaded in a PHP process of its own, with the autoloader that knows it, then what came from outside - classes of a framework, an HTTP client or an application, and files of packages it does not require.
4 methods · 1 constant
RecordedHttpClientclassAn HTTP client that answers from what it was given - a callable of the method, the URL and the options, returning [status, body, headers] - and keeps every request made ($requests): a provider's calls checked with no network.
5 methods · 1 property
RecordedResponseclassRecordedHttpClient's answer.
7 methods
Omniticket
AttendeeListInterface interface
interface AttendeeListInterface extends ProviderInterface AttendeeListInterface.php:8
Who comes to an event: one Attendee per ticket.
AttendeeListInterface::attendees()
public function attendees(string $eventId, ?\DateTimeImmutable $updatedSince = null): iterableEvery ticket of the event, cancelled and refunded ones included (their status says so). With $updatedSince, only those created or changed since then - the incremental read providers ask for (Capabilities::$incremental; NotSupportedException otherwise).
Capabilities class
final readonly class Capabilities Capabilities.php:9
What a provider is, said before it is asked anything: what it can read, and the terms and limits whoever runs it must keep.
public bool $catalogit lists and reads events (EventCatalogInterface)
public bool $attendeesit lists an event's attendees (AttendeeListInterface)
public bool $checkit checks a ticket code (TicketCheckInterface)
public bool $incrementalits attendees can be read from a moment on (only those changed since)
public bool $widgetits events carry a purchase module to embed (Event::$widgetUrl)
public array $termsthe terms whoever runs it must follow (URLs)
public array $limitsthe rate limits and usage rules the provider states, in words
Capabilities::__construct()
public function __construct(public bool $catalog = false, public bool $attendees = false, public bool $check = false, public bool $incremental = false, public bool $widget = false, public array $terms = [], public array $limits = [])$catalogit lists and reads events (EventCatalogInterface)
$attendeesit lists an event's attendees (AttendeeListInterface)
$checkit checks a ticket code (TicketCheckInterface)
$incrementalits attendees can be read from a moment on (only those changed since)
$widgetits events carry a purchase module to embed (Event::$widgetUrl)
$termsthe terms whoever runs it must follow (URLs)
$limitsthe rate limits and usage rules the provider states, in words
Capabilities::contracts()
public function contracts(): array- Returns
what it can be asked, by contract: catalog, attendees, check
Capabilities::toArray()
public function toArray(): arrayConfig class
final class Config extends ArrayObject Config.php:14
A provider's configuration while its factory builds it: the options given, the factory's defaults under them, and the keys that must be filled.
Config::defaults()
public function defaults(array $defaults): selfSets each key not set yet.
Config::validateNotEmpty()
public function validateNotEmpty(array $keys): voidConfig::get()
public function get(string $key, mixed $default = null): mixedConfig::string()
public function string(string $key): ?stringA string option; null when it is empty.
Config::int()
public function int(string $key, int $default = 0): intConfig::float()
public function float(string $key, float $default = 0.0): floatConfig::bool()
public function bool(string $key): boolA boolean option, as an environment variable gives it too: "1", "true", "yes", "on".
EventCatalogInterface interface
interface EventCatalogInterface extends ProviderInterface EventCatalogInterface.php:9
The events a ticketing service sells: dates, rates, places left, where to buy.
EventCatalogInterface::events()
public function events(EventQuery $query = new EventQuery()): iterableThe account's events (or the public ones, for a public catalogue), as the query selects them - upcoming ones by default. Pages are fetched as the iteration goes.
EventCatalogInterface::event()
public function event(string $id): EventOne event, whole: its rates, sessions and places left when the provider has them.
- Throws
Exception\NotFoundException when the provider has no such event
ProviderFactory class
abstract class ProviderFactory implements ProviderFactoryInterface ProviderFactory.php:15
A provider's factory fills a Config - its name ("omniticket.factory_name"), its title ("omniticket.factory_title"), the options it needs ("omniticket.required_options") and the defaults of the others - then builds the provider from it.
Nothing here calls anything: a factory whose provider is reached over HTTP takes its client in its own constructor - the application's, a MockHttpClient in a test.
ProviderFactory::getName()
public function getName(): stringProviderFactory::create()
public function create(array $options = []): ProviderInterfaceProviderFactory::createConfig()
public function createConfig(array $options = []): ConfigProviderFactoryInterface interface
interface ProviderFactoryInterface ProviderFactoryInterface.php:6
Builds a provider from its options (a key, a secret, an organization...).
ProviderFactoryInterface::getName()
public function getName(): stringThe name providers are configured with: "weezevent", "billetweb".
..
ProviderFactoryInterface::create()
public function create(array $options = []): ProviderInterfaceProviderInterface interface
interface ProviderInterface ProviderInterface.php:11
One ticketing service, configured: Weezevent, Billetweb, HelloAsso... Its Capabilities say what it can be asked - list and read events (EventCatalogInterface), list who comes (AttendeeListInterface), check a ticket code (TicketCheckInterface).
ProviderInterface::getName()
public function getName(): stringThe factory's name: "weezevent", "billetweb".
..
ProviderInterface::getTitle()
public function getTitle(): stringProviderInterface::capabilities()
public function capabilities(): CapabilitiesRegistry class
final class Registry Registry.php:20
The application's ticketing providers by name, each built once from its factory and options:
$registry = new Registry([new BilletwebFactory($http), new TicketmasterFactory($http)], [ 'box_office' => ['factory' => 'billetweb', 'options' => ['user' => '...', 'key' => '...']], 'concerts' => ['factory' => 'ticketmaster', 'options' => ['api_key' => '...']], ]);
foreach ($registry->catalog('box_office')->events() as $event) { ... } $registry->checker('box_office')->check('1235', '4475320')->valid();
Registry::__construct()
public function __construct(iterable $factories, readonly array $config)Registry::get()
public function get(string $name): ProviderInterfaceRegistry::has()
public function has(string $name): boolRegistry::catalog()
public function catalog(string $name): EventCatalogInterfaceThe provider, as a catalogue of events.
Registry::attendees()
public function attendees(string $name): AttendeeListInterfaceThe provider, as an event's attendees.
Registry::checker()
public function checker(string $name): TicketCheckInterfaceThe provider, as a ticket check.
Registry::options()
public function options(string $name): array- Returns
the options a provider is configured with
Registry::names()
public function names(): array- Returns
the configured providers' names
Registry::factories()
public function factories(): array- Returns
the factories installed: what
factory:may name
TicketCheckInterface interface
interface TicketCheckInterface extends ProviderInterface TicketCheckInterface.php:12
A ticket code checked at the door: valid, already used, void, unknown.
Reading only: the ticket is not marked as scanned at the provider - the provider's own scanning application does that.
TicketCheckInterface::check()
public function check(string $eventId, string $code): CheckOmniticket\Exception
InvalidConfigException class
final class InvalidConfigException extends InvalidArgumentException implements OmniticketException InvalidConfigException.php:6
A provider asked for with options it cannot work with, or not configured at all.
InvalidKeyException class
final class InvalidKeyException extends ProviderException InvalidKeyException.php:6
The provider refused the credentials (401, 403): a wrong or revoked key, a token past its time, a scope not granted.
InvalidKeyException::refused()
public static function refused(string $provider, string $what, int $status, ?string $message = null): selfNotFoundException class
final class NotFoundException extends ProviderException NotFoundException.php:6
The provider has nothing under that identifier (404): an event that does not exist or is not this account's.
NotFoundException::of()
public static function of(string $provider, string $what, ?string $message = null): selfNotSupportedException class
final class NotSupportedException extends LogicException implements OmniticketException NotSupportedException.php:6
A provider asked for what it cannot do: the attendees of a read-only catalogue, an incremental read it has no filter for.
NotSupportedException::capability()
public static function capability(object $provider, string $name, string $capability): selfOmniticketException interface
interface OmniticketException extends Throwable OmniticketException.php:6
Every exception omniticket throws.
ProviderException class
class ProviderException extends RuntimeException implements OmniticketException ProviderException.php:6
The provider answered, and not with what was asked: an error status, an answer that is not JSON.
ProviderException::answered()
public static function answered(string $provider, string $what, int $status, ?string $message = null): selfUnreachableException class
final class UnreachableException extends RuntimeException implements OmniticketException UnreachableException.php:6
The provider could not be reached: a network error, a timeout.
Omniticket\Http
JsonApi class
final class JsonApi JsonApi.php:22
A JSON API called through the application's HTTP client (Symfony's contracts: its own client, or a MockHttpClient in a test), the answer turned into Data and every failure into one of omniticket's exceptions: not reached (UnreachableException), the key refused (401, 403: InvalidKeyException), nothing there (404: NotFoundException), any other error or an answer that is not JSON (ProviderException) - with the provider's own message when it gives one.
JsonApi::__construct()
public function __construct(readonly HttpClientInterface $http, readonly string $provider)JsonApi::request()
public function request(string $method, string $url, array $options = [], string $what = 'the request'): Data$optionsthe HTTP client's options (query, headers, json, body, auth_bearer...)
JsonApi::message()
public static function message(Data $answer): ?stringThe error message an answer carries, under the names APIs give it.
Redaction class
final class Redaction Redaction.php:22
What a failed call may carry of its credentials, taken out before the failure leaves the package: an HTTP client's exception quotes the URL called (a key in its query, a password in its user part), and every exception's trace keeps the arguments of the calls under it (the request options, headers and query with the key) unless PHP runs with zend.exception_ignore_args.
copy() gives the previous exception to wrap instead of the client's own: the same class and code, its message with the key's parameters, the user part and every secret value replaced by ***, its trace without arguments, its own previous copied the same way. Properties of the client's class beyond those of \Exception are not copied (a Symfony HttpException's response, a PSR-18 exception's request: their URL holds the key). withoutArguments() takes the arguments out of the trace of the exception thrown in its place.
const MASK = '***'
Redaction::secrets()
public static function secrets(string $url, array $options = []): arrayThe secrets a request carries: the values of its query parameters, headers and body fields named as credentials (key, token, secret, password, signature, auth...), a bearer token, a basic password, the URL's user part.
$optionsthe HTTP client's options
Redaction::sensitive()
public static function sensitive(string $name): boolWhether a parameter, header or field of this name holds a credential.
Redaction::text()
public static function text(string $text, array $secrets = []): stringA text without credentials: in every address, the user part and the parameters named as credentials masked (api_key=***); then every secret given, raw or URL-encoded, masked wherever it stands.
Redaction::copy()
public static function copy(\Throwable $failure, array $secrets = []): \ThrowableA copy of a failure to wrap in its place: its class, code, file and line, its message through text(), its trace without arguments, its previous copied the same way.
Redaction::withoutArguments()
public static function withoutArguments(\Throwable $failure): \ThrowableThe failure given, the arguments out of its trace (and out of its previous ones'), as zend.exception_ignore_args would have left it.
Omniticket\Model
Attendee class
final readonly class Attendee Attendee.php:6
One ticket and the person it is for.
public string $idpublic string $eventIdpublic ?string $codewhat the ticket's barcode or QR code holds: what the door checks
public ?string $firstNamepublic ?string $lastNamepublic ?string $emailpublic ?string $ratepublic AttendeeStatus $statuspublic ?\DateTimeImmutable $checkedInAtpublic ?string $orderIdpublic ?string $sessionIdpublic ?string $ticketUrl
Attendee::__construct()
public function __construct(public string $id, public string $eventId, public ?string $code = null, public ?string $firstName = null, public ?string $lastName = null, public ?string $email = null, public ?string $rate = null, public AttendeeStatus $status = AttendeeStatus::Valid, public ?\DateTimeImmutable $checkedInAt = null, public ?string $orderId = null, public ?string $sessionId = null, public ?string $ticketUrl = null)$codewhat the ticket's barcode or QR code holds: what the door checks
Attendee::name()
public function name(): stringAttendee::toArray()
public function toArray(): arrayAttendeeStatus enum
enum AttendeeStatus AttendeeStatus.php:6
Where a ticket stands.
case Valid = 'valid'Paid (or free) and not scanned yet.
case CheckedIn = 'checked_in'Scanned at the door.
case Cancelled = 'cancelled'case Refunded = 'refunded'case Pending = 'pending'Not paid yet, waiting for a validation.
Availability class
final readonly class Availability Availability.php:9
How many places are left, as far as the provider says: an unknown remainder is null, not zero; a sale without a limit is unlimited.
public ?int $remainingpublic ?int $capacitypublic ?int $soldpublic bool $soldOutpublic bool $unlimited
Availability::__construct()
public function __construct(public ?int $remaining = null, public ?int $capacity = null, public ?int $sold = null, public bool $soldOut = false, public bool $unlimited = false)Availability::of()
public static function of(?int $remaining, ?int $capacity = null, ?int $sold = null): selfFrom counts: sold out when nothing remains of a limited capacity.
Availability::unlimited()
public static function unlimited(?int $sold = null): selfAvailability::known()
public function known(): boolWhether the provider said anything about it.
Availability::toArray()
public function toArray(): arrayCheck class
final readonly class Check Check.php:10
A ticket code checked against an event: valid, already used, void or unknown, with the attendee when one was found. A check reads; it never marks the ticket as scanned at the provider.
public string $codepublic CheckResult $resultpublic ?Attendee $attendee
Check::__construct()
public function __construct(public string $code, public CheckResult $result, public ?Attendee $attendee = null)Check::of()
public static function of(string $code, ?Attendee $attendee): selfCheck::among()
public static function among(iterable $attendees, string $code): selfThe check by reading the attendees: for providers with no lookup by code. The first attendee holding the code decides.
Check::valid()
public function valid(): boolCheck::toArray()
public function toArray(): arrayCheckResult enum
enum CheckResult CheckResult.php:6
What the door is told about a ticket code.
case Valid = 'valid'case AlreadyUsed = 'already_used'Already scanned.
case Void = 'void'Cancelled, refunded or not paid.
case Unknown = 'unknown'No ticket of this event holds that code.
Event class
final readonly class Event Event.php:10
An event as the ticketing service sells it. events() fills what a list gives; event() the whole record - its rates, sessions and places left when the provider has them.
public string $idpublic string $titlepublic ?\DateTimeImmutable $startpublic ?\DateTimeImmutable $endpublic EventStatus $statuspublic ?string $urlwhere a visitor buys a ticket (the provider's page)
public ?string $venuepublic Availability $availabilitypublic array $ratespublic array $sessionspublic ?Money $priceFromthe lowest price, when the provider gives a range rather than rates
public ?Money $priceTopublic ?string $widgetUrlthe provider's purchase module, to embed in a frame, when it has one
public string $provider
Event::__construct()
public function __construct(public string $id, public string $title, public ?\DateTimeImmutable $start = null, public ?\DateTimeImmutable $end = null, public EventStatus $status = EventStatus::Unknown, public ?string $url = null, public ?string $venue = null, public Availability $availability = new Availability(), public array $rates = [], public array $sessions = [], public ?Money $priceFrom = null, public ?Money $priceTo = null, public ?string $widgetUrl = null, public string $provider = '')$urlwhere a visitor buys a ticket (the provider's page)
$widgetUrlthe provider's purchase module, to embed in a frame, when it has one
$priceFromthe lowest price, when the provider gives a range rather than rates
Event::onSale()
public function onSale(): boolTickets can be bought now, as far as the provider says.
Event::soldOut()
public function soldOut(): boolEvent::lowestPrice()
public function lowestPrice(): ?MoneyThe lowest price among the rates, or the range's lower end.
Event::toArray()
public function toArray(): arrayEventQuery class
final readonly class EventQuery EventQuery.php:11
Which events to list: a period, a keyword, past ones or not, how many.
A provider passes what its API can filter on and filter() applies the whole query to what comes back, so every provider answers the same query the same way.
public ?\DateTimeImmutable $frompublic ?\DateTimeImmutable $topublic ?string $keywordpublic bool $pastpublic ?int $limitpublic ?\DateTimeImmutable $nowthe present (a test's clock); the real one when null
EventQuery::__construct()
public function __construct(public ?\DateTimeImmutable $from = null, public ?\DateTimeImmutable $to = null, public ?string $keyword = null, public bool $past = false, public ?int $limit = null, public ?\DateTimeImmutable $now = null)$nowthe present (a test's clock); the real one when null
EventQuery::matches()
public function matches(Event $event): boolEventQuery::filter()
public function filter(iterable $events): \GeneratorEventStatus enum
enum EventStatus EventStatus.php:6
Where an event's sale stands, in the words every provider is mapped to.
case Draft = 'draft'Not published yet.
case Upcoming = 'upcoming'Published, sales not open yet.
case OnSale = 'on_sale'case SoldOut = 'sold_out'case SalesClosed = 'sales_closed'Sales over (closed, or the event under way) but the event not cancelled.
case Ended = 'ended'case Cancelled = 'cancelled'case Postponed = 'postponed'case Unknown = 'unknown'
Money class
final readonly class Money Money.php:9
A price: an amount in the currency's minor unit (cents; yen have none) and its ISO 4217 code - never a float, so 9.99 stays 999.
public string $currencypublic int $amount
Money::__construct()
public function __construct(public int $amount, string $currency)Money::fromMajor()
public static function fromMajor(int|float|string $major, string $currency): selfFrom a price in units ("12.50", 9.99, 10), as most APIs give it.
Money::exponent()
public static function exponent(string $currency): intMoney::major()
public function major(): stringThe amount in units, as a decimal string: "12.50", "3000".
Money::isFree()
public function isFree(): boolMoney::toArray()
public function toArray(): arrayRate class
final readonly class Rate Rate.php:6
One price of an event: "Plein tarif", "Early bird", a tier.
public string $idpublic string $labelpublic ?Money $pricenull when the provider gives none; for a pay-what-you-want rate, see $minimum
public Availability $availabilitypublic ?\DateTimeImmutable $salesStartpublic ?\DateTimeImmutable $salesEndpublic ?Money $minimumthe least a buyer may pay when the price is theirs to choose
public ?string $category
Rate::__construct()
public function __construct(public string $id, public string $label, public ?Money $price = null, public Availability $availability = new Availability(), public ?\DateTimeImmutable $salesStart = null, public ?\DateTimeImmutable $salesEnd = null, public ?Money $minimum = null, public ?string $category = null)$pricenull when the provider gives none; for a pay-what-you-want rate, see $minimum
$minimumthe least a buyer may pay when the price is theirs to choose
Rate::toArray()
public function toArray(): arraySession class
final readonly class Session Session.php:6
One date of an event sold for several (a "séance").
public string $idpublic ?\DateTimeImmutable $startpublic ?\DateTimeImmutable $endpublic ?string $namepublic ?string $venuepublic Availability $availability
Session::__construct()
public function __construct(public string $id, public ?\DateTimeImmutable $start = null, public ?\DateTimeImmutable $end = null, public ?string $name = null, public ?string $venue = null, public Availability $availability = new Availability())Session::toArray()
public function toArray(): arrayOmniticket\Support
Data class
final class Data Data.php:10
A decoded JSON answer, read with types: a provider asks for the string, the number, the date or the list it expects at a dotted path, and gets null (or an empty list) when the answer holds something else.
public readonly array $values
Data::__construct()
public function __construct(public readonly array $values = [])Data::of()
public static function of(mixed $value): selfData::raw()
public function raw(string $path): mixedThe value at a dotted path ("venue.city.name"), as it is.
Data::has()
public function has(string $path): boolData::string()
public function string(string $path): ?stringA string; null when absent or empty.
Data::int()
public function int(string $path): ?intData::float()
public function float(string $path): ?floatData::bool()
public function bool(string $path): booltrue, 1, "1", "true", "yes".
Data::date()
public function date(string $path, ?\DateTimeZone $timezone = null): ?\DateTimeImmutableA date: a UNIX timestamp, or a string PHP reads ("2026-11-14 20:00:00", ISO 8601), in $timezone when it names none. Null when absent, empty, unreadable or "0000-00-00...".
Data::data()
public function data(string $path): selfThe object at a path; an empty one when absent.
Data::list()
public function list(string $path): array- Returns
the items of the list (or object) at a path
Data::items()
public function items(): array- Returns
the items of this value itself, when it is a list
Omniticket\Testing
FixedTicketing class
final class FixedTicketing implements EventCatalogInterface, AttendeeListInterface, TicketCheckInterface FixedTicketing.php:20
A provider that answers from what it was given: an application's tests, a demo, the harness's bare script. Every contract, no network.
FixedTicketing::__construct()
public function __construct(readonly array $events = [], readonly array $attendees = [])$attendeesby event id
FixedTicketing::getName()
public function getName(): stringFixedTicketing::getTitle()
public function getTitle(): stringFixedTicketing::capabilities()
public function capabilities(): CapabilitiesFixedTicketing::events()
public function events(EventQuery $query = new EventQuery()): iterableFixedTicketing::event()
public function event(string $id): EventFixedTicketing::attendees()
public function attendees(string $eventId, ?\DateTimeImmutable $updatedSince = null): iterableEvery attendee given for the event; not incremental: a read since a date is refused.
FixedTicketing::check()
public function check(string $eventId, string $code): CheckFixedTicketingFactory class
final class FixedTicketingFactory extends ProviderFactory FixedTicketingFactory.php:12
FixedTicketing under the name "fixed", for a Registry.
FixedTicketingFactory::__construct()
public function __construct(readonly array $events = [], readonly array $attendees = [])LoadCheck class
final class LoadCheck LoadCheck.php:12
The check every package of the family runs in its BareTest: each class of the package loaded in a PHP process of its own, with the autoloader that knows it, then what came from outside - classes of a framework, an HTTP client or an application, and files of packages it does not require.
const FOREIGN = '~^(?:Symfony\\\\(?!Contracts\\\\HttpClient\\\\|Contracts\\\\Service\\\\|Polyfill\\\\)|(?:Illuminate|Laravel|Doctrine|Twig|League|GuzzleHttp|Nyholm|Http|Omni…Classes no package of the family may load: a framework, an HTTP client, an application. Symfony's HTTP client contracts are interfaces, allowed.
LoadCheck::run()
public static function run(string $root, string $namespace, string $autoload, array $extra = []): array$rootthe package's directory
$namespaceits namespace, "Omniticket\\Billetweb\\"
$autoloadthe autoload.php that knows it
$extraclasses to load besides (the check that it is not blind)
- Returns
the files without those Composer includes at start for every package
LoadCheck::foreign()
public static function foreign(array $symbols): arrayLoadCheck::outside()
public static function outside(array $files, string $root, array $allowed): arrayThe files loaded from outside the package and outside the vendor directories allowed.
$allowedpath fragments: "/vendor/psr/", "/vendor/omnisense/omniticket/"...
LoadCheck::autoload()
public static function autoload(string $class, string $test, string $root): ?stringThe autoloader that knows a class and the test asking: the package's own or its harness's. Null when the package sits in an application's vendor/ (the application's autoloader loads what it needs at start: the check is the package's own) or when none knows it.
RecordedHttpClient class
final class RecordedHttpClient implements HttpClientInterface RecordedHttpClient.php:15
An HTTP client that answers from what it was given - a callable of the method, the URL and the options, returning [status, body, headers] - and keeps every request made ($requests): a provider's calls checked with no network.
public array $requests = []
RecordedHttpClient::__construct()
public function __construct(readonly \Closure $answer)RecordedHttpClient::routes()
public static function routes(array $routes): selfAnswers by route: "GET /api/events" => the body (status 200) or [status, body] - the first route whose method matches and whose path ends the URL's path; 404 for anything not recorded.
RecordedHttpClient::request()
public function request(string $method, string $url, array $options = []): ResponseInterfaceRecordedHttpClient::stream()
public function stream(ResponseInterface|iterable $responses, ?float $timeout = null): ResponseStreamInterfaceRecordedHttpClient::withOptions()
public function withOptions(array $options): staticRecordedResponse class
final class RecordedResponse implements ResponseInterface RecordedResponse.php:8
RecordedHttpClient's answer.
RecordedResponse::__construct()
public function __construct(readonly int $status, readonly string $body, readonly array $headers, readonly string $url)RecordedResponse::getStatusCode()
public function getStatusCode(): intRecordedResponse::getHeaders()
public function getHeaders(bool $throw = true): arrayRecordedResponse::getContent()
public function getContent(bool $throw = true): stringRecordedResponse::toArray()
public function toArray(bool $throw = true): arrayRecordedResponse::cancel()
public function cancel(): voidRecordedResponse::getInfo()
public function getInfo(?string $type = null): mixed