Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 16, 2024 via composer

grasmash/expander 3.0.0

Expands internal property references in PHP arrays file.
Package summary
Share
0
issues
1
license
3
MIT
Package created
21 Dec 2017
Version published
10 May 2022
Maintainers
1
Total deps
3
Direct deps
2
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
3 Packages, Including:
dflydev/dot-access-data@v3.0.2
grasmash/expander@3.0.0
psr/log@3.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of grasmash/expander 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
dflydev/dot-access-datav3.0.210.25 kBMIT
prod
psr/log3.0.06.77 kBMIT
prod

Visualizations

Frequently Asked Questions

What does grasmash/expander do?

The grasmash/expander is a versatile PHP tool designed for expanding internal property references in PHP arrays files. It uses dot-notated string property references and converts them into corresponding values. This makes it a highly beneficial tool for the real-time expansion of property references in configuration files. Indeed, this feature can greatly simplify the management and utilization of nested arrays in PHP, no matter how complex the data structure may be.

How do you use grasmash/expander?

To use the grasmash/expander, you firstly need to include it in your project using composer with the command composer require grasmash/expander. The package provides the Expander class which you will use for expanding the property references in the arrays. Property references should be wrapped in ${}, using dot notation for indicating array keys.

Below is an example code snippet illustrating its usage:

<?php
use Grasmash\Expander\Expander;

$array = [
    'type' => 'book',
    //...additional array data
    'env-test' => '${env.test}',
];

$expander = new Expander();
$expanded = $expander->expandArrayProperties($array);

print_r($expanded);

In the above example, $array is the array with references to internal properties. The expandArrayProperties method will expand these references and return the resultant array.

Where are the grasmash/expander docs?

Regarding the documentation for grasmash/expander, detailed information on how to use the package is provided directly in the README file on the package's GitHub page (https://github.com/grasmash/expander). The page offers comprehensive examples which help you understand how to install and use this tool properly, making it an essential resource for learning more about the functionality of grasmash/expander.