forked from phpstan/phpstan-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForbiddenClassNameExtension.php
More file actions
35 lines (29 loc) · 939 Bytes
/
Copy pathForbiddenClassNameExtension.php
File metadata and controls
35 lines (29 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php declare(strict_types = 1);
namespace PHPStan\Classes;
use PHPStan\DependencyInjection\ExtensionInterface;
/**
* This is the extension interface to implement if you want to dynamically
* add forbidden class prefixes to the ClassForbiddenNameCheck rule.
*
* The idea is that you want to report usages of classes that you're not supposed to use in application.
* For example: Generated Doctrine proxies from their configured namespace.
*
* To register it in the configuration file use the `phpstan.forbiddenClassNamesExtension` service tag:
*
* ```
* services:
* -
* class: App\PHPStan\MyExtension
* tags:
* - phpstan.forbiddenClassNamesExtension
* ```
*
* @api
*/
#[ExtensionInterface(tag: self::EXTENSION_TAG)]
interface ForbiddenClassNameExtension
{
public const EXTENSION_TAG = 'phpstan.forbiddenClassNamesExtension';
/** @return array<string, string> */
public function getClassPrefixes(): array;
}