Download the PHP package kodzila/architecture-validator without Composer

On this page you can find all versions of the php package kodzila/architecture-validator. 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 architecture-validator

Architecture validator

Motivation

Most projects are monoliths with some rules maintained to allow projects to scale if needed. Those rules must normally be enforced during code review and are exhausting to check each time.

This library aims to specify those rules explicitly by having a tool to check the rules automatically.

Inspiration was taken from Java ArchUnit and not maintained anymore PhpArch.

Installation

Via composer:

Running

Library itself does not provide any runner - it is only set of functionalities to validate rules. You need to write runner of your own choice.

Runner: PHPUnit

Personally I recommend using this runner as it is quite easy to configure, and almost each project is shipped with that library.

Concept

Unlike other modern OOP languages like Java and C#, PHP has no concept of packaging inside one project. The only thing are folders, but they cannot be restricted by scope modifiers.

As mentioned earlier, project can be a monolith application, but without any structure projects can quickly become a spaghetti code.

Modular approach

The idea is that project source code can be bundled in Modules. Each module has a Path and corresponding PHP Namespace.

Consider such project:

You can see that project has been divided in modules: Armap and Core. Architecture validator can reflect such situation:

Each module can contain set of PHP classes, interfaces and traits that will be analysed.

Rules

Architecture validator provides set of validators to check for common used approaches. They are called Rules and they can be found in src/Rule/Extension

CoreModuleRule

Rule is assigning one module as Core module. Rest of registered modules are treated as Submodule.

Checks:

This approach allows creating easy to maintain packages. Dependencies are only in one direction.

DomainDrivenDesignRule

The rule is enforcing structures typical for this module architecture. Typical structure looks like that:

You can read more about the structure here.

Further, {Domain, Application, Infrastructure, Presentation} shall be called Layers

Checks:

DomainForbiddenDependenciesRule

Domain is a heart of the system, and should not be polluted with unstable libraries. It should be well-tought process. The rule ensures that developers thought about implications of adding dependency into Domain layer.

Quote:

You need to add dependency whitelisted to ignore the error.

Development

Release a new version


All versions of architecture-validator with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 | ^8.0
symfony/finder Version 4.* || 5.*
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 kodzila/architecture-validator contains the following files

Loading the files please wait ....