diff --git a/tests/Feature/Extraction/BlockBindingsContractTest.php b/tests/Feature/Extraction/BlockBindingsContractTest.php new file mode 100644 index 00000000..449fadc3 --- /dev/null +++ b/tests/Feature/Extraction/BlockBindingsContractTest.php @@ -0,0 +1,128 @@ +justReturn(0); + Functions\when('number_format_i18n')->alias(fn (float|int $number, int $decimals = 0): string => number_format((float) $number, $decimals, ',', ' ')); + Functions\when('get_block_bindings_source')->justReturn(); + Functions\when('get_option')->alias(fn (string $name): string => $name === 'blogdescription' ? 'Live music' : 'secret'); + + $this->registered = []; + Functions\when('register_block_bindings_source')->alias(function (string $name, array $args): void { + $this->registered[$name] = $args; + }); + + $this->app = new Application(sys_get_temp_dir()); + $this->app->instance('config', new Repository(['app' => ['debug' => false], 'block-bindings' => ['options' => ['blogdescription']]])); + $this->app->instance(LoggerInterface::class, new NullLogger); + $this->app->instance('events', new Dispatcher); + $this->app->instance('validator', new Factory(new Translator(new ArrayLoader, 'en'))); + + $this->hooks = []; + $action = Mockery::mock(Action::class); + $action->shouldReceive('add')->andReturnUsing(function (string $hook, Closure $callback) use ($action): Action { + $this->hooks[$hook][] = $callback; + + return $action; + }); + $this->app->instance(Action::class, $action); + $this->app->instance(Filter::class, Mockery::mock(Filter::class)->shouldIgnoreMissing()); + + (new MetaServiceProvider($this->app))->register(); + $this->provider = new BlockBindingServiceProvider($this->app); + $this->provider->register(); + + $this->app->instance(MetaStoreInterface::class, new ArrayMetaStore(['post' => [7 => ['capacity' => '1200']], 'user' => [5 => ['stage_name' => 'The Hums', 'phone' => '0600000000']]])); + $this->app->instance(ContentVisibilityInterface::class, new FakeVisibility); + $this->app->instance(ValuePresenterInterface::class, new FakePresenter); + + $schemas = $this->app->make(MetaSchemaRepository::class); + foreach ([Concert::class, ArtistProfile::class, VenueExtras::class] as $class) { + $schemas->add($this->app->make(MetaSchemaBuilder::class)->build($class)); + } + + $this->provider->boot(); +}); + +afterEach(function (): void { + \Brain\Monkey\tearDown(); +}); + +it('registers the four sources Pollora ships, with WordPress, on init', function (): void { + foreach ($this->hooks['init'] as $register) { + $register(); + } + + expect(array_keys($this->registered))->toBe(['pollora/post-meta', 'pollora/term-meta', 'pollora/author-meta', 'pollora/option']) + ->and($this->app->make(BindingSourceRegistry::class)->find('pollora/post-meta')?->name)->toBe('pollora/post-meta'); +}); + +it('lists the options of the project, through the container, in the editor data', function (): void { + $data = $this->app->make(BindingEditorData::class)->toArray(); + + expect($data['route'])->toBe('pollora/v1/block-bindings/resolve') + ->and($data['sources']['pollora/option']['fields'])->toBe([['label' => 'Blogdescription', 'args' => ['name' => 'blogdescription'], 'type' => 'string']]) + ->and(array_column(array_column($data['sources']['pollora/author-meta']['fields'][''], 'args'), 'key'))->toBe(['stage_name']) + ->and(array_keys($data['sources']['pollora/post-meta']['fields']))->toContain('concert'); +}); + +it('reads only the listed options, through the container', function (): void { + $source = $this->app->make(OptionSource::class); + + expect($source(new BindingContext(args: ['name' => 'blogdescription'])))->toBe('Live music') + ->and($source(new BindingContext(args: ['name' => 'admin_email'])))->toBeNull(); +}); + +it('resolves a post meta, an author meta and an unlisted key through the resolver the container builds', function (): void { + foreach ($this->hooks['init'] as $register) { + $register(); + } + + $block = boundParagraph(['postId' => 7, 'postType' => 'concert']); + + $resolve = fn (string $source, array $args): mixed => $this->registered[$source]['get_value_callback']($args, $block, 'content'); + + expect($resolve('pollora/post-meta', ['key' => 'capacity']))->toBe('1 200') + ->and($resolve('pollora/post-meta', ['key' => 'backstage_code']))->toBeNull() + ->and($resolve('pollora/option', ['name' => 'blogdescription']))->toBe('Live music') + ->and($resolve('pollora/option', ['name' => 'admin_email']))->toBeNull(); +}); diff --git a/tests/Feature/Extraction/PublicSurfaceTest.php b/tests/Feature/Extraction/PublicSurfaceTest.php new file mode 100644 index 00000000..fa9d88a5 --- /dev/null +++ b/tests/Feature/Extraction/PublicSurfaceTest.php @@ -0,0 +1,119 @@ +> + */ +function describeSurface(string $class): array +{ + $reflection = new ReflectionClass($class); + + $kind = match (true) { + $reflection->isEnum() => 'enum', + $reflection->isInterface() => 'interface', + $reflection->isTrait() => 'trait', + default => ($reflection->isAbstract() ? 'abstract ' : '').($reflection->isFinal() ? 'final ' : '').($reflection->isReadOnly() ? 'readonly ' : '').'class', + }; + + $type = static fn (?ReflectionType $t): string => $t instanceof ReflectionType ? (string) $t : 'mixed'; + + $methods = []; + foreach ($reflection->getMethods() as $method) { + if ($method->isPrivate() || $method->getDeclaringClass()->getName() !== $class) { + continue; + } + + $params = array_map( + static fn (ReflectionParameter $p): string => trim( + ($p->isPassedByReference() ? '&' : '').($p->isVariadic() ? '...' : '').$type($p->getType()).' $'.$p->getName().($p->isOptional() && ! $p->isVariadic() ? ' = ?' : ''), + ), + $method->getParameters(), + ); + $methods[$method->getName()] = ($method->isPublic() ? 'public' : 'protected').($method->isStatic() ? ' static' : '').($method->isAbstract() ? ' abstract' : '') + .' ('.implode(', ', $params).'): '.$type($method->getReturnType()); + } + + ksort($methods); + + $constants = []; + foreach ($reflection->getReflectionConstants() as $constant) { + if ($constant->isPublic() && $constant->getDeclaringClass()->getName() === $class) { + $constants[$constant->getName()] = $constant->isEnumCase() ? 'case' : 'const'; + } + } + + ksort($constants); + + $interfaces = array_values(array_diff($reflection->getInterfaceNames(), $reflection->getParentClass() ? $reflection->getParentClass()->getInterfaceNames() : [])); + sort($interfaces); + + return [ + 'kind' => $kind, + 'extends' => $reflection->getParentClass() ? $reflection->getParentClass()->getName() : null, + 'implements' => $interfaces, + 'constants' => $constants, + 'methods' => $methods, + ]; +} + +/** + * @return list + */ +function surfaceClassesOnDisk(): array +{ + $classes = []; + foreach (SURFACE_MODULES as $module) { + $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__DIR__, 3).'/src/'.$module, FilesystemIterator::SKIP_DOTS)); + foreach ($iterator as $file) { + if ($file->getExtension() !== 'php' || str_contains($file->getPathname(), '/config/')) { + continue; + } + + $relative = substr($file->getPathname(), strlen(dirname(__DIR__, 3).'/src/'), -4); + $classes[] = 'Pollora\\'.str_replace('/', '\\', $relative); + } + } + + sort($classes); + + return $classes; +} + +it('keeps the name and the public signatures of every Meta, Role and BlockBinding class', function (): void { + $snapshot = __DIR__.'/surface.json'; + + if (getenv('UPDATE_SURFACE') === '1') { + $surface = []; + foreach (surfaceClassesOnDisk() as $class) { + $surface[$class] = describeSurface($class); + } + + file_put_contents($snapshot, json_encode($surface, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)."\n"); + } + + $expected = json_decode((string) file_get_contents($snapshot), true, 512, JSON_THROW_ON_ERROR); + expect($expected)->not->toBeEmpty(); + + $actual = []; + foreach (array_keys($expected) as $class) { + expect(class_exists($class) || interface_exists($class) || trait_exists($class) || enum_exists($class)) + ->toBeTrue("{$class} no longer resolves"); + $actual[$class] = describeSurface($class); + } + + expect($actual)->toEqual($expected); +}); diff --git a/tests/Feature/Extraction/RolesContractTest.php b/tests/Feature/Extraction/RolesContractTest.php new file mode 100644 index 00000000..8104afb9 --- /dev/null +++ b/tests/Feature/Extraction/RolesContractTest.php @@ -0,0 +1,98 @@ +app = new Application(sys_get_temp_dir()); + $this->app->instance('config', new Repository(['roles' => ['super_roles' => ['administrator']]])); + $this->app->instance(LoggerInterface::class, new NullLogger); + + $this->action = Mockery::mock(Action::class)->shouldIgnoreMissing(); + $this->app->instance(Action::class, $this->action); + $this->app->instance(Filter::class, Mockery::mock(Filter::class)->shouldIgnoreMissing()); + $this->app->instance('events', new Dispatcher); + (new RoleServiceProvider($this->app))->register(); + + $this->stored = [ + 'administrator' => ['name' => 'Administrator', 'capabilities' => ['manage_options' => true, 'edit_posts' => true, 'edit_theme_options' => true]], + 'editor' => ['name' => 'Editor', 'capabilities' => ['edit_posts' => true, 'edit_theme_options' => true, 'moderate_comments' => true]], + 'author' => ['name' => 'Author', 'capabilities' => ['read' => true, 'edit_posts' => true, 'publish_posts' => true, 'upload_files' => true]], + 'subscriber' => ['name' => 'Subscriber', 'capabilities' => ['read' => true]], + ]; +}); + +it('compiles the declared roles and modifications into the capabilities WordPress stores', function (): void { + $builder = $this->app->make(RoleDefinitionBuilder::class); + $registry = $this->app->make(RoleRegistry::class); + $registry->addPostType(Event::class); + $registry->addPostType(Venue::class); + $registry->addTaxonomy(Genre::class); + $registry->addRole($builder->build(EventManager::class)); + $registry->addModification($builder->build(EditorAdjustments::class)); + + $roles = $this->app->make(RoleCompiler::class)->compile( + $this->stored, + $registry->definitions(), + $registry->modifications(), + ['administrator'], + $registry->declaredCapabilities(), + ); + + ksort($roles['event_manager']['capabilities']); + ksort($roles['editor']['capabilities']); + ksort($roles['administrator']['capabilities']); + + expect(array_keys($roles))->toBe(['administrator', 'editor', 'author', 'subscriber', 'event_manager']) + ->and($roles['event_manager']['name'])->toBe('Event manager') + ->and($roles['event_manager']['_pollora'])->toBe(['managed' => true]) + ->and($roles['event_manager']['capabilities'])->not->toHaveKey('publish_posts') + ->and($roles['event_manager']['capabilities'])->toHaveKeys(['read', 'export_attendees', 'scan_tickets', 'edit_others_events', 'open_venues', 'manage_genres']) + ->and($roles['editor']['capabilities'])->not->toHaveKey('edit_theme_options') + ->and($roles['editor']['capabilities'])->toHaveKey('scan_tickets') + ->and($roles['administrator']['capabilities'])->toHaveKeys(['edit_others_events', 'manage_genres']) + ->and($roles['administrator']['capabilities'])->not->toHaveKey('export_attendees'); + expect(array_keys($roles['event_manager']['capabilities']))->toBe(['assign_genres', 'delete_events', 'delete_others_events', 'delete_private_events', 'delete_published_events', 'delete_published_venues', 'delete_venues', 'edit_events', 'edit_genres', 'edit_others_events', 'edit_posts', 'edit_private_events', 'edit_published_events', 'edit_published_venues', 'edit_venues', 'export_attendees', 'manage_genres', 'open_venues', 'publish_events', 'read', 'read_private_events', 'scan_tickets', 'upload_files']); +}); + +it('aliases the role middleware and compiles @role once the application has booted', function (): void { + $this->app->instance('router', $router = new Router(new Dispatcher)); + $this->app->instance('blade.compiler', $blade = new BladeCompiler(new Filesystem, sys_get_temp_dir())); + + $provider = new RoleServiceProvider($this->app); + $provider->boot(); + + $this->app->make('router'); + $this->app->booted(static fn (): null => null); + $this->app->boot(); + $this->app->make('blade.compiler'); + + expect($router->getMiddleware()['role'] ?? null)->toBe(EnsureUserHasRole::class) + ->and($blade->compileString("@role('editor') shown @endrole"))->toContain('endif'); +}); diff --git a/tests/Feature/Extraction/TypedMetaContractTest.php b/tests/Feature/Extraction/TypedMetaContractTest.php new file mode 100644 index 00000000..847c6244 --- /dev/null +++ b/tests/Feature/Extraction/TypedMetaContractTest.php @@ -0,0 +1,199 @@ + */ + public array $rows = []; + + public function get(MetaObjectType $objectType, int $objectId, string $key): mixed + { + return $this->rows[$this->id($objectType, $objectId, $key)] ?? ''; + } + + public function getAll(MetaObjectType $objectType, int $objectId, string $key): array + { + return (array) ($this->rows[$this->id($objectType, $objectId, $key)] ?? []); + } + + public function update(MetaObjectType $objectType, int $objectId, string $key, string|array $value): void + { + $this->rows[$this->id($objectType, $objectId, $key)] = $value; + } + + public function replaceAll(MetaObjectType $objectType, int $objectId, string $key, array $values): void + { + $this->rows[$this->id($objectType, $objectId, $key)] = $values; + } + + public function delete(MetaObjectType $objectType, int $objectId, string $key): void + { + unset($this->rows[$this->id($objectType, $objectId, $key)]); + } + + private function id(MetaObjectType $objectType, int $objectId, string $key): string + { + return $objectType->value.':'.$objectId.':'.$key; + } +} + +final class RecordingUiDriver implements MetaUiDriver +{ + /** @var list */ + public array $registered = []; + + public function supports(MetaDefinition $definition): bool + { + return true; + } + + public function register(MetaSchema $schema): void + { + foreach ($schema->definitions as $definition) { + $this->registered[] = implode(',', $schema->subtypes).'.'.$definition->key; + } + } +} + +beforeEach(function (): void { + $this->app = new Application(sys_get_temp_dir()); + $this->app->instance('config', new Repository(['app' => ['debug' => false]])); + $this->app->instance('validator', new Factory(new Translator(new ArrayLoader, 'en'))); + $this->app->instance(LoggerInterface::class, new NullLogger); + + $this->hooks = []; + $action = Mockery::mock(Action::class); + $action->shouldReceive('add')->andReturnUsing(function (string $hook, Closure $callback) use ($action): Action { + $this->hooks[$hook] = $callback; + + return $action; + }); + $this->app->instance(Action::class, $action); + $this->app->instance(Filter::class, Mockery::mock(Filter::class)->shouldIgnoreMissing()); + $this->app->instance('events', new Dispatcher); + + $this->provider = new MetaServiceProvider($this->app); + $this->provider->register(); + + $this->store = new MemoryMetaStore; + $this->app->instance(MetaStoreInterface::class, $this->store); + + // What the discovery does at boot: one compiled schema per declaring class + $builder = $this->app->make(MetaSchemaBuilder::class); + $repository = $this->app->make(MetaSchemaRepository::class); + foreach ([Event::class, MemberProfile::class, RatedEvent::class] as $class) { + $repository->add($builder->build($class)); + } + + Facade::setFacadeApplication($this->app); +}); + +afterEach(function (): void { + Facade::clearResolvedInstances(); + Facade::setFacadeApplication(null); +}); + +it('reads the declared defaults, typed, when nothing is stored', function (): void { + $event = Meta::of(Event::class, 42); + + expect($event)->toBeInstanceOf(MetaRecord::class) + ->and($event->objectId())->toBe(42) + ->and($event->capacity)->toBe(0) + ->and($event->price)->toBe(9.5) + ->and($event->soldOut)->toBeFalse() + ->and($event->status)->toBe(EventStatus::Draft) + ->and($event->startsAt)->toBeNull(); +}); + +it('writes through the fluent record under the declared key, and reads back the PHP type', function (): void { + $saved = Meta::of(Event::class, 42)->fill(['capacity' => 250, 'soldOut' => true, 'status' => EventStatus::Published, 'internalRef' => 'X-1'])->save(); + + expect($saved)->toBeInstanceOf(MetaRecord::class) + ->and($this->store->rows)->toHaveKeys(['post:42:capacity', 'post:42:sold_out', 'post:42:status', 'post:42:_event_internal_ref']); + + $again = Meta::of(Event::class, 42); + expect($again->capacity)->toBe(250) + ->and($again->soldOut)->toBeTrue() + ->and($again->status)->toBe(EventStatus::Published) + ->and($again->internalRef)->toBe('X-1') + ->and($again->toArray())->toMatchArray(['capacity' => 250, 'soldOut' => true]); +}); + +it('chains set() and keeps the record', function (): void { + $record = Meta::of(Event::class, 7); + + expect($record->set('capacity', 12))->toBe($record) + ->and($record->get('capacity'))->toBe(12); +}); + +it('stores the meta of users, terms and comments under their own object type', function (): void { + Meta::of(MemberProfile::class, 5)->fill(['newsletterOptIn' => true, 'jobTitle' => 'Chef'])->save(); + + expect($this->store->rows)->toHaveKeys(['user:5:newsletter_opt_in', 'user:5:job_title']) + ->and(Meta::of(MemberProfile::class, 5)->newsletterOptIn)->toBeTrue(); +}); + +it('applies the Laravel rules to writes from PHP, with the message of the rule', function (): void { + $event = Meta::of(RatedEvent::class, 9); + + expect(fn () => $event->set('capacity', 9000))->toThrow(MetaValidationException::class) + ->and(fn () => $event->set('contact', 'not-an-email'))->toThrow(MetaValidationException::class) + ->and(fn () => $event->set('status', EventStatus::Draft))->toThrow(MetaValidationException::class); + + $event->set('capacity', 100)->set('contact', 'a@b.fr'); + expect($event->capacity)->toBe(100); +}); + +it('gives the compiled schemas to tooling, by object type and subtype', function (): void { + $schemas = Meta::schemaFor('post', 'event'); + + expect($schemas)->toHaveCount(1) + ->and($schemas[0]->subtypes)->toBe(['event']) + ->and(array_map(fn (MetaDefinition $d): string => $d->key, $schemas[0]->definitions)) + ->toContain('capacity', 'sold_out', 'starts_at', 'status', '_event_internal_ref'); +}); + +it('hands the schemas to the UI driver picked in meta.ui, once WordPress has registered them', function (): void { + $driver = new RecordingUiDriver; + $this->app->make('config')->set('meta.ui', 'recording'); + Meta::extend('recording', fn (): RecordingUiDriver => $driver); + + $this->provider->boot(); + ($this->hooks['init'])(); + + expect($driver->registered)->toContain('event.capacity', 'event.sold_out', 'rated_event.contact', '.newsletter_opt_in'); +}); diff --git a/tests/Feature/Extraction/surface.json b/tests/Feature/Extraction/surface.json new file mode 100644 index 00000000..ce47d294 --- /dev/null +++ b/tests/Feature/Extraction/surface.json @@ -0,0 +1,1034 @@ +{ + "Pollora\\BlockBinding\\Application\\Services\\BindingReferenceInspector": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\BlockBinding\\Application\\Services\\BindingSourceRegistry $sources, Pollora\\Meta\\Application\\Services\\MetaSchemaRepository $schemas, array $options = ?): mixed", + "knows": "public (string $sourceName): bool", + "problem": "public (string $sourceName, array $args): ?string" + } + }, + "Pollora\\BlockBinding\\Application\\Services\\BindingResolver": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": { + "SLOW_FIELD_MS": "const" + }, + "methods": { + "__construct": "public (Illuminate\\Contracts\\Container\\Container $container, Pollora\\BlockBinding\\Domain\\Contracts\\ContentVisibilityInterface $visibility, Pollora\\BlockBinding\\Domain\\Contracts\\ValuePresenterInterface $presenter, ?Pollora\\Meta\\Application\\Services\\MetaAccessor $metaAccessor = ?, bool $debug = ?, ?Psr\\Log\\LoggerInterface $logger = ?): mixed", + "preview": "public (Pollora\\BlockBinding\\Domain\\Models\\BindingSource $source, array $args, array $blockContext, string $attribute, ?string $attributeSource = ?): mixed", + "resolve": "public (Pollora\\BlockBinding\\Domain\\Models\\BindingSource $source, array $args, ?WP_Block $block, string $attribute): mixed" + } + }, + "Pollora\\BlockBinding\\Application\\Services\\BindingSourceBuilder": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "build": "public (string $class): Pollora\\BlockBinding\\Domain\\Models\\BindingSource" + } + }, + "Pollora\\BlockBinding\\Application\\Services\\BindingSourceRegistry": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "add": "public (Pollora\\BlockBinding\\Domain\\Models\\BindingSource $source): void", + "all": "public (): array", + "find": "public (string $name): ?Pollora\\BlockBinding\\Domain\\Models\\BindingSource" + } + }, + "Pollora\\BlockBinding\\Domain\\Contracts\\ContentVisibilityInterface": { + "kind": "interface", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "canShowPost": "public abstract (int $postId): bool", + "canShowTerm": "public abstract (int $termId, string $taxonomy): bool" + } + }, + "Pollora\\BlockBinding\\Domain\\Contracts\\ValuePresenterInterface": { + "kind": "interface", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "boolean": "public abstract (bool $value, ?string $true = ?, ?string $false = ?): string", + "html": "public abstract (string $value): string", + "richText": "public abstract (string $value): string", + "url": "public abstract (string $value): string" + } + }, + "Pollora\\BlockBinding\\Domain\\Events\\BindingResolved": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (string $source, string $field, string $attribute, ?int $postId, float $milliseconds, bool $cached, bool $hasValue): mixed" + } + }, + "Pollora\\BlockBinding\\Domain\\Exceptions\\InvalidBindingSourceException": { + "kind": "final class", + "extends": "InvalidArgumentException", + "implements": [], + "constants": [], + "methods": { + "duplicateName": "public static (string $name, string $existing, string $class): self", + "forClass": "public static (string $class, string $reason): self", + "forField": "public static (string $class, string $method, string $reason): self" + } + }, + "Pollora\\BlockBinding\\Domain\\Models\\BindingContext": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (array $args = ?, string $attribute = ?, ?int $postId = ?, ?string $postType = ?, ?int $termId = ?, ?string $taxonomy = ?, ?WP_Block $block = ?, ?Pollora\\Meta\\Application\\Services\\MetaAccessor $metaAccessor = ?): mixed", + "arg": "public (string $name, mixed $default = ?): mixed", + "meta": "public (string $class): ?Pollora\\Meta\\Domain\\Models\\MetaRecord", + "post": "public (): ?Pollora\\Models\\Post" + } + }, + "Pollora\\BlockBinding\\Domain\\Models\\BindingFieldDefinition": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (string $name, string $label, Pollora\\BlockBinding\\Domain\\Enums\\BindingFieldType $type, string $method): mixed" + } + }, + "Pollora\\BlockBinding\\Domain\\Models\\BindingSource": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (string $name, string $label, string $class, array $usesContext, array $postTypes, array $fields): mixed", + "answersFor": "public (?string $postType): bool", + "field": "public (string $name): ?Pollora\\BlockBinding\\Domain\\Models\\BindingFieldDefinition", + "isInvokable": "public (): bool" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Adapters\\WordPressBindingEditorScript": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": { + "HANDLE": "const" + }, + "methods": { + "__construct": "public (Pollora\\BlockBinding\\Infrastructure\\Services\\BindingEditorData $data, string $scriptPath = ?): mixed", + "enqueue": "public (): void" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Adapters\\WordPressBindingRegistry": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Hook\\Domain\\Contract\\Action $action, Pollora\\BlockBinding\\Application\\Services\\BindingResolver $resolver): mixed", + "register": "public (Pollora\\BlockBinding\\Domain\\Models\\BindingSource $source): void" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Adapters\\WordPressContentVisibility": { + "kind": "final readonly class", + "extends": null, + "implements": [ + "Pollora\\BlockBinding\\Domain\\Contracts\\ContentVisibilityInterface" + ], + "constants": [], + "methods": { + "canShowPost": "public (int $postId): bool", + "canShowTerm": "public (int $termId, string $taxonomy): bool" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Adapters\\WordPressValuePresenter": { + "kind": "final readonly class", + "extends": null, + "implements": [ + "Pollora\\BlockBinding\\Domain\\Contracts\\ValuePresenterInterface" + ], + "constants": [], + "methods": { + "boolean": "public (bool $value, ?string $true = ?, ?string $false = ?): string", + "html": "public (string $value): string", + "richText": "public (string $value): string", + "url": "public (string $value): string" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Checks\\BlockBindingsCheck": { + "kind": "final readonly class", + "extends": null, + "implements": [ + "Pollora\\Doctor\\Domain\\Contracts\\CheckInterface" + ], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Doctor\\Infrastructure\\Support\\ProjectModules $modules, Pollora\\BlockBinding\\Application\\Services\\BindingReferenceInspector $inspector): mixed", + "id": "public (): string", + "label": "public (): string", + "run": "public (Pollora\\Doctor\\Domain\\Enums\\RunContext $context): Pollora\\Doctor\\Domain\\Models\\CheckResult", + "runsIn": "public (): array" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Providers\\BlockBindingServiceProvider": { + "kind": "class", + "extends": "Illuminate\\Support\\ServiceProvider", + "implements": [], + "constants": { + "SOURCES": "const" + }, + "methods": { + "boot": "public (): void", + "register": "public (): void" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Services\\BindingEditorData": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": { + "REST_NAMESPACE": "const", + "REST_ROUTE": "const" + }, + "methods": { + "__construct": "public (Pollora\\BlockBinding\\Application\\Services\\BindingSourceRegistry $sources, Pollora\\Meta\\Application\\Services\\MetaSchemaRepository $schemas, Illuminate\\Contracts\\Config\\Repository $config): mixed", + "toArray": "public (): array" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Services\\BindingFormatter": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\BlockBinding\\Domain\\Contracts\\ValuePresenterInterface $presenter): mixed", + "format": "public (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition, mixed $value, array $args, string $attribute): string|int|float|bool|null" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Services\\BlockBindingDiscovery": { + "kind": "final class", + "extends": null, + "implements": [ + "Pollora\\Discovery\\Domain\\Contracts\\DiscoveryInterface" + ], + "constants": [], + "methods": { + "__construct": "public (Pollora\\BlockBinding\\Application\\Services\\BindingSourceBuilder $builder, Pollora\\BlockBinding\\Application\\Services\\BindingSourceRegistry $sources, Pollora\\BlockBinding\\Infrastructure\\Adapters\\WordPressBindingRegistry $registry, ?Psr\\Log\\LoggerInterface $logger = ?): mixed", + "apply": "public (): void", + "discover": "public (Pollora\\Discovery\\Domain\\Contracts\\DiscoveryLocationInterface $location, Spatie\\StructureDiscoverer\\Data\\DiscoveredStructure $structure, ?Pollora\\Discovery\\Domain\\Contracts\\ReflectionCacheInterface $reflectionCache = ?): void", + "getIdentifier": "public (): string", + "getItems": "public (): Pollora\\Discovery\\Domain\\Contracts\\DiscoveryItemsInterface", + "setItems": "public (Pollora\\Discovery\\Domain\\Contracts\\DiscoveryItemsInterface $items): void" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Sources\\AuthorMetaSource": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\BlockBinding\\Infrastructure\\Sources\\TypedMetaReader $reader, Pollora\\BlockBinding\\Infrastructure\\Services\\BindingFormatter $formatter): mixed", + "__invoke": "public (Pollora\\BlockBinding\\Domain\\Models\\BindingContext $context): string|int|float|bool|null" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Sources\\OptionSource": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Illuminate\\Contracts\\Config\\Repository $config): mixed", + "__invoke": "public (Pollora\\BlockBinding\\Domain\\Models\\BindingContext $context): ?string" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Sources\\PostMetaSource": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\BlockBinding\\Infrastructure\\Sources\\TypedMetaReader $reader, Pollora\\BlockBinding\\Infrastructure\\Services\\BindingFormatter $formatter): mixed", + "__invoke": "public (Pollora\\BlockBinding\\Domain\\Models\\BindingContext $context): string|int|float|bool|null" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Sources\\TermMetaSource": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\BlockBinding\\Infrastructure\\Sources\\TypedMetaReader $reader, Pollora\\BlockBinding\\Infrastructure\\Services\\BindingFormatter $formatter, Pollora\\BlockBinding\\Domain\\Contracts\\ContentVisibilityInterface $visibility): mixed", + "__invoke": "public (Pollora\\BlockBinding\\Domain\\Models\\BindingContext $context): string|int|float|bool|null" + } + }, + "Pollora\\BlockBinding\\Infrastructure\\Sources\\TypedMetaReader": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Meta\\Application\\Services\\MetaSchemaRepository $schemas, Pollora\\Meta\\Application\\Services\\MetaAccessor $accessor): mixed", + "exposedInRest": "public static (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition): bool", + "read": "public (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, ?string $subtype, int $objectId, string $key, Closure $readable): ?array" + } + }, + "Pollora\\BlockBinding\\UI\\Console\\BindingListCommand": { + "kind": "class", + "extends": "Illuminate\\Console\\Command", + "implements": [], + "constants": [], + "methods": { + "bindableBlocks": "protected (): ?array", + "handle": "public (Pollora\\BlockBinding\\Application\\Services\\BindingSourceRegistry $sources, Pollora\\BlockBinding\\Infrastructure\\Services\\BindingEditorData $editorData): int" + } + }, + "Pollora\\BlockBinding\\UI\\Console\\MakeBindingCommand": { + "kind": "class", + "extends": "Pollora\\Console\\AbstractGeneratorCommand", + "implements": [], + "constants": [], + "methods": { + "getArguments": "protected (): array", + "getStub": "protected (): string", + "replaceClass": "protected (mixed $stub, mixed $name): string" + } + }, + "Pollora\\BlockBinding\\UI\\Http\\ResolveBindingsController": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": { + "MAX_BINDINGS": "const" + }, + "methods": { + "__construct": "public (Pollora\\BlockBinding\\Application\\Services\\BindingSourceRegistry $sources, Pollora\\BlockBinding\\Application\\Services\\BindingResolver $resolver): mixed", + "canPreview": "public (WP_REST_Request $request): bool", + "handle": "public (WP_REST_Request $request): array", + "register": "public (): void" + } + }, + "Pollora\\Meta\\Application\\Services\\MetaAccessor": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Meta\\Application\\Services\\MetaSchemaRepository $schemas, Pollora\\Meta\\Application\\Services\\MetaSchemaBuilder $builder, Pollora\\Meta\\Domain\\Contracts\\MetaStoreInterface $store, Pollora\\Meta\\Domain\\Services\\MetaValueCaster $caster, bool $debug = ?, ?Psr\\Log\\LoggerInterface $logger = ?, ?Pollora\\Meta\\Domain\\Contracts\\MetaValidatorInterface $validator = ?, ?Pollora\\Meta\\Application\\Services\\MetaUiDrivers $drivers = ?): mixed", + "extend": "public (string $name, Closure|string $driver): void", + "of": "public (string $class, int $objectId): Pollora\\Meta\\Domain\\Models\\MetaRecord", + "record": "public (Pollora\\Meta\\Domain\\Models\\MetaSchema $schema, int $objectId): Pollora\\Meta\\Domain\\Models\\MetaRecord", + "schema": "public (string $class): Pollora\\Meta\\Domain\\Models\\MetaSchema", + "schemaFor": "public (Pollora\\Meta\\Domain\\Enums\\MetaObjectType|string $objectType, ?string $subtype = ?): array", + "schemas": "public (): array" + } + }, + "Pollora\\Meta\\Application\\Services\\MetaAuditor": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Meta\\Application\\Services\\MetaSchemaRepository $schemas, Pollora\\Meta\\Domain\\Contracts\\MetaInventoryInterface $inventory, Pollora\\Meta\\Domain\\Services\\MetaValueCaster $caster): mixed", + "undeclared": "public (int $limit): array", + "unreadable": "public (int $limit): array" + } + }, + "Pollora\\Meta\\Application\\Services\\MetaSchemaBuilder": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "build": "public (string $class): Pollora\\Meta\\Domain\\Models\\MetaSchema" + } + }, + "Pollora\\Meta\\Application\\Services\\MetaSchemaRepository": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "add": "public (Pollora\\Meta\\Domain\\Models\\MetaSchema $schema): void", + "all": "public (): array", + "declares": "public (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, string $propertyOrKey): bool", + "fail": "public (string $class, string $reason): void", + "failures": "public (): array", + "forClass": "public (string $class): ?Pollora\\Meta\\Domain\\Models\\MetaSchema", + "forObject": "public (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, ?string $subtype): array" + } + }, + "Pollora\\Meta\\Application\\Services\\MetaUiDrivers": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Illuminate\\Contracts\\Container\\Container $container): mixed", + "build": "public (Pollora\\Meta\\Domain\\Contracts\\MetaUiDriver $driver, array $schemas): void", + "driver": "public (string $name): Pollora\\Meta\\Domain\\Contracts\\MetaUiDriver", + "extend": "public (string $name, Closure|string $driver): void", + "has": "public (string $name): bool" + } + }, + "Pollora\\Meta\\Domain\\Contracts\\MetaInventoryInterface": { + "kind": "interface", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "keys": "public abstract (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, array $subtypes, int $limit): array", + "values": "public abstract (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, array $subtypes, string $key, int $limit): array" + } + }, + "Pollora\\Meta\\Domain\\Contracts\\MetaRegistryInterface": { + "kind": "interface", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "register": "public abstract (Pollora\\Meta\\Domain\\Models\\MetaSchema $schema): void" + } + }, + "Pollora\\Meta\\Domain\\Contracts\\MetaStoreInterface": { + "kind": "interface", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "delete": "public abstract (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, int $objectId, string $key): void", + "get": "public abstract (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, int $objectId, string $key): mixed", + "getAll": "public abstract (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, int $objectId, string $key): array", + "replaceAll": "public abstract (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, int $objectId, string $key, array $values): void", + "update": "public abstract (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, int $objectId, string $key, array|string $value): void" + } + }, + "Pollora\\Meta\\Domain\\Contracts\\MetaUiDriver": { + "kind": "interface", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "register": "public abstract (Pollora\\Meta\\Domain\\Models\\MetaSchema $schema): void", + "supports": "public abstract (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition): bool" + } + }, + "Pollora\\Meta\\Domain\\Contracts\\MetaValidatorInterface": { + "kind": "interface", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "validate": "public abstract (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition, mixed $value): void" + } + }, + "Pollora\\Meta\\Domain\\Enums\\MetaObjectType": { + "kind": "enum", + "extends": null, + "implements": [ + "BackedEnum", + "UnitEnum" + ], + "constants": { + "Comment": "case", + "Post": "case", + "Term": "case", + "User": "case" + }, + "methods": { + "cases": "public static (): array", + "from": "public static (string|int $value): static", + "tryFrom": "public static (string|int $value): ?static" + } + }, + "Pollora\\Meta\\Domain\\Enums\\MetaValueType": { + "kind": "enum", + "extends": null, + "implements": [ + "UnitEnum" + ], + "constants": { + "ArrayOf": "case", + "Boolean": "case", + "DataObject": "case", + "DateTime": "case", + "Enum": "case", + "Integer": "case", + "Number": "case", + "String": "case" + }, + "methods": { + "cases": "public static (): array" + } + }, + "Pollora\\Meta\\Domain\\Events\\MetaSchemasRegistered": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (array $schemas): mixed" + } + }, + "Pollora\\Meta\\Domain\\Exceptions\\InvalidMetaDefinitionException": { + "kind": "final class", + "extends": "LogicException", + "implements": [], + "constants": [], + "methods": { + "duplicateKey": "public static (string $key, string $owner, string $firstClass, string $secondClass): self", + "forProperty": "public static (string $class, string $property, string $reason): self", + "notADeclaration": "public static (string $class): self" + } + }, + "Pollora\\Meta\\Domain\\Exceptions\\InvalidMetaValueException": { + "kind": "final class", + "extends": "InvalidArgumentException", + "implements": [], + "constants": [], + "methods": { + "forRead": "public static (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition, mixed $raw): self", + "forWrite": "public static (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition, mixed $value): self" + } + }, + "Pollora\\Meta\\Domain\\Exceptions\\MetaValidationException": { + "kind": "final class", + "extends": "InvalidArgumentException", + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition, array $messages): mixed" + } + }, + "Pollora\\Meta\\Domain\\Models\\MetaDefinition": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (string $property, string $key, Pollora\\Meta\\Domain\\Enums\\MetaValueType $valueType, ?string $valueClass, bool $nullable, mixed $default, bool $showInRest = ?, ?string $label = ?, ?string $description = ?, array|string|null $sanitize = ?, ?string $capability = ?, bool $revisions = ?, array $rules = ?, bool $single = ?, ?Pollora\\Meta\\Domain\\Models\\MetaDefinition $items = ?, array $properties = ?, ?Pollora\\Meta\\Domain\\Enums\\Control $control = ?, ?string $group = ?, array $hints = ?, bool $media = ?, bool $public = ?): mixed", + "isProtected": "public (): bool", + "isStructured": "public (): bool", + "item": "public (): Pollora\\Meta\\Domain\\Models\\MetaDefinition", + "restSchema": "public (): array", + "wordPressType": "public (): string" + } + }, + "Pollora\\Meta\\Domain\\Models\\MetaRecord": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Meta\\Domain\\Models\\MetaSchema $schema, int $objectId, Pollora\\Meta\\Domain\\Contracts\\MetaStoreInterface $store, Pollora\\Meta\\Domain\\Services\\MetaValueCaster $caster, Closure $onUnreadable, ?Pollora\\Meta\\Domain\\Contracts\\MetaValidatorInterface $validator = ?): mixed", + "__get": "public (string $name): mixed", + "__isset": "public (string $name): bool", + "__set": "public (string $name, mixed $value): void", + "fill": "public (array $values): static", + "get": "public (string $name): mixed", + "objectId": "public (): int", + "save": "public (): static", + "set": "public (string $name, mixed $value): static", + "toArray": "public (): array" + } + }, + "Pollora\\Meta\\Domain\\Models\\MetaSchema": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (string $declaringClass, Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, array $subtypes, array $definitions, bool $declaresSubtypes = ?): mixed", + "exposesInRest": "public (): bool", + "find": "public (string $propertyOrKey): ?Pollora\\Meta\\Domain\\Models\\MetaDefinition", + "isEmpty": "public (): bool", + "overlaps": "public (self $other): bool", + "ownerName": "public (): string", + "withDefinitions": "public (array $definitions): self" + } + }, + "Pollora\\Meta\\Domain\\Services\\MetaValueCaster": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "absentValue": "public (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition): mixed", + "sanitize": "public (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition, mixed $value): mixed", + "toJson": "public (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition, mixed $value): mixed", + "toPhp": "public (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition, mixed $raw): mixed", + "toRestDefault": "public (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition): mixed", + "toStorage": "public (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition, mixed $value): array|string|null" + } + }, + "Pollora\\Meta\\Infrastructure\\Adapters\\WordPressMetaInventory": { + "kind": "final readonly class", + "extends": null, + "implements": [ + "Pollora\\Meta\\Domain\\Contracts\\MetaInventoryInterface" + ], + "constants": [], + "methods": { + "keys": "public (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, array $subtypes, int $limit): array", + "values": "public (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, array $subtypes, string $key, int $limit): array" + } + }, + "Pollora\\Meta\\Infrastructure\\Adapters\\WordPressMetaRegistry": { + "kind": "final readonly class", + "extends": null, + "implements": [ + "Pollora\\Meta\\Domain\\Contracts\\MetaRegistryInterface" + ], + "constants": { + "INIT_PRIORITY": "const" + }, + "methods": { + "__construct": "public (Pollora\\Hook\\Domain\\Contract\\Action $action, Pollora\\Meta\\Domain\\Services\\MetaValueCaster $caster): mixed", + "register": "public (Pollora\\Meta\\Domain\\Models\\MetaSchema $schema): void" + } + }, + "Pollora\\Meta\\Infrastructure\\Adapters\\WordPressMetaStore": { + "kind": "final class", + "extends": null, + "implements": [ + "Pollora\\Meta\\Domain\\Contracts\\MetaStoreInterface" + ], + "constants": [], + "methods": { + "delete": "public (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, int $objectId, string $key): void", + "get": "public (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, int $objectId, string $key): mixed", + "getAll": "public (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, int $objectId, string $key): array", + "replaceAll": "public (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, int $objectId, string $key, array $values): void", + "update": "public (Pollora\\Meta\\Domain\\Enums\\MetaObjectType $objectType, int $objectId, string $key, array|string $value): void" + } + }, + "Pollora\\Meta\\Infrastructure\\Adapters\\WordPressRestMetaValidation": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Meta\\Application\\Services\\MetaSchemaRepository $schemas, Pollora\\Meta\\Domain\\Services\\MetaValueCaster $caster, Pollora\\Meta\\Domain\\Contracts\\MetaValidatorInterface $validator): mixed", + "validate": "public (mixed $response, array $handler, WP_REST_Request $request): mixed" + } + }, + "Pollora\\Meta\\Infrastructure\\Checks\\TypedMetaCheck": { + "kind": "final readonly class", + "extends": null, + "implements": [ + "Pollora\\Doctor\\Domain\\Contracts\\CheckInterface" + ], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Meta\\Application\\Services\\MetaSchemaRepository $schemas, Pollora\\Meta\\Application\\Services\\MetaAuditor $auditor): mixed", + "id": "public (): string", + "label": "public (): string", + "run": "public (Pollora\\Doctor\\Domain\\Enums\\RunContext $context): Pollora\\Doctor\\Domain\\Models\\CheckResult", + "runsIn": "public (): array" + } + }, + "Pollora\\Meta\\Infrastructure\\Providers\\MetaServiceProvider": { + "kind": "class", + "extends": "Illuminate\\Support\\ServiceProvider", + "implements": [], + "constants": [], + "methods": { + "boot": "public (): void", + "register": "public (): void" + } + }, + "Pollora\\Meta\\Infrastructure\\Services\\LaravelMetaValidator": { + "kind": "final readonly class", + "extends": null, + "implements": [ + "Pollora\\Meta\\Domain\\Contracts\\MetaValidatorInterface" + ], + "constants": [], + "methods": { + "__construct": "public (Illuminate\\Contracts\\Validation\\Factory $validator): mixed", + "validate": "public (Pollora\\Meta\\Domain\\Models\\MetaDefinition $definition, mixed $value): void" + } + }, + "Pollora\\Meta\\Infrastructure\\Services\\MetaDiscovery": { + "kind": "final class", + "extends": null, + "implements": [ + "Pollora\\Discovery\\Domain\\Contracts\\DiscoveryInterface" + ], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Meta\\Application\\Services\\MetaSchemaBuilder $builder, Pollora\\Meta\\Application\\Services\\MetaSchemaRepository $schemas, Pollora\\Meta\\Domain\\Contracts\\MetaRegistryInterface $registry, ?Psr\\Log\\LoggerInterface $logger = ?): mixed", + "apply": "public (): void", + "discover": "public (Pollora\\Discovery\\Domain\\Contracts\\DiscoveryLocationInterface $location, Spatie\\StructureDiscoverer\\Data\\DiscoveredStructure $structure, ?Pollora\\Discovery\\Domain\\Contracts\\ReflectionCacheInterface $reflectionCache = ?): void", + "getIdentifier": "public (): string", + "getItems": "public (): Pollora\\Discovery\\Domain\\Contracts\\DiscoveryItemsInterface", + "setItems": "public (Pollora\\Discovery\\Domain\\Contracts\\DiscoveryItemsInterface $items): void" + } + }, + "Pollora\\Meta\\Testing\\Fixtures\\EveryMetaKind": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": [] + }, + "Pollora\\Meta\\Testing\\MetaUiDriverConformance": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "check": "public static (Pollora\\Meta\\Domain\\Contracts\\MetaUiDriver $driver): array", + "schema": "public static (): Pollora\\Meta\\Domain\\Models\\MetaSchema" + } + }, + "Pollora\\Meta\\UI\\Console\\MetaAuditCommand": { + "kind": "class", + "extends": "Illuminate\\Console\\Command", + "implements": [], + "constants": [], + "methods": { + "handle": "public (Pollora\\Meta\\Application\\Services\\MetaAuditor $auditor): int" + } + }, + "Pollora\\Meta\\UI\\Console\\MetaListCommand": { + "kind": "class", + "extends": "Illuminate\\Console\\Command", + "implements": [], + "constants": [], + "methods": { + "handle": "public (Pollora\\Meta\\Application\\Services\\MetaSchemaRepository $schemas): int" + } + }, + "Pollora\\Role\\Application\\Services\\CapabilityOwnerReader": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": { + "TERM_CAPABILITIES": "const" + }, + "methods": { + "postType": "public (string $class): ?array", + "taxonomy": "public (string $class): ?array" + } + }, + "Pollora\\Role\\Application\\Services\\RoleDefinitionBuilder": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": { + "CORE_ROLES": "const", + "SENSITIVE_CAPABILITIES": "const" + }, + "methods": { + "__construct": "public (Pollora\\Role\\Application\\Services\\CapabilityOwnerReader $owners, array $superRoles = ?): mixed", + "build": "public (string $class): Pollora\\Role\\Domain\\Models\\RoleDefinition|Pollora\\Role\\Domain\\Models\\RoleModification" + } + }, + "Pollora\\Role\\Application\\Services\\RoleReference": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "matchesAny": "public static (array $userRoles, array $roles): bool", + "slug": "public static (string $role): string" + } + }, + "Pollora\\Role\\Application\\Services\\RoleRegistry": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Role\\Application\\Services\\CapabilityOwnerReader $owners, Pollora\\Role\\Domain\\Services\\PostTypeCapabilityMap $postTypeCapabilities): mixed", + "addCapabilitySet": "public (array $capabilities): void", + "addModification": "public (Pollora\\Role\\Domain\\Models\\RoleModification $modification): void", + "addPostType": "public (string $class): void", + "addRole": "public (Pollora\\Role\\Domain\\Models\\RoleDefinition $definition): void", + "addTaxonomy": "public (string $class): void", + "declaredCapabilities": "public (): array", + "definitions": "public (?Closure $warn = ?): array", + "isEmpty": "public (): bool", + "labelDomains": "public (): array", + "modifications": "public (?Closure $warn = ?): array" + } + }, + "Pollora\\Role\\Domain\\Contracts\\RoleStoreInterface": { + "kind": "interface", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "addRoleToUser": "public abstract (int $userId, string $role): void", + "removeFromUser": "public abstract (int $userId, string $entry): void", + "rolesOf": "public abstract (int $userId): array", + "saveStoredRoles": "public abstract (array $roles): void", + "storedRoles": "public abstract (): array" + } + }, + "Pollora\\Role\\Domain\\Contracts\\RoleUsageInterface": { + "kind": "interface", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "entries": "public abstract (): array", + "usersWith": "public abstract (string $entry): array" + } + }, + "Pollora\\Role\\Domain\\Exceptions\\InvalidRoleDefinitionException": { + "kind": "final class", + "extends": "LogicException", + "implements": [], + "constants": [], + "methods": { + "forClass": "public static (string $class, string $reason): self" + } + }, + "Pollora\\Role\\Domain\\Models\\RoleChanges": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (array $grants = ?, array $removals = ?, array $postTypeGrants = ?, array $taxonomyGrants = ?): mixed", + "withResolvedGrants": "public (array $grants): self" + } + }, + "Pollora\\Role\\Domain\\Models\\RoleDefinition": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (string $slug, string $label, ?string $inherits, Pollora\\Role\\Domain\\Models\\RoleChanges $changes, string $declaringClass, ?string $textDomain = ?): mixed", + "withChanges": "public (Pollora\\Role\\Domain\\Models\\RoleChanges $changes): self" + } + }, + "Pollora\\Role\\Domain\\Models\\RoleModification": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (string $slug, Pollora\\Role\\Domain\\Models\\RoleChanges $changes, string $declaringClass): mixed", + "withChanges": "public (Pollora\\Role\\Domain\\Models\\RoleChanges $changes): self" + } + }, + "Pollora\\Role\\Domain\\Services\\PostTypeCapabilityMap": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "capabilities": "public (string $capabilityType, Pollora\\Role\\Domain\\Enums\\Access $access, array $overrides = ?): array" + } + }, + "Pollora\\Role\\Domain\\Services\\RoleCompiler": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": { + "MARKER": "const" + }, + "methods": { + "compile": "public (array $storedRoles, array $definitions, array $modifications, array $superRoles, array $declaredCapabilities, ?Closure $warn = ?): array" + } + }, + "Pollora\\Role\\Domain\\Services\\StoredEntryClassifier": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": { + "CAPABILITY": "const", + "DEAD": "const", + "ROLE": "const" + }, + "methods": { + "classify": "public (string $entry, array $roles): string" + } + }, + "Pollora\\Role\\Infrastructure\\Adapters\\WordPressRoleInjector": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Role\\Application\\Services\\RoleRegistry $registry, Pollora\\Role\\Domain\\Services\\RoleCompiler $compiler, array $superRoles = ?, ?Psr\\Log\\LoggerInterface $logger = ?): mixed", + "inject": "public (WP_Roles $wpRoles): void", + "refresh": "public (): void", + "reportWarnings": "public (): void", + "warnings": "public (): array" + } + }, + "Pollora\\Role\\Infrastructure\\Adapters\\WordPressRoleLabelTranslator": { + "kind": "final readonly class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Role\\Application\\Services\\RoleRegistry $registry): mixed", + "translate": "public (string $translation, string $text, string $context): string" + } + }, + "Pollora\\Role\\Infrastructure\\Adapters\\WordPressRoleStore": { + "kind": "final readonly class", + "extends": null, + "implements": [ + "Pollora\\Role\\Domain\\Contracts\\RoleStoreInterface" + ], + "constants": [], + "methods": { + "addRoleToUser": "public (int $userId, string $role): void", + "removeFromUser": "public (int $userId, string $entry): void", + "rolesOf": "public (int $userId): array", + "saveStoredRoles": "public (array $roles): void", + "storedRoles": "public (): array" + } + }, + "Pollora\\Role\\Infrastructure\\Adapters\\WordPressRoleUsage": { + "kind": "final class", + "extends": null, + "implements": [ + "Pollora\\Role\\Domain\\Contracts\\RoleUsageInterface" + ], + "constants": [], + "methods": { + "entries": "public (): array", + "usersWith": "public (string $entry): array" + } + }, + "Pollora\\Role\\Infrastructure\\Checks\\RolesCheck": { + "kind": "final readonly class", + "extends": null, + "implements": [ + "Pollora\\Doctor\\Domain\\Contracts\\CheckInterface" + ], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Role\\Domain\\Contracts\\RoleUsageInterface $usage, Pollora\\Role\\Infrastructure\\Adapters\\WordPressRoleInjector $injector, Pollora\\Role\\Domain\\Services\\StoredEntryClassifier $classifier = ?): mixed", + "id": "public (): string", + "label": "public (): string", + "run": "public (Pollora\\Doctor\\Domain\\Enums\\RunContext $context): Pollora\\Doctor\\Domain\\Models\\CheckResult", + "runsIn": "public (): array" + } + }, + "Pollora\\Role\\Infrastructure\\Middleware\\EnsureUserHasRole": { + "kind": "class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "handle": "public (Illuminate\\Http\\Request $request, Closure $next, ...string $roles): Symfony\\Component\\HttpFoundation\\Response", + "using": "public static (...string $roles): string" + } + }, + "Pollora\\Role\\Infrastructure\\Providers\\RoleServiceProvider": { + "kind": "class", + "extends": "Illuminate\\Support\\ServiceProvider", + "implements": [], + "constants": [], + "methods": { + "boot": "public (): void", + "register": "public (): void" + } + }, + "Pollora\\Role\\Infrastructure\\Services\\RoleDiscovery": { + "kind": "final class", + "extends": null, + "implements": [ + "Pollora\\Discovery\\Domain\\Contracts\\DiscoveryInterface" + ], + "constants": [], + "methods": { + "__construct": "public (Pollora\\Role\\Application\\Services\\RoleDefinitionBuilder $builder, Pollora\\Role\\Application\\Services\\RoleRegistry $registry, Pollora\\Role\\Infrastructure\\Adapters\\WordPressRoleInjector $injector, ?Psr\\Log\\LoggerInterface $logger = ?): mixed", + "apply": "public (): void", + "discover": "public (Pollora\\Discovery\\Domain\\Contracts\\DiscoveryLocationInterface $location, Spatie\\StructureDiscoverer\\Data\\DiscoveredStructure $structure, ?Pollora\\Discovery\\Domain\\Contracts\\ReflectionCacheInterface $reflectionCache = ?): void", + "getIdentifier": "public (): string", + "getItems": "public (): Pollora\\Discovery\\Domain\\Contracts\\DiscoveryItemsInterface", + "setItems": "public (Pollora\\Discovery\\Domain\\Contracts\\DiscoveryItemsInterface $items): void" + } + }, + "Pollora\\Role\\UI\\Console\\RoleDumpCommand": { + "kind": "class", + "extends": "Illuminate\\Console\\Command", + "implements": [], + "constants": [], + "methods": { + "handle": "public (Pollora\\Role\\Domain\\Contracts\\RoleStoreInterface $store): int" + } + }, + "Pollora\\Role\\UI\\Console\\RoleImportCommand": { + "kind": "class", + "extends": "Pollora\\Console\\AbstractGeneratorCommand", + "implements": [], + "constants": [], + "methods": { + "execute": "protected (Symfony\\Component\\Console\\Input\\InputInterface $input, Symfony\\Component\\Console\\Output\\OutputInterface $output): int", + "getArguments": "protected (): array", + "getNameInput": "protected (): string", + "getOptions": "protected (): array", + "getStub": "protected (): string", + "handle": "public (): ?bool", + "replaceClass": "protected (mixed $stub, mixed $name): string" + } + }, + "Pollora\\Role\\UI\\Console\\RoleListCommand": { + "kind": "class", + "extends": "Illuminate\\Console\\Command", + "implements": [], + "constants": [], + "methods": { + "handle": "public (Pollora\\Role\\Application\\Services\\RoleRegistry $registry, Pollora\\Role\\Domain\\Contracts\\RoleUsageInterface $usage): int" + } + }, + "Pollora\\Role\\UI\\Console\\RoleMakeCommand": { + "kind": "class", + "extends": "Pollora\\Console\\AbstractGeneratorCommand", + "implements": [], + "constants": [], + "methods": { + "getArguments": "protected (): array", + "getStub": "protected (): string", + "replaceClass": "protected (mixed $stub, mixed $name): string" + } + }, + "Pollora\\Role\\UI\\Console\\RolePruneCommand": { + "kind": "class", + "extends": "Illuminate\\Console\\Command", + "implements": [], + "constants": [], + "methods": { + "handle": "public (Pollora\\Role\\Domain\\Contracts\\RoleUsageInterface $usage, Pollora\\Role\\Domain\\Contracts\\RoleStoreInterface $store, Pollora\\Role\\Application\\Services\\RoleRegistry $registry, Pollora\\Role\\Domain\\Services\\StoredEntryClassifier $classifier): int" + } + }, + "Pollora\\Role\\UI\\Console\\RoleShowCommand": { + "kind": "class", + "extends": "Illuminate\\Console\\Command", + "implements": [], + "constants": [], + "methods": { + "handle": "public (Pollora\\Role\\Application\\Services\\RoleRegistry $registry): int" + } + }, + "Pollora\\Role\\UI\\View\\RoleDirective": { + "kind": "final class", + "extends": null, + "implements": [], + "constants": [], + "methods": { + "__invoke": "public (string $expression): string" + } + } +}