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
The following items:
- constants
- enums
- superglobals
- control structures
can now be re-allowed in given
- methods or functions (`allowInMethods`, `allowInFunctions`)
- instances (`allowInInstanceOf`)
- classes with given attributes (`allowInClassWithAttributes`)
- methods and functions with attributes (`allowInMethodsWithAttributes`,
`allowInFunctionsWithAttributes`)
- classes with any method with given attributes
(`allowInClassWithMethodAttributes`)
Bringing the items listed above on par with the already fully supported items like namespaces, attributes, method and function calls.
Close#307
### Allow some previously disallowed calls or usages
49
49
50
-
Let's say you have disallowed `foo()` with custom rules. But you want to re-allow it when used in your custom wrapper, or when the first parameter equals, or not, a specified value. The extension offers multiple ways of doing that:
50
+
Let's say you have disallowed the `foo()` function (or any other supported items like constants or method calls etc.) with custom rules. But you want to re-allow it when used in your custom wrapper, or when the first parameter equals, or not, a specified value. The extension offers multiple ways of doing that:
51
51
52
52
-[Ignore errors](docs/allow-ignore-errors.md) the PHPStan way
Copy file name to clipboardExpand all lines: docs/allow-in-class-with-method-attributes.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
## Allow in class with given attributes on any method
2
2
3
-
You can allow or disallow a function or a method, an attribute, a namespace or a classname in a class where any method, including the method the call is done in, but not the class itself, has the specified attribute.
3
+
You can allow or disallow an item in a class where any method, including the method the call is done in, but not the class itself, has the specified attribute.
4
4
This is done with `allowInClassWithMethodAttributes` and `allowExceptInClassWithMethodAttributes` (or `disallowInClassWithMethodAttributes` which is an alias). The method with the attribute can also be static, final or even abstract, and the method visibility doesn't matter.
Copy file name to clipboardExpand all lines: docs/allow-in-instance-of.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
## Allow in classes, child classes, classes implementing an interface
2
2
3
-
Use `allowInInstanceOf`, named after the PHP's `instanceof` operator, if you want to allow a function or a method call, an attribute, a classname, or a namespace in
3
+
Use `allowInInstanceOf`, named after the PHP's `instanceof` operator, if you want to allow an item like function or a method call, an attribute, a classname, or a namespace etc. in
4
4
- a class of given name
5
5
- a class that inherits from a class of given name
Copy file name to clipboardExpand all lines: docs/allow-in-methods-with-attributes.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
## Allow in methods or functions with given attributes
2
2
3
-
Similar to [allowing items in methods or functions by name](allow-in-methods.md), you can allow or disallow items like functions and method calls, attributes, namespace and classname usage in methods and functions with given attributes.
3
+
Similar to [allowing items in methods or functions by name](allow-in-methods.md), you can allow or disallow items like functions and method calls, attributes, namespace and classname usage etc. in methods and functions with given attributes.
4
4
5
5
You can use `allowInMethodsWithAttributes` (or the `allowInFunctionsWithAttributes` alias) for that:
Copy file name to clipboardExpand all lines: docs/allow-in-methods.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
## Allow in methods or functions
2
2
3
-
To allow a previously disallowed method or function only when called from a different method or function in any file, use `allowInFunctions` (or `allowInMethods` alias):
3
+
To allow a previously disallowed item like method or function etc. only when called from a different method or function in any file, use `allowInFunctions` (or `allowInMethods` alias):
0 commit comments