brofist/configuration

处理配置合并

v0.1 2016-11-04 12:59 UTC

This package is not auto-updated.

Last update: 2024-09-14 20:14:54 UTC


README

处理配置合并

代码信息

Build Status Coverage Status Code Coverage Scrutinizer Code Climate Issue Count Scrutinizer Code Quality StyleCI

包信息

Latest Stable Version Total Downloads Latest Unstable Version License Dependency Status composer.lock

用法

<?php

use Brofist\Configuration\Configuration;

$development = new Configuration([
    'env'   => 'development',
    'admin' => [
        'name'       => 'John',
        'middleName' => 'Some Middle Name',
    ],
]);

$production = new Configuration([
    'env'   => 'production',
    'admin' => [
        'name'     => 'Other Name',
        'lastName' => 'John',
    ],
]);

$application = $development->merge($production);

$application->toArray();

// will return

[
    // replaces when it is not an array
    'env'   => 'production',

    // merges when it is an array, replacing when necessary
    'admin' => [
        'name'       => 'Other Name',
        'middleName' => 'Some Middle Name',
        'lastName'   => 'John',
    ],
];

安装

composer require brofist/configuration

问题/特性建议

这里 是问题跟踪器。

许可证

MIT

作者