Skip to content

ampeco/phpstan-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Use

  1. Require ampeco/phpstan-rules as a composer dependency in your project
  2. In your phpstan.neon file, add the following line to the includes section:
- ./vendor/ampeco/phpstan-rules/rules.neon
  1. In the parameters section, configure the directories by adding the preventNamespacesUsageInDirectories parameter. For instance:
preventNamespacesUsageInDirectories:
    directories:
        - modules:
            - App

In this example, importing anything from the "App" namespace in the modules directory is forbidden.

You can define multiple rules as shown below:

preventNamespacesUsageInDirectories:
    directories:
        - modules:
            - App
        - app/Csv/Resources:
            - Ampeco\Modules

Here, it is forbidden to import anything from the App namespace in the modules directory. Additionally, importing anything from Ampeco\Modules to the files in the app/Csv/Resources directory is also prohibited.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages