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/annotating_code/type_syntax/top_bottom_types.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,6 @@ It can be aliased to `no-return` or `never-return` in docblocks. Note: it replac
12
12
This is the _bottom type_ in PHP's type system. It's used to describe a type that has no possible value. It can happen in multiple cases:
13
13
14
14
- the actual `never` type from PHP 8.1 (can be used in docblocks for older versions). This type can be used as a return type for functions that will never return, either because they always throw exceptions or always exit()
15
-
-an union type that have been stripped for all its possible types. (For example, if a variable is `string|int` and we perform a is_bool() check in a condition, the type of the variable in the condition will be `never` as the condition will never be entered)
15
+
-a union type that has been stripped of all its possible types. (For example, if a variable is `string|int` and we perform an is_bool() check in a condition, the type of the variable in the condition will be `never` as the condition will never be entered)
16
16
- it can represent a placeholder for types yet to come — a good example is the type of the empty array `[]`, which Psalm types as `array<never, never>`, the content of the array is void so it can accept any content
17
17
- it can also happen in the same context as the line above for templates that have yet to be defined
Copy file name to clipboardexpand all lines: docs/running_psalm/configuration.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -444,21 +444,21 @@ Allows you to hard-code the number of threads Psalm will use (similar to `--thre
444
444
maxStringLength="1000"
445
445
>
446
446
```
447
-
This setting controls the maximum length of literal strings that will be transformed into a literal string type during Psalm analysis.
448
-
Strings longer than this value (by default 1000 bytes) will be transformed in a generic `non-empty-string` type, instead.
447
+
This setting controls the maximum length of literal strings that will be transformed into a literal string type during Psalm analysis.
448
+
Strings longer than this value (by default 1000 bytes) will be transformed in a generic `non-empty-string` type, instead.
449
449
450
-
Please note that changing this setting might introduce unwanted side effects and those side effects won't be considered as bugs.
450
+
Please note that changing this setting might introduce unwanted side effects and those side effects won't be considered as bugs.
451
451
452
452
#### maxShapedArraySize
453
453
```xml
454
454
<psalm
455
455
maxShapedArraySize="100"
456
456
>
457
457
```
458
-
This setting controls the maximum size of shaped arrays that will be transformed into a shaped `array{key1: "value", key2: T}` type during Psalm analysis.
459
-
Arrays bigger than this value (100 by default) will be transformed in a generic `non-empty-array` type, instead.
458
+
This setting controls the maximum size of shaped arrays that will be transformed into a shaped `array{key1: "value", key2: T}` type during Psalm analysis.
459
+
Arrays bigger than this value (100 by default) will be transformed in a generic `non-empty-array` type, instead.
460
460
461
-
Please note that changing this setting might introduce unwanted side effects and those side effects won't be considered as bugs.
461
+
Please note that changing this setting might introduce unwanted side effects and those side effects won't be considered as bugs.
462
462
463
463
#### restrictReturnTypes
464
464
@@ -474,20 +474,20 @@ the inferred return type.
474
474
This code:
475
475
```php
476
476
function getOne(): int // declared type: int
477
-
{
477
+
{
478
478
return 1; // inferred type: 1 (int literal)
479
479
}
480
480
```
481
481
Will give this error: `LessSpecificReturnType - The inferred return type '1' for
482
-
a is more specific than the declared return type 'int'`
482
+
getOne is more specific than the declared return type 'int'`
483
483
484
484
To fix the error, you should specify the more specific type in the doc-block:
Copy file name to clipboardexpand all lines: docs/running_psalm/issues/TaintedHtml.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Emitted when user-controlled input that can contain HTML can be passed into to a
4
4
5
5
## Risk
6
6
7
-
This could lead to a potential Cross Site Scripting (XSS) vulnerability. Using a XSS vulnerability, an attacker could inject malicious JavaScript and execute any action JavaScript could do. Examples include:
7
+
This could lead to a potential Cross Site Scripting (XSS) vulnerability. Using an XSS vulnerability, an attacker could inject malicious JavaScript and execute any action JavaScript could do. Examples include:
8
8
9
9
- Stealing authentication material (e.g. cookies, JWT tokens)
10
10
- Exfiltrate sensitive information by reading the DOM
Copy file name to clipboardexpand all lines: docs/running_psalm/issues/TaintedSSRF.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ Potential Server-Side Request Forgery vulnerability. This rule is emitted when u
4
4
5
5
## Risk
6
6
7
-
Passing untrusted user input to network requests could be dangerous.
7
+
Passing untrusted user input to network requests could be dangerous.
8
8
9
-
If an attacker can fully control a HTTP request they could connect to internal services. Depending on the nature of these, this can pose a security risk. (e.g. backend services, admin interfaces, AWS metadata, ...)
9
+
If an attacker can fully control an HTTP request they could connect to internal services. Depending on the nature of these, this can pose a security risk. (e.g. backend services, admin interfaces, AWS metadata, ...)
Copy file name to clipboardexpand all lines: docs/running_psalm/issues/TaintedTextWithQuotes.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Emitted when user-controlled input that can contain quotation marks can be passe
4
4
5
5
## Risk
6
6
7
-
This could lead to a potential Cross Site Scripting (XSS) vulnerability. Using a XSS vulnerability, an attacker could inject malicious JavaScript and execute any action JavaScript could do. Examples include:
7
+
This could lead to a potential Cross Site Scripting (XSS) vulnerability. Using an XSS vulnerability, an attacker could inject malicious JavaScript and execute any action JavaScript could do. Examples include:
8
8
9
9
- Stealing authentication material (e.g. cookies, JWT tokens)
10
10
- Exfiltrate sensitive information by reading the DOM
Copy file name to clipboardexpand all lines: docs/running_psalm/plugins/authoring_plugins.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -80,8 +80,8 @@ class SomePlugin implements \Psalm\Plugin\EventHandler\AfterStatementAnalysisInt
80
80
-`AfterFunctionCallAnalysisInterface` - called after Psalm evaluates a function call to any function defined within the project itself. Can alter the return type or perform modifications of the call.
81
81
-`AfterFunctionLikeAnalysisInterface` - called after Psalm has completed its analysis of a given function-like.
82
82
-`AfterMethodCallAnalysisInterface` - called after Psalm analyzes a method call.
83
-
-`BeforeStatementAnalysisInterface` - called before Psalm evaluates an statement.
84
-
-`AfterStatementAnalysisInterface` - called after Psalm evaluates an statement.
83
+
-`BeforeStatementAnalysisInterface` - called before Psalm evaluates a statement.
84
+
-`AfterStatementAnalysisInterface` - called after Psalm evaluates a statement.
85
85
-`BeforeAddIssueInterface` - called before Psalm adds an item to it's internal `IssueBuffer`, allows handling code issues individually
86
86
-`BeforeFileAnalysisInterface` - called before Psalm analyzes a file.
87
87
-`FunctionExistenceProviderInterface` - can be used to override Psalm's builtin function existence checks for one or more functions.
0 commit comments