Skip to content

Commit

Permalink
update docs for enum case deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
pilif committed Dec 22, 2021
1 parent e8e968e commit fdeb195
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/running_psalm/issues/DeprecatedConstant.md
@@ -1,6 +1,6 @@
# DeprecatedConstant

Emitted when referring to a deprecated constant:
Emitted when referring to a deprecated constant or enum case:

```php
<?php
Expand All @@ -11,6 +11,13 @@ class A {
}

echo A::FOO;

enum B {
/** @deprecated */
case B;
}

echo B::B;
```

## Why this is bad
Expand All @@ -19,4 +26,4 @@ The `@deprecated` tag is normally indicative of code that will stop working in t

## How to fix

Don’t use the deprecated constant.
Don’t use the deprecated constant or enum case
1 change: 1 addition & 0 deletions tests/DocumentationTest.php
Expand Up @@ -314,6 +314,7 @@ public function providerInvalidCodeParse(): array
case 'DuplicateEnumCase':
case 'DuplicateEnumCaseValue':
case 'NoEnumProperties':
case 'DeprecatedConstant':
$php_version = '8.1';
break;
}
Expand Down

0 comments on commit fdeb195

Please sign in to comment.