Skip to content

omnisense/omniticket API reference

Floor
Family
Version
1.x
Verified for real
Verified in part
Licence
MIT
composer require omnisense/omniticket:1.x-dev

Read from the package's own PHP files at the commit 5132f9698bdc: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.

Omniticket

  • AttendeeListInterface interface

    Who comes to an event: one Attendee per ticket.

    1 method

  • Capabilities class

    What 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

  • Config class

    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.

    7 methods

  • EventCatalogInterface interface

    The events a ticketing service sells: dates, rates, places left, where to buy.

    2 methods

  • ProviderFactory class

    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.

    3 methods

  • ProviderFactoryInterface interface

    Builds a provider from its options (a key, a secret, an organization...).

    2 methods

  • ProviderInterface interface

    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).

    3 methods

  • Registry class

    The application's ticketing providers by name, each built once from its factory and options:

    9 methods

  • TicketCheckInterface interface

    A ticket code checked at the door: valid, already used, void, unknown.

    1 method

Omniticket\Exception

  • InvalidConfigException class

    A provider asked for with options it cannot work with, or not configured at all.

  • InvalidKeyException class

    The provider refused the credentials (401, 403): a wrong or revoked key, a token past its time, a scope not granted.

    1 method

  • NotFoundException class

    The provider has nothing under that identifier (404): an event that does not exist or is not this account's.

    1 method

  • NotSupportedException class

    A provider asked for what it cannot do: the attendees of a read-only catalogue, an incremental read it has no filter for.

    1 method

  • OmniticketException interface

    Every exception omniticket throws.

  • ProviderException class

    The provider answered, and not with what was asked: an error status, an answer that is not JSON.

    1 method

  • UnreachableException class

    The provider could not be reached: a network error, a timeout.

Omniticket\Http

  • JsonApi class

    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.

    3 methods

  • Redaction class

    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.

    5 methods · 1 constant

Omniticket\Model

  • Attendee class

    One ticket and the person it is for.

    3 methods · 12 properties

  • AttendeeStatus enum

    Where a ticket stands.

    5 cases

  • Availability class

    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.

    5 methods · 5 properties

  • Check class

    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.

    5 methods · 3 properties

  • CheckResult enum

    What the door is told about a ticket code.

    4 cases

  • Event class

    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.

    5 methods · 14 properties

  • EventQuery class

    Which events to list: a period, a keyword, past ones or not, how many.

    3 methods · 6 properties

  • EventStatus enum

    Where an event's sale stands, in the words every provider is mapped to.

    9 cases

  • Money class

    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.

    6 methods · 2 properties

  • Rate class

    One price of an event: "Plein tarif", "Early bird", a tier.

    2 methods · 8 properties

  • Session class

    One date of an event sold for several (a "séance").

    2 methods · 6 properties

Omniticket\Support

  • Data class

    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.

    12 methods · 1 property

Omniticket\Testing

  • FixedTicketing class

    A 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

  • FixedTicketingFactory class

    FixedTicketing under the name "fixed", for a Registry.

    1 method

  • LoadCheck class

    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.

    4 methods · 1 constant

  • RecordedHttpClient class

    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.

    5 methods · 1 property

  • RecordedResponse class

    RecordedHttpClient'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): iterable

Every 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 $catalog

it lists and reads events (EventCatalogInterface)

public bool $attendees

it lists an event's attendees (AttendeeListInterface)

public bool $check

it checks a ticket code (TicketCheckInterface)

public bool $incremental

its attendees can be read from a moment on (only those changed since)

public bool $widget

its events carry a purchase module to embed (Event::$widgetUrl)

public array $terms

the terms whoever runs it must follow (URLs)

public array $limits

the 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 = [])
$catalog

it lists and reads events (EventCatalogInterface)

$attendees

it lists an event's attendees (AttendeeListInterface)

$check

it checks a ticket code (TicketCheckInterface)

$incremental

its attendees can be read from a moment on (only those changed since)

$widget

its events carry a purchase module to embed (Event::$widgetUrl)

$terms

the terms whoever runs it must follow (URLs)

$limits

the 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(): array

Config 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): self

Sets each key not set yet.

Config::validateNotEmpty()

public function validateNotEmpty(array $keys): void

Config::get()

public function get(string $key, mixed $default = null): mixed

Config::string()

public function string(string $key): ?string

A string option; null when it is empty.

Config::int()

public function int(string $key, int $default = 0): int

Config::float()

public function float(string $key, float $default = 0.0): float

Config::bool()

public function bool(string $key): bool

A 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()): iterable

The 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): Event

One 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(): string

ProviderFactory::create()

public function create(array $options = []): ProviderInterface

ProviderFactory::createConfig()

public function createConfig(array $options = []): Config

ProviderFactoryInterface interface

interface ProviderFactoryInterface ProviderFactoryInterface.php:6

Builds a provider from its options (a key, a secret, an organization...).

ProviderFactoryInterface::getName()

public function getName(): string

The name providers are configured with: "weezevent", "billetweb".

..

ProviderFactoryInterface::create()

public function create(array $options = []): ProviderInterface

ProviderInterface 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(): string

The factory's name: "weezevent", "billetweb".

..

ProviderInterface::getTitle()

public function getTitle(): string

ProviderInterface::capabilities()

public function capabilities(): Capabilities

Registry 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): ProviderInterface

Registry::has()

public function has(string $name): bool

Registry::catalog()

public function catalog(string $name): EventCatalogInterface

The provider, as a catalogue of events.

Registry::attendees()

public function attendees(string $name): AttendeeListInterface

The provider, as an event's attendees.

Registry::checker()

public function checker(string $name): TicketCheckInterface

The 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): Check

Omniticket\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): self

NotFoundException 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): self

NotSupportedException 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): self

OmniticketException 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): self

UnreachableException 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
$options

the HTTP client's options (query, headers, json, body, auth_bearer...)

JsonApi::message()

public static function message(Data $answer): ?string

The 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 = []): array

The 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.

$options

the HTTP client's options

Redaction::sensitive()

public static function sensitive(string $name): bool

Whether a parameter, header or field of this name holds a credential.

Redaction::text()

public static function text(string $text, array $secrets = []): string

A 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 = []): \Throwable

A 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): \Throwable

The 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 $id
public string $eventId
public ?string $code

what the ticket's barcode or QR code holds: what the door checks

public ?string $firstName
public ?string $lastName
public ?string $email
public ?string $rate
public AttendeeStatus $status
public ?\DateTimeImmutable $checkedInAt
public ?string $orderId
public ?string $sessionId
public ?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)
$code

what the ticket's barcode or QR code holds: what the door checks

Attendee::name()

public function name(): string

Attendee::toArray()

public function toArray(): array

AttendeeStatus 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 $remaining
public ?int $capacity
public ?int $sold
public bool $soldOut
public 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): self

From counts: sold out when nothing remains of a limited capacity.

Availability::unlimited()

public static function unlimited(?int $sold = null): self

Availability::known()

public function known(): bool

Whether the provider said anything about it.

Availability::toArray()

public function toArray(): array

Check 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 $code
public CheckResult $result
public ?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): self

Check::among()

public static function among(iterable $attendees, string $code): self

The check by reading the attendees: for providers with no lookup by code. The first attendee holding the code decides.

Check::valid()

public function valid(): bool

Check::toArray()

public function toArray(): array

CheckResult 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 $id
public string $title
public ?\DateTimeImmutable $start
public ?\DateTimeImmutable $end
public EventStatus $status
public ?string $url

where a visitor buys a ticket (the provider's page)

public ?string $venue
public Availability $availability
public array $rates
public array $sessions
public ?Money $priceFrom

the lowest price, when the provider gives a range rather than rates

public ?Money $priceTo
public ?string $widgetUrl

the 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 = '')
$url

where a visitor buys a ticket (the provider's page)

$widgetUrl

the provider's purchase module, to embed in a frame, when it has one

$priceFrom

the lowest price, when the provider gives a range rather than rates

Event::onSale()

public function onSale(): bool

Tickets can be bought now, as far as the provider says.

Event::soldOut()

public function soldOut(): bool

Event::lowestPrice()

public function lowestPrice(): ?Money

The lowest price among the rates, or the range's lower end.

Event::toArray()

public function toArray(): array

EventQuery 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 $from
public ?\DateTimeImmutable $to
public ?string $keyword
public bool $past
public ?int $limit
public ?\DateTimeImmutable $now

the 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)
$now

the present (a test's clock); the real one when null

EventQuery::matches()

public function matches(Event $event): bool

EventQuery::filter()

public function filter(iterable $events): \Generator

EventStatus 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 $currency
public int $amount

Money::__construct()

public function __construct(public int $amount, string $currency)

Money::fromMajor()

public static function fromMajor(int|float|string $major, string $currency): self

From a price in units ("12.50", 9.99, 10), as most APIs give it.

Money::exponent()

public static function exponent(string $currency): int

Money::major()

public function major(): string

The amount in units, as a decimal string: "12.50", "3000".

Money::isFree()

public function isFree(): bool

Money::toArray()

public function toArray(): array

Rate class

final readonly class Rate Rate.php:6

One price of an event: "Plein tarif", "Early bird", a tier.

public string $id
public string $label
public ?Money $price

null when the provider gives none; for a pay-what-you-want rate, see $minimum

public Availability $availability
public ?\DateTimeImmutable $salesStart
public ?\DateTimeImmutable $salesEnd
public ?Money $minimum

the 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)
$price

null when the provider gives none; for a pay-what-you-want rate, see $minimum

$minimum

the least a buyer may pay when the price is theirs to choose

Rate::toArray()

public function toArray(): array

Session class

final readonly class Session Session.php:6

One date of an event sold for several (a "séance").

public string $id
public ?\DateTimeImmutable $start
public ?\DateTimeImmutable $end
public ?string $name
public ?string $venue
public 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(): array

Omniticket\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): self

Data::raw()

public function raw(string $path): mixed

The value at a dotted path ("venue.city.name"), as it is.

Data::has()

public function has(string $path): bool

Data::string()

public function string(string $path): ?string

A string; null when absent or empty.

Data::int()

public function int(string $path): ?int

Data::float()

public function float(string $path): ?float

Data::bool()

public function bool(string $path): bool

true, 1, "1", "true", "yes".

Data::date()

public function date(string $path, ?\DateTimeZone $timezone = null): ?\DateTimeImmutable

A 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): self

The 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 = [])
$attendees

by event id

FixedTicketing::getName()

public function getName(): string

FixedTicketing::getTitle()

public function getTitle(): string

FixedTicketing::capabilities()

public function capabilities(): Capabilities

FixedTicketing::events()

public function events(EventQuery $query = new EventQuery()): iterable

FixedTicketing::event()

public function event(string $id): Event

FixedTicketing::attendees()

public function attendees(string $eventId, ?\DateTimeImmutable $updatedSince = null): iterable

Every attendee given for the event; not incremental: a read since a date is refused.

FixedTicketing::check()

public function check(string $eventId, string $code): Check

FixedTicketingFactory 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
$root

the package's directory

$namespace

its namespace, "Omniticket\\Billetweb\\"

$autoload

the autoload.php that knows it

$extra

classes 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): array

LoadCheck::outside()

public static function outside(array $files, string $root, array $allowed): array

The files loaded from outside the package and outside the vendor directories allowed.

$allowed

path fragments: "/vendor/psr/", "/vendor/omnisense/omniticket/"...

LoadCheck::autoload()

public static function autoload(string $class, string $test, string $root): ?string

The 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): self

Answers 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 = []): ResponseInterface

RecordedHttpClient::stream()

public function stream(ResponseInterface|iterable $responses, ?float $timeout = null): ResponseStreamInterface

RecordedHttpClient::withOptions()

public function withOptions(array $options): static

RecordedResponse 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(): int

RecordedResponse::getHeaders()

public function getHeaders(bool $throw = true): array

RecordedResponse::getContent()

public function getContent(bool $throw = true): string

RecordedResponse::toArray()

public function toArray(bool $throw = true): array

RecordedResponse::cancel()

public function cancel(): void

RecordedResponse::getInfo()

public function getInfo(?string $type = null): mixed