deptrac:
  paths:
    - ./src/
    - ./vendor/codeigniter4/framework/system/
  exclude_files:
    - '#.*test.*#i'
  layers:
    - name: Model
      collectors:
        - type: bool
          must:
            - type: class
              value: .*[A-Za-z]+Model$
          must_not:
            - type: directory
              value: vendor/.*
    - name: Vendor Model
      collectors:
        - type: bool
          must:
            - type: class
              value: .*[A-Za-z]+Model$
            - type: directory
              value: vendor/.*
    - name: Controller
      collectors:
        - type: bool
          must:
            - type: class
              value: .*\/Controllers\/.*
          must_not:
            - type: directory
              value: vendor/.*
    - name: Vendor Controller
      collectors:
        - type: bool
          must:
            - type: class
              value: .*\/Controllers\/.*
            - type: directory
              value: vendor/.*
    - name: Config
      collectors:
        - type: bool
          must:
            - type: directory
              value: src/Config/.*
          must_not:
            - type: class
              value: .*Services
            - type: directory
              value: vendor/.*
    - name: Vendor Config
      collectors:
        - type: bool
          must:
            - type: directory
              value: vendor/.*/Config/.*
          must_not:
            - type: class
              value: .*Services
    - name: Entity
      collectors:
        - type: bool
          must:
            - type: directory
              value: src/Entities/.*
          must_not:
            - type: directory
              value: vendor/.*
    - name: Vendor Entity
      collectors:
        - type: bool
          must:
            - type: directory
              value: vendor/.*/Entities/.*
    - name: View
      collectors:
        - type: bool
          must:
            - type: directory
              value: src/Views/.*
          must_not:
            - type: directory
              value: vendor/.*
    - name: Vendor View
      collectors:
        - type: bool
          must:
            - type: directory
              value: vendor/.*/Views/.*
    - name: Service
      collectors:
        - type: class
          value: .*Services.*
  ruleset:
    Entity:
      - Config
      - Model
      - Service
      - Vendor Config
      - Vendor Entity
      - Vendor Model
    Config:
      - Service
      - Vendor Config
    Model:
      - Config
      - Entity
      - Service
      - Vendor Config
      - Vendor Entity
      - Vendor Model
    Service:
      - Config
      - Vendor Config

    # Ignore anything in the Vendor layers
    Vendor Model:
      - Config
      - Service
      - Vendor Config
      - Vendor Controller
      - Vendor Entity
      - Vendor Model
      - Vendor View
    Vendor Controller:
      - Service
      - Vendor Config
      - Vendor Controller
      - Vendor Entity
      - Vendor Model
      - Vendor View
    Vendor Config:
      - Config
      - Service
      - Vendor Config
      - Vendor Controller
      - Vendor Entity
      - Vendor Model
      - Vendor View
    Vendor Entity:
      - Service
      - Vendor Config
      - Vendor Controller
      - Vendor Entity
      - Vendor Model
      - Vendor View
    Vendor View:
      - Service
      - Vendor Config
      - Vendor Controller
      - Vendor Entity
      - Vendor Model
      - Vendor View
  skip_violations: []
