Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The asset classes that left for the package no longer reach for Laravel: `AssetEnqueuer` receives the hook services, the Vite factory, the runtime and a PSR-3 logger instead of resolving them from the container, `AssetFile` is resolved through a resolver the provider sets (`AssetFile::resolveUsing()`), and `AssetManager`, `MissingBuilds` and `MissingBuildNotice` take their public directory, logger and project root as arguments. The rendered HTML of a Pollora site is unchanged, in build and while Vite runs hot
- An `AssetEnqueuer` destroyed after its application, as in a test, no longer throws while it reports a failure of its deferred enqueue
- The typed meta classes that will leave for `pollora/meta` no longer reach for Laravel: `MetaUiDrivers` and `MetaAccessor::extend()` take a PSR-11 `ContainerInterface` (the Laravel container is one, a driver closure receives the same object), and the key of a data object's property is derived by `Pollora\Attributes\Support\Naming` instead of `Str::snake()`. What needs Laravel moved to `Pollora\Meta\Infrastructure\Laravel`: `MetaServiceProvider`, `LaravelMetaValidator`, `TypedMetaCheck`, `MetaListCommand` and `MetaAuditCommand`. The rendered pages, the REST responses and the output of the `pollora:meta:*`, `pollora:binding:list`, `pollora:roles:*` and `pollora:doctor` commands of a Pollora site are unchanged
- The roles classes that will leave for `pollora/roles` no longer reach for Laravel: the label of a `#[Role]` without one comes from `Naming::headline()` (the same words as `Str::headline()`) and `Naming::classBasename()`. What needs Laravel moved to `Pollora\Role\Infrastructure\Laravel`: `RoleServiceProvider`, the `role` middleware `EnsureUserHasRole`, the `@role` directive `RoleDirective`, the `RolesCheck` of `pollora:doctor` and the `pollora:roles:*` and `pollora:make:role` commands with their stubs. Roles, capabilities and command outputs of a Pollora site are unchanged

## [v13.36.0](https://github.com/Pollora/framework/compare/v13.35.6...v13.36.0) - 2026-10-14

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"pollora/abilities": "^1.0",
"pollora/ajax": "^1.1",
"pollora/assets": "^0.1",
"pollora/attributes": "^0.1 || ^1.0",
"pollora/attributes": "^0.1.1 || ^1.0",
"pollora/discovery": "^0.1 || ^1.0",
"pollora/entity": "^1.2",
"pollora/hook": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/PolloraServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
use Pollora\Permalink\Infrastructure\Providers\PermalinkServiceProvider;
use Pollora\Plugin\Infrastructure\Providers\PluginServiceProvider;
use Pollora\PostType\Infrastructure\Providers\PostTypeServiceProvider;
use Pollora\Role\Infrastructure\Providers\RoleServiceProvider;
use Pollora\Role\Infrastructure\Laravel\RoleServiceProvider;
use Pollora\Route\Infrastructure\Providers\RouteServiceProvider;
use Pollora\Schedule\SchedulerServiceProvider;
use Pollora\Taxonomy\Infrastructure\Providers\TaxonomyServiceProvider;
Expand Down
4 changes: 2 additions & 2 deletions src/Role/Application/Services/RoleDefinitionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
namespace Pollora\Role\Application\Services;

use BackedEnum;
use Illuminate\Support\Str;
use Pollora\Attributes\ModifyRole;
use Pollora\Attributes\Role;
use Pollora\Attributes\Role\Grants;
use Pollora\Attributes\Role\GrantsPostType;
use Pollora\Attributes\Role\GrantsTaxonomy;
use Pollora\Attributes\Role\Without;
use Pollora\Attributes\Support\Naming;
use Pollora\Role\Domain\Exceptions\InvalidRoleDefinitionException;
use Pollora\Role\Domain\Models\RoleChanges;
use Pollora\Role\Domain\Models\RoleDefinition;
Expand Down Expand Up @@ -83,7 +83,7 @@ public function build(string $class): RoleDefinition|RoleModification

return new RoleDefinition(
slug: $role->slug,
label: $role->label ?? Str::headline(class_basename($class)),
label: $role->label ?? Naming::headline(Naming::classBasename($class)),
inherits: $inherits,
changes: $changes,
declaringClass: $class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Pollora\Role\UI\Console;
namespace Pollora\Role\Infrastructure\Laravel\Console;

use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Pollora\Role\UI\Console;
namespace Pollora\Role\Infrastructure\Laravel\Console;

use Illuminate\Console\Attributes\Description;
use Illuminate\Support\Str;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Pollora\Role\UI\Console;
namespace Pollora\Role\Infrastructure\Laravel\Console;

use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Pollora\Role\UI\Console;
namespace Pollora\Role\Infrastructure\Laravel\Console;

use Illuminate\Console\Attributes\Description;
use Illuminate\Support\Str;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Pollora\Role\UI\Console;
namespace Pollora\Role\Infrastructure\Laravel\Console;

use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Pollora\Role\UI\Console;
namespace Pollora\Role\Infrastructure\Laravel\Console;

use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Pollora\Role\Infrastructure\Middleware;
namespace Pollora\Role\Infrastructure\Laravel;

use Closure;
use Illuminate\Auth\Access\AuthorizationException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Pollora\Role\UI\View;
namespace Pollora\Role\Infrastructure\Laravel;

use Pollora\Role\Application\Services\RoleReference;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Pollora\Role\Infrastructure\Providers;
namespace Pollora\Role\Infrastructure\Laravel;

use Illuminate\Contracts\Foundation\Application;
use Illuminate\Routing\Router;
Expand All @@ -22,16 +22,13 @@
use Pollora\Role\Infrastructure\Adapters\WordPressRoleLabelTranslator;
use Pollora\Role\Infrastructure\Adapters\WordPressRoleStore;
use Pollora\Role\Infrastructure\Adapters\WordPressRoleUsage;
use Pollora\Role\Infrastructure\Checks\RolesCheck;
use Pollora\Role\Infrastructure\Middleware\EnsureUserHasRole;
use Pollora\Role\Infrastructure\Laravel\Console\RoleDumpCommand;
use Pollora\Role\Infrastructure\Laravel\Console\RoleImportCommand;
use Pollora\Role\Infrastructure\Laravel\Console\RoleListCommand;
use Pollora\Role\Infrastructure\Laravel\Console\RoleMakeCommand;
use Pollora\Role\Infrastructure\Laravel\Console\RolePruneCommand;
use Pollora\Role\Infrastructure\Laravel\Console\RoleShowCommand;
use Pollora\Role\Infrastructure\Services\RoleDiscovery;
use Pollora\Role\UI\Console\RoleDumpCommand;
use Pollora\Role\UI\Console\RoleImportCommand;
use Pollora\Role\UI\Console\RoleListCommand;
use Pollora\Role\UI\Console\RoleMakeCommand;
use Pollora\Role\UI\Console\RolePruneCommand;
use Pollora\Role\UI\Console\RoleShowCommand;
use Pollora\Role\UI\View\RoleDirective;
use Psr\Log\LoggerInterface;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Pollora\Role\Infrastructure\Checks;
namespace Pollora\Role\Infrastructure\Laravel;

use Pollora\Doctor\Domain\Contracts\CheckInterface;
use Pollora\Doctor\Domain\Enums\RunContext;
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/Extraction/RolesContractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
use Pollora\Role\Application\Services\RoleDefinitionBuilder;
use Pollora\Role\Application\Services\RoleRegistry;
use Pollora\Role\Domain\Services\RoleCompiler;
use Pollora\Role\Infrastructure\Middleware\EnsureUserHasRole;
use Pollora\Role\Infrastructure\Providers\RoleServiceProvider;
use Pollora\Role\Infrastructure\Laravel\EnsureUserHasRole;
use Pollora\Role\Infrastructure\Laravel\RoleServiceProvider;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Tests\Unit\Role\Fixtures\EditorAdjustments;
Expand Down
116 changes: 58 additions & 58 deletions tests/Feature/Extraction/surface.json
Original file line number Diff line number Diff line change
Expand Up @@ -921,58 +921,7 @@
"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": {
"Pollora\\Role\\Infrastructure\\Laravel\\Console\\RoleDumpCommand": {
"kind": "class",
"extends": "Illuminate\\Console\\Command",
"implements": [],
Expand All @@ -981,7 +930,7 @@
"handle": "public (Pollora\\Role\\Domain\\Contracts\\RoleStoreInterface $store): int"
}
},
"Pollora\\Role\\UI\\Console\\RoleImportCommand": {
"Pollora\\Role\\Infrastructure\\Laravel\\Console\\RoleImportCommand": {
"kind": "class",
"extends": "Pollora\\Console\\AbstractGeneratorCommand",
"implements": [],
Expand All @@ -996,7 +945,7 @@
"replaceClass": "protected (mixed $stub, mixed $name): string"
}
},
"Pollora\\Role\\UI\\Console\\RoleListCommand": {
"Pollora\\Role\\Infrastructure\\Laravel\\Console\\RoleListCommand": {
"kind": "class",
"extends": "Illuminate\\Console\\Command",
"implements": [],
Expand All @@ -1005,7 +954,7 @@
"handle": "public (Pollora\\Role\\Application\\Services\\RoleRegistry $registry, Pollora\\Role\\Domain\\Contracts\\RoleUsageInterface $usage): int"
}
},
"Pollora\\Role\\UI\\Console\\RoleMakeCommand": {
"Pollora\\Role\\Infrastructure\\Laravel\\Console\\RoleMakeCommand": {
"kind": "class",
"extends": "Pollora\\Console\\AbstractGeneratorCommand",
"implements": [],
Expand All @@ -1016,7 +965,7 @@
"replaceClass": "protected (mixed $stub, mixed $name): string"
}
},
"Pollora\\Role\\UI\\Console\\RolePruneCommand": {
"Pollora\\Role\\Infrastructure\\Laravel\\Console\\RolePruneCommand": {
"kind": "class",
"extends": "Illuminate\\Console\\Command",
"implements": [],
Expand All @@ -1025,7 +974,7 @@
"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": {
"Pollora\\Role\\Infrastructure\\Laravel\\Console\\RoleShowCommand": {
"kind": "class",
"extends": "Illuminate\\Console\\Command",
"implements": [],
Expand All @@ -1034,13 +983,64 @@
"handle": "public (Pollora\\Role\\Application\\Services\\RoleRegistry $registry): int"
}
},
"Pollora\\Role\\UI\\View\\RoleDirective": {
"Pollora\\Role\\Infrastructure\\Laravel\\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\\Laravel\\RoleDirective": {
"kind": "final class",
"extends": null,
"implements": [],
"constants": [],
"methods": {
"__invoke": "public (string $expression): string"
}
},
"Pollora\\Role\\Infrastructure\\Laravel\\RoleServiceProvider": {
"kind": "class",
"extends": "Illuminate\\Support\\ServiceProvider",
"implements": [],
"constants": [],
"methods": {
"boot": "public (): void",
"register": "public (): void"
}
},
"Pollora\\Role\\Infrastructure\\Laravel\\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\\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"
}
}
}
2 changes: 1 addition & 1 deletion tests/Unit/Role/EnsureUserHasRoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Http\Request;
use Pollora\Role\Infrastructure\Middleware\EnsureUserHasRole;
use Pollora\Role\Infrastructure\Laravel\EnsureUserHasRole;
use Symfony\Component\HttpFoundation\Response;
use Tests\Unit\Role\Fixtures\EventManager;

Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Role/RoleCommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
use Pollora\Role\Domain\Services\PostTypeCapabilityMap;
use Pollora\Role\Domain\Services\RoleCompiler;
use Pollora\Role\Infrastructure\Adapters\WordPressRoleInjector;
use Pollora\Role\UI\Console\RoleListCommand;
use Pollora\Role\UI\Console\RoleShowCommand;
use Pollora\Role\Infrastructure\Laravel\Console\RoleListCommand;
use Pollora\Role\Infrastructure\Laravel\Console\RoleShowCommand;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;
use Tests\Unit\Role\Fixtures\EditorAdjustments;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Role/RoleDirectiveTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare(strict_types=1);

use Brain\Monkey\Functions;
use Pollora\Role\UI\View\RoleDirective;
use Pollora\Role\Infrastructure\Laravel\RoleDirective;
use Tests\Unit\Role\Fixtures\EventManager;

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Role/RoleServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
use Pollora\Hook\Domain\Contract\Filter;
use Pollora\Role\Application\Services\RoleDefinitionBuilder;
use Pollora\Role\Infrastructure\Adapters\WordPressRoleInjector;
use Pollora\Role\Infrastructure\Middleware\EnsureUserHasRole;
use Pollora\Role\Infrastructure\Providers\RoleServiceProvider;
use Pollora\Role\Infrastructure\Laravel\Console\RoleMakeCommand;
use Pollora\Role\Infrastructure\Laravel\EnsureUserHasRole;
use Pollora\Role\Infrastructure\Laravel\RoleDirective;
use Pollora\Role\Infrastructure\Laravel\RoleServiceProvider;
use Pollora\Role\Infrastructure\Services\RoleDiscovery;
use Pollora\Role\UI\Console\RoleMakeCommand;
use Pollora\Role\UI\View\RoleDirective;
use Psr\Log\LoggerInterface;

beforeEach(function (): void {
Expand Down
Loading
Loading