Skip to content

Remove shared StorageInterface in favor of package-level contracts #433

Description

@armanist

Description

The framework's package-based architecture has each package self-contained with its own Contracts/, Exceptions/, etc. However, src/Contracts/StorageInterface.php is a leftover shared contract that breaks this pattern -- it's the sole file in src/Contracts/ and creates cross-package coupling.

Problem

StorageInterface is never used as a type-hint or in an instanceof check anywhere in the codebase. The polymorphism it provides is unused.
CookieStorageInterface extends StorageInterface but overrides set() and delete() with incompatible signatures, violating the Liskov Substitution Principle.
Four unrelated packages (Config, Debugger, Session, Cookie) are coupled through a shared contract they never interchange.
src/Contracts/ is the only top-level shared contracts folder, inconsistent with every other package.

Acceptance criteria

src/Contracts/ directory no longer exists
SessionStorageInterface and CookieStorageInterface are self-contained (no external extends)
Config implements ConfigInterface from its own package
DebuggerStore implements DebuggerStoreInterface from its own package
Implementing classes use @inheritDoc instead of duplicating docblocks
All existing tests pass with no new failures
phpstan level 6 passes with no new errors

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions