Download the PHP package boundwize/structarmed without Composer

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

StructArmed

StructArmed

Configurable PHP architecture guards — define your layers and rules, then keep them enforced.

Latest Version ci build Code Coverage PHPStan Downloads

Windows macOS Linux

Turn architecture rules into executable checks

Installation

Quick start

Generates a structarmed.php in your project root. Edit it to match your structure, then run:

If violations are found, the output reports each one:

Image

If everything passes, you get a clean summary:

Image

Configuration

Default

Multiple presets

Cache directory

StructArmed stores analysis cache in the system temp directory by default. You can configure a project cache directory:

Relative cache directories are resolved from the project root. --config also controls the cache directory used by analyse and --clear-cache.

Custom layers and rules

Inside skip(), string entries skip files or directories unless they match a registered rule key, keyed entries skip paths for one specific rule, and rule key constants skip that rule entirely. You can also use skipPath() / skipPaths() and skipRule() / skipRules() when you prefer the explicit methods.

Use replaceRule() to swap a preset rule's configuration — it throws RuleNotFoundException if the key does not exist, so a typo is caught immediately. Use rule() to add new custom rules; it can also overwrite an existing key, but silently, with no verification that the target exists.

Layer resolution

Layers are resolved by file path — no attributes needed on classes:

Layer patterns (namespace-based layers)

When your architecture is expressed through namespace conventions rather than directory structure, use layerPattern() to resolve layers by matching the fully-qualified class name against a regex:

An optional third argument excludes classes whose FQN matches a second regex, even when the first matches:

Declarative ruleset

Once layers are defined (via layer() or layerPattern()), declare which layers each layer is allowed to depend on. Any dependency that resolves to a layer not in the allowed list is a violation:

Layers absent from the ruleset keys are not checked. Dependencies on external (non-registered) classes are always allowed.

Same-layer dependencies are always allowed regardless of the ruleset.

Skipping class-level violations

When a specific class-to-class dependency is a known exception, suppress it without disabling the whole layer rule:

The first argument is the fully-qualified violating class name; the second is one or more dependency FQNs to ignore for that class.

Excluding paths from ruleset checks only

Test files often cross layer boundaries by design. Use skipPathsForRuleset() to exclude paths from ruleset evaluation while still scanning them for all other rules (e.g. PSR-4 namespace checks):

This is different from skipPaths() / skipPath(), which exclude files from all analysis.

Custom presets

A custom preset is a class that implements Boundwize\StructArmed\Preset\PresetInterface. Inside apply(), add the layers and rules you want to reuse:

Register it in structarmed.php:

Preset constructor parameters

Available presets

Preset Rules
Preset::PSR1() Basic Coding Standard checks: PHP tags, UTF-8 without BOM, symbols vs side effects, PSR-4 class placement, StudlyCaps class names, upper-case class constants, camelCase methods
Preset::PSR12() Extends PSR-1: all methods, constants, and properties must declare explicit visibility
Preset::PSR4() Verifies configured source paths exist in composer.json autoload or autoload-dev PSR-4 mappings
Preset::DDD() Layer isolation, entity/VO/repository/event/service conventions
Preset::MVC() Layer isolation, thin controllers, model/view/service rules

PHPUnit extension

Run architecture checks as part of your test suite:

Violations cause the test run to fail before any tests execute.

CLI analyse commands

Tips

Rule key constants

Every preset rule has a public constant. Use constants, never raw strings:

Adopting existing projects

Fix reported violations where practical before reaching for a baseline. If the remaining findings are too large to resolve in one pass, generate a baseline to record the known violations:

Then reference it from your config:

Baseline entries are matched against future analysis results, so existing violations stay quiet while new violations still fail the run.

Do not use a baseline to hide issues you can fix now; treat it as a migration aid for legacy findings that should be reduced over time.


All versions of structarmed with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
composer-runtime-api Version ^2.0
fidry/cpu-core-counter Version ^1.3
nikic/php-parser Version ^5.7
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 boundwize/structarmed contains the following files

Loading the files please wait ...