PHPackages                             savinmikhail/add\_named\_arguments\_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/add\_named\_arguments\_rector

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

savinmikhail/add\_named\_arguments\_rector
==========================================

Rector rule to add names to arguments for functions'/methods' calls

v0.1.25(2mo ago)1969.5k↑14.2%3MITPHPPHP &gt;=8.2CI passing

Since Jan 19Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/savinmikhail/AddNamedArgumentsRector)[ Packagist](https://packagist.org/packages/savinmikhail/add_named_arguments_rector)[ RSS](/packages/savinmikhail-add-named-arguments-rector/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (23)Versions (37)Used By (3)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/71105bd80873948645ed23dc34364535bcff79944e39c52f05bcd860952f12be/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736176696e6d696b6861696c2f4164644e616d6564417267756d656e7473526563746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/savinmikhail/AddNamedArgumentsRector/?branch=main)[![Code Coverage](https://camo.githubusercontent.com/2caed3a45ae95c35ff1c833be7d150eb3af5f5bac5a392edbf3a276fe7e26876/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736176696e6d696b6861696c2f4164644e616d6564417267756d656e7473526563746f722f6261646765732f636f7665726167652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/savinmikhail/AddNamedArgumentsRector/?branch=main)[![Total Downloads](https://camo.githubusercontent.com/d4cb76652238e78a018301a24742ac725479c544cbcf84fc8027471ab302bb06/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736176696e6d696b6861696c2f6164645f6e616d65645f617267756d656e74735f726563746f72)](https://packagist.org/packages/savinmikhail/add_named_arguments_rector)[![dist-size status](https://camo.githubusercontent.com/8a860c82f8fd3787c727736c6ab91d27243f015c277720075d736d4b40823b95/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f736176696e6d696b6861696c2f4164644e616d6564417267756d656e7473526563746f722f6d61696e2f646973742d73697a652d7374617475732e6a736f6e)](https://camo.githubusercontent.com/8a860c82f8fd3787c727736c6ab91d27243f015c277720075d736d4b40823b95/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f736176696e6d696b6861696c2f4164644e616d6564417267756d656e7473526563746f722f6d61696e2f646973742d73697a652d7374617475732e6a736f6e)

AddNamedArgumentsRector
=======================

[](#addnamedargumentsrector)

The **AddNamedArgumentsRector** rule enhances your code by converting function, method, or constructor calls to use named arguments where possible. Named arguments improve readability and reduce errors by explicitly naming the parameters being passed.

### Example

[](#example)

```
- str_contains('foo', 'bar');
+ str_contains(haystack: 'foo', needle: 'bar');
```

This feature works for:

- Functions
- Static methods
- Instance methods
- Constructors

---

### Installation

[](#installation)

You can install the package via Composer:

```
composer require --dev savinmikhail/add_named_arguments_rector
```

---

### Usage

[](#usage)

To enable the rule, add it to your Rector configuration (`rector.php`):

```
