PHPackages                             savinmikhail/annotate\_throws\_rector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. savinmikhail/annotate\_throws\_rector

ActiveRector-extension[Testing &amp; Quality](/categories/testing)

savinmikhail/annotate\_throws\_rector
=====================================

Rector rule to add missing @throws tags for direct throws and inter-class propagation

v0.1.0(today)00MITPHPPHP &gt;=8.2

Since Jun 20Pushed todayCompare

[ Source](https://github.com/savinmikhail/AnnotateThrowsRector)[ Packagist](https://packagist.org/packages/savinmikhail/annotate_throws_rector)[ Docs](https://github.com/savinmikhail/AnnotateThrowsRector)[ RSS](/packages/savinmikhail-annotate-throws-rector/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (11)Versions (2)Used By (0)

AnnotateThrowsRector
--------------------

[](#annotatethrowsrector)

Rector extension that adds missing `@throws` tags for:

- direct `throw` expressions in class methods
- propagation through same-class calls like `$this->foo()`, `self::foo()`, `static::foo()`
- propagation through inter-class calls when the callee already has `@throws`

Current MVP scope:

- class methods only
- inter-class propagation relies on existing callee docblocks
- repeated Rector runs can gradually converge the call graph across files
- caught exceptions inside `try/catch` are not propagated
- existing `@throws` tags are preserved and deduplicated
- no removal of stale `@throws` tags yet

Install
-------

[](#install)

```
composer require --dev savinmikhail/annotate_throws_rector
```

Configure
---------

[](#configure)

```
