API / Minn\Runtime / Patterns

Patterns final class

Minn\Runtime\Patterns · public/minn/src/Minn/Runtime/Patterns.php · 161 lines

The block pattern, pattern category, and block style registries as data. Entries registered after init are remembered separately, because the editor asks for those on their own.

Constants and properties

privatearray $patterns
privatearray $patternsAfterInit
privatearray $categories
privatearray $categoriesAfterInit
privatearray $styles

Public

methodregisterPattern(mixed $name, mixed $properties): ?Minn\Runtime\Refusal#

Registers a block pattern, or the refusal.

methodunregisterPattern(string $name): bool#

Forgets a pattern.

methodpattern(string $name): ?array#

One pattern, or null.

methodpatterns(): array#

Every pattern.

@return list<array<string, mixed>>
methodpatternsAfterInit(): array#

The patterns registered after init, which the editor lists separately.

methodregisterCategory(mixed $name, mixed $properties): ?Minn\Runtime\Refusal#

Registers a pattern category, or the refusal.

methodunregisterCategory(string $name): bool#

Forgets a category.

methodcategory(string $name): ?array#

One category, or null.

methodcategories(): array#

Every category.

@return list<array<string, mixed>>
methodcategoriesAfterInit(): array#

The categories registered after init.

methodregisterStyle(mixed $blocks, mixed $properties): ?Minn\Runtime\Refusal#

Registers a block style, or the refusal.

$blocksstring|list<string>
methodunregisterStyle(string $block, string $style): bool#

Forgets a block style.

methodstyle(string $block, string $style): ?array#

One block style, or null.

methodstyles(?string $block = NULL): array#

Every block style, or one block's.

@return array<string, array<string, array<string, mixed>>>