PHPackages                             railken/bag - 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. railken/bag

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

railken/bag
===========

v2.0.1(1y ago)087.5k—2%20PHPPHP ^8.1

Since Sep 18Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (19)Used By (20)

Bag
===

[](#bag)

[![Build Status](https://camo.githubusercontent.com/b37d271330a8d37c9e8df578bdc1ed858e54004a07a07db8ada638bf11ba12e4/68747470733a2f2f7472617669732d63692e6f72672f7261696c6b656e2f6261672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/railken/bag)[![Maintainability](https://camo.githubusercontent.com/8784664d7abd9ad2ae1d98bd98c78c6b4882ff6787bc5dc3218c39a3b545c98c/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f36663632643863343331393564363132626530632f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/railken/bag/maintainability)[![Test Coverage](https://camo.githubusercontent.com/3e3b980ac69b97f1b19abde771eae1b8c95a2cf3b6e828bba800579d057d01c1/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f36663632643863343331393564363132626530632f746573745f636f766572616765)](https://codeclimate.com/github/railken/bag/test_coverage)[![Style CI](https://camo.githubusercontent.com/c901709a82b6c62437a0c44808293bd7e28c6a2ed9ffaacf3deeca8671e238c5/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130333937353731382f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/103975718)[![License](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Latest stable](https://camo.githubusercontent.com/82d63a7da3327360691ff6efc758e5cb7e24f50b8e27594286134c00a27b1f27/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7261696c6b656e2f6261672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/railken/bag)[![PHP](https://camo.githubusercontent.com/5f84a4908f96ace42f60891e2d2653280c29515b206756d8b34ae5e4a31eba07/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7068702d762f7261696c6b656e2f6261672e737667)](https://secure.php.net/)

Inspired by [ParameterBag](https://github.com/symfony/http-foundation/blob/master/ParameterBag.php) I decided to create a new repository that contains a similiar class with a few adjustments.

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

[](#requirements)

PHP 8.1 or later.

Composer
--------

[](#composer)

You can install it via [Composer](https://getcomposer.org/) by typing the following command:

```
composer require railken/bag
```

Getting Started
---------------

[](#getting-started)

Simple usage looks like:

```
use Railken\Bag;

# Initialization
$bag = new Bag();
$bag = new Bag(['foo' => '1']);

# Setting
$bag->set('foo', 1)->set('fee', 2);

# Getting
$bag->foo; #1
$bag->get('bar', 3); #3

```

License
-------

[](#license)

Open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance47

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 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 ~162 days

Recently: every ~619 days

Total

18

Last Release

399d ago

Major Versions

v1.2.13 → v2.0.02023-12-29

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

baglibraryphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/railken-bag/health.svg)

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

###  Alternatives

[php-lrpm/php-lrpm

PHP Long Running Process Manager

187.8k1](/packages/php-lrpm-php-lrpm)

PHPackages © 2026

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