Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 4, 2024 via composer

dflydev/dot-access-data v3.0.2

Given a deep data structure, access data by dot notation.
Package summary
Share
0
issues
1
license
1
MIT
Package created
11 Apr 2012
Version published
27 Oct 2022
Maintainers
1
Total deps
1
Direct deps
0
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
1 Packages, Including:
dflydev/dot-access-data@v3.0.2
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

0
All Dependencies CSV
β“˜ This is a list of dflydev/dot-access-data 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does dflydev/dot-access-data do?

The dflydev/dot-access-data is a versatile PHP package that allows you to access data in deep data structures using dot notation. This powerful tool simplifies data management by making it easy to retrieve, set, check, and append data in intricate and multi-tiered arrays or structures with minimal effort.

How do you use dflydev/dot-access-data?

Using dflydev/dot-access-data is straightforward. To begin, you'll need to include the Dflydev\DotAccessData\Data class in your PHP file using the use declaration. You can initialize a new Data object, and then use the set, get, append, has and remove methods to manipulate this data structure. Here is an abstract example of dflydev/dot-access-data usage:

use Dflydev\DotAccessData\Data;

$data = new Data;

$data->set('a.b.c', 'C');
$data->set('a.b.d', 'D1');
$data->append('a.b.d', 'D2');
$data->set('a.b.e', ['E0', 'E1', 'E2']);

echo $data->get('a.b.c'); // Outputs 'C'

Also, more concrete example includes:

use Dflydev\DotAccessData\Data;

$data = new Data(['hosts' => [...]]);
$username = $data->get('hosts.hewey.username');
$nick = $data->get('hosts.lewey.nick', 'Unknown');

You can also use Data as an array since it implements ArrayAccess interface:

$data['name'] = 'Dewey';
isset($data['name']) === $data->has('name');

Where are the dflydev/dot-access-data docs?

As per the readme content on the package's GitHub repository, there is no separate documentation linked or mentioned. However, you can refer to the repository itself for all the necessary details, usage examples and parameters. The code examples in the readme file are quite comprehensive and offer a solid understanding of how to use the package effectively.