PHPackages                             solidframe/core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. solidframe/core

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

solidframe/core
===============

Core interfaces, base classes, Result type, and Pipeline for SolidFrame

v0.1.0(2mo ago)099MITPHPPHP ^8.2

Since Apr 11Pushed 2mo agoCompare

[ Source](https://github.com/solidframe/core)[ Packagist](https://packagist.org/packages/solidframe/core)[ RSS](/packages/solidframe-core/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (9)

SolidFrame Core
===============

[](#solidframe-core)

Core interfaces, base classes, Pipeline, and Middleware for the SolidFrame ecosystem.

Every SolidFrame package depends on this one. It provides the shared contracts that keep the ecosystem consistent and composable.

Installation
------------

[](#installation)

```
composer require solidframe/core
```

Components
----------

[](#components)

### Identity

[](#identity)

Type-safe identity objects for your entities.

```
use SolidFrame\Core\Identity\AbstractIdentity;
use SolidFrame\Core\Identity\UuidIdentity;

// Simple identity
final readonly class UserId extends AbstractIdentity {}

$id = new UserId('user-123');
$id->value();              // 'user-123'
$id->equals(new UserId('user-123')); // true

// UUID identity with auto-generation
final readonly class OrderId extends UuidIdentity {}

$id = OrderId::generate(); // random UUIDv4
```

### Bus Interfaces

[](#bus-interfaces)

Minimal bus contracts for CQRS and event-driven architectures.

```
use SolidFrame\Core\Bus\CommandBusInterface;
use SolidFrame\Core\Bus\QueryBusInterface;
use SolidFrame\Core\Bus\EventBusInterface;

// Command — side effect, no return value
$commandBus->dispatch($command); // void

// Query — returns data, no side effect
$result = $queryBus->ask($query); // mixed

// Event — notification, no return value
$eventBus->dispatch($event); // void
```

### Domain Events

[](#domain-events)

Base contract for all domain events.

```
use SolidFrame\Core\Event\DomainEventInterface;

final readonly class OrderPlaced implements DomainEventInterface
{
    public function __construct(
        private string $orderId,
        private DateTimeImmutable $occurredAt = new DateTimeImmutable(),
    ) {}

    public function eventName(): string
    {
        return 'order.placed';
    }

    public function occurredAt(): DateTimeImmutable
    {
        return $this->occurredAt;
    }
}
```

### Pipeline

[](#pipeline)

Immutable, composable data processing pipeline.

```
use SolidFrame\Core\Pipeline\Pipeline;

$pipeline = new Pipeline();

$result = $pipeline
    ->pipe(fn (string $payload) => strtoupper($payload))
    ->pipe(fn (string $payload) => trim($payload))
    ->process('  hello world  ');

// 'HELLO WORLD'
```

Implement `StageInterface` for reusable stages:

```
use SolidFrame\Core\Pipeline\StageInterface;

final readonly class FormatPrice implements StageInterface
{
    public function __invoke(mixed $payload): mixed
    {
        return number_format($payload / 100, 2) . ' TL';
    }
}

$pipeline = (new Pipeline())->pipe(new FormatPrice());
$pipeline->process(1500); // '15.00 TL'
```

### Middleware

[](#middleware)

Middleware contract for bus implementations.

```
use SolidFrame\Core\Middleware\MiddlewareInterface;

final readonly class LoggingMiddleware implements MiddlewareInterface
{
    public function __construct(private LoggerInterface $logger) {}

    public function handle(object $message, callable $next): mixed
    {
        $this->logger->info('Handling: ' . $message::class);
        $result = $next($message);
        $this->logger->info('Handled: ' . $message::class);

        return $result;
    }
}
```

### Exceptions

[](#exceptions)

Named constructor pattern for clear, consistent error messages.

```
use SolidFrame\Core\Exception\EntityNotFoundException;

throw EntityNotFoundException::forId('order-123');
// "Entity with id "order-123" was not found."

throw EntityNotFoundException::forClassAndId(Order::class, 'order-123');
// "Entity App\Domain\Order with id "order-123" was not found."
```

All exceptions implement `SolidFrameException` marker interface for catch-all handling.

### Application Service

[](#application-service)

Marker interface for use case handlers.

```
use SolidFrame\Core\Service\ApplicationServiceInterface;

final readonly class PlaceOrderService implements ApplicationServiceInterface
{
    public function __invoke(PlaceOrderCommand $command): void
    {
        // ...
    }
}
```

API Reference
-------------

[](#api-reference)

Class / InterfacePurpose`IdentityInterface`Contract for identity objects`AbstractIdentity`Base identity with equality`UuidIdentity`UUID-based identity with `generate()``DomainEventInterface`Contract for domain events`CommandBusInterface`Command dispatch contract`QueryBusInterface`Query dispatch contract`EventBusInterface`Event dispatch contract`MiddlewareInterface`Middleware chain contract`PipelineInterface`Pipeline contract`Pipeline`Immutable pipeline implementation`StageInterface`Callable pipeline stage contract`ApplicationServiceInterface`Marker for application services`SolidFrameException`Base exception marker`EntityNotFoundException`Entity lookup failure`InvalidArgumentException`Validation failureRelated Packages
----------------

[](#related-packages)

- [solidframe/ddd](../ddd) — Entity, ValueObject, AggregateRoot, Specification
- [solidframe/cqrs](../cqrs) — CommandBus, QueryBus, Handlers
- [solidframe/event-driven](../event-driven) — EventBus, Listeners
- [solidframe/laravel](../laravel) — Laravel integration
- [solidframe/symfony](../symfony) — Symfony integration

Contributing
------------

[](#contributing)

This repository is a read-only split of the [solidframe/solidframe](https://github.com/solidframe/solidframe) monorepo, auto-synced on every push to `main`. Issues, pull requests, and discussions belong in the monorepo.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance84

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

84d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/97de2a466719393a21a8ce5caef247a1afb8aec5a8974248da0583f4197765b2?d=identicon)[abdulkadir-posul](/maintainers/abdulkadir-posul)

---

Top Contributors

[![abdulkadir-posul](https://avatars.githubusercontent.com/u/88670954?v=4)](https://github.com/abdulkadir-posul "abdulkadir-posul (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/solidframe-core/health.svg)

```
[![Health](https://phpackages.com/badges/solidframe-core/health.svg)](https://phpackages.com/packages/solidframe-core)
```

###  Alternatives

[m2-boilerplate/module-critical-css

Magento 2 module to automatically generate critical css with the addyosmani/critical npm package

3684.7k](/packages/m2-boilerplate-module-critical-css)[jajuma/awesomehyva

This Magento 2 extension allows using Font Awesome 5 icons with Hyvä Themes

1354.7k](/packages/jajuma-awesomehyva)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
