Skip to content

Commit

Permalink
Fix doc using wrong function name a instead of getOne
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonE committed Nov 10, 2024
1 parent d09a737 commit 97dfc24
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/running_psalm/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,21 +444,21 @@ Allows you to hard-code the number of threads Psalm will use (similar to `--thre
maxStringLength="1000"
>
```
This setting controls the maximum length of literal strings that will be transformed into a literal string type during Psalm analysis.
Strings longer than this value (by default 1000 bytes) will be transformed in a generic `non-empty-string` type, instead.
This setting controls the maximum length of literal strings that will be transformed into a literal string type during Psalm analysis.
Strings longer than this value (by default 1000 bytes) will be transformed in a generic `non-empty-string` type, instead.

Please note that changing this setting might introduce unwanted side effects and those side effects won't be considered as bugs.
Please note that changing this setting might introduce unwanted side effects and those side effects won't be considered as bugs.

#### maxShapedArraySize
```xml
<psalm
maxShapedArraySize="100"
>
```
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.
Arrays bigger than this value (100 by default) will be transformed in a generic `non-empty-array` type, instead.
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.
Arrays bigger than this value (100 by default) will be transformed in a generic `non-empty-array` type, instead.

Please note that changing this setting might introduce unwanted side effects and those side effects won't be considered as bugs.
Please note that changing this setting might introduce unwanted side effects and those side effects won't be considered as bugs.

#### restrictReturnTypes

Expand All @@ -474,20 +474,20 @@ the inferred return type.
This code:
```php
function getOne(): int // declared type: int
{
{
return 1; // inferred type: 1 (int literal)
}
```
Will give this error: `LessSpecificReturnType - The inferred return type '1' for
a is more specific than the declared return type 'int'`
getOne is more specific than the declared return type 'int'`

To fix the error, you should specify the more specific type in the doc-block:
```php
/**
* @return 1
*/
function getOne(): int
{
function getOne(): int
{
return 1;
}
```
Expand Down

0 comments on commit 97dfc24

Please sign in to comment.