Skip to content

Installation

Muhammet Şafak edited this page May 24, 2026 · 1 revision

Installation

Requirements

PHP ^7.4 || ^8.0 (tested up to 8.4)
Extensions None
Runtime dependencies None

The package has zero runtime dependencies. Development dependencies (PHPUnit, PHPStan, PHP-CS-Fixer) live under require-dev and are not installed when you depend on initphp/parameterbag from another project.

Install via Composer

composer require initphp/parameterbag

The classes are autoloaded under the InitPHP\ParameterBag namespace via PSR-4:

{
    "autoload": {
        "psr-4": {
            "InitPHP\\ParameterBag\\": "src/"
        }
    }
}

Verifying the install

<?php
require __DIR__ . '/vendor/autoload.php';

use InitPHP\ParameterBag\ParameterBag;

$bag = new ParameterBag(['hello' => 'world']);
echo $bag->get('hello'); // world

If the autoloader cannot locate the class, double-check that you ran composer install (or composer dump-autoload) and that your script requires vendor/autoload.php before instantiating the bag.

Supported PHP versions in CI

Every PR runs the test matrix against:

  • PHP 7.4
  • PHP 8.0
  • PHP 8.1
  • PHP 8.2
  • PHP 8.3
  • PHP 8.4

If you discover a regression on a supported version, please file an issue and include the PHP version reported by php -v.

Next steps

Clone this wiki locally