Login   Register  
PHP Classes

Learn From the PHP Clean Architecture Example Package Clean Archi Queue: Example implementations of clean architechture

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2025-08-12 (1 hour ago) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
clean-archi-queue 1.0The PHP License7.4Design Patterns, PHP 7
Description 

Author

This package provides example implementations of clean architecture.

It provides classes that demonstrate how to implement a clean architecture of classes.

Currently, it demonstrates two ways of implementing a clean architecture:

1. An application provides classes that implement features that reuse class libraries that execute general purpose actions.

2. Features are implemented by modules with classes for implementing each feature, interfaces that define contracts to access class libraries that execute general purpose actions.

Picture of DeGraciaMathieu
  Performance   Level  
Name: DeGraciaMathieu <contact>
Classes: 27 packages by
Country: France France
Age: ???
All time rank: 287479 in France France
Week rank: 22 Up1 in France France Up
Innovation award
Innovation award
Nominee: 20x

Winner: 2x

Instructions

Please read this document to learn more about how to implement a clean architecture using PHP classes in two ways.

Documentation

clean-archi-queue

Option 1: The features are aware of the library.

<img width="774" height="231" alt="image" src="https://github.com/user-attachments/assets/ea132de3-a574-44ef-ac3c-0b1349c1f82d" />

  • ? Dependencies between components are unidirectional.
  • ? Boundary crossing is done through interfaces, introducing little rigidity.
  • ? Library components are easily reusable from one feature to another.
  • ? Libraries are generally stable, preserving the decreasing instability gradient.
  • ? Features (domain) become coupled to technical implementation details exposed by the libraries.
  • ? This limits the ability of features to drive design through their own functional contracts.

Option 2: The features are unaware of the library.

<img width="756" height="474" alt="image" src="https://github.com/user-attachments/assets/e57c0bde-4be0-4059-83bb-9101e8b706b9" />

  • ? Dependencies between components are unidirectional.
  • ? Boundary crossing is done through interfaces, introducing little rigidity.
  • ? Dependencies go in the right direction: from technical to domain.
  • ? Features can express their functional needs through contracts.
  • ? Contracts declared by the features can be shared across features.
  • ? The library must satisfy the functional needs of the features, which may lead to more components being added to the library.
  • ? More indirection between the Shared components and the Library (dependency inversion).

  Files folder image Files (9)  
File Role Description
Files folder imageapp (2 directories)
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (9)  /  app  
File Role Description
Files folder imageFeatures (1 directory)
Files folder imageLibraries (1 directory)

  Files folder image Files (9)  /  app  /  Features  
File Role Description
Files folder imageOrder (1 directory)

  Files folder image Files (9)  /  app  /  Features  /  Order  
File Role Description
Files folder imageCreate (2 directories)

  Files folder image Files (9)  /  app  /  Features  /  Order  /  Create  
File Role Description
Files folder imageServices (1 file)
Files folder imageUseCases (3 files)

  Files folder image Files (9)  /  app  /  Features  /  Order  /  Create  /  Services  
File Role Description
  Plain text file CreateOrder.php Class Class source

  Files folder image Files (9)  /  app  /  Features  /  Order  /  Create  /  UseCases  
File Role Description
  Plain text file CreateOrderAction.php Class Class source
  Plain text file CreateOrderInput.php Class Class source
  Plain text file CreateOrderOutput.php Class Class source

  Files folder image Files (9)  /  app  /  Libraries  
File Role Description
Files folder imageAsync (2 directories)

  Files folder image Files (9)  /  app  /  Libraries  /  Async  
File Role Description
Files folder imageApi (2 files)
Files folder imageInfrastructure (2 files)

  Files folder image Files (9)  /  app  /  Libraries  /  Async  /  Api  
File Role Description
  Plain text file AsyncCommand.php Class Class source
  Plain text file AsyncDispatcher.php Class Class source

  Files folder image Files (9)  /  app  /  Libraries  /  Async  /  Infrastructure  
File Role Description
  Plain text file GenericAsyncJob.php Class Class source
  Plain text file LaravelAsyncDispatcher.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads  
 100%
Total:0
This week:0