1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Removed obsolete documenation (#3982)

`allowCoercionFromStringToClassConst` was removed in 3.0 and never
worked since.

Refs vimeo/psalm#3976
This commit is contained in:
Bruce Weirdan 2020-08-11 14:30:09 +03:00 committed by GitHub
parent 7fe7146dc3
commit d5055ea1d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 11 deletions

View File

@ -32,7 +32,6 @@
<xs:attribute name="serializer" type="xs:string" />
<xs:attribute name="addParamDefaultToDocblockType" type="xs:boolean" default="false" />
<xs:attribute name="allowCoercionFromStringToClassConst" type="xs:boolean" default="false" />
<xs:attribute name="allowFileIncludes" type="xs:boolean" default="true" />
<xs:attribute name="allowPhpStormGenerics" type="xs:boolean" default="false" />
<xs:attribute name="allowStringToStandInForClass" type="xs:boolean" default="false" />

View File

@ -30,7 +30,7 @@ class A {}
function takesClassName(string $s) : void {}
```
`takesClassName("A");` would trigger a `TypeCoercion` issue (or a `PossiblyInvalidArgument` issue if [`allowCoercionFromStringToClassConst`](../running_psalm/configuration.md#coding-style) was set to `false` in your config), whereas `takesClassName(A::class)` is fine.
`takesClassName("A");` would trigger a `TypeCoercion` issue, whereas `takesClassName(A::class)` is fine.
You can also parameterize `class-string` with an object name e.g. [`class-string<Foo>`](value_types.md#regular-class-constants). This tells Psalm that any matching type must either be a class string of `Foo` or one of its descendants.

View File

@ -161,15 +161,6 @@ Setting this to `false` means that any function calls will cause Psalm to forget
```
Allows you to specify whether or not to use the typed iterator docblock format supported by PHP Storm e.g. `ArrayIterator|string[]`, which Psalm transforms to `ArrayIterator<string>`. Defaults to `false`.
#### allowCoercionFromStringToClassConst
```xml
<psalm
allowCoercionFromStringToClassConst="[bool]"
>
```
When `true`, strings can be coerced to [`class-string`](../annotating_code/templated_annotations.md#param-class-stringt), with Psalm emitting a `TypeCoercion` issue. If disabled, that issue changes to a more serious one. Defaults to `false`.
#### allowStringToStandInForClass
```xml