PHPackages                             aplia/support - 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. aplia/support

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

aplia/support
=============

Extra support classes and functions for making it easier to work with PHP

v1.2(5y ago)19433MITPHPPHP &gt;=5.3

Since Sep 1Pushed 5y ago4 watchersCompare

[ Source](https://github.com/Aplia/php-helpers)[ Packagist](https://packagist.org/packages/aplia/support)[ Docs](https://github.com/Aplia/PhpSupport)[ RSS](/packages/aplia-support/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (1)Versions (9)Used By (3)

PHP helper classes and functions
================================

[](#php-helper-classes-and-functions)

This package contains extra support classes and functions for making it easier to work with PHP. It implements some features which are missing from PHP but which are commonly required, for instance array and path manipulation.

[![Latest Stable Version](https://camo.githubusercontent.com/794028a7a0012f083a78b0d54b1a81b87d0c43a8b282e2ba1b9ef0b83d111dd3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61706c69612f737570706f72742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aplia/support)[![Minimum PHP Version](https://camo.githubusercontent.com/b3f29eb7882d2bf523390e9982827e9d2d3a4f74266ca923b512e5d02b9e4011/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e332d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)

All classes are placed under the namespace `Aplia\Support`, for instance:

```
use Aplia\Support\Arr;

Arr::get($array, 'key');
```

Installation
------------

[](#installation)

Install with Composer:

```
composer require aplia/support

```

Arr
---

[](#arr)

Various functionality for working with arrays. These are mostly taken from the Laravel framework and placed in this repository to avoid extra dependencies.

### Arr::get

[](#arrget)

```
use Aplia\Support\Arr;

$array = ['products' => ['desk' => ['price' => 100]]];

$price = Arr::get($array, 'products.desk.price');

// 100
```

A typical use case is to support keyword arguments to a function by passing an array as a parameter. `Arr::get` can then be used to easily fetch a parameter if it is set or use a default value.

```
use Aplia\Support\Arr;

function search($query, $params = null)
{
    $limit = Arr::get($params, 'limit');
    $fields = Arr::get($params, 'fields', 1);
    // ...
}
```

Path
----

[](#path)

Path manipulation such as joining multiple files/dir names into one path.

```
Path::join(['var', 'storage']);
// "var/storage"
```

```
Path::join([]);
// ""
```

```
// Using a root
Path::join(['var', 'storage'], '/var/www');
// "/var/www/var/storage"
```

```
Path::make('vendor', 'composer');
// "vendor/composer"
```

LoggerAdapter
-------------

[](#loggeradapter)

Adapts the PSR logger interface to eZ debug, add this as a handler to any PSR log. If the class `eZDebug` exists it will pass log messages along.

Val
---

[](#val)

Enforces a variable to a simple value, closures are called to get the real value.

```
use Aplia\Support\Val;

// Any regular value is simply returned
Val::value(5) === 5;

// Closures are called to fetch the actual value
Val::value(function () {
    return 5;
}) === 5;
```

VirtualProperties
-----------------

[](#virtualproperties)

> Available since: 1.1

A trait which makes it easier to create classes with virtual properties.

Virtual properties are properties that doesn't exist on the object but are bound to a function that gets called when the property name is accessed on the object. This is all done using the PHP magic methods `__get()`, `__isset()`, `__set()` and `__unset()`.

If the class extends a base class and that class also implements `__isset()` etc. VirtualProperties will make sure they are called as part of the checks.

If `__baseProperties()` exists it will use this to add in extra properties when `__properties()` is called.

Property lookup is strict by default and will throw `PropertyError` for missing properties in `__get()`, to disable strictness reimplement the method `__requireProperties()` and make it return `false`.

Example of a class using all functionality, it will have the following properties:

- *name* - regular
- *id* - virtual and read-only
- *version* - virtual
- *code* - virtual and cached

```
/**
 * @property-read string $id
 * @property string $version
 * @property string $code
 *\/
class Topic
{
    use \Aplia\Support\Traits\VirtualProperties;

    public $name;
    protected $_id;
    protected $_version;

    public function __construct($id, $version, $name)
    {
        $this->_id = $id;
        $this->_version = $version;
        $this->name = $name;
    }
    public function cachedCode()
    {
        return $this->version !== null ? ($this->_id . '-' . $this->version) : $this->_id;
    }
    public function propId($id)
    {
        return $this->_id;
    }
    public function propVersion()
    {
        return $this->_version;
    }

    public function setpropVersion($version)
    {
        $this->_version = $version;
    }
    public function unsetpropVersion()
    {
        $this->_version = null;
    }
}

$t = new Topic('english', '1', 'foo');
$t->name; // returns 'foo' (regular property)
$t->id; // returns 'english'
$t->id = 'greek'; // *id* is read-only so this fails
$t->version; // returns '1'
$t->code; // returns 'english-1'
$t->version = '2';
$t->code; // returns 'english-2'
unset($t->version);
$t->code; // returns 'english'
```

TemplateAttributes
------------------

[](#templateattributes)

> Available since: 1.1

A trait which gives the class support for eZ publish template attributes.

By using this trait the classes will allow instances to be used in eZ publish templates. The attributes will map to the existing properties or virtual properties on the class.

Works best when combined with `VirtualPropertes`.

License
-------

[](#license)

The helper library is open-sourced software licensed under the MIT license.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~273 days

Recently: every ~388 days

Total

7

Last Release

1906d ago

Major Versions

v0.1.0 → v1.0.02016-10-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/250c0249ebb7ec2fc9e3987323829740e5f255a65b450a7b94cd9f6da2e33b75?d=identicon)[aplia](/maintainers/aplia)

![](https://www.gravatar.com/avatar/653784c2a838a5b7a9103211c66a88107b3f20a700502632ef137ae45af1fcb7?d=identicon)[4m0s](/maintainers/4m0s)

---

Top Contributors

[![am0s](https://avatars.githubusercontent.com/u/394461?v=4)](https://github.com/am0s "am0s (16 commits)")

---

Tags

array-manipulationshelper-functionsphpphp-library

### Embed Badge

![Health badge](/badges/aplia-support/health.svg)

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

###  Alternatives

[composer/satis

Simple Repository Generator

3.3k1.4M17](/packages/composer-satis)[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5953.3M56](/packages/roave-backward-compatibility-check)[magento/magento-composer-installer

Composer installer for Magento modules

7523.3M318](/packages/magento-magento-composer-installer)[larapack/hooks

A Laravel Hook system

2171.5M21](/packages/larapack-hooks)[ramsey/conventional-commits

A PHP library for creating and validating commit messages according to the Conventional Commits specification. Includes a CaptainHook action!

1931.2M122](/packages/ramsey-conventional-commits)[dominikb/composer-license-checker

Utility to check for licenses of dependencies and block/allow them.

563.8M9](/packages/dominikb-composer-license-checker)

PHPackages © 2026

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