PHPackages                             initphp/parameterbag - 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. initphp/parameterbag

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

initphp/parameterbag
====================

InitPHP Parameter Bag Library

1.1.2(3y ago)11806MITPHPPHP &gt;=7.2

Since Mar 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/InitPHP/ParameterBag)[ Packagist](https://packagist.org/packages/initphp/parameterbag)[ RSS](/packages/initphp-parameterbag/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (7)Used By (6)

InitPHP ParameterBag
====================

[](#initphp-parameterbag)

Single and multi-dimensional parameter bag.

[![Latest Stable Version](https://camo.githubusercontent.com/bc82d4094f40109fe9b19bab5163ae81cff3dc061ced09bd951e59a4e630cbf3/687474703a2f2f706f7365722e707567782e6f72672f696e69747068702f706172616d657465726261672f76)](https://packagist.org/packages/initphp/parameterbag) [![Total Downloads](https://camo.githubusercontent.com/a114f6ddfd9eff6838de19171a3425d8ec509e8995e90d44103d9a2cce3fc0ee/687474703a2f2f706f7365722e707567782e6f72672f696e69747068702f706172616d657465726261672f646f776e6c6f616473)](https://packagist.org/packages/initphp/parameterbag) [![Latest Unstable Version](https://camo.githubusercontent.com/1cfa53974cffd8763f04211061fcce0040f17504681d09fe3b8e61af0f9ac71c/687474703a2f2f706f7365722e707567782e6f72672f696e69747068702f706172616d657465726261672f762f756e737461626c65)](https://packagist.org/packages/initphp/parameterbag) [![License](https://camo.githubusercontent.com/fbf2c759921074e77b152e8adbe599f07bdbf764a65013304775634700288ff4/687474703a2f2f706f7365722e707567782e6f72672f696e69747068702f706172616d657465726261672f6c6963656e7365)](https://packagist.org/packages/initphp/parameterbag) [![PHP Version Require](https://camo.githubusercontent.com/c647cba716670a70ecc8c2dca5d4762fb94435f133e42dc07b8e20077cbdb8ed/687474703a2f2f706f7365722e707567782e6f72672f696e69747068702f706172616d657465726261672f726571756972652f706870)](https://packagist.org/packages/initphp/parameterbag)

[![parameterbag](https://camo.githubusercontent.com/ad6634db18922ce000b52cc07f12c7ada26457027fcc1372e35c53c1162acbfe/68747470733a2f2f696e69747068702e6769746875622e696f2f6c6f676f732f706172616d657465726261672e706e67)](https://camo.githubusercontent.com/ad6634db18922ce000b52cc07f12c7ada26457027fcc1372e35c53c1162acbfe/68747470733a2f2f696e69747068702e6769746875622e696f2f6c6f676f732f706172616d657465726261672e706e67)

Installation
------------

[](#installation)

```
composer require initphp/parameterbag

```

Requirements
------------

[](#requirements)

- PHP 7.2 or later

Usage
-----

[](#usage)

```
require_once "vendor/autoload.php";
use \InitPHP\ParameterBag\ParameterBag;

$parameter = new ParameterBag($_GET);

// GET /?user=muhametsafak
echo $parameter->get('user', null); // "muhametsafak"
```

### Using nested arrays

[](#using-nested-arrays)

```
require_once "vendor/autoload.php";
use \InitPHP\ParameterBag\ParameterBag;

$data = [
    'database'  => [
        'dsn'           => 'mysql:host=localhost',
        'username'      => 'root',
        'password'      => '123456'
    ]
];

$parameter = new ParameterBag($data, ['isMulti' => true, 'separator' => '.']);

$parameter->get('database.username'); // "root"
$parameter->has('database.charset'); // false
```

### Methods

[](#methods)

#### `has()`

[](#has)

```
public function has(string $key): bool;
```

#### `get()`

[](#get)

```
public function get(string $key, mixed $default = null): mixed;
```

#### `set()`

[](#set)

```
public function set(string $key, mixed $value): \InitPHP\ParameterBag\ParameterBagInterface;
```

#### `remove()`

[](#remove)

```
public function remove(string ...$keys): \InitPHP\ParameterBag\ParameterBagInterface;
```

#### `all()`

[](#all)

```
public function all(): array;
```

#### `merge()`

[](#merge)

```
public function merge(array|\InitPHP\ParameterBag\ParameterBagInterface ...$merge): \InitPHP\ParameterBag\ParameterBagInterface;
```

Credits
-------

[](#credits)

- [Muhammet ŞAFAK](https://www.muhammetsafak.com.tr) &lt;&gt;

License
-------

[](#license)

Copyright © 2022 - [MIT License](./LICENSE)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity48

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.

###  Release Activity

Cadence

Every ~51 days

Recently: every ~30 days

Total

6

Last Release

1272d ago

PHP version history (2 changes)1.0PHP &gt;=7.4

1.1PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b6b34f3ac8938d8ee52ba3bd260680855dc5715c7b2929d9380de30d15a67dd?d=identicon)[muhammetsafak](/maintainers/muhammetsafak)

---

Top Contributors

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

---

Tags

parameter-bagphp

### Embed Badge

![Health badge](/badges/initphp-parameterbag/health.svg)

```
[![Health](https://phpackages.com/badges/initphp-parameterbag/health.svg)](https://phpackages.com/packages/initphp-parameterbag)
```

###  Alternatives

[matt-daneshvar/laravel-survey

Create surveys inside your Laravel app

28770.3k](/packages/matt-daneshvar-laravel-survey)[stecman/composer-bash-completion-plugin

BASH/ZSH auto-complete plugin for Composer

7910.3k](/packages/stecman-composer-bash-completion-plugin)

PHPackages © 2026

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