Types
Every enum, exception and interface, and what each one is for.
Enums
- Core\Api\KeyIn: The place where a client sends the key of an ApiKey security scheme. You write it as in: in an #[Core\Api\Scheme].
- Core\Api\SchemeType: The kind of security scheme that an #[Core\Api\Scheme] declares. There are five kinds. They are the five that OpenAPI 3.1 lists.
- Core\Arr::Order: The direction a sort puts things in: Asc for smallest first, Desc for largest first.
- Core\Arr::SetOn: Which part of an entry is compared when you ask what two arrays have in common, or what only one of them has.
- Core\Audience: Names the one audience Novis itself understands: everyone.
- Core\Charset: Names the character encoding of some text, so a conversion knows which encoding to use.
- Core\Cldr::PluralCategory: Names the form a language uses for a given count, so one message can be written correctly in every language.
- Core\Cli::ColorDepth: Says how much colour a terminal can show, so a program can pick a palette that will actually arrive.
- Core\Cli::Stream: Names which of a program's three standard streams a call is about.
- Core\Command::Shell: Names the shell a completion script is written for.
- Core\Compress::Codec: Names the compressed format a program reads or writes.
- Core\Crypto::Cipher: Names the construction a sealed message is written and read under.
- Core\Crypto\KeyKind: Names which asymmetric key a call is talking about — the curve, or the RSA signing scheme.
- Core\Crypto\PublicKey::Format: Says which encoding a public key is read from or written to.
- Core\Db\Column::Type: Says what a result column was declared as in the database.
- Core\Db\DbError::Kind: Says why the database refused a statement, in the same words on every backend.
- Core\Db\Driver: Names which database a connection speaks to.
- Core\Db\Isolation: How much of other transactions' unfinished work your own transaction is allowed to see.
- Core\Db\Plan\Step::Grade: What one step of a schema change can cost you, at worst.
- Core\Env::Context: The kind of run your code is in. There are seven kinds.
- Core\Env::Mode: Which deployment your program is running in. There are two modes and there is no third.
- Core\Env::Platform: The operating system your program runs on.
- Core\Hash::Digest: Which hashing algorithm a Core\Hash call computes.
- Core\Http\Method: The HTTP methods a route can be declared with, and a request can arrive with. There are exactly eight of them.
- Core\IO::FileMode: What an open file is allowed to do, and what opening it does to whatever is already in the file.
- Core\Ldap::Tls: Says whether a connection to a directory is encrypted.
- Core\Ldap\Connection::Scope: Says how far below its base a search looks.
- Core\Ldap\Entry::AccountType: Says what kind of object an Active Directory entry is.
- Core\Ldap\LdapError::Kind: Says why a directory operation failed.
- Core\Log::Level: How loud a log record is. Every record your program writes carries one of five levels, and whoever runs the server decides how much of that they want to keep.
- Core\Mail\Message::Kind: What a received message is, as Core\Mail\Message::kind() returns it.
- Core\Mail\ReportRecipient::Action: What the mail server did with a message for one recipient of a delivery report.
- Core\Mime::Type: What a run of bytes turned out to be, read from the bytes themselves. Core\Mime::detect answers with one of these cases, one per format it can recognise: images, audio and video, documents and archives.
- Core\Passkey\Credential::Algorithm: The signature algorithm of a passkey: ES256 or Ed25519.
- Core\Queue::State: What has become of a background job. Asking the queue about a job you handed it earlier answers with one of five states, and between them they cover everything a job can be doing.
- Core\Reflect::TypeKind: What a value actually is, when its declared type no longer says. Nearly everywhere in Novis the type is written down and nobody has to ask; a mixed is the exception, and asking one what it is holding answers with one of ten kinds.
- Core\Response::Redirect: Which kind of redirect a response is, when it answers by sending the visitor somewhere else.
- Core\Response::SameSite: Which cross-site requests carry your cookie. A cookie belongs to your site, and this setting decides whether it also travels on a request that somebody else's page made to yours.
- Core\RoundMode: How a number that lands exactly between two neighbours is settled when you round it.
- Core\Router\Refusal: The reason Core\Router::dispatch did not call the method of a route.
- Core\Script\ExitReport::Reason: Which ending ran your cleanup. A script can register work to do on the way out, and whatever that work is, its first question is usually how the script ended — you tidy up differently after a clean run than after a crash.
- Core\Str::NormalForm: The four spellings Unicode allows for the same text, and the one Core\Str::normalize rewrites into.
- Core\Time\Weekday: A day of the week: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday or Sunday.
- Core\Unit: Core\Unit is a step in the calendar or on the clock: a nanosecond, a microsecond, a millisecond, a second, a minute, an hour, a day, a week, a month, a quarter or a year.
- Core\Xml\Node::Kind: What a node in a parsed document is: the document itself, an element, some text, a comment or a processing instruction. There are five and there will never be a sixth, so a walk that handles all five has handled everything a document can hold.
- Novis\Image\Barcode::Symbology: The barcode format that Barcode::render and Barcode::svg draw. A barcode format is also called a symbology.
- Novis\Image\Format: An image file format.
- Novis\Image\Image::Align: How the lines of a text are placed next to each other.
- Novis\Image\Image::Axis: The direction in which flipped mirrors an image.
- Novis\Image\Image::Blend: How withOverlay mixes the colours of the image on top with the colours of the image below it.
- Novis\Image\Image::Filter: The filter resized uses to calculate the pixels of the new image.
- Novis\Image\Image::Fit: How resized fits an image into the width and height you give it.
- Novis\Image\Image::Gravity: A position in an image, written as a direction from the center. Image programs call this position the gravity.
- Novis\Image\Image::HashKind: The kind of hash Image::hash returns.
- Novis\Image\Image::PlaceholderKind: The kind of placeholder Image::placeholder returns.
- Novis\Image\QrCode::Level: How much of a QR code can be damaged and still be read.
- Novis\Intl\Collator::CaseFirst: Whether uppercase or lowercase letters come first when Collator sorts two words that differ only in case.
- Novis\Intl\Collator::Strength: Which differences between two strings change their order when Collator sorts them.
- Novis\Intl\DateFormat::Fields: Which parts of a date DateFormat writes: the day, the month, the year and the day of the week.
- Novis\Intl\DateFormat::Length: How long a date is when DateFormat writes it.
- Novis\Intl\DateFormat::ZoneStyle: How DateFormat::dateTimes shows the time zone of a date and time.
- Novis\Intl\ListFormat::Type: The words ListFormat::join uses to join the items of a list.
- Novis\Intl\Locale::Service: The kind of language data that Locale::resolve looks up, such as the data for sorting text.
- Novis\Intl\NumberFormat::CompactDisplay: How NumberFormat::compact writes a large number in a short form.
- Novis\Intl\NumberFormat::CurrencyDisplay: How NumberFormat::currency writes the currency of an amount.
- Novis\Intl\RelativeTime::Numeric: Whether RelativeTime::format always writes a number, or uses a word such as "yesterday" where the language has one.
- Novis\Intl\RelativeTime::Unit: The unit of an amount of time that RelativeTime::format writes, such as "5 minutes ago".
- Novis\Intl\Width: How short RelativeTime::format and ListFormat::join make their text.
- Novis\Pdf\Document::Standard: The set of rules that a PDF file follows. Document::withStandard returns a copy of the document with this standard set.
- Novis\Spreadsheet\Chart::Kind: The type of a chart.
- Novis\Spreadsheet\Chart::Legend: Where a chart shows its legend, the list of series names and their colors.
- Novis\Spreadsheet\Reader::SheetKind: Whether a sheet of a workbook has cells or only a chart.
- Novis\Spreadsheet\Reader::Visibility: Whether a sheet of a workbook shows its tab in Excel.
- Novis\Spreadsheet\Style::Align: Where the text of a cell is placed from left to right.
- Novis\Spreadsheet\Style::Line: The kind of line that one side of a cell border has.
- Novis\Spreadsheet\Style::Underline: One or two lines under the text of a cell.
- Novis\Spreadsheet\Style::Valign: Where the text of a cell is placed from top to bottom.
Exceptions
- ArithmeticError: The error a calculation raises when it has no right answer.
- Core\Cli\NotInteractive: The error a question throws when nobody is there to answer it.
- Core\Db\DbError: The error a database throws when it does not accept a statement.
- Core\Db\RolledBack: The error that is thrown when a program gives up on a transaction it started.
- Core\DeprecatedError: The error a use of deprecated code throws when the setting errors.deprecated is throw. Code is deprecated when it carries the attribute #[Core\Deprecated]. The error is a LogicError, because the program itself still uses old code.
- Core\Ldap\LdapError: The error a directory operation throws when it fails.
- Core\Script\Finished: Every script that ends early ends through this class. Core\Script::finish() raises it, and what travels out is an ordinary raised value, so leaving takes the same path a thrown error takes: every finally between the call and the top of the program runs, and what was opened is closed on the way out. Nothing after the call runs.
- Core\Test\Failure: The error a failed check throws.
- ExtensionError: The error a call into an extension throws when the extension's code crashes. An extension is code that runs in a sandbox beside your program, such as the built-in Novis\Image and Novis\Intl. When that code stops on a bug of its own, your call throws ExtensionError. It is a RuntimeError, so a catch (RuntimeError $e) catches it too.
- IOError: The error a program throws when something outside it failed: a file is missing, a disk is full, or a network connection closed too early.
- LogicError: The error a program raises when the mistake is its own.
- ParseError: The error a program throws when input does not match the format it should have: text that is not valid JSON, a field with the wrong type, or a document that is nested too deeply.
- RecursionError: The error for a call that never comes back. A function that calls itself — a walk over a tree, a parser over nested text — is stopped once the calls are stacked deeper than any working program needs, rather than being left to exhaust the machine and take the whole process with it.
- RevokedObjectError: RevokedObjectError is the error a program gets when it uses a revoked object. An object is revoked when its class implements Revocable and the program called revoke() on it. The error is a LogicError, which is the error class for a mistake in the program itself.
- RuntimeError: The error a program raises when something outside it said no.
- Throwable: The root every error in Novis descends from, and the one a program's own errors extend.
- TimeoutError: The error for something that did not answer in time: a connection that never opened, a query still running when its limit was reached, a cache that went quiet. It sits under RuntimeError, beside the other refusals that come from outside the program.
Interfaces
- Comparable: Lets a class of your own say how two of its values are ordered, so everything that sorts can sort them.
- Core\Router\Gate: The interface your class implements to control Core\Router::dispatch. You pass an instance of the class to dispatch, and it calls three methods:
- Core\Router\Responder: The interface your class implements to write the response from the value that a route method returns.
- Iterable: What a class implements so a foreach loop can walk it, the way it walks an array.
- Iterator: A cursor that walks a sequence once, front to back.
- KeyedIterable: The interface a class implements so that a foreach loop can give a key and a value for each entry.
- KeyedIterator: The interface for a cursor that moves through entries one at a time, each with a key and a value.
- LateInit: LateInit is an interface. A class implements it to give a lateinit property its value the first time a program reads it.
- Parses: The interface for a class that is built from a piece of text and written back as text.
- PropertyGuard: PropertyGuard is an interface. A class implements it to check every write of its own properties before the value is stored.
- PropertyObserver: A class that implements PropertyObserver is told about every read and every write of its own properties.
- Revocable: The interface for an object that can stop being valid, such as a deleted database row.
- Stringable: What a class adds so that its objects can be written as text.
