Keep your architecture clean.

Overview

Deptrac

What is Deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers in your PHP projects.

For example, you can define a rule like "controllers may not depend on models". To ensure this, deptrac analyzes your code to find any usages of models in your controllers and will show you where this rule has been violated.

ModelController1

Table of Contents

  1. Getting Started
    1. The Depfile
    2. Explanation
  2. Installation
    1. PHAR
    2. Composer
    3. PHIVE
    4. Optional Dependency: Graphviz
  3. Run Deptrac
    1. Debug Layer
    2. Debug Class-Like
  4. Layers
    1. Collecting Layers
  5. Violations
  6. Ruleset (Allowing Dependencies)
  7. Different Layers and Different Views
  8. Collectors
    1. className Collector
    2. classNameRegex Collector
    3. directory Collector
    4. bool Collector
    5. method Collector
    6. implements Collector
    7. extends Collector
    8. uses Collector
    9. inherits Collector
    10. Custom Collectors
  9. Formatters
    1. Console Formatter
    2. Table Formatter
    3. Graphviz Formatter
    4. JUnit Formatter
    5. GitHubActions Formatter
    6. Baseline Formatter
  10. Uncovered dependencies
  11. Import depfiles
  12. Parameters
  13. Build Deptrac
  14. Contribute

Getting Started

The easiest way to get started is to download the latest deptrac.phar.

At first, you need a so called depfile, which is written in YAML. You can generate a bootstrapped depfile.yaml with:

php deptrac.phar init

In this file you define (mainly) three things:

  1. The location of your source code.
  2. The layers of your application.
  3. The allowed dependencies between your layers.

The Depfile

Let's have a look at the generated file:

# depfile.yaml
paths:
  - ./src
exclude_files:
  - '#.*test.*#'
layers:
  - name: Controller
    collectors:
      - type: className
        regex: .*Controller.*
  - name: Repository
    collectors:
      - type: className
        regex: .*Repository.*
  - name: Service
    collectors:
      - type: className
        regex: .*Service.*
ruleset:
  Controller:
    - Service
  Service:
    - Repository
  Repository: ~

Explanation

In the first section, paths, you declare where deptrac should look for your code. As this is an array of directories, you can specify multiple locations. Paths are relative to your depfile. It can be changed to the current working directory with setting following option use_relative_path_from_depfile: false.

With the exclude_files section, you can specify one or more regular expressions for files that should be excluded, the most common being probably anything containing the "test" word in the path.

We defined three layers in the example: Controller, Repository and Service. Deptrac is using so called collectors to group classes into layers. You can define it by the name of the class or by the FQCN.

The ruleset section defines, how these layers may or may not depend on other layers. In the example, every class of the Controller layer may depend on classes that reside in the Service layer, and classes in the Service layer may depend on classes in the Repository layer.

Classes in the Repository layer may NOT depend on any classes in other layers. The ruleset acts as a whitelist, therefore the Repository layer rules can be omitted, however explicitly stating that the layer may not depend on other layers is more declarative.

If a class in the Repository layer uses a class in the Service layer, deptrac will recognize the dependency and raises a violation for this case. The same counts if a Service layer class uses a Controller layer class.

Installation

PHAR

Download the latest deptrac.phar.

Run it using php deptrac.phar or feel free to add it to your PATH (i.e. /usr/local/bin/deptrac)

curl -LS https://github.com/qossmic/deptrac/releases/download/0.13.0/deptrac.phar -o deptrac.phar

# optional
sudo chmod +x deptrac.phar
sudo mv deptrac.phar /usr/local/bin/deptrac

(In this guide, we assume, you have the deptrac.phar in your project root)

Composer

We do not recommend installing this repository via Composer. Instead please use the dedicated distribution repository https://github.com/qossmic/deptrac-shim.

PHIVE

You can install Deptrac with Phive

phive install -g qossmic/deptrac

and accept the key with fingerprint ED42 E915 4E81 A416 E7FB A19F 4F2A B4D1 1A9A 65F7

To upgrade Deptrac use the following command:

phive update -g qossmic/deptrac

Optional Dependency: Graphviz

If you want to create graphical diagrams with your class dependencies, you will also need the dot command provided by Graphviz. Graphviz can be installed using common package managers:

# for osx + brew
brew install graphviz

# for ubuntu and debian
sudo apt-get install graphviz

Graphviz is also available for Windows: Install the current stable release and append the binary path on the environment variable Path (like C:\Program Files (x86)\Graphviz2.38\bin).

Run Deptrac

To execute deptrac, run

php deptrac.phar

# which is equivalent to
php deptrac.phar analyze depfile.yaml

If you run php deptrac.phar -v you'll get a more verbose output.

The analyse command runs with a caching mechanism for parsed files by default. This could be disabled with the --no-cache option.

Debug Layer

With the debug:layer-command you can list all class-likes wich are matched in a specific layer.

php deptrac.phar debug:layer examples/DirectoryLayer.depfile.yaml Layer1

---------------------------------------------
 Layer1
---------------------------------------------
 examples\Layer1\AnotherClassLikeAController
 examples\Layer1\SomeClass
 examples\Layer1\SomeClass2
---------------------------------------------

Debug Class-Like

With the debug:class-command you list all layers for a specific class-like.

php deptrac.phar debug:class-like examples/DirectoryLayer.depfile.yaml 'examples\Layer1\AnotherClassLikeAController'

 ---------------------------------------------
  examples\Layer1\AnotherClassLikeAController
 ---------------------------------------------
  Controller
  Layer1
 ---------------------------------------------

Layers

Deptrac allows you to group different classes into layers. Technically layers are nothing more than a collection of classes.

Each layer has a unique name and a list of one or more collectors, which will look for classes that should be assigned to this layer (and yes, classes can be assigned to more than one layer).

(Hopefully) most software is written with some kind of layers in mind. For example a typical MVC application has at least controllers, models and views.

Deptrac allows you to visualize and enforce rulesets, based on such layer information.

So you could define that every class that ends with Controller will be assigned to the Controller layer, and every class that has \Model\ in its namespace will be added to the Model layer.

Say you are adopting MVC, most of the time you do not want your models to access controllers, but it is allowed for controllers to access models. Deptrac allows you to enforce and visualize these dependencies/rules.

By default, all dependencies between layers are forbidden!

Collecting Layers

If your application has controllers and models, deptrac allows you to group them into layers.

paths:
  - ./examples/ModelController
exclude_files: ~
layers:
  - name: Models
    collectors:
      - type: className
        regex: .*MyNamespace\\Models\\.*
  - name: Controller
    collectors:
      - type: className
        regex: .*MyNamespace\\.*Controller.*
ruleset: []

At first, lets take a closer look at the first layer (named Models).

Here we decided that our software has some kind of layer called Models. You assign classes to this layer with the help of Collectors.

Collectors are responsible for taking a closer look at your code and decide if a class is part of a layer. By using the className collector you can define a regular expression for a class name. Every (fully qualified) class name that matches this regular expression becomes part of the assigned layer. In this example we define that every class that contains MyNamespace\Models\ will be a part of the Model layer.

Every class that matches .*MyNamespace\\.*Controller.* will become a part of the Controller layer.

As we defined our layers, we can generate a dependency graph for the example configuration: (Make sure that Graphviz (dot) is installed on your system)

php deptrac.php analyze examples/ModelController1.depfile.yaml

After deptrac has finished, an image should be opened:

ModelController1

On your command line deptrac will produce this output:

Start to create an AstMap for 2 Files.
..
AstMap created.
start emitting dependencies "InheritanceDependencyEmitter"
start emitting dependencies "BasicDependencyEmitter"
end emitting dependencies
start flatten dependencies
end flatten dependencies
collecting violations.
formatting dependencies.

Found 0 Violations

The output shows, that deptrac is parsing 2 files and found 0 violations. By default every dependency between layers is a violation. In our case there are (for now) no dependencies between our classes (layers). So it's fine that deptrac will show us 2 independent layers without any relationship.

Violations

If we have 2 layers (Models, Controller) and one layer is using the other, deptrac will raise a violation by default:

// see the example in examples/ModelController2
namespace examples\MyNamespace\Controllers;

use examples\MyNamespace\Models\SomeModel;

class SomeController
{
    public function foo(SomeModel $m) {
        return $m;
    }
}

After running deptrac for this example

php deptrac.php analyze examples/ModelController2.depfile.yaml

we will get this output:

Start to create an AstMap for 2 Files.
..
AstMap created.
start emitting dependencies "InheritanceDependencyEmitter"
start emitting dependencies "BasicDependencyEmitter"
end emitting dependencies
start flatten dependencies
end flatten dependencies
collecting violations.
formatting dependencies.
examples\MyNamespace\Controllers\SomeController::5 must not depend on examples\MyNamespace\Models\SomeModel (Controller on Models)
examples\MyNamespace\Controllers\SomeController::9 must not depend on examples\MyNamespace\Models\SomeModel (Controller on Models)

Found 2 Violations

ModelController1

Deptrac has found two violations because the relation from the controller to model layers is not allowed. The console output shows exactly the lines deptrac found.

Skip violations

Deptrac integration into existing CI/CD pipeline might be difficult because of existing dependency violations in the code. In this case, you can skip existing violations to gradually improve your code and avoid possibility introduce any new violations.

Violations can be skipped by provided list of dependencies in skip_violations configuration section:

skip_violations:
  Library\LibClass:
    - Core\CoreClass

skip_violations section contains an associative array where a key (Library\LibClass) is the name of dependant class and values (Core\CoreClass) are dependency classes.

Matched violations will be marked as skipped:

php deptrac.php analyze examples/SkipViolations.yaml --report-skipped
1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[SKIPPED] Library\LibClass must not depend on Core\CoreClass (Library on Core)
/path/examples/SkipViolations/SkipViolations.php::11

[ERROR] Skipped violation "Core\Unmatched" for "Library\LibClass" was not matched.

Report:
Violations: 0
Skipped violations: 1
Uncovered: 0
Allowed: 1

Ruleset (Allowing Dependencies)

Allowed dependencies between layers are configured in rulesets.

By default deptrac will raise a violation for every dependency between layers. In real software you want to allow dependencies between different kinds of layers.

As a lot of architectures define some kind of controllers, services and repositories, a natural approach for this would be to define these rules:

  • Controllers may access services, but not repositories.
  • Services may access repositories, but not controllers.
  • Repositories neither may access services nor controllers.

We can define this using the following depfile:

paths:
  - ./examples/ControllerServiceRepository1/
exclude_files: ~
layers:
  - name: Controller
    collectors:
      - type: className
        regex: .*MyNamespace\\.*Controller.*
  - name: Repository
    collectors:
      - type: className
        regex: .*MyNamespace\\.*Repository.*
  - name: Service
    collectors:
      - type: className
        regex: .*MyNamespace\\.*Service.*
ruleset:
  Controller:
    - Service
  Service:
    - Repository
  Repository: ~

Take a closer look at the ruleset. We whitelist that Controller can access Service and Service can access Repository.

After running deptrac we will get this result:

ModelController1

Start to create an AstMap for 3 Files.
...
AstMap created.
start emitting dependencies "InheritanceDependencyEmitter"
start emitting dependencies "BasicDependencyEmitter"
end emitting dependencies
start flatten dependencies
end flatten dependencies
collecting violations.
formatting dependencies.
examples\MyNamespace\Repository\SomeRepository::5 must not depend on examples\MyNamespace\Controllers\SomeController (Repository on Controller)

Deptrac now finds a violation. If we take a closer look at the "SomeRepository" on line 5, we will see an unused use statement for a controller:

namespace examples\MyNamespace\Repository;

use examples\MyNamespace\Controllers\SomeController;

class SomeRepository { }

If we remove the use statement and rerun deptrac, the violation will disappear.

Different Layers and Different Views

In the example above we defined 3 different layers (controller, repository and service). Deptrac gives architects the power to define what kind of layers exist.

Typically usecases are:

  • caring about layers in different architectures (tier, hexagonal, ddd, ...)
  • caring about dependencies between different kinds of services (infrastructure services / domain services / entities / DTOs / ...)
  • caring about coupling to third party code like composer vendors, frameworks, ...
  • enforcing naming conventions
  • ...

Typically software has more than just one view. It is possible to use multiple depfiles, to take care about different architectural views.

Collectors

Collectors decide if a node (typically a class) is part of a layer. Deptrac will support more collectors out of the box and will provide an easy way to extend deptrac with custom collectors.

Technically, deptrac creates an AST from your code and groups nodes to different layers.

className Collector

The className collector allows collecting classes by matching their fully qualified name to a simplified regular expression. Any matching class will be added to the assigned layer.

layers:
  - name: Controller
    collectors:
      - type: className
        regex: .*Controller.*

Every class name that matches the regular expression becomes a part of the controller layer. This collector has predefined delimiters and modifier: /YOUR_EXPRESSION/i

classNameRegex Collector

The classNameRegex collector allows collecting classes by matching their fully qualified name to a regular expression. Any matching class will be added to the assigned layer.

layers:
  - name: Controller
    collectors:
      - type: classNameRegex
        regex: '#.*Controller.*#'

Every class name that matches the regular expression becomes a part of the controller layer.

directory Collector

The directory collector allows collecting classes by matching their file path they are declared in to a simplified regular expression. Any matching class will be added to the assigned layer.

layers:
  - name: Controller
    collectors:
      - type: directory
        regex: src/Controller/.*

Every file path that matches the regular expression src/Controller/.* becomes a part of the controller layer. This collector has predefined delimiters and modifier: #YOUR_EXPRESSION#i

bool Collector

The bool collector allows combining other collectors with or without negation.

layers:
  - name: Asset
    collectors:
      - type: bool
        must:
          - type: className
            regex: .*Foo\\.*
          - type: className
            regex: .*\\Asset.*
        must_not:
          - type: className
            regex: .*Assetic.*

Every class contains Foo\ AND \Asset and NOT Assetic, will become a part of the Asset layer.

method Collector

The method collector allows collecting classes by matching their methods name to a regular expression. Any matching class will be added to the assigned layer.

layers:
  - name: Foo services
    collectors:
      - type: method
        name: .*foo

Every class having a method that matches the regular expression .*foo, e.g. getFoo() or setFoo() becomes a part of the Foo services layer.

implements Collector

The implements collector allows collecting classes implementing a specified interface by matching recursively for a fully qualified interface name.

layers:
  - name: Foo
    collectors:
      - type: implements
        implements: 'App\SomeInterface'

extends Collector

The extends collector allows collecting classes extending a specified class by matching recursively for a fully qualified class or interface name.

layers:
  - name: Foo
    collectors:
      - type: extends
        extends: 'App\SomeClass'

uses Collector

The uses collector allows collecting classes using a specified trait by matching recursively for a fully qualified trait name.

layers:
  - name: Foo
    collectors:
      - type: uses
        uses: 'App\SomeTrait'

inherits Collector

The inherits collector allows collecting classes inheriting from a specified class, whether by implementing an interface, extending another class or by using a trait, by matching recursively for a fully qualified class name.

layers:
  - name: Foo
    collectors:
      - type: inherits
        inherits: 'App\SomeInterface'

Custom Collectors

You can even create custom collectors in your project by implementing the Qossmic\Deptrac\Collector\CollectorInterface. As soon as an unknown collector is referenced in the config file deptrac will try to load the class in your project. With this you can create collectors specific for your usecase. And more people can use these custom collectors per default if you contribute them back to deptrac!

Formatters

Deptrac has support for different output formatters with various options.

You can get a list of available formatters by running,

php deptrac.php analyze --help

Hint: Symfony Console does not allow to pass options to the default command. Therefore in order to use the formatter options you have to explicitly use the analyze command as shown above.

Console Formatter

The default formatter is the console formatter, which dumps basic information to STDOUT,

examples\MyNamespace\Repository\SomeRepository::5 must not depend on examples\MyNamespace\Controllers\SomeController (Repository on Controller)

Table Formatter

The table formatter groups results by layers to its own table. It can be activated with --formatter=table.

Graphviz Formatter

The Graphviz formatter is disabled by default. It can be activated with --formatter=graphviz. Deptrac automatically tries to open the image generated by Graphviz. You can disable automatic opening of the image by setting the --graphviz-display=false option, which is useful on CI-servers.

Supported options:

--graphviz-display=           should try to open graphviz image [default: true]
--graphviz-dump-image=        path to a dumped png file [default: ""]
--graphviz-dump-dot=          path to a dumped dot file [default: ""]
--graphviz-dump-html=         path to a dumped html file [default: ""]

Hint: You can create an image, a dot and an HTML file at the same time.

JUnit Formatter

The JUnit formatter dumps a JUnit Report XML file, which is quite handy in CI environments. It is disabled by default, to activate the formatter just use --formatter=junit.

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite id="1" package="" name="Controller" timestamp="2018-06-07T10:09:34+00:00" hostname="localhost" tests="3" failures="2" errors="0" time="0">
    <testcase name="Controller-examples\Layer1\AnotherClassLikeAController" classname="examples\Layer1\AnotherClassLikeAController" time="0">
      <failure message="examples\Layer1\AnotherClassLikeAController:5 must not depend on examples\Layer2\SomeOtherClass (Controller on Layer2)" type="WARNING"/>
      <failure message="examples\Layer1\AnotherClassLikeAController:23 must not depend on examples\Layer2\SomeOtherClass (Controller on Layer2)" type="WARNING"/>
    </testcase>
  </testsuite>
  <testsuite id="2" package="" name="Layer2" timestamp="2018-06-07T10:09:34+00:00" hostname="localhost" tests="3" failures="4" errors="0" time="0">
    <testcase name="Layer2-examples\Layer2\SomeOtherClass2" classname="examples\Layer2\SomeOtherClass2" time="0">
      <failure message="examples\Layer2\SomeOtherClass2:5 must not depend on examples\Layer1\SomeClass2 (Layer2 on Layer1)" type="WARNING"/>
      <failure message="examples\Layer2\SomeOtherClass2:17 must not depend on examples\Layer1\SomeClass2 (Layer2 on Layer1)" type="WARNING"/>
    </testcase>
    <testcase name="Layer2-examples\Layer2\SomeOtherClass" classname="examples\Layer2\SomeOtherClass" time="0">
      <failure message="examples\Layer2\SomeOtherClass:5 must not depend on examples\Layer1\SomeClass (Layer2 on Layer1)" type="WARNING"/>
      <failure message="examples\Layer2\SomeOtherClass:17 must not depend on examples\Layer1\SomeClass (Layer2 on Layer1)" type="WARNING"/>
    </testcase>
  </testsuite>
</testsuites>

Supported options:

--junit-dump-xml=     path to a dumped xml file [default: "./junit-report.xml"]

GitHubActions Formatter

The GithubActions formatter is a console formater, which dumps basic information in github-actions format to STDOUT. This formatter is enabled by default while running in a github actions environment. It can be activated manually with --formatter=github-actions.

::error file=/home/testuser/originalA.php,line=12::ACME\OriginalA must not depend on ACME\OriginalB (LayerA on LayerB)

Baseline Formatter

The Baseline formatter is a console formater, which generates the skip_violations section to the given File. With this formatter it's possible to start on a project with some violations without a failing CI Build.

Note: It's not the best solution to ignore all the errors because maybe your current Architecture doesn't allow a change without a new violation.

It can be activated with --formatter=baseline.

Supported options:

--baseline-dump[=BASELINE-DUMP] path to a dumped baseline file [default: "./depfile.baseline.yml"]

Include the baseline into your existing depfile.yml

# depfile.yml
baseline: depfile.baseline.yml

Uncovered dependencies

Deptrac collects uncovered dependencies which could be reported with Console Formatter. By default, internal php classes will be ignored. This could be changed by adding ignore_uncovered_internal_classes: false to your depfile.

Use --fail-on-uncovered option to fail on uncovered dependencies. Use --report-uncovered option to report uncovered dependencies.

Import depfiles

It is possible to import other depfile definitions in your depfile as followed:

imports:
   - some/depfile.yaml

Parameters

Parameters can be used in a collector's configuration.
Deptrac provides predefined parameters:

  • %currentWorkingDirectory% The path deptrac has been executed
  • %depfileDirectory% The path where the depfile is stored.

Custom parameters can be configured as followed:

parameters:
    Project: MyProject

layers:
   - name: Foo
     collectors:
        - type: implements
          implements: '%Project%\SomeInterface'

Build Deptrac

To build deptrac, clone this repository and ensure you have the build dependencies installed:

cd into your cloned directory, and call make build.

git clone https://github.com/qossmic/deptrac.git
cd deptrac
make build

This will create an executable file deptrac.phar in the current directory. In order to use deptrac globally on your system, feel free to add it to your PATH (i.e. /usr/local/bin).

Contribute

Deptrac is in a very early state, so it needs you to make it more awesome.

Feel free to report bugs, improve the documentation, request or even implement new features.

Comments
  • Enhancement: Ignored/Exempt Layers

    Enhancement: Ignored/Exempt Layers

    I would like a way to define a layer that was available for dependency checks to other layers but otherwise exempt from validation. See also the conversation at: https://github.com/qossmic/deptrac/issues/506

    This might be beyond me for my first PR but I would be willing to try. I imagine it working with a special modifier like ~ (maybe + as a nod to transitive dependencies?). Those this would be a valid depfile:

    layers:
      - name: Core
        collectors:
          - type: className
            regex: Core
      - name: Module
        collectors:
          - type: className
            regex: Module
    
    ruleset:
      Core: +
      Module:
        - Core
    
    help wanted 
    opened by MGatner 18
  • Internal - Refactor AstRunner to support parsing more than classes

    Internal - Refactor AstRunner to support parsing more than classes

    Right now the whole AstRunner part of the codebase presumes that we are parsing classes only. This assumption runs deep across the codebase.

    Right now we have an issue requesting support for parsing function https://github.com/qossmic/deptrac/issues/331 Also, there is another issue requesting support for parsing global variables/superglobals https://github.com/qossmic/deptrac/issues/473

    After a Slack discussion with @dbrumann, I created this issue, where we can discuss what/how needs to be changed.

    cc @smoench, @slde-flash we would welcome your input on this, as you are more familiar with this part of the codebase.

    someone works on 
    opened by patrickkusebauch 18
  • test-suite doesn't green on windows

    test-suite doesn't green on windows

    running the testsuite on a windows box lead to a lot of errors.

    ...<snip>
    
    C:\dvl\GitHub\deptrac\tests\OutputFormatter\BaselineOutputFormatterTest.php:115
    
    31) Tests\Qossmic\Deptrac\OutputFormatter\BaselineOutputFormatterTest::testBasic with data set #1 (array(Qossmic\Deptrac\RulesetEngine\Violation Object (...)), 'skip_violations:\r\n  Origina...lB\r\n')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -'skip_violations:\r\n
    -  OriginalA:\r\n
    -    - OriginalB\r\n
    +'skip_violations:\n
    +  OriginalA:\n
    +    - OriginalB\n
     '
    
    C:\dvl\GitHub\deptrac\tests\OutputFormatter\BaselineOutputFormatterTest.php:115
    
    32) Tests\Qossmic\Deptrac\OutputFormatter\BaselineOutputFormatterTest::testBasic with data set #0 (array(Qossmic\Deptrac\RulesetEngine\Violation Object (...)), 'skip_violations:\r\n  ClassA:...sB\r\n')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -'skip_violations:\r\n
    -  ClassA:\r\n
    -    - ClassB\r\n
    +'skip_violations:\n
    +  ClassA:\n
    +    - ClassB\n
     '
    
    C:\dvl\GitHub\deptrac\tests\OutputFormatter\BaselineOutputFormatterTest.php:115
    
    FAILURES!
    Tests: 283, Assertions: 466, Failures: 32.
    

    it seems most of them are related to mixed line-endings.

    bug help wanted 
    opened by staabm 16
  • using `/vendor/` as a layer

    using `/vendor/` as a layer

    we want to minimize dependencies on external libraries (those installed via composer), or at least allow using those externals only from certain layers.

    from a architecture perspective we want 3rd party code only allow within the Integration layer.

    we try to use something like this (simplified):

    paths:
      - app/
    layers:
      - name: Controller
        collectors:
          - type: className
            regex: .*Controller.*
      - name: Business
        collectors:
          - type: className
            regex: .*\\business\\.*
      - name: BusinessException
        collectors:
          - type: className
            regex: .*\\exception\\.*
      - name: Vendor
        collectors:
          - type: directory
            regex: .*/vendor/.*
    ruleset:
      Controller:
        - ViewModel
      Business:
        - BusinessException
      Integration:
        - Business
        - Vendor
    

    we are wondering why we don't see a violation for the following code

    // app/portal/controllers/AuthenticationController.php
    <?php
    
    class AuthenticationController extends ApplicationController
    {
        public function createArchitectureErrorForTesting(): void
        {
            $test = (new \ZxcvbnPhp\Zxcvbn())->passwordStrength('xyt');
        }
    }
    

    the mentioned lib is installed via composer.json

    {
    ...
        "require" : {
            "ext-json": "*",
            "ext-soap": "*",
            "bjeavons/zxcvbn-php": "^1.2"
        },
    ...
    

    PS: using the regex on /vendor/ a few packages would be whitelisted via negative lookahead or similar (e.g. framework packages)

    opened by staabm 16
  • Load Collectors by FQCN

    Load Collectors by FQCN

    This patch enables the registry to load collectors by FQCN if not already present in the cache the missing object gets initiated and added to the cache.

    Should fix #164

    enhancement 
    opened by DanielBadura 16
  • Enhancement: skip_violations for traits

    Enhancement: skip_violations for traits

    Currently allowing a violation in a trait:

    skip_violations:
      CodeIgniter\HTTP\ResponseTrait:
        - CodeIgniter\Pager\PagerInterface
    

    ... will not apply to any of the classes that use the trait, requiring every class to apply the exemption as well.

    ----------- ------------------------------------------------------------------------------------------------ 
      Reason      HTTP                                                                                            
     ----------- ------------------------------------------------------------------------------------------------ 
      Violation   CodeIgniter\HTTP\ResponseInterface must not depend on CodeIgniter\Pager\PagerInterface (Pager)  
                  /opt/CodeIgniter4/system/HTTP/ResponseInterface.php:16                                          
      Violation   CodeIgniter\HTTP\ResponseInterface must not depend on CodeIgniter\Pager\PagerInterface (Pager)  
                  /opt/CodeIgniter4/system/HTTP/ResponseInterface.php:189                                         
      Violation   CodeIgniter\HTTP\ResponseInterface must not depend on CodeIgniter\Pager\PagerInterface (Pager)  
                  /opt/CodeIgniter4/system/HTTP/ResponseInterface.php:178                                         
      Violation   CodeIgniter\HTTP\Response must not depend on CodeIgniter\Pager\PagerInterface (Pager)           
                  CodeIgniter\HTTP\ResponseInterface::32 ->                                                       
                  CodeIgniter\Pager\PagerInterface::16                                                            
                  /opt/CodeIgniter4/system/HTTP/ResponseInterface.php:16                                          
      Violation   CodeIgniter\HTTP\Response must not depend on CodeIgniter\Pager\PagerInterface (Pager)           
                  CodeIgniter\HTTP\ResponseInterface::32 ->                                                       
                  CodeIgniter\Pager\PagerInterface::189                                                           
                  /opt/CodeIgniter4/system/HTTP/ResponseInterface.php:189                                         
      Violation   CodeIgniter\HTTP\Response must not depend on CodeIgniter\Pager\PagerInterface (Pager)           
                  CodeIgniter\HTTP\ResponseInterface::32 ->                                                       
                  CodeIgniter\Pager\PagerInterface::178                                                           
                  /opt/CodeIgniter4/system/HTTP/ResponseInterface.php:178                                         
      Violation   CodeIgniter\HTTP\Response must not depend on CodeIgniter\Pager\PagerInterface (Pager)           
                  CodeIgniter\HTTP\ResponseTrait::34 ->                                                           
                  CodeIgniter\Pager\PagerInterface::18                                                            
                  /opt/CodeIgniter4/system/HTTP/ResponseTrait.php:18                                              
      Violation   CodeIgniter\HTTP\Response must not depend on CodeIgniter\Pager\PagerInterface (Pager)           
                  CodeIgniter\HTTP\ResponseTrait::34 ->                                                           
                  CodeIgniter\Pager\PagerInterface::196                                                           
                  /opt/CodeIgniter4/system/HTTP/ResponseTrait.php:196                                             
      Violation   CodeIgniter\HTTP\Response must not depend on CodeIgniter\Pager\PagerInterface (Pager)           
                  CodeIgniter\HTTP\ResponseTrait::34 ->                                                           
                  CodeIgniter\Pager\PagerInterface::185                                                           
                  /opt/CodeIgniter4/system/HTTP/ResponseTrait.php:185                                             
      Violation   CodeIgniter\HTTP\RedirectResponse must not depend on CodeIgniter\Pager\PagerInterface (Pager)   
                  CodeIgniter\HTTP\Response::21 ->                                                                
                  CodeIgniter\HTTP\ResponseInterface::32 ->                                                       
                  CodeIgniter\Pager\PagerInterface::16                                                            
                  /opt/CodeIgniter4/system/HTTP/ResponseInterface.php:16                                          
      Violation   CodeIgniter\HTTP\RedirectResponse must not depend on CodeIgniter\Pager\PagerInterface (Pager)   
                  CodeIgniter\HTTP\Response::21 ->                                                                
                  CodeIgniter\HTTP\ResponseInterface::32 ->                                                       
                  CodeIgniter\Pager\PagerInterface::189                                                           
                  /opt/CodeIgniter4/system/HTTP/ResponseInterface.php:189                                         
      Violation   CodeIgniter\HTTP\RedirectResponse must not depend on CodeIgniter\Pager\PagerInterface (Pager)   
                  CodeIgniter\HTTP\Response::21 ->                                                                
                  CodeIgniter\HTTP\ResponseInterface::32 ->                                                       
                  CodeIgniter\Pager\PagerInterface::178                                                           
                  /opt/CodeIgniter4/system/HTTP/ResponseInterface.php:178                                         
      Violation   CodeIgniter\HTTP\RedirectResponse must not depend on CodeIgniter\Pager\PagerInterface (Pager)   
                  CodeIgniter\HTTP\Response::21 ->                                                                
                  CodeIgniter\HTTP\ResponseTrait::34 ->                                                           
                  CodeIgniter\Pager\PagerInterface::18                                                            
                  /opt/CodeIgniter4/system/HTTP/ResponseTrait.php:18                                              
      Violation   CodeIgniter\HTTP\RedirectResponse must not depend on CodeIgniter\Pager\PagerInterface (Pager)   
                  CodeIgniter\HTTP\Response::21 ->                                                                
                  CodeIgniter\HTTP\ResponseTrait::34 ->                                                           
                  CodeIgniter\Pager\PagerInterface::196                                                           
                  /opt/CodeIgniter4/system/HTTP/ResponseTrait.php:196                                             
      Violation   CodeIgniter\HTTP\RedirectResponse must not depend on CodeIgniter\Pager\PagerInterface (Pager)   
                  CodeIgniter\HTTP\Response::21 ->                                                                
                  CodeIgniter\HTTP\ResponseTrait::34 ->                                                           
                  CodeIgniter\Pager\PagerInterface::185                                                           
                  /opt/CodeIgniter4/system/HTTP/ResponseTrait.php:185                                             
      Violation   CodeIgniter\HTTP\DownloadResponse must not depend on CodeIgniter\Pager\PagerInterface (Pager)   
                  CodeIgniter\HTTP\Response::21 ->                                                                
                  CodeIgniter\HTTP\ResponseInterface::32 ->                                                       
                  CodeIgniter\Pager\PagerInterface::16                                                            
                  /opt/CodeIgniter4/system/HTTP/ResponseInterface.php:16                                          
      Violation   CodeIgniter\HTTP\DownloadResponse must not depend on CodeIgniter\Pager\PagerInterface (Pager)   
                  CodeIgniter\HTTP\Response::21 ->                                                                
                  CodeIgniter\HTTP\ResponseInterface::32 ->                                                       
                  CodeIgniter\Pager\PagerInterface::189                                                           
                  /opt/CodeIgniter4/system/HTTP/ResponseInterface.php:189                                         
      Violation   CodeIgniter\HTTP\DownloadResponse must not depend on CodeIgniter\Pager\PagerInterface (Pager)   
                  CodeIgniter\HTTP\Response::21 ->                                                                
                  CodeIgniter\HTTP\ResponseInterface::32 ->                                                       
                  CodeIgniter\Pager\PagerInterface::178                                                           
                  /opt/CodeIgniter4/system/HTTP/ResponseInterface.php:178                                         
      Violation   CodeIgniter\HTTP\DownloadResponse must not depend on CodeIgniter\Pager\PagerInterface (Pager)   
                  CodeIgniter\HTTP\Response::21 ->                                                                
                  CodeIgniter\HTTP\ResponseTrait::34 ->                                                           
                  CodeIgniter\Pager\PagerInterface::18                                                            
                  /opt/CodeIgniter4/system/HTTP/ResponseTrait.php:18                                              
      Violation   CodeIgniter\HTTP\DownloadResponse must not depend on CodeIgniter\Pager\PagerInterface (Pager)   
                  CodeIgniter\HTTP\Response::21 ->                                                                
                  CodeIgniter\HTTP\ResponseTrait::34 ->                                                           
                  CodeIgniter\Pager\PagerInterface::196                                                           
                  /opt/CodeIgniter4/system/HTTP/ResponseTrait.php:196                                             
      Violation   CodeIgniter\HTTP\DownloadResponse must not depend on CodeIgniter\Pager\PagerInterface (Pager)   
                  CodeIgniter\HTTP\Response::21 ->                                                                
                  CodeIgniter\HTTP\ResponseTrait::34 ->                                                           
                  CodeIgniter\Pager\PagerInterface::185                                                           
                  /opt/CodeIgniter4/system/HTTP/ResponseTrait.php:185                                             
     ----------- ------------------------------------------------------------------------------------------------ 
    
    help wanted no-issue-activity 
    opened by MGatner 14
  • `\` vs `\\`  in depfile

    `\` vs `\\` in depfile

    my testing on windows suggests that the example mentioned in the readme

    layers:
      - name: Foo
        collectors:
          - type: implements
            implements: 'App\SomeInterface'
    

    does not work.

    it works after adjusting it to

    layers:
      - name: Foo
        collectors:
          - type: implements
            implements: 'App\\SomeInterface'
    

    is this a windows only issue? is the example in the readme wrong?

    opened by clxmstaab 14
  • Exclude classes with `@internal` from collection

    Exclude classes with `@internal` from collection

    See #538

    To Do:

    • [x] Read @internal in class doc block
    • [x] Add flag to AstClassReference for @internal
    • [x] Provide collector for classes flagged as @internal
    no-pr-activity 
    opened by dbrumann 13
  • DirectoryCollector not working

    DirectoryCollector not working

    Hi,

    i'm trying to add my vendor directory as a layer to track dependencies. I get the following error:

    PHP Fatal error:  Uncaught Error: Call to a member function getFilepath() on null in phar:///home/user/projects/project/bin/deptrac.phar/src/Collector/DirectoryCollector.php:39
    Stack trace:
    #0 phar:///home/user/projects/project/bin/deptrac.phar/src/ClassNameLayerResolver.php(64): SensioLabs\Deptrac\Collector\DirectoryCollector->satisfy(Array, Object(SensioLabs\AstRunner\AstParser\NikicPhpParser\AstClassReference), Object(SensioLabs\AstRunner\AstMap), Object(SensioLabs\Deptrac\CollectorFactory), Object(SensioLabs\AstRunner\AstParser\NikicPhpParser\NikicPhpParser))
    #1 phar:///home/user/projects/project/bin/deptrac.phar/src/ClassNameLayerResolverCacheDecorator.php(23): SensioLabs\Deptrac\ClassNameLayerResolver->getLayersByClassName('Exception')
    #2 phar:///home/user/projects/project/bin/deptrac.phar/src/RulesetEngine.php(25): SensioLabs\Deptrac\ClassNameLayerResolverCacheDecorator->getLayersByClassName('Exception')
    #3 phar:///home/user/projects/project in phar:///home/user/projects/project/bin/deptrac.phar/src/Collector/DirectoryCollector.php on line 39
    

    My configuration for the layer looks like this:

    - name: Vendor
        collectors:
          - type: directory
            regex: vendor/.*
    

    The configuration follows the documentation, I also tried different regex and escaping of the slash etc.

    Any ideas?

    Love this tool by the way ;)

    bug 
    opened by maxkaemmerer 12
  • added windows-ci github-action

    added windows-ci github-action

    https://github.com/qossmic/deptrac/pull/700 should be merged before we discuss this PR, as it partly depends on the changes

    closes https://github.com/qossmic/deptrac/issues/586

    opened by staabm 11
  • Bool Collector: Multiple Class Layers

    Bool Collector: Multiple Class Layers

    Off this recommendation I am implementing the Bool Collector. I think I have it configured all correctly, but I am receiving warnings about classes existing in multiple layers that they clearly should not qualify for.

    Here is an example message:

    Tatter\Users\Entities\MythEntity is in more than one layer ["Entity", "Other Entity"]. It is recommended that one class should only be in one layer.

    An example of the generating files: https://github.com/tattersoftware/codeigniter4-workflows/pull/34/files

    And the full output, in case that is helpful: https://github.com/tattersoftware/codeigniter4-workflows/runs/2968297790?check_suite_focus=true

    Note: This is a work in progress, I realize some things in the depfile are wonky but I don't think that is the issue.

    opened by MGatner 11
  • Bump phpstan/phpstan-symfony from 1.2.14 to 1.2.19

    Bump phpstan/phpstan-symfony from 1.2.14 to 1.2.19

    Bumps phpstan/phpstan-symfony from 1.2.14 to 1.2.19.

    Release notes

    Sourced from phpstan/phpstan-symfony's releases.

    1.2.19

    • dac2474 - Add generics for PasswordUpgraderInterface
    • 72cf8cf - Update release-toot.yml
    • 4a920ef - Create release-toot.yml

    1.2.18

    • 3178f15 - Revert "Remove nullable type after calling HeaderBag::has"

    1.2.17

    • 7389207 - Remove nullable type after calling HeaderBag::has
    • c55237a - Update dessant/lock-threads action to v4
    • e088444 - Fix build

    1.2.16

    • d6ea162 - Fix Envelope::all() return type

    1.2.15

    • 7210072 - Improve Envelope::all() return type
    • e5e807b - Update metcalfc/changelog-generator action to v4
    Commits
    • dac2474 Add generics for PasswordUpgraderInterface
    • 72cf8cf Update release-toot.yml
    • 4a920ef Create release-toot.yml
    • 3178f15 Revert "Remove nullable type after calling HeaderBag::has"
    • 7389207 Remove nullable type after calling HeaderBag::has
    • c55237a Update dessant/lock-threads action to v4
    • e088444 Fix build
    • d6ea162 Fix Envelope::all() return type
    • 7210072 Improve Envelope::all() return type
    • e5e807b Update metcalfc/changelog-generator action to v4
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump phpstan/phpdoc-parser from 1.13.0 to 1.15.3

    Bump phpstan/phpdoc-parser from 1.13.0 to 1.15.3

    Bumps phpstan/phpdoc-parser from 1.13.0 to 1.15.3.

    Release notes

    Sourced from phpstan/phpdoc-parser's releases.

    1.15.3

    • 61800f7 - Fix ConstExprArrayItemNode::__toString()
    • 57918d9 - Create release-toot.yml

    1.15.2

    1.15.1

    • 950bddf - Support unsealed array shapes

    1.15.0

    • 6ff970a - Fix tests
    • 2a4686e - Add generics support to @method definitions
    • c7c2609 - Update dessant/lock-threads action to v4

    1.14.0

    • df1a794 - Generics type projections (call-site variance)

    1.13.1

    • aac4411 - Add specialized tags support
    • 066f9d0 - Update send-pr.yml
    • 4f28c2e - Update metcalfc/changelog-generator action to v4
    Commits
    • 61800f7 Fix ConstExprArrayItemNode::__toString()
    • 57918d9 Create release-toot.yml
    • 5941477 Fix printing nodes
    • 950bddf Support unsealed array shapes
    • 6ff970a Fix tests
    • 2a4686e Add generics support to @method definitions
    • c7c2609 Update dessant/lock-threads action to v4
    • df1a794 Generics type projections (call-site variance)
    • aac4411 Add specialized tags support
    • 066f9d0 Update send-pr.yml
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • CodeClimate Report: location/path must be set from repository root

    CodeClimate Report: location/path must be set from repository root

    Hi,

    the code-climate report generated with -f codeclimate has an issue: The entry for location/path per issue must be set relative to the repository root. Currently this is set as an absolute path.

    This is a problem for GitLab CI which sets an URL in its interface relative to this path in the repository. This is also stated in the GitLab CI documentation: https://docs.gitlab.com/ee/ci/testing/code_quality.html#implementing-a-custom-tool

    location.path | The relative path to the file containing the code quality violation.

    F.e.:

    [
        {
            "type": "issue",
            "check_name": "Dependency violation",
            "description": "App\\GreetingService has uncovered dependency on App\\Greeting\\GreetingInterface (Interface)",
            "categories": [
                "Style",
                "Complexity"
            ],
            "severity": "major",
            "location": {
                "path": "\/builds\/group\/example\/src\/GreetingService.php",
                "lines": {
                    "begin": 9
                }
            }
        },
    

    which generates a URL in GitLab like https://gitlab.com/group/example/-/blob/9013bc9744e99436767e0ef57d0fbcf6a7f5//builds/group/example/src/GreetingService.php#L9

    Possible solution: Cut everything from the path up to the working directory of deptrac or determine path based on paths in the deptrac config/option.

    opened by codegain 0
  • Bump symfony/console from 6.1.7 to 6.2.2

    Bump symfony/console from 6.1.7 to 6.2.2

    Bumps symfony/console from 6.1.7 to 6.2.2.

    Release notes

    Sourced from symfony/console's releases.

    v6.2.2

    Changelog (https://github.com/symfony/console/compare/v6.2.1...v6.2.2)

    • bug #48681 Revert "bug #48089 Fix clear line with question in section (maxbeckers) (chalasr)
    • bug #48580 Fix missing command not matching namespace error message (Titouan Galopin)
    • bug #48089 Fix clear line with question in section (maxbeckers)

    v6.2.1

    Changelog (https://github.com/symfony/console/compare/v6.2.0...v6.2.1)

    • bug #48428 Fixed undefined variable error (Kevin Meijer)

    v6.2.0

    Changelog (https://github.com/symfony/console/compare/v6.2.0-RC2...v6.2.0)

    • no significant changes

    v6.2.0-RC2

    Changelog (https://github.com/symfony/console/compare/v6.2.0-RC1...v6.2.0-RC2)

    • no significant changes

    v6.2.0-RC1

    Changelog (https://github.com/symfony/console/compare/v6.2.0-BETA3...v6.2.0-RC1)

    • bug #48179 Support completion for bash functions (Chi-teck)

    v6.2.0-BETA3

    Changelog (https://github.com/symfony/console/compare/v6.2.0-BETA2...v6.2.0-BETA3)

    • bug #48217 Improve error message when shell is not detected in completion command (GromNaN)
    • bug #48210  Fix signal handlers called after event listeners and skip exit (GromNaN)
    • bug #47998 Fix console ProgressBar::override() after manual ProgressBar::cleanup() (maxbeckers)
    • bug #48085 Tell about messenger:consume invalid limit options (MatTheCat)

    v6.2.0-BETA2

    Changelog (https://github.com/symfony/console/compare/v6.2.0-BETA1...v6.2.0-BETA2)

    • bug #47907 Update Application.php (aleksandr-shevchenko)

    v6.2.0-BETA1

    Changelog (https://github.com/symfony/console/compare/v6.1.6...v6.2.0-BETA1)

    • feature #47750 Show available commands in namespace when running namespace as command (wouterj)
    • feature #47730 Ban DateTime from the codebase (WebMamba)
    • feature #47308 Allow limiting the height of a console section (wouterj)
    • feature #47588 Add warning for possibly truncated inputs in QuestionHelper (#47586) (pbek)
    • feature #38996 Remove the default values from setters with a nullable parameter (derrabus, nicolas-grekas)
    • feature #47407 Terminal Color Mode refactoring and force Color Mode (julien-boudry)
    • feature #47062 Don't cut Urls wrapped in SymfonyStyle block (fchris82, GromNaN)

    ... (truncated)

    Changelog

    Sourced from symfony/console's changelog.

    CHANGELOG

    6.2

    • Improve truecolor terminal detection in some cases
    • Add support for 256 color terminals (conversion from Ansi24 to Ansi8 if terminal is capable of it)
    • Deprecate calling *Command::setApplication(), *FormatterStyle::setForeground/setBackground(), Helper::setHelpSet(), Input*::setDefault(), Question::setAutocompleterCallback/setValidator()without any arguments
    • Change the signature of OutputFormatterStyleInterface::setForeground/setBackground() to setForeground/setBackground(?string)
    • Change the signature of HelperInterface::setHelperSet() to setHelperSet(?HelperSet)

    6.1

    • Add support to display table vertically when calling setVertical()
    • Add method __toString() to InputInterface
    • Added OutputWrapper to prevent truncated URL in SymfonyStyle::createBlock.
    • Deprecate Command::$defaultName and Command::$defaultDescription, use the AsCommand attribute instead
    • Add suggested values for arguments and options in input definition, for input completion
    • Add $resumeAt parameter to ProgressBar#start(), so that one can easily 'resume' progress on longer tasks, and still get accurate getEstimate() and getRemaining() results.

    6.0

    • Command::setHidden() has a default value (true) for $hidden parameter and is final
    • Remove Helper::strlen(), use Helper::width() instead
    • Remove Helper::strlenWithoutDecoration(), use Helper::removeDecoration() instead
    • AddConsoleCommandPass can not be configured anymore
    • Remove HelperSet::setCommand() and getCommand() without replacement

    5.4

    • Add TesterTrait::assertCommandIsSuccessful() to test command
    • Deprecate HelperSet::setCommand() and getCommand() without replacement

    5.3

    • Add GithubActionReporter to render annotations in a Github Action
    • Add InputOption::VALUE_NEGATABLE flag to handle --foo/--no-foo options
    • Add the Command::$defaultDescription static property and the description attribute on the console.command tag to allow the list command to instantiate commands lazily
    • Add option --short to the list command
    • Add support for bright colors
    • Add #[AsCommand] attribute for declaring commands on PHP 8
    • Add Helper::width() and Helper::length()
    • The --ansi and --no-ansi options now default to null.

    ... (truncated)

    Commits
    • 5a9bd5c Merge branch '6.1' into 6.2
    • c649f33 Revert "bug #48089 [Console] Fix clear line with question in section (maxbeck...
    • 0945e82 Merge branch '6.1' into 6.2
    • 578809f bug #48089 [Console] Fix clear line with question in section (maxbeckers)
    • a42df13 Fix missing command not matching namespace error message
    • 58f6cef Fixed undefined variable error
    • 75d4749 [Console] Fix OutputInterface options int-mask for PhpStan
    • 54f790f Merge branch '6.1' into 6.2
    • a71863e Merge branch '6.0' into 6.1
    • be29442 Merge branch '5.4' into 6.0
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • Bump symfony/dependency-injection from 6.1.5 to 6.2.2

    Bump symfony/dependency-injection from 6.1.5 to 6.2.2

    Bumps symfony/dependency-injection from 6.1.5 to 6.2.2.

    Release notes

    Sourced from symfony/dependency-injection's releases.

    v6.2.2

    Changelog (https://github.com/symfony/dependency-injection/compare/v6.2.1...v6.2.2)

    • bug #48591 Shared private services becomes public after a public service is accessed (alexpott)
    • bug #48449 Fix bug when tag name is a text node (BrandonlinU)
    • bug #48522 Generate different classes for ghost objects and virtual proxies (nicolas-grekas)
    • bug #48482 Revert "bug #48027 Don't autoconfigure tag when it's already set with attributes" (nicolas-grekas)

    v6.2.1

    Changelog (https://github.com/symfony/dependency-injection/compare/v6.2.0...v6.2.1)

    • bug #48502 Fix ContainerBuilder stats env usage with enum (alamirault)
    • bug #48483 Remove refs that point to container.excluded services when allowed (nicolas-grekas)
    • bug #48461 Fix possible memory-leak when using lazy-objects (nicolas-grekas)

    v6.2.0

    Changelog (https://github.com/symfony/dependency-injection/compare/v6.2.0-RC2...v6.2.0)

    • no significant changes

    v6.2.0-RC1

    Changelog (https://github.com/symfony/dependency-injection/compare/v6.2.0-BETA3...v6.2.0-RC1)

    • bug #48224 Process bindings in ServiceLocatorTagPass (MatTheCat)

    v6.2.0-BETA3

    Changelog (https://github.com/symfony/dependency-injection/compare/v6.2.0-BETA2...v6.2.0-BETA3)

    • bug #48093 don't move locator tag for service subscriber (RobertMe)
    • feature #48045 Allow enum as service parameter in php config files (alexndlm)
    • bug #48027 Don't autoconfigure tag when it's already set with attributes (nicolas-grekas)

    v6.2.0-BETA1

    Changelog (https://github.com/symfony/dependency-injection/compare/v6.1.6...v6.2.0-BETA1)

    • feature #47364 Allow array attributes for service tags (aschempp)
    • feature #47906 Allow injecting the current env into php config closures (HypeMC)
    • feature #47902 Add support for tagged iterators/locators exclude option to xml and yaml (HypeMC)
    • feature #47801 Allow array for the value of Autowire attribute (willemverspyck)
    • feature #47730 Ban DateTime from the codebase (WebMamba)
    • feature #47683 Deprecate numeric parameter names (HeahDude)
    • feature #38996 Remove the default values from setters with a nullable parameter (derrabus, nicolas-grekas)
    • feature #47236 Generate lazy-loading virtual proxies for non-ghostable lazy services (nicolas-grekas)
    • feature #47367 Handle INI arrays (MatTheCat)
    • feature #47101 Allow service subscribers to return SubscribedService[] (kbond)
    • feature #47196 Allow extending #[When] attribute (ruudk)
    • feature #46821 Add resolve-env option to debug:config command (alexandre-daubois)
    • feature #46752 Use lazy-loading ghost object proxies out of the box (nicolas-grekas)
    • feature #46883 Add shuffle env processor (ostrolucky)
    • feature #46564 Add Enum Env Var Processor (jack-worman)

    ... (truncated)

    Changelog

    Sourced from symfony/dependency-injection's changelog.

    CHANGELOG

    6.2

    • Use lazy-loading ghost objects and virtual proxies out of the box
    • Add arguments &$asGhostObject and $id to LazyProxy's DumperInterface to allow using ghost objects for lazy loading services
    • Add enum env var processor
    • Add shuffle env var processor
    • Allow #[When] to be extended
    • Change the signature of ContainerAwareInterface::setContainer() to setContainer(?ContainerInterface)
    • Deprecate calling ContainerAwareTrait::setContainer() without arguments
    • Deprecate using numeric parameter names
    • Add support for tagged iterators/locators exclude option to the xml and yaml loaders/dumpers
    • Allow injecting string $env into php config closures

    6.1

    • Add #[MapDecorated] attribute telling to which parameter the decorated service should be mapped in a decorator
    • Add #[AsDecorator] attribute to make a service decorates another
    • Add $exclude to TaggedIterator and TaggedLocator attributes
    • Add $exclude to tagged_iterator and tagged_locator configurator
    • Add an env function to the expression language provider
    • Add an Autowire attribute to tell a parameter how to be autowired
    • Allow using expressions as service factories
    • Add argument type closure to help passing closures to services
    • Deprecate ReferenceSetArgumentTrait
    • Add AbstractExtension class for DI configuration/definition on a single file

    6.0

    • Remove Definition::setPrivate() and Alias::setPrivate(), use setPublic() instead
    • Remove inline() in favor of inline_service() and ref() in favor of service() when using the PHP-DSL
    • Remove Definition::getDeprecationMessage(), use Definition::getDeprecation() instead
    • Remove Alias::getDeprecationMessage(), use Alias::getDeprecation() instead
    • Remove the Psr\Container\ContainerInterface and Symfony\Component\DependencyInjection\ContainerInterface aliases of the service_container service

    5.4

    • Add $defaultIndexMethod and $defaultPriorityMethod to TaggedIterator and TaggedLocator attributes
    • Add service_closure() to the PHP-DSL
    • Add support for autoconfigurable attributes on methods, properties and parameters
    • Make auto-aliases private by default
    • Add support for autowiring union and intersection types

    5.3

    ... (truncated)

    Commits
    • c33a5f6 Merge branch '6.1' into 6.2
    • bfa7df2 Merge branch '6.0' into 6.1
    • 91b31a3 Merge branch '5.4' into 6.0
    • 4fc0a1b bug #48591 [DependencyInjection] Shared private services becomes public after...
    • 69123ae [DependencyInjection] Shared private services becomes public after a public s...
    • 82953de [DI] Fix undefined class in test
    • 7dcae05 bug #48449 [DependencyInjection] Fix bug when tag name is a text node (Brando...
    • a8b127b [DependencyInjection] Fix bug when tag name is a text node
    • 96b1ef4 bug #48522 [DependencyInjection] Generate different classes for ghost objects...
    • 6d272bc Merge branch '6.1' into 6.2
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump friendsofphp/php-cs-fixer from 3.13.0 to 3.13.1

    Bump friendsofphp/php-cs-fixer from 3.13.0 to 3.13.1

    Bumps friendsofphp/php-cs-fixer from 3.13.0 to 3.13.1.

    Release notes

    Sourced from friendsofphp/php-cs-fixer's releases.

    v3.13.1 Oliva

    • bug: Align all the arrows inside the same array (#6590)
    • bug: Fix priority between modernize_types_casting and no_unneeded_control_parentheses (#6687)
    • bug: TrailingCommaInMultilineFixer - do not add trailing comma when there is no break line after last element (#6677)
    • docs: Fix docs for disabled rules in rulesets (#6679)
    • docs: fix the cookbook_fixers.rst (#6672)
    • docs: Update installation recommended commands for mkdir argument (-p insteadof --parents). (#6689)
    • Make static data providers that are not using dynamic calls (#6696)
    • minor: displaying number of checked files (#6674)
    Changelog

    Sourced from friendsofphp/php-cs-fixer's changelog.

    Changelog for v3.13.1

    • bug: Align all the arrows inside the same array (#6590)
    • bug: Fix priority between modernize_types_casting and no_unneeded_control_parentheses (#6687)
    • bug: TrailingCommaInMultilineFixer - do not add trailing comma when there is no break line after last element (#6677)
    • docs: Fix docs for disabled rules in rulesets (#6679)
    • docs: fix the cookbook_fixers.rst (#6672)
    • docs: Update installation recommended commands for mkdir argument (-p insteadof --parents). (#6689)
    • Make static data providers that are not using dynamic calls (#6696)
    • minor: displaying number of checked files (#6674)
    Commits
    • 78d2251 prepared the 3.13.1 release
    • a2bdba3 Make static data providers that are not using dynamic calls (#6696)
    • ad0a87e bug: Align all the arrows inside the same array (#6590)
    • 663f3fc docs: Update installation recommended commands for mkdir argument (-p ins...
    • 9c7070b bug: Fix priority between modernize_types_casting and `no_unneeded_control_...
    • 046ff90 docs: Fix docs for disabled rules in rulesets (#6679)
    • b577444 minor: displaying number of checked files (#6674)
    • bb94db0 bug: TrailingCommaInMultilineFixer - do not add trailing comma when there is ...
    • 3969f39 docs: fix the cookbook_fixers.rst (#6672)
    • a1a5570 bumped version
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
Releases(1.0.2)
Owner
QOSSMIC GmbH
QOSSMIC GmbH
PHP Architecture Tester - Easy to use architectural testing tool for PHP :heavy_check_mark:

Easy to use architecture testing tool for PHP Introduction ?? PHP Architecture Tester is a static analysis tool to verify architectural requirements.

Carlos A Sastre 765 Dec 30, 2022
Feel free to create new file, don't hesitate to pull your code, the most important thing is that the file name here must match your nickname so that file does not conflict with other people.

PHP-Projects hacktoberfest Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to cha

Firmansyah Helmi Kurniawan 43 Nov 28, 2022
PHP Static Analysis Tool - discover bugs in your code without running it!

PHPStan - PHP Static Analysis Tool PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even b

PHPStan 11.6k Dec 30, 2022
Automagically generate UML diagrams of your Laravel code.

Laravel UML Diagram Generator Automagically generate UML diagrams of your Laravel code. Installation To install LTU via composer, run the command: com

Andy Abi Haidar 93 Jan 1, 2023
Deptrac is a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects

Deptrac is a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects. You can freely define your architectural layers over classes and which rules should apply to them.

QOSSMIC GmbH 2.2k Dec 30, 2022
Keep your architecture clean.

Deptrac What is Deptrac Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers in your PHP projec

QOSSMIC GmbH 2.2k Jan 5, 2023
Data providers encapsulate logic for Inertia views, keep your controllers clean and simple.

Laravel Data Providers for Inertia.js Data providers encapsulate logic for Inertia views, keep your controllers clean and simple. Installation We assu

Webfox Developments Ltd 18 Sep 12, 2022
FFCMS 3 version core MVC architecture. Build-on use with ffcms main architecture builder.

FFCMS 3 version core MVC architecture. Build-on use with ffcms main architecture builder.

FFCMS 0 Feb 25, 2022
Php API based in clean architecture

Clean Arch API 1.1 Run docker-compose command: $ docker-compose up -d 1.2 Install dependencies: $ docker exec -it clean-arch-api composer install 1.3

Pedro Amaral 6 Sep 27, 2021
my personal example of Laravel clean architecture

what is this repo about Clean Architect Laravel ###run we assume docker desktop is up and running open up a terminal cd project directory run "cp .env

Sadegh Salari 37 Dec 23, 2022
POC d'un projet Clean Architecture + DDD

Proof Of Concept - Clean Architecture & DDD Installation Dans un premier temps, cloner le repository : git clone https://github.com/TBoileau/rse cd rs

Thomas Boileau 11 Sep 3, 2022
Dockerise Symfony Application (Symfony 6 + Clean Architecture+ DDD+ CQRS + Docker + Xdebug + PHPUnit + Doctrine ORM + JWT Auth + Static analysis)

Symfony Dockerise Symfony Application Install Docker Install Docker Compose Docker PHP & Nginx Create Symfony Application Debugging Install Xdebug Con

null 48 Jan 5, 2023
Clean Architecture, DDD and CQRS using Symfony 6

Task manager system using Clean Architecture, DDD and CQRS. Environment setup Install Docker Clone the project: git clone https://github.com/k0t9i/Tas

null 3 Sep 5, 2022
Documentation on clean coding and demonstration of studied clean coding principals with PHP.

practice-php-clean-code Documentation on clean coding and demonstration of studied clean coding principals with PHP. The document contained in this re

Ferdous Islam 1 Feb 21, 2022
Keep your forms alive, avoid `TokenMismatchException` by gently poking your Laravel app.

Poke Keep your forms alive, avoid TokenMismatchException by gently poking your Laravel app. Keep this package free Your support allows me to keep this

Laragear 12 Nov 28, 2022
A package to keep track of your pages & understand your audience

A clean way to track your pages & understand your user's behavior Installation You can install the package via composer: composer require coderflexx/l

Coderflex 178 Jan 4, 2023
The place to keep your cache.

Stash - A PHP Caching Library Stash makes it easy to speed up your code by caching the results of expensive functions or code. Certain actions, like d

Tedious Developments 944 Jan 4, 2023
DaybydayCRM an open-source CRM, to help you keep track of your daily workflow.

====================== DaybydayCRM is an everyday customer relationship management system (CRM) to help you keep track of your customers, tasks, appoi

Casper Bottelet 2.1k Dec 30, 2022
Keep your laravel logs small and tidy.

Logs can get quite out of hand. This package helps save server space and keep your Laravel log files small.

Accent Interactive 73 Nov 14, 2022
Ensure your Laravel applications keep a normal pulse

Ensure your Laravel applications keep a normal rhythm Laravel Defibrillator helps you ensure that aspects of your application that should be running a

Michael Dyrynda 148 Dec 20, 2022