Download the PHP package kajstrom/dependency-constraints without Composer

On this page you can find all versions of the php package kajstrom/dependency-constraints. 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 dependency-constraints

Tracis CI Version PHP version

DependencyConstraints

DependencyConstraints is a static code analysis tool for creating constraints for dependencies between modules in your project. It is intended to be used within a testing library such as PHPUnit or Codeception.

The core idea of DependencyConstraints is to shorten the feedback loop for finding changes that degrade the architecture of your application. Instead of finding out 6 months later that you or someone else on the team added undesirable coupling into your application, you can create tests that act as a safeguard against such changes.

DependencyConstraints is inspired by JDepend and Fitness Functions introduced in the book Building Evolutionary Architectures.

Getting started

To get started require DependencyConstraints with Composer.

After DependencyConstraints has been installed you can start creating tests with it. It is recommended to create only a single instance of DependencyConstraints as it will go through all PHP files in your in the target directory.

In addition, you should use DependencyConstraints on your own src/classes directory. It is not necessary for DependencyConstraints to parse vendor directory etc. to be able to look for usages of external classes.

Using PHPUnit the test would look like this.

What is considered to be a dependency

DependencyConstraints assumes the following to be dependencies:

Currently globally scoped classes, functions and constants are not considered to be dependencies.

Using something from a submodule is not considered to be a dependency.

For example:

Using "MyProject\ModuleA\SomeClass" in "MyProject\ModuleB" is a dependency.

Using "MyProject\ModuleA\SubModule\SomeClass" in "MyProject\ModuleA" is not a dependency.

Potential use cases

In a layered architecture you might want to prevent other layers of your software from becoming coupled to the presentation layer.

Perhaps you have a modular monolith and want to ensure that a certain module will not get coupled to another module.

Or maybe you want to keep certain external libraries out of the Application layer in a Hexagonal Architecture.

You can also check for dependencies on a certain class. Maybe you are refactoring it out but it keeps popping up in new places all the time!

Limitations

As a static code analysis tool DependencyConstraints can't catch absolutely everything. Let's say someone wants to be clever and do something like this:

This would not be found as a dependency when analyzing the source.

Why not use Pdepend?

Pdepend offers very useful metrics on the quality of the codebase, but it does not allow testing dependencies between modules.


All versions of dependency-constraints with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.0
ext-tokenizer Version ^7.1.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 kajstrom/dependency-constraints contains the following files

Loading the files please wait ....