Download the PHP package phparkitect/phparkitect without Composer

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

📐 PHPArkitect

Latest Stable Version PHPArkitect Packagist codecov

  1. Introduction
  2. Installation
  3. Usage
  4. Available rules
  5. Rule Builders
  6. Integrations

Introduction

PHPArkitect helps you to keep your PHP codebase coherent and solid, by permitting to add some architectural constraint check to your workflow. You can express the constraint that you want to enforce, in simple and readable PHP code, for example:

Installation

Using Composer

Using a Phar

Sometimes your project can conflict with one or more of PHPArkitect's dependencies. In that case you may find the Phar (a self-contained PHP executable) useful.

The Phar can be downloaded from GitHub:

Usage

To use this tool you need to launch a command via Bash:

With this command phparkitect will search all rules in the root of your project the default config file called phparkitect.php. You can also specify your configuration file using --config option like this:

By default, a progress bar will show the status of the ongoing analysis.

Using a baseline file

If there are a lot of violations in your codebase and you can't fix them now, you can use the baseline feature to instruct the tool to ignore past violations.

To create a baseline file, run the check command with the generate-baseline parameter as follows:

This will create a phparkitect-baseline.json, if you want a different file name you can do it with:

It will produce a json file with the current list of violations.

If is present a baseline file with the default name will be used automatically.

To use a different baseline file, run the check command with the use-baseline parameter as follows:

To avoid using the default baseline file, you can use the skip-baseline option:

Line numbers in baseline

By default, the baseline check also looks at line numbers of known violations. When a line before the offending line changes, the line numbers change and the check fails despite the baseline.

With the optional flag ignore-baseline-linenumbers, you can ignore the line numbers of violations:

Warning: When ignoring line numbers, phparkitect can no longer discover if a rule is violated additional times in the same file.

Configuration

Example of configuration file phparkitect.php

PHPArkitect can detect violations also on DocBlocks custom annotations (like @Assert\NotBlank or @Serializer\Expose). If you want to disable this feature you can add this simple configuration:

Available rules

Hint: If you want to test how a Rule work, you can use the command like phparkitect debug:expression <RuleName> <arguments> to check which class satisfy the rule in your current folder.

For example: phparkitect debug:expression ResideInOneOfTheseNamespaces App


Currently, you can check if a class:

Depends on a namespace

Doc block contains a string

Doc block not contains a string

Extend another class

Has an attribute (requires PHP >= 8.0)

Have a name matching a pattern

Implements an interface

Not implements an interface

Is abstract

Is trait

Is final

Is readonly

Is interface

Is enum

Is not abstract

Is not trait

Is not final

Is not readonly

Is not interface

Is not enum

Not depends on a namespace

Not extend another class

Don't have dependency outside a namespace

Not have a name matching a pattern

Reside in a namespace

Not reside in a namespace

You can also define components and ensure that a component:

Check out this demo project to get an idea on how write rules.

Rule Builders

PHPArkitect offers some builders that enable you to implement more readable rules for specific contexts.

Component Architecture Rule Builder

Thanks to this builder you can define components and enforce dependency constraints between them in a more readable fashion.

Excluding classes when parser run

If you want to exclude some classes from the parser you can use the except function inside your config file like this:

You can use wildcards or the exact name of a class.

Optional parameters and options

You can add parameters when you launch the tool. At the moment you can add these parameters and options:

Run only a specific rule

For some reasons, you might want to run only a specific rule, you can do it using runOnlyThis like this:

Integrations

Laravel

If you plan to use Arkitect with Laravel, smortexa wrote a nice wrapper with some predefined rules for laravel: https://github.com/smortexa/laravel-arkitect


All versions of phparkitect with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1|^8
symfony/finder Version ^3.0|^4.0|^5.0|^6.0|^7.0
symfony/event-dispatcher Version ^3.0|^4.0|^5.0|^6.0|^7.0
symfony/console Version ^3.0|^4.0|^5.0|^6.0|^7.0
symfony/polyfill-php80 Version ^1.20
nikic/php-parser Version ~4
webmozart/assert Version ^1.9
ext-json Version *
phpstan/phpdoc-parser Version ^1.2
ondram/ci-detector Version ^4.1
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 phparkitect/phparkitect contains the following files

Loading the files please wait ....