Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Annotation Updater

Annotation Updater Laravel Package

jawira/annotation-updater

A command-line tool that scans PHP source files and updates annotations in place, helping keep docblock metadata consistent across a codebase. Useful for bulk-editing annotations after refactors, namespace changes, or library upgrades.

Deep Wiki
Context7

jawira/annotation-updater is a PHP command-line tool for keeping PHPDoc annotations in your source files in sync. Instead of editing docblocks by hand, define the annotations you need and let the updater rewrite them consistently—useful for generated @method, @property, and @param tags in models, facades, and service classes.

  • Automated docblock updates for repeatable, error-free annotations
  • CLI-driven workflow that fits into scripts and build pipelines
  • Idempotent output so repeated runs produce stable results
  • Framework-friendly, including Laravel-style classes and facades
  • Lightweight and easy to drop into existing projects
Frequently asked questions about Annotation Updater
What does jawira/annotation-updater do?
It is a custom PHP-CS-Fixer rule that updates PHPDoc annotations in your PHP source files. You define annotation rules in a config file, and the tool keeps tags such as @author, @since, @deprecated, and custom tags in sync with your code. It runs as a CLI tool through PHP-CS-Fixer.
How do I install jawira/annotation-updater in a Laravel project?
Install it as a development dependency with Composer, for example composer require --dev jawira/annotation-updater. Then reference the custom rule in your PHP-CS-Fixer configuration and define your annotation rules. Commit the configuration so other developers and CI use the same rules.
Does jawira/annotation-updater support Laravel 10, 11, and 12?
The package is framework-agnostic because it operates on PHP files through PHP-CS-Fixer, so Laravel version support mostly depends on your PHP and PHP-CS-Fixer versions. Check the package's Composer requirements before installing on older Laravel applications. It should work with Laravel 10, 11, and 12 as long as those requirements are met.
How do I configure the annotation rules?
You define rules in the tool's configuration file, specifying which PHPDoc tags to update and the values or logic to apply. Run the rule through PHP-CS-Fixer like any other fixer. The exact configuration schema is documented in the package README.
Can it update custom PHPDoc annotations, not just @author and @since?
Yes. Beyond standard tags like @author, @since, and @deprecated, the tool is designed to handle custom annotations you define. You add those tags to the configuration and let the rule update them across the configured paths.
How is jawira/annotation-updater different from PHP-CS-Fixer's built-in fixers?
PHP-CS-Fixer's built-in fixers mainly handle code style and standard PHPDoc formatting. jawira/annotation-updater focuses on the content of annotation tags, such as setting @author or @since values and keeping custom tags consistent. It plugs into the same PHP-CS-Fixer workflow rather than replacing it.
Can I preview annotation changes before files are modified?
Yes, run PHP-CS-Fixer in dry-run mode with diff output to see proposed annotation changes without modifying files. Review the diff, then rerun without dry-run to apply the updates. This is useful before committing a large annotation sync.
How do I run jawira/annotation-updater in CI or a Git hook?
Add PHP-CS-Fixer with this rule to your CI pipeline and run it with --dry-run --diff so the job fails when annotations are out of sync. Cache Composer dependencies to keep the job fast. Developers can run the same command locally or in a Git pre-commit hook.
Will it modify vendor or third-party code?
No, as long as your PHP-CS-Fixer Finder configuration only includes your application paths. PHP-CS-Fixer processes the files and directories you explicitly configure, so exclude vendor and generated code. Always check the dry-run diff before applying changes.
Is jawira/annotation-updater safe to use in production?
It is a development tool and should be installed as a dev dependency, not used at runtime in production. It changes source files, so run it locally or in CI and review the diff before committing. Production deployments should use the reviewed code, not run the updater during deploy.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator