You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/custom-rules.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,6 +130,23 @@ parameters:
130
130
This config would disallow all `pcntl` functions except (an imaginary) `pcntl_foobar()`.
131
131
Please note `exclude` also accepts [`fnmatch`](https://www.php.net/function.fnmatch) patterns so please be careful to not create a contradicting config, and that it can accept both a string and an array of strings.
132
132
133
+
### Wildcards, except when having an attribute
134
+
135
+
If there's this one class (or multiple of them) that you'd like to exclude from the set, you can do that with `excludeWithAttribute`:
136
+
137
+
```neon
138
+
parameters:
139
+
disallowedClasses:
140
+
-
141
+
class: 'App\PrivateModule\*'
142
+
excludeWithAttribute:
143
+
- '\App\Support\IsPublic'
144
+
```
145
+
146
+
This config would disallow all `App\PrivateModule\*` classes except those classes marked with a `#[\App\Support\IsPublic] attribute`.
147
+
148
+
Please note `excludeWithAttribute` also accepts [`fnmatch`](https://www.php.net/function.fnmatch) patterns, and that it can accept both a string and an array of strings.
149
+
133
150
### Wildcards, except when defined in this path
134
151
135
152
Another option how to limit the set of functions or methods selected by the `function` or `method` directive is a file path in which these are defined which mostly makes sense when a [`fnmatch`](https://www.php.net/function.fnmatch) pattern is used in those directives.
0 commit comments