Download the PHP package byte-kitsune/mago-architecture-graph without Composer

On this page you can find all versions of the php package byte-kitsune/mago-architecture-graph. 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 mago-architecture-graph

Mago Architecture Graph

Tests Security Check

Path-aware module boundaries and a conservative PHP call graph for Mago. This beta is a Mago Analyzer plugin. Use Mago Guard for ordinary namespace and structural rules; this package adds checks that need the source path, parsed namespace, or a proven call path.

See the runnable example for a controller that crosses a hidden module boundary and reaches a forbidden method through another service.

Install and run

Requires PHP 8.2+ and Mago 1.50. Pin the beta in your project:

Add an extension host to mago.toml (keep your normal [source] paths configured):

Create .mago/architecture-worker.php:

Run vendor/bin/mago analyze. The worker and policy are trusted project inputs; review changes to them like other analysis configuration.

Configure the checks

Create .mago/architecture-policy.json. Paths are relative to the project root; namespace and path must both match. Modules are ordered, and exclusions take precedence.

Remove scope_graph if you only need module boundaries. direct graph mode stops after one edge; transitive follows calls up to max_depth (1–64). A path_pattern ending in / matches a directory prefix; * matches one nonempty segment. module_family can capture such segments and restrict imports between instances; see the graph fixture shows separate allow and deny scopes.

The graph follows literal static calls, narrowly proven instance receivers, constructors, literal callbacks, named project functions, and exact Symfony service lookups. It also follows calls on a literal temporary new instance. A local variable assigned one literal new expression or exact container get() lookup is followed only through up to 31 straight-line calls with simple arguments. Branching, reassignment, escape, dynamic IDs, unproven mutable receivers, overridable dispatch and decorators are not silently treated as proven.

For Symfony type, #[Target], and service-ID resolution, install mago-symfony-wiring and pass its complete dev service map:

Pass only reviewed shared/dev service files. A complete literal map proves configured IDs and aliases, not the runtime container or decorators.

When one class has multiple service definitions with different constructor arguments, pass the positional bindings from a revision-matched compiled dev container reference as the sixth argument. Map each owner service ID to constructor positions and their target service IDs; include aliases and an empty array for a same-class service with no explicit arguments. Use null for an argument whose target cannot be proved. For example:

The graph keeps those two Processor instances separate through private $this calls and constructor-injected properties. Exact container lookups retain the selected service ID; an unbound construction does not borrow either service's constructor proof. The service constructor fixture exercises this case. A compiled reference is needed for runtime service parity: parsing service YAML or PHP cannot establish all effective aliases, environment overrides and argument values. The caller must regenerate and verify that reference for the analyzed revision; this extension does not compile or execute the application container.

Read the results

Boundary violations appear as Analyzer issues such as foreign-module-instance and forbidden-internal-access. Graph permissions produce scope-forbidden-entrypoint-method errors or scope-allowed-entrypoint-method notes. The graph-evidence note contains the shortest modeled path, policy ID, target and complete flag. scope-graph-incomplete means a reached part could not be proven; do not interpret missing denials as a clean graph when it appears. Reachable unproven recursion is recursive-cycle; a narrow guarded integer self-call with a positive literal decrement is classified as bounded-recursion.

When the graph is enabled and at least one PHP source is in its configured root, the Analyzer also emits one analysis-attestation note. Its bounded extension-attestation payload identifies the extension, version, scope_graph capability, source-file count and completeness. Proofs exceeding the 4096-byte evidence limit are omitted and make the whole graph attestation incomplete. Consumers that require graph coverage should require this note; its absence must not count as a clean run.

This is static evidence, not a runtime trace. It does not replace Mago's parse diagnostics or prove all PHP execution paths. Benchmark the full mago analyze run on your own project before setting a CI time budget.

Develop

The fictional corpora cover allowed, denied and incomplete paths through a real Mago worker. Licensed under MIT.


All versions of mago-architecture-graph with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
carthage-software/mago Version ^1.50
nikic/php-parser Version ^5.9
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 byte-kitsune/mago-architecture-graph contains the following files

Loading the files please wait ...