Skip to content

Commit bcbf756

Browse files
committed
Removed deprecated UnusedPrivateElementsSniff
1 parent 4837c51 commit bcbf756

16 files changed

+0
-1529
lines changed

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -290,21 +290,6 @@ Requires using combined assignment operators, eg `+=`, `.=` etc.
290290

291291
### Cleaning - detecting dead code
292292

293-
#### SlevomatCodingStandard.Classes.UnusedPrivateElements 🚧
294-
295-
**DEPRECATED**
296-
See https://phpstan.org/blog/detecting-unused-private-properties-methods-constants
297-
298-
Although PHP_CodeSniffer is not suitable for static analysis because it is limited to analysing one file at a time, it is possible to use it to perform certain checks. `UnusedPrivateElementsSniff` checks for unused methods, unused or write-only properties in a class and unused private constants. Reported unused elements are safe to remove.
299-
300-
This is very useful during refactoring to clean up dead code and injected dependencies.
301-
302-
Sniff provides the following settings:
303-
304-
* `alwaysUsedPropertiesAnnotations`: mark certain properties as always used, for example the ones with `@ORM\Column`
305-
* `alwaysUsedPropertiesSuffixes`: mark properties with name ending with a certain string to be always marked as used
306-
* `alwaysUsedMethodsAnnotations`: mark certain methods as always used, for example the ones with `@Serializer\PostDeserialize`
307-
308293
#### SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure 🔧
309294

310295
Looks for unused inherited variables passed to closure via `use`.

0 commit comments

Comments
 (0)