PHPackages                             lyquidity/utilities - 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. lyquidity/utilities

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

lyquidity/utilities
===================

Utility classes to provide a tuple dictionary and to convert a simple XML class to an array

15.0k↓50%1PHP

Since Nov 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/bseddon/utilities)[ Packagist](https://packagist.org/packages/lyquidity/utilities)[ RSS](/packages/lyquidity-utilities/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Array and XML utilities for PHP
===============================

[](#array-and-xml-utilities-for-php)

**Table of contents**

- [About the project](#about-the-project)
- [License](#license)
- [Contributing](#contributing)
- [Install](#istall)
- [Getting started](#getting-started)

About the project
-----------------

[](#about-the-project)

This project defines two classes: TupleDictionary and SimpleXMLElementToArray to make it easier to compare PHP arrays and XML fragments.

### Motivation

[](#motivation)

This project is standalone but is part of the XBRL project.

The XBRL project needs the ability to determine if two arrays representsing a collection of key/value pairs are identical and hold data against those pairs. This is achieved using the TupleDictionary class.

It also sometimes necessary, for example when examining segment or scenarios within contexts in instance documents, to be able to compare for equality the elements defined under segments or scenarios of a pair of contexts. The SimpleXMLElementToArray class makes it simple to convert the elements defined under a segment or scenario element node to an array so they can be compared following the various rules defined by the XBRL 2.1 specification.

It is common to need to create a temporary file to hold zip contents and then tidy up after. The MemoryWrapper is a StreamWrapper implementation that provides a named in-memory pseudo file that can be uses to store content. The 'filename' can then be passed to another function such as file\_get\_contents() so the contents can be accessed. The pseudo file will be lost when the script terminates so there is no need to explcitly delete the file. However the file can be explicitly deleted to recover memory.

### Dependencies

[](#dependencies)

This project depends on [pear/log](https://github.com/pear/Log) and [lyquidity/xml](https://github.com/bseddon/xml)

License
-------

[](#license)

This project is released under [GPL version 3.0](LICENCE)

**What does this mean?**

It means you can use the source code in any way you see fit. However, the source code for any changes you make must be made available to others and must be made available on the same terms as you receive the source code in this project: under a GPL v3.0 license. You must include the license of this project with any distribution of the source code whether the distribution includes all the source code or just part of it. For example, if you create a class that derives from one of the classes provided by this project - a new taxonomy class, perhaps - that is derivative.

**What does this not mean?**

It does *not* mean that any products you create that only *use* this source code must be released under GPL v3.0. If you create a budgeting application that uses the source code from this project to access data in instance documents, used by the budgeting application to transfer data, that is not derivative.

Contributing
------------

[](#contributing)

We welcome contributions. See our [contributions page](https://gist.github.com/bseddon/cfe04753192087c82766bee583f519aa) for more information. If you do choose to contribute we will ask you to agree to our [Contributor License Agreement (CLA)](https://gist.github.com/bseddon/cfe04753192087c82766bee583f519aa). We will ask you to agree to the terms in the CLA to assure other users that the code they use is not going to be encumbered by a labyrinth of different license and patent liabilities. You are also urged to review our [code of conduct](CODE_OF_CONDUCT.md).

Install
-------

[](#install)

The project can be installed by [composer](https://getcomposer.org/). Assuming Composer is installed and a shortcut to the program is called 'composer' then the command to install this project is:

```
composer require lyquidity/utilities:dev-master lyquidity/xml:dev-master --prefer-dist

```

Or fork or download the repository. The source can be found in the 'source' sub-folder.

Getting started
---------------

[](#getting-started)

The test.php file includes illustrations of using the classes.

Assuming you have installed the library using composer then this PHP application will run the test:

```
&lt;?php
require_once __DIR__ . '/vendor/autoload.php';
include __DIR__ . "/vendor/lyquidity/utilities/test.php";
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![bseddon](https://avatars.githubusercontent.com/u/1221824?v=4)](https://github.com/bseddon "bseddon (19 commits)")

### Embed Badge

![Health badge](/badges/lyquidity-utilities/health.svg)

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

PHPackages © 2026

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