PHPackages                             parfumix/php-function-arguments - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. parfumix/php-function-arguments

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

parfumix/php-function-arguments
===============================

08PHP

Since May 18Pushed 11y ago1 watchersCompare

[ Source](https://github.com/parfumix/php-function-arguments)[ Packagist](https://packagist.org/packages/parfumix/php-function-arguments)[ RSS](/packages/parfumix-php-function-arguments/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Argument helper
===============

[](#argument-helper)

Argument helper is an class helper which can help wich help you to reduce the arguments of php function and easy convert it to class and can extracted and validated ..

```
    // From ..
    public function example($arg1, $arg2, $arg3, $arg4 = null, $arg5 = array());
    // To ..
    public function example(Argumentable $args);
```

### Instalation

[](#instalation)

You can use the `composer` package manager to install. Either run:

```
$ php composer.phar require parfumix/php-function-arguments "dev-master"

```

or add:

```
"parfumix/php-function-arguments": "dev-master"

```

to your composer.json file

### Usage

[](#usage)

You can easy create an instance of arugments by using args helper functions

```
$args = args();

// or if you want to pass some values and rules
$args = args($values = array(), $rules = array());

// or you can use ::create static functions
$args = Argument::create($values = array(), $rules = array());
```

Argument implements php interfaces like "Argumentable, ArrayAccess, Iterator, IteratorAggregate, Countable" so you can easy iterate by arguments or access elements as array or count your arguments

```
$args = args($values = array(
    'key' => 'value'
));

// to access an arguments you can use
$args['key']
// or
$args->get('key')

// counting arguments
count($args)
```

### Validation

[](#validation)

You can easy validate arguments using validation function or call object as function (using \_\_invoke)

```
$args = args();
$args->set('key', 'value');

// You can validate your args before
if( ! $args->validate(function($failedFields) {
    // you can do whetever with failed fields ..
}) )

class Example {
    public function needParams(Argumentable $args) {
        // Or you can validate here .
        if( ! $args->validate(function($failedFields) {
            // you can do whetever with failed fields ..
        }) )
    }
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/db7299473afa8a93d6beb49c5c9c31a6d58efb07c74a91eae71c77f9c1786fd8?d=identicon)[parfumix](/maintainers/parfumix)

---

Top Contributors

[![parfumix](https://avatars.githubusercontent.com/u/6368534?v=4)](https://github.com/parfumix "parfumix (23 commits)")

### Embed Badge

![Health badge](/badges/parfumix-php-function-arguments/health.svg)

```
[![Health](https://phpackages.com/badges/parfumix-php-function-arguments/health.svg)](https://phpackages.com/packages/parfumix-php-function-arguments)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
