Download the PHP package zjkiza/response-processor without Composer

On this page you can find all versions of the php package zjkiza/response-processor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package response-processor

ResponseProcessor Bundle

A Symfony bundle that fetches and injects related data into DTOs after a controller returns, using PHP 8 attributes.

How it works

  1. Controller returns DTOs with #[ProcessorIdentifier] on the ID property
  2. DTO properties are annotated with #[InjectData(SomeFetcher::class)] or a custom attribute
  3. ProcessorListener intercepts kernel.view, reads #[Processor('handler_key')] from the controller method
  4. Each registered handler delegates to ProcessorEngine, which batches fetches per DataFetcher class (one fetch() call per class per request) and injects results directly into DTO properties

When to use it

The problem

After a controller returns DTOs (or any response objects), you often need to enrich them with related data — tags, authors, categories, metadata, or data from external sources. Common approaches all have drawbacks:

Use cases

1. API responses with relational data A controller returns PostDto[], each with author, tags, attachments. Instead of manually populating fields, annotate DTO properties with #[InjectData(TagFetcher::class)]. The bundle populates them before serialization — zero controller code.

2. CQRS read models A query handler returns a read model that combines data from PostgreSQL, Redis, and an HTTP API. Each source gets its own DataFetcher, each property its own #[InjectData(...)]. Batching is automatic — one fetch() call per source per request.

3. Multi-source user profiles User details from the database, notifications from Redis, permissions from a remote API. One controller, one #[Processor], multiple DTO properties with different fetchers — all resolved in the same kernel.view pass.

4. Aggregate views with expensive fields Some DTO fields are costly to load (e.g. full-text search data, analytics). Instead of always joining or always lazy-loading, mark them with #[InjectData]. The bundle resolves them only when needed — no premature optimization, no waste.

What you gain

Installation

Configuration

Usage

1. Define your DTO

Mark the ID property with #[ProcessorIdentifier] and properties to be injected with #[InjectData]:

#[InjectData] points to a DataFetcherInterface implementation that provides the data.

2. Create a DataFetcher

All DataFetcherInterface implementations are auto-tagged with zjkiza_response_processor.fetcher.

3. Register handlers

The key tag matches the value in #[Processor('key')]. Different keys can use the same attributeClass or different ones.

4. Use on controller

Multiple handlers can be stacked on one method:

Custom attributes

Extend InjectDataAbstract for a minimal custom attribute:

The $fetcher property and ProcessorAttributeInterface implementation are inherited — you only need to add the #[\Attribute] declaration and extend the abstract class.

Register it with AttributeHandler:

Architecture

Service Tags

Tag Purpose
zjkiza_response_processor.handler Registers a handler with a key attribute
zjkiza_response_processor.fetcher Auto-tagged on all DataFetcherInterface implementations

Contracts

Interface Purpose
ProcessorAttributeInterface Marker interface for custom processor attributes
DataFetcherInterface Fetches data by array of identifiers
ProcessorHandlerInterface Handles processed data in kernel.view
IdentifierExtractorInterface Extracts identifier from an object
PropertyResolverInterface Resolves a DataFetcherInterface for a property

All versions of response-processor with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
symfony/http-kernel Version ^5.4|^6.0|^7.0|^8.0
symfony/dependency-injection Version ^5.4|^6.0|^7.0|^8.0
symfony/config Version ^5.4|^6.0|^7.0|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zjkiza/response-processor contains the following files

Loading the files please wait ...